<PreferenceCategory android:title="@string/prefs_category_more" android:key="more">
<Preference android:title="@string/prefs_help" android:key="help" />
- <Preference android:title="@string/actionbar_logger" android:key="log" />
<Preference android:title="@string/prefs_recommend" android:key="recommend" />
<Preference android:title="@string/prefs_feedback" android:key="feedback" />
<Preference android:title="@string/prefs_imprint" android:key="imprint" />
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mDrawerToggle;
- private boolean showAccounts = false;
+ private boolean mShowAccounts = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
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;
}
}
});
}
}
-
+
if (BuildConfig.DEBUG) {
Preference pLog = findPreference("log");
if (pLog != null ){
return true;
}
});
- }
+ }
}
boolean recommendEnabled = getResources().getBoolean(R.bool.recommend_enabled);
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);