Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.owncloud.android"
android:versionCode="10020099"
android:versionName="1.2.0">
android:versionCode="10030001"
android:versionName="1.3.0 RC1">

<uses-sdk
android:minSdkVersion="14"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
/// dependencies for app building
compile name: 'touch-image-view'

compile 'com.github.nextcloud:android-library:1.0.6'
compile 'com.github.nextcloud:android-library:1.0.7'
compile "com.android.support:support-v4:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile 'com.jakewharton:disklrucache:2.0.2'
Expand Down
34 changes: 34 additions & 0 deletions res/layout/share_file_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,40 @@

</RelativeLayout>

<RelativeLayout
android:id="@+id/shareViaLinkHideFileListingPermissionSection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_half_margin"
android:visibility="invisible"
>

<android.support.v7.widget.SwitchCompat
android:id="@+id/shareViaLinkFileListingPermissionSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:padding="@dimen/standard_half_padding"
/>

<TextView
android:id="@+id/shareViaLinkFileListingPermissionLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@id/shareViaLinkFileListingPermissionSwitch"
android:layout_toStartOf="@id/shareViaLinkFileListingPermissionSwitch"
android:padding="@dimen/standard_half_padding"
android:text="@string/share_via_link_hide_file_listing_permission_label"
android:textColor="@color/black"
android:textSize="14sp"
/>

</RelativeLayout>

<RelativeLayout
android:id="@+id/shareViaLinkPasswordSection"
android:layout_width="match_parent"
Expand Down
1 change: 1 addition & 0 deletions res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<string name="mail_recommend">"mailto:"</string>
<string name="mail_feedback">"mailto:[email protected]"</string>
<string name="url_app_download">"https://play.google.com/store/apps/details?id=com.nextcloud.client"</string>
<string name="url_server_install">https://nextcloud.com/install</string>

<!--Destination mail for sending log files -->
<string name="mail_logger"></string>
Expand Down
3 changes: 3 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
<string name="share_via_link_password_label">Password protect</string>
<string name="share_via_link_password_title">Secured</string>
<string name="share_via_link_edit_permission_label">Allow editing</string>
<string name="share_via_link_hide_file_listing_permission_label">Hide file listing</string>
<string name="share_get_public_link_button">Get link</string>
<string name="share_with_title">Share with &#8230;</string>
<string name="share_with_edit_title">Share with %1$s</string>
Expand Down Expand Up @@ -464,6 +465,8 @@
<string name="confirmation_remove_folders_alert">Do you really want to remove the selected items and their contents?</string>
<string name="uploads_view_upload_status_waiting_for_charging">Waiting for device charging</string>
<string name="actionbar_search">Search</string>
<string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>
<string name="learn_more">Learn more</string>
<plurals name="items_selected_count">
<!--
As a developer, you should always supply "one" and "other"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1911,6 +1911,7 @@ public OCCapability saveCapabilities(OCCapability capability){
cv.put(ProviderTableMeta.CAPABILITIES_FILES_BIGFILECHUNKING, capability.getFilesBigFileChuncking().getValue());
cv.put(ProviderTableMeta.CAPABILITIES_FILES_UNDELETE, capability.getFilesUndelete().getValue());
cv.put(ProviderTableMeta.CAPABILITIES_FILES_VERSIONING, capability.getFilesVersioning().getValue());
cv.put(ProviderTableMeta.CAPABILITIES_FILES_DROP, capability.getFilesFileDrop().getValue());

if (capabilityExists(mAccount.name)) {
if (getContentResolver() != null) {
Expand Down Expand Up @@ -2051,6 +2052,8 @@ private OCCapability createCapabilityInstance(Cursor c) {
.getColumnIndex(ProviderTableMeta.CAPABILITIES_FILES_UNDELETE))));
capability.setFilesVersioning(CapabilityBooleanType.fromValue(c.getInt(c
.getColumnIndex(ProviderTableMeta.CAPABILITIES_FILES_VERSIONING))));
capability.setFilesFileDrop(CapabilityBooleanType.fromValue(c.getInt(c
.getColumnIndex(ProviderTableMeta.CAPABILITIES_FILES_DROP))));

}
return capability;
Expand Down
3 changes: 2 additions & 1 deletion src/com/owncloud/android/db/ProviderMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public class ProviderMeta {

public static final String DB_NAME = "filelist";
public static final int DB_VERSION = 14;
public static final int DB_VERSION = 15;

private ProviderMeta() {
}
Expand Down Expand Up @@ -131,6 +131,7 @@ static public class ProviderTableMeta implements BaseColumns {
public static final String CAPABILITIES_FILES_BIGFILECHUNKING = "files_bigfilechunking";
public static final String CAPABILITIES_FILES_UNDELETE = "files_undelete";
public static final String CAPABILITIES_FILES_VERSIONING = "files_versioning";
public static final String CAPABILITIES_FILES_DROP = "files_drop";

public static final String CAPABILITIES_DEFAULT_SORT_ORDER = CAPABILITIES_ACCOUNT_NAME
+ " collate nocase asc";
Expand Down
27 changes: 22 additions & 5 deletions src/com/owncloud/android/files/FileOperationsHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.OCUpload;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.common.utils.Log_OC;
Expand All @@ -51,13 +49,10 @@
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.ShareActivity;
import com.owncloud.android.ui.dialog.ShareLinkToDialog;
import com.owncloud.android.ui.dialog.SharePasswordDialogFragment;

import java.util.Collection;
import java.util.List;

import java.util.ArrayList;

/**
*
*/
Expand Down Expand Up @@ -397,6 +392,28 @@ public void setUploadPermissionsToShare(OCFile folder, boolean uploadPermission)
queueShareIntent(updateShareIntent);
}

/**
* Updates a public share on a folder to set its hide file listing permission.
* Starts a request to do it in {@link OperationsService}
*
* @param share {@link OCShare} instance which permissions will be updated.
* @param hideFileListing New state of the permission for editing the folder shared via link.
*/
public void setHideFileListingPermissionsToShare(OCShare share, boolean hideFileListing) {
Intent updateShareIntent = new Intent(mFileActivity, OperationsService.class);
updateShareIntent.setAction(OperationsService.ACTION_UPDATE_SHARE);
updateShareIntent.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount());
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_ID, share.getId());

if (hideFileListing) {
updateShareIntent.putExtra(OperationsService.EXTRA_SHARE_PERMISSIONS, OCShare.CREATE_PERMISSION_FLAG);
} else {
updateShareIntent.
putExtra(OperationsService.EXTRA_SHARE_PERMISSIONS, OCShare.FEDERATED_PERMISSIONS_FOR_FOLDER);
}

queueShareIntent(updateShareIntent);
}

/**
* @return 'True' if the server supports the Search Users API
Expand Down
18 changes: 17 additions & 1 deletion src/com/owncloud/android/providers/FileContentProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,21 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}

if (oldVersion < 15 && newVersion >= 15) {
Log_OC.i("SQL", "Entering in the #15 ADD in onUpgrade");
db.beginTransaction();
try {
// drop old capabilities table
db.execSQL("DROP TABLE IF EXISTS " + "capabilities" + ";");
// Create uploads table
createCapabilitiesTable(db);
upgraded = true;
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}

if (!upgraded)
Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
", newVersion == " + newVersion);
Expand Down Expand Up @@ -844,7 +859,8 @@ private void createCapabilitiesTable(SQLiteDatabase db){
+ ProviderTableMeta.CAPABILITIES_SHARING_FEDERATION_INCOMING + " INTEGER, " // boolean
+ ProviderTableMeta.CAPABILITIES_FILES_BIGFILECHUNKING + " INTEGER, " // boolean
+ ProviderTableMeta.CAPABILITIES_FILES_UNDELETE + " INTEGER, " // boolean
+ ProviderTableMeta.CAPABILITIES_FILES_VERSIONING + " INTEGER );" ); // boolean
+ ProviderTableMeta.CAPABILITIES_FILES_VERSIONING + " INTEGER, " // boolean
+ ProviderTableMeta.CAPABILITIES_FILES_DROP + " INTEGER );" ); // boolean
}

private void createUploadsTable(SQLiteDatabase db){
Expand Down
Loading