Merge "Clean up usage of theme colors, deprecated Resources.getColor* methods"
This commit is contained in:
committed by
Android (Google) Code Review
commit
042dad7cc7
@@ -18,6 +18,7 @@ package com.android.settings.applications;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceFrameLayout;
|
||||
import android.support.v13.app.FragmentPagerAdapter;
|
||||
@@ -103,7 +104,15 @@ public class AppOpsSummary extends Fragment {
|
||||
mViewPager.setAdapter(adapter);
|
||||
mViewPager.setOnPageChangeListener(adapter);
|
||||
PagerTabStrip tabs = (PagerTabStrip) rootView.findViewById(R.id.tabs);
|
||||
tabs.setTabIndicatorColorResource(R.color.theme_accent);
|
||||
|
||||
// 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);
|
||||
|
||||
// We have to do this now because PreferenceFrameLayout looks at it
|
||||
// only when the view is added.
|
||||
|
@@ -34,6 +34,7 @@ import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.IPackageManager;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.TypedArray;
|
||||
import android.net.NetworkPolicyManager;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
@@ -924,7 +925,15 @@ public class ManageApplications extends Fragment implements
|
||||
mViewPager.setAdapter(adapter);
|
||||
mViewPager.setOnPageChangeListener(adapter);
|
||||
PagerTabStrip tabs = (PagerTabStrip) rootView.findViewById(R.id.tabs);
|
||||
tabs.setTabIndicatorColorResource(R.color.theme_accent);
|
||||
|
||||
// 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);
|
||||
|
||||
// We have to do this now because PreferenceFrameLayout looks at it
|
||||
// only when the view is added.
|
||||
|
@@ -474,10 +474,10 @@ public class ProcessStatsUi extends PreferenceFragment
|
||||
memStates = ProcessStats.ALL_MEM_ADJ;
|
||||
break;
|
||||
}
|
||||
Resources res = getResources();
|
||||
colors.setColors(res.getColor(R.color.running_processes_apps_ram),
|
||||
res.getColor(R.color.running_processes_apps_ram),
|
||||
res.getColor(R.color.running_processes_free_ram));
|
||||
final Context context = getActivity();
|
||||
colors.setColors(context.getColor(R.color.running_processes_apps_ram),
|
||||
context.getColor(R.color.running_processes_apps_ram),
|
||||
context.getColor(R.color.running_processes_free_ram));
|
||||
|
||||
// Compute memory badness for chart color.
|
||||
/*
|
||||
|
@@ -449,10 +449,10 @@ public class RunningProcessesView extends FrameLayout
|
||||
mHeader = inflater.inflate(R.layout.running_processes_header, null);
|
||||
mListView.addHeaderView(mHeader, null, false /* set as not selectable */);
|
||||
mColorBar = (LinearColorBar)mHeader.findViewById(R.id.color_bar);
|
||||
Resources res = getResources();
|
||||
mColorBar.setColors(res.getColor(R.color.running_processes_system_ram),
|
||||
res.getColor(R.color.running_processes_apps_ram),
|
||||
res.getColor(R.color.running_processes_free_ram));
|
||||
final Context context = getContext();
|
||||
mColorBar.setColors(context.getColor(R.color.running_processes_system_ram),
|
||||
context.getColor(R.color.running_processes_apps_ram),
|
||||
context.getColor(R.color.running_processes_free_ram));
|
||||
mBackgroundProcessPrefix = (TextView)mHeader.findViewById(R.id.freeSizePrefix);
|
||||
mAppsProcessPrefix = (TextView)mHeader.findViewById(R.id.appsSizePrefix);
|
||||
mForegroundProcessPrefix = (TextView)mHeader.findViewById(R.id.systemSizePrefix);
|
||||
|
Reference in New Issue
Block a user