Search in sources :

Example 31 with UsageView

use of com.android.settings.graph.UsageView in project platform_packages_apps_Settings by BlissRoms.

the class BatteryHistoryPreference method onBindViewHolder.

@Override
public void onBindViewHolder(PreferenceViewHolder view) {
    super.onBindViewHolder(view);
    final long startTime = System.currentTimeMillis();
    if (mBatteryInfo == null) {
        return;
    }
    ((TextView) view.findViewById(R.id.charge)).setText(mBatteryInfo.batteryPercentString);
    mSummaryView = (TextView) view.findViewById(R.id.bottom_summary);
    if (mSummary != null) {
        mSummaryView.setText(mSummary);
    }
    if (hideSummary) {
        mSummaryView.setVisibility(View.GONE);
    }
    UsageView usageView = (UsageView) view.findViewById(R.id.battery_usage);
    usageView.findViewById(R.id.label_group).setAlpha(.7f);
    mBatteryInfo.bindHistory(usageView);
    BatteryUtils.logRuntime(TAG, "onBindViewHolder", startTime);
}
Also used : UsageView(com.android.settings.graph.UsageView) TextView(android.widget.TextView)

Aggregations

UsageView (com.android.settings.graph.UsageView)31 SparseIntArray (android.util.SparseIntArray)15 TextView (android.widget.TextView)11 View (android.view.View)6 Context (android.content.Context)5