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 @@
*/ */
package acr.browser.lightning.activity; package acr.browser.lightning.activity;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
@ -11,11 +12,12 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.anthonycr.grant.PermissionsManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import acr.browser.lightning.R; import acr.browser.lightning.R;
import com.anthonycr.grant.PermissionsManager;
public class SettingsActivity extends ThemableSettingsActivity { public class SettingsActivity extends ThemableSettingsActivity {
@ -44,6 +46,10 @@ public class SettingsActivity extends ThemableSettingsActivity {
loadHeadersFromResource(R.xml.preferences_headers, target); loadHeadersFromResource(R.xml.preferences_headers, target);
fragments.clear(); fragments.clear();
for (Header header : target) { 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); fragments.add(header.fragment);
} }
} }

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

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