From: masensio Date: Tue, 26 May 2015 07:11:27 +0000 (+0200) Subject: Move 'Logs' from Settings to Navigation Drawer X-Git-Tag: oc-android-1.7.2~1^2~23^2~38^2~3 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/101989b70c302517d1e0dc6eb6c164d97d97fd0a?ds=inline;hp=-c Move 'Logs' from Settings to Navigation Drawer --- 101989b70c302517d1e0dc6eb6c164d97d97fd0a diff --git a/res/values/strings.xml b/res/values/strings.xml index d17fdb50..84ede4fa 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -25,6 +25,7 @@ All Files Settings + Logs ownCloud Close diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index e1d0a476..4823a83f 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -56,7 +56,6 @@ - diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index c248f827..26992ad9 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -167,7 +167,7 @@ OnSslUntrustedCertListener, OnEnforceableRefreshListener { private DrawerLayout mDrawerLayout; private ActionBarDrawerToggle mDrawerToggle; - private boolean showAccounts = false; + private boolean mShowAccounts = false; @Override protected void onCreate(Bundle savedInstanceState) { @@ -242,29 +242,39 @@ OnSslUntrustedCertListener, OnEnforceableRefreshListener { listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { - if (showAccounts && position > 0){ + if (mShowAccounts && position > 0){ position = position - 1; } switch (position){ - case 0: - showAccounts = !showAccounts; - adapter.setShowAccounts(showAccounts); - adapter.notifyDataSetChanged(); - break; - case 1: + case 0: // Accounts + mShowAccounts = !mShowAccounts; + adapter.setShowAccounts(mShowAccounts); + adapter.notifyDataSetChanged(); + break; + + case 1: // All Files + // TODO Enable when "On Device" is recovered ? + //MainApp.showOnlyFilesOnDevice(false); + mDrawerLayout.closeDrawers(); + break; + // TODO Enable when "On Device" is recovered ? - //MainApp.showOnlyFilesOnDevice(false); - mDrawerLayout.closeDrawers(); - break; - // TODO Enable when "On Device" is recovered ? // case 2: // MainApp.showOnlyFilesOnDevice(true); // mDrawerLayout.closeDrawers(); // break; - case 2: - Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class); - startActivity(settingsIntent); - break; + + case 2: // Settings + Intent settingsIntent = new Intent(getApplicationContext(), + Preferences.class); + startActivity(settingsIntent); + break; + + case 3: // Logs + Intent loggerIntent = new Intent(getApplicationContext(), + LogHistoryActivity.class); + startActivity(loggerIntent); + break; } } }); diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index e7e76790..39fc314c 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -203,7 +203,7 @@ public class Preferences extends SherlockPreferenceActivity } } - + if (BuildConfig.DEBUG) { Preference pLog = findPreference("log"); if (pLog != null ){ @@ -215,7 +215,7 @@ public class Preferences extends SherlockPreferenceActivity return true; } }); - } + } } boolean recommendEnabled = getResources().getBoolean(R.bool.recommend_enabled); @@ -236,7 +236,8 @@ public class Preferences extends SherlockPreferenceActivity Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(Preferences.this); String username = currentAccount.name.substring(0, currentAccount.name.lastIndexOf('@')); - String recommendSubject = String.format(getString(R.string.recommend_subject), appName); + String recommendSubject = String.format(getString(R.string.recommend_subject), + appName); String recommendText = String.format(getString(R.string.recommend_text), appName, downloadUrl, username);