More details in the summary and details screens.

Show packages included, time that a subsystem was on for.
Load label and icon in the background and cache the values.
Switch between totals and since-unplugged.
Other UI improvements.
This commit is contained in:
Amith Yamasani
2009-06-09 06:34:49 -07:00
parent 8036862226
commit 78fd96a1c5
8 changed files with 618 additions and 131 deletions

View File

@@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable;
import android.preference.Preference;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.settings.R;
import com.android.settings.fuelgauge.PowerUsageSummary.BatterySipper;
@@ -39,6 +40,7 @@ public class PowerGaugePreference extends Preference {
private GaugeDrawable mGauge;
private double mValue;
private BatterySipper mInfo;
private double mPercent;
public PowerGaugePreference(Context context, Drawable icon, BatterySipper info) {
super(context);
@@ -58,10 +60,19 @@ public class PowerGaugePreference extends Preference {
mGauge.percent = mValue;
}
void setPercent(double percent) {
mPercent = percent;
}
BatterySipper getInfo() {
return mInfo;
}
void setIcon(Drawable icon) {
mIcon = icon;
notifyChanged();
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
@@ -74,6 +85,9 @@ public class PowerGaugePreference extends Preference {
ImageView appGauge = (ImageView) view.findViewById(R.id.appGauge);
appGauge.setImageDrawable(mGauge);
TextView percentView = (TextView) view.findViewById(R.id.percent);
percentView.setText((int) (Math.ceil(mPercent)) + "%");
}
static class GaugeDrawable extends Drawable {