Implement Holo Light Theme for Settings
... and use Holo (Dark) Theme for the Drawer as requested by UX Also remove the Wi-Fi and Bluetooth switches in the Drawer per following UX specification. Change-Id: I4fc17481255b5db337a887033bc831ded0d2d701
This commit is contained in:
@@ -76,6 +76,6 @@
|
|||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ff333333"/>
|
android:background="@color/background_drawer"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
@@ -15,6 +15,8 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
|
<color name="background_drawer">#ff777777</color>
|
||||||
|
|
||||||
<color name="black">#000</color>
|
<color name="black">#000</color>
|
||||||
<color name="red">#F00</color>
|
<color name="red">#F00</color>
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@
|
|||||||
<item name="wifi_signal">@drawable/wifi_signal_light</item>
|
<item name="wifi_signal">@drawable/wifi_signal_light</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Settings" parent="@android:style/Theme.Holo">
|
<style name="Theme.Settings" parent="@android:style/Theme.Holo.Light">
|
||||||
<item name="@*android:preferenceHeaderPanelStyle">@style/PreferenceHeaderPanelSinglePane</item>
|
<item name="@*android:preferenceHeaderPanelStyle">@style/PreferenceHeaderPanelSinglePane</item>
|
||||||
<item name="@*android:preferencePanelStyle">@style/PreferencePanelSinglePane</item>
|
<item name="@*android:preferencePanelStyle">@style/PreferencePanelSinglePane</item>
|
||||||
<item name="@*android:preferenceListStyle">@style/PreferenceHeaderListSinglePane</item>
|
<item name="@*android:preferenceListStyle">@style/PreferenceHeaderListSinglePane</item>
|
||||||
@@ -70,6 +70,5 @@
|
|||||||
<item name="ic_menu_moreoverflow">@*android:drawable/ic_menu_moreoverflow_holo_dark</item>
|
<item name="ic_menu_moreoverflow">@*android:drawable/ic_menu_moreoverflow_holo_dark</item>
|
||||||
<item name="ic_wps">@drawable/ic_wps_dark</item>
|
<item name="ic_wps">@drawable/ic_wps_dark</item>
|
||||||
<item name="wifi_signal">@drawable/wifi_signal_dark</item>
|
<item name="wifi_signal">@drawable/wifi_signal_dark</item>
|
||||||
<item name="android:actionBarStyle">@android:style/Widget.Holo.ActionBar.Solid</item>
|
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -65,6 +65,7 @@ import android.util.Log;
|
|||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
|
import android.view.ContextThemeWrapper;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -519,7 +520,14 @@ public class SettingsActivity extends Activity
|
|||||||
|
|
||||||
DevicePolicyManager dpm =
|
DevicePolicyManager dpm =
|
||||||
(DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
|
(DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
|
||||||
mHeaderAdapter= new HeaderAdapter(this, getHeaders(), mAuthenticatorHelper, dpm);
|
|
||||||
|
// As the Settings Theme is now Holo Light, the primary text color is "Black" ... but
|
||||||
|
// we want the text color of the Drawer items to be "White", so use the inverse Theme (Holo)
|
||||||
|
// for the Header adapter (and thus making the TextView appearance to have a white color.
|
||||||
|
Context headersContext = new ContextThemeWrapper(this,
|
||||||
|
com.android.internal.R.style.Theme_Holo);
|
||||||
|
|
||||||
|
mHeaderAdapter= new HeaderAdapter(headersContext, getHeaders(), mAuthenticatorHelper, dpm);
|
||||||
|
|
||||||
mDevelopmentPreferences = getSharedPreferences(DevelopmentSettings.PREF_FILE,
|
mDevelopmentPreferences = getSharedPreferences(DevelopmentSettings.PREF_FILE,
|
||||||
Context.MODE_PRIVATE);
|
Context.MODE_PRIVATE);
|
||||||
@@ -1438,8 +1446,6 @@ public class SettingsActivity extends Activity
|
|||||||
static int getHeaderType(Header header) {
|
static int getHeaderType(Header header) {
|
||||||
if (header.fragment == null && header.intent == null) {
|
if (header.fragment == null && header.intent == null) {
|
||||||
return HEADER_TYPE_CATEGORY;
|
return HEADER_TYPE_CATEGORY;
|
||||||
} else if (header.id == R.id.wifi_settings || header.id == R.id.bluetooth_settings) {
|
|
||||||
return HEADER_TYPE_SWITCH;
|
|
||||||
} else if (header.id == R.id.security_settings) {
|
} else if (header.id == R.id.security_settings) {
|
||||||
return HEADER_TYPE_BUTTON;
|
return HEADER_TYPE_BUTTON;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user