Add high power whitelist for apps
- Strings not final! - New UX for power usage details (more preferency) - Add high power apps list shows on/off and screen to change (when possible) - Link from power usage summary to high power list - Link from advanced apps to high power list Bug: 19991702 Change-Id: I97c927ed82d3b89041e4429b427508545763d66c
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -29,6 +30,11 @@ public class AppHeader {
|
||||
|
||||
public static void createAppHeader(final Activity activity, Drawable icon, CharSequence label,
|
||||
final Intent settingsIntent) {
|
||||
createAppHeader(activity, icon, label, settingsIntent, 0);
|
||||
}
|
||||
|
||||
public static void createAppHeader(final Activity activity, Drawable icon, CharSequence label,
|
||||
final Intent settingsIntent, int tintColorRes) {
|
||||
final View content = activity.findViewById(R.id.main_content);
|
||||
final ViewGroup contentParent = (ViewGroup) content.getParent();
|
||||
final View bar = activity.getLayoutInflater().inflate(R.layout.app_header,
|
||||
@@ -36,6 +42,9 @@ public class AppHeader {
|
||||
|
||||
final ImageView appIcon = (ImageView) bar.findViewById(R.id.app_icon);
|
||||
appIcon.setImageDrawable(icon);
|
||||
if (tintColorRes != 0) {
|
||||
appIcon.setImageTintList(ColorStateList.valueOf(activity.getColor(tintColorRes)));
|
||||
}
|
||||
|
||||
final TextView appName = (TextView) bar.findViewById(R.id.app_name);
|
||||
appName.setText(label);
|
||||
|
Reference in New Issue
Block a user