Add BatteryTipDialogFragment.
This DialogFragment handles all the tip related dialogs. This cl makes: 1. All the tips parcelable. 2. Add dialog for HighUsageTip. It also need adapter to populate app list in dialog. 3. Add and update tests Bug: 70570352 Test: RunSettingsRoboTests Change-Id: Ie4c986172cfc73d8746abc7457d966c8600c6145
This commit is contained in:
@@ -16,8 +16,9 @@
|
||||
|
||||
package com.android.settings.fuelgauge.batterytip.tips;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
@@ -27,9 +28,11 @@ import com.android.settings.R;
|
||||
public class SummaryTip extends BatteryTip {
|
||||
|
||||
public SummaryTip(@StateType int state) {
|
||||
mShowDialog = false;
|
||||
mState = state;
|
||||
mType = TipType.SUMMARY;
|
||||
super(TipType.SUMMARY, state, false /* showDialog */);
|
||||
}
|
||||
|
||||
private SummaryTip(Parcel in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,9 +60,13 @@ public class SummaryTip extends BatteryTip {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog buildDialog() {
|
||||
//TODO(b/70570352): create the dialog for summary tip and add test
|
||||
return null;
|
||||
}
|
||||
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
|
||||
public BatteryTip createFromParcel(Parcel in) {
|
||||
return new SummaryTip(in);
|
||||
}
|
||||
|
||||
public BatteryTip[] newArray(int size) {
|
||||
return new SummaryTip[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user