mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Move auto upload to settings
Resolves #6793 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
a7fed0fc49
commit
fca4e92749
6 changed files with 34 additions and 18 deletions
|
@ -314,8 +314,6 @@ public abstract class DrawerActivity extends ToolbarActivity
|
||||||
DrawerMenuUtil.removeMenuItem(menu, R.id.nav_contacts, !getResources().getBoolean(R.bool.contacts_backup)
|
DrawerMenuUtil.removeMenuItem(menu, R.id.nav_contacts, !getResources().getBoolean(R.bool.contacts_backup)
|
||||||
|| !getResources().getBoolean(R.bool.show_drawer_contacts_backup));
|
|| !getResources().getBoolean(R.bool.show_drawer_contacts_backup));
|
||||||
|
|
||||||
DrawerMenuUtil.removeMenuItem(menu, R.id.nav_synced_folders,
|
|
||||||
getResources().getBoolean(R.bool.syncedFolder_light));
|
|
||||||
DrawerMenuUtil.removeMenuItem(menu, R.id.nav_logout, !getResources().getBoolean(R.bool.show_drawer_logout));
|
DrawerMenuUtil.removeMenuItem(menu, R.id.nav_logout, !getResources().getBoolean(R.bool.show_drawer_logout));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,9 +365,6 @@ public abstract class DrawerActivity extends ToolbarActivity
|
||||||
case R.id.nav_notifications:
|
case R.id.nav_notifications:
|
||||||
startActivity(NotificationsActivity.class);
|
startActivity(NotificationsActivity.class);
|
||||||
break;
|
break;
|
||||||
case R.id.nav_synced_folders:
|
|
||||||
startActivity(SyncedFoldersActivity.class);
|
|
||||||
break;
|
|
||||||
case R.id.nav_contacts:
|
case R.id.nav_contacts:
|
||||||
ContactsPreferenceActivity.startActivity(this);
|
ContactsPreferenceActivity.startActivity(this);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -317,6 +317,8 @@ public class SettingsActivity extends ThemedPreferenceActivity
|
||||||
preferenceCategoryMore.setTitle(ThemeUtils.getColoredTitle(getString(R.string.prefs_category_more),
|
preferenceCategoryMore.setTitle(ThemeUtils.getColoredTitle(getString(R.string.prefs_category_more),
|
||||||
accentColor));
|
accentColor));
|
||||||
|
|
||||||
|
setupAutoUploadPreference(preferenceCategoryMore);
|
||||||
|
|
||||||
setupCalendarPreference(preferenceCategoryMore);
|
setupCalendarPreference(preferenceCategoryMore);
|
||||||
|
|
||||||
setupContactsBackupPreference(preferenceCategoryMore);
|
setupContactsBackupPreference(preferenceCategoryMore);
|
||||||
|
@ -455,6 +457,18 @@ public class SettingsActivity extends ThemedPreferenceActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupAutoUploadPreference(PreferenceCategory preferenceCategoryMore) {
|
||||||
|
Preference autoUpload = findPreference("syncedFolders");
|
||||||
|
if (getResources().getBoolean(R.bool.syncedFolder_light)) {
|
||||||
|
preferenceCategoryMore.removePreference(autoUpload);
|
||||||
|
} else {
|
||||||
|
autoUpload.setOnPreferenceClickListener(preference -> {
|
||||||
|
SyncedFoldersActivity.startActivityWithoutSidebar(this);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setupContactsBackupPreference(PreferenceCategory preferenceCategoryMore) {
|
private void setupContactsBackupPreference(PreferenceCategory preferenceCategoryMore) {
|
||||||
boolean contactsBackupEnabled = !getResources().getBoolean(R.bool.show_drawer_contacts_backup)
|
boolean contactsBackupEnabled = !getResources().getBoolean(R.bool.show_drawer_contacts_backup)
|
||||||
&& getResources().getBoolean(R.bool.contacts_backup);
|
&& getResources().getBoolean(R.bool.contacts_backup);
|
||||||
|
@ -618,9 +632,7 @@ public class SettingsActivity extends ThemedPreferenceActivity
|
||||||
if (getResources().getBoolean(R.bool.syncedFolder_light)
|
if (getResources().getBoolean(R.bool.syncedFolder_light)
|
||||||
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
pSyncedFolder.setOnPreferenceClickListener(preference -> {
|
pSyncedFolder.setOnPreferenceClickListener(preference -> {
|
||||||
Intent syncedFoldersIntent = new Intent(getApplicationContext(), SyncedFoldersActivity.class);
|
SyncedFoldersActivity.startActivityWithoutSidebar(this);
|
||||||
syncedFoldersIntent.putExtra(SyncedFoldersActivity.EXTRA_SHOW_SIDEBAR, false);
|
|
||||||
startActivity(syncedFoldersIntent);
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -115,6 +115,12 @@ public class SyncedFoldersActivity extends FileActivity implements SyncedFolderA
|
||||||
@Inject Clock clock;
|
@Inject Clock clock;
|
||||||
@Inject BackgroundJobManager backgroundJobManager;
|
@Inject BackgroundJobManager backgroundJobManager;
|
||||||
|
|
||||||
|
public static void startActivityWithoutSidebar(Context context) {
|
||||||
|
Intent intent = new Intent(context, SyncedFoldersActivity.class);
|
||||||
|
intent.putExtra(EXTRA_SHOW_SIDEBAR, false);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -151,12 +157,16 @@ public class SyncedFoldersActivity extends FileActivity implements SyncedFolderA
|
||||||
setupToolbar();
|
setupToolbar();
|
||||||
updateActionBarTitleAndHomeButtonByString(getString(R.string.drawer_synced_folders));
|
updateActionBarTitleAndHomeButtonByString(getString(R.string.drawer_synced_folders));
|
||||||
|
|
||||||
// setup drawer
|
|
||||||
setupDrawer(R.id.nav_synced_folders);
|
|
||||||
|
|
||||||
if (!showSidebar) {
|
if (!showSidebar) {
|
||||||
setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
|
setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
|
||||||
mDrawerToggle.setDrawerIndicatorEnabled(false);
|
|
||||||
|
if (getSupportActionBar() != null) {
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mDrawerToggle != null) {
|
||||||
|
mDrawerToggle.setDrawerIndicatorEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: The content loading should be done asynchronously
|
// TODO: The content loading should be done asynchronously
|
||||||
|
@ -800,7 +810,6 @@ public class SyncedFoldersActivity extends FileActivity implements SyncedFolderA
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
setDrawerMenuItemChecked(R.id.nav_synced_folders);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showBatteryOptimizationInfo() {
|
private void showBatteryOptimizationInfo() {
|
||||||
|
|
|
@ -76,11 +76,6 @@
|
||||||
android:id="@+id/nav_notifications"
|
android:id="@+id/nav_notifications"
|
||||||
android:icon="@drawable/nav_notifications"
|
android:icon="@drawable/nav_notifications"
|
||||||
android:title="@string/drawer_item_notifications"/>
|
android:title="@string/drawer_item_notifications"/>
|
||||||
<item
|
|
||||||
android:orderInCategory="0"
|
|
||||||
android:id="@+id/nav_synced_folders"
|
|
||||||
android:icon="@drawable/nav_synced_folders"
|
|
||||||
android:title="@string/drawer_synced_folders"/>
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_uploads"
|
android:id="@+id/nav_uploads"
|
||||||
android:icon="@drawable/uploads"
|
android:icon="@drawable/uploads"
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
<string name="prefs_calendar_contacts_no_store_error">Neither F-Droid nor Google Play is installed</string>
|
<string name="prefs_calendar_contacts_no_store_error">Neither F-Droid nor Google Play is installed</string>
|
||||||
<string name="prefs_calendar_contacts_sync_setup_successful">Calendar & contacts sync set up</string>
|
<string name="prefs_calendar_contacts_sync_setup_successful">Calendar & contacts sync set up</string>
|
||||||
<string name="prefs_daily_contacts_sync_summary">Daily backup of your contacts</string>
|
<string name="prefs_daily_contacts_sync_summary">Daily backup of your contacts</string>
|
||||||
|
<string name="prefs_sycned_folders_summary">Manage folders for auto upload</string>
|
||||||
<string name="prefs_help">Help</string>
|
<string name="prefs_help">Help</string>
|
||||||
<string name="prefs_recommend">Recommend to friend</string>
|
<string name="prefs_recommend">Recommend to friend</string>
|
||||||
<string name="prefs_imprint">Imprint</string>
|
<string name="prefs_imprint">Imprint</string>
|
||||||
|
|
|
@ -60,6 +60,10 @@
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="@string/prefs_category_more" android:key="more">
|
<PreferenceCategory android:title="@string/prefs_category_more" android:key="more">
|
||||||
|
<Preference
|
||||||
|
android:title="@string/drawer_synced_folders"
|
||||||
|
android:key="syncedFolders"
|
||||||
|
android:summary="@string/prefs_sycned_folders_summary"/>
|
||||||
<Preference android:title="@string/prefs_calendar_contacts"
|
<Preference android:title="@string/prefs_calendar_contacts"
|
||||||
android:key="calendar_contacts"
|
android:key="calendar_contacts"
|
||||||
android:summary="@string/prefs_calendar_contacts_summary" />
|
android:summary="@string/prefs_calendar_contacts_summary" />
|
||||||
|
|
Loading…
Reference in a new issue