Browse Source

Make the workaround more obvious

master
Anthony Restaino 9 years ago
parent
commit
734574616d
  1. 8
      app/src/main/java/acr/browser/lightning/activity/SettingsActivity.java
  2. 20
      app/src/main/res/xml/preferences_headers.xml

8
app/src/main/java/acr/browser/lightning/activity/SettingsActivity.java

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
*/
package acr.browser.lightning.activity;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.Toolbar;
@ -11,11 +12,12 @@ import android.view.View; @@ -11,11 +12,12 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.anthonycr.grant.PermissionsManager;
import java.util.ArrayList;
import java.util.List;
import acr.browser.lightning.R;
import com.anthonycr.grant.PermissionsManager;
public class SettingsActivity extends ThemableSettingsActivity {
@ -44,6 +46,10 @@ public class SettingsActivity extends ThemableSettingsActivity { @@ -44,6 +46,10 @@ public class SettingsActivity extends ThemableSettingsActivity {
loadHeadersFromResource(R.xml.preferences_headers, target);
fragments.clear();
for (Header header : target) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
// Workaround for bug in the AppCompat support library
header.iconRes = R.drawable.empty;
}
fragments.add(header.fragment);
}
}

20
app/src/main/res/xml/preferences_headers.xml

@ -2,27 +2,21 @@ @@ -2,27 +2,21 @@
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header
android:fragment="acr.browser.lightning.fragment.GeneralSettingsFragment"
android:icon="@drawable/empty"
android:title="@string/settings_general"/>
android:title="@string/settings_general" />
<header
android:fragment="acr.browser.lightning.fragment.BookmarkSettingsFragment"
android:icon="@drawable/empty"
android:title="@string/bookmark_settings"/>
android:title="@string/bookmark_settings" />
<header
android:fragment="acr.browser.lightning.fragment.DisplaySettingsFragment"
android:icon="@drawable/empty"
android:title="@string/settings_display"/>
android:title="@string/settings_display" />
<header
android:fragment="acr.browser.lightning.fragment.PrivacySettingsFragment"
android:icon="@drawable/empty"
android:title="@string/settings_privacy"/>
android:title="@string/settings_privacy" />
<header
android:fragment="acr.browser.lightning.fragment.AdvancedSettingsFragment"
android:icon="@drawable/empty"
android:title="@string/settings_advanced"/>
android:title="@string/settings_advanced" />
<header
android:fragment="acr.browser.lightning.fragment.AboutSettingsFragment"
android:icon="@drawable/empty"
android:summary="@string/settings_about_explain"
android:title="@string/settings_about"/>
android:title="@string/settings_about"
android:summary="@string/settings_about_explain" />
</preference-headers>
Loading…
Cancel
Save