mirror of
https://github.com/playmusicexporter/playmusicexporter
synced 2024-04-28 21:16:42 +00:00
This should fix #24.
This commit is contained in:
parent
9625d9c302
commit
bd7cd4d8ef
|
@ -25,6 +25,7 @@ import re.jcg.playmusicexporter.settings.PlayMusicExporterPreferences;
|
|||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* A {@link PreferenceActivity} that presents a set of application settings. On
|
||||
|
@ -127,15 +128,8 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public void onBuildHeaders(List<Header> target) {
|
||||
loadHeadersFromResource(R.xml.pref_headers, target);
|
||||
|
||||
// Remove the Debug Fragment
|
||||
if (!BuildConfig.DEBUG) {
|
||||
for (int i = 0; i < target.size(); i++) {
|
||||
if ("Debug".equals(target.get(i).title)) {
|
||||
target.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (BuildConfig.DEBUG) {
|
||||
loadHeadersFromResource(R.xml.pref_debug_header, target);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
7
playmusicexporter/src/main/res/xml/pref_debug_header.xml
Normal file
7
playmusicexporter/src/main/res/xml/pref_debug_header.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<header
|
||||
android:fragment="re.jcg.playmusicexporter.activities.SettingsActivity$DebugPreferenceFragment"
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
android:title="@string/pref_header_debug" />
|
||||
|
||||
</preference-headers>
|
|
@ -16,9 +16,5 @@
|
|||
android:fragment="re.jcg.playmusicexporter.activities.SettingsActivity$AboutPreferenceFragment"
|
||||
android:icon="@drawable/ic_info_black_24dp"
|
||||
android:title="@string/pref_header_about" />
|
||||
<header
|
||||
android:fragment="re.jcg.playmusicexporter.activities.SettingsActivity$DebugPreferenceFragment"
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
android:title="@string/pref_header_debug" />
|
||||
|
||||
</preference-headers>
|
||||
|
|
Loading…
Reference in a new issue