OSDN Git Service

Fix advanced privacy guard screen
authorRoman Birg <roman@cyngn.com>
Tue, 3 Nov 2015 01:34:00 +0000 (17:34 -0800)
committerRoman Birg <roman@cyngn.com>
Tue, 3 Nov 2015 20:21:37 +0000 (12:21 -0800)
Change-Id: I1064f2df748b21384f53219b87645f1569f595d5
Signed-off-by: Roman Birg <roman@cyngn.com>
AndroidManifest.xml
src/com/android/settings/applications/AppOpsSummary.java

index 4798382..0b009a1 100644 (file)
             </intent-filter>
         </activity>
 
-        <!--
         <activity android:name="Settings$AppOpsSummaryActivity"
                 android:label="@string/app_ops_settings"
                 android:taskAffinity=""
             <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
                 android:resource="@id/application_settings" />
         </activity>
-        -->
 
         <activity android:name="Settings$LocationSettingsActivity"
                 android:label="@string/location_settings_title"
index 782b8fb..46ffb9d 100644 (file)
@@ -18,12 +18,14 @@ package com.android.settings.applications;
 
 import android.app.Fragment;
 import android.app.FragmentManager;
+import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.os.Bundle;
 import android.preference.PreferenceFrameLayout;
 import android.support.v13.app.FragmentPagerAdapter;
 import android.support.v4.view.PagerTabStrip;
 import android.support.v4.view.ViewPager;
+import android.util.TypedValue;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -112,14 +114,11 @@ public class AppOpsSummary extends InstrumentedFragment {
         mViewPager.setOnPageChangeListener(adapter);
         PagerTabStrip tabs = (PagerTabStrip) rootView.findViewById(R.id.tabs);
 
-        // This should be set in the XML layout, but PagerTabStrip lives in
-        // support-v4 and doesn't have styleable attributes.
-        final TypedArray ta = tabs.getContext().obtainStyledAttributes(
-                new int[] { android.R.attr.colorAccent });
-        final int colorAccent = ta.getColor(0, 0);
-        ta.recycle();
-
-        tabs.setTabIndicatorColorResource(colorAccent);
+        Resources.Theme theme = tabs.getContext().getTheme();
+        TypedValue typedValue = new TypedValue();
+        theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
+        final int colorAccent = getContext().getColor(typedValue.resourceId);
+        tabs.setTabIndicatorColor(colorAccent);
 
         // We have to do this now because PreferenceFrameLayout looks at it
         // only when the view is added.