Skip to content

Commit

Permalink
moved logs from drawer menu to "More" section in the settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyScherzinger committed Mar 22, 2016
1 parent 9bab7df commit 32b6a58
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
2 changes: 0 additions & 2 deletions res/values/drawer_resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<item>@string/drawer_item_all_files</item>
<!--<item>@string/drawer_item_on_device</item>-->
<item>@string/actionbar_settings</item>
<item>@string/actionbar_logger</item>
</string-array>

<!-- Nav Drawer Content Descriptions -->
Expand All @@ -35,7 +34,6 @@
<item>@string/drawer_item_all_files</item>
<!--<item>@string/drawer_item_on_device</item>-->
<item>@string/drawer_item_settings</item>
<item>@string/drawer_item_logs</item>
</string-array>

</resources>
1 change: 1 addition & 0 deletions res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<bool name="imprint_enabled">false</bool>
<bool name="recommend_enabled">true</bool>
<bool name="feedback_enabled">true</bool>
<bool name="logger_enabled">true</bool>
<string name="url_help">http://owncloud.com/mobile/help</string>
<string name="url_imprint"></string>
<string name="mail_recommend">"mailto:"</string>
Expand Down
1 change: 0 additions & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<!-- TODO re-enable when "On Device" is available
<string name="drawer_item_on_device">On device</string>-->
<string name="drawer_item_settings">Settings</string>
<string name="drawer_item_logs">Logs</string>
<string name="drawer_close">Close</string>
<string name="drawer_open">Open</string>
<string name="prefs_category_general">General</string>
Expand Down
14 changes: 6 additions & 8 deletions res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@
</PreferenceCategory>

<PreferenceCategory android:title="@string/prefs_category_more" android:key="more">
<Preference android:title="@string/prefs_help" android:key="help" />
<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" />

<Preference android:id="@+id/about_app"
android:title="@string/about_title"
android:key="about_app" />
<Preference android:title="@string/prefs_help" android:key="help" />
<Preference android:title="@string/prefs_recommend" android:key="recommend" />
<Preference android:title="@string/prefs_feedback" android:key="feedback" />
<Preference android:title="@string/actionbar_logger" android:key="logger" />
<Preference android:title="@string/prefs_imprint" android:key="imprint" />
<Preference android:title="@string/about_title" android:id="@+id/about_app" android:key="about_app" />
</PreferenceCategory>


Expand Down
12 changes: 0 additions & 12 deletions src/com/owncloud/android/ui/activity/FileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,6 @@ protected void initDrawer(){
// Settings
mDrawerItems.add(new NavigationDrawerItem(mDrawerTitles[1], mDrawerContentDescriptions[1],
R.drawable.ic_settings));
// Logs
if (BuildConfig.DEBUG) {
mDrawerItems.add(new NavigationDrawerItem(mDrawerTitles[2],
mDrawerContentDescriptions[2],R.drawable.ic_log));
}

// setting the nav drawer list adapter
mNavigationDrawerAdapter = new NavigationDrawerListAdapter(getApplicationContext(), this,
Expand Down Expand Up @@ -1038,13 +1033,6 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
startActivity(settingsIntent);
mDrawerLayout.closeDrawers();
break;

case 2: // Logs
Intent loggerIntent = new Intent(getApplicationContext(),
LogHistoryActivity.class);
startActivity(loggerIntent);
mDrawerLayout.closeDrawers();
break;
}
}
}
Expand Down
21 changes: 19 additions & 2 deletions src/com/owncloud/android/ui/activity/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,26 @@ public boolean onPreferenceClick(Preference preference) {
} else {
preferenceCategory.removePreference(pFeedback);
}

}


boolean loggerEnabled = getResources().getBoolean(R.bool.logger_enabled);
Preference pLogger = findPreference("logger");
if (pLogger != null){
if (loggerEnabled) {
pLogger.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent loggerIntent = new Intent(getApplicationContext(), LogHistoryActivity.class);
startActivity(loggerIntent);

return true;
}
});
} else {
preferenceCategory.removePreference(pLogger);
}
}

boolean imprintEnabled = getResources().getBoolean(R.bool.imprint_enabled);
Preference pImprint = findPreference("imprint");
if (pImprint != null) {
Expand Down

0 comments on commit 32b6a58

Please sign in to comment.