Search in sources :

Example 1 with BatteryTipListener

use of com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController.BatteryTipListener in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BatteryTipDialogFragment method onClick.

@Override
public void onClick(DialogInterface dialog, int which) {
    final BatteryTipListener lsn = (BatteryTipListener) getTargetFragment();
    if (lsn == null) {
        return;
    }
    final BatteryTipAction action = BatteryTipUtils.getActionForBatteryTip(mBatteryTip, (SettingsActivity) getActivity(), (InstrumentedPreferenceFragment) getTargetFragment());
    if (action != null) {
        action.handlePositiveAction(mMetricsKey);
    }
    lsn.onBatteryTipHandled(mBatteryTip);
}
Also used : BatteryTipListener(com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController.BatteryTipListener) BatteryTipAction(com.android.settings.fuelgauge.batterytip.actions.BatteryTipAction)

Example 2 with BatteryTipListener

use of com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController.BatteryTipListener in project android_packages_apps_Settings by omnirom.

the class BatteryTipDialogFragment method onClick.

@Override
public void onClick(DialogInterface dialog, int which) {
    final BatteryTipListener lsn = (BatteryTipListener) getTargetFragment();
    if (lsn == null) {
        return;
    }
    final BatteryTipAction action = BatteryTipUtils.getActionForBatteryTip(mBatteryTip, (SettingsActivity) getActivity(), (InstrumentedPreferenceFragment) getTargetFragment());
    if (action != null) {
        action.handlePositiveAction(mMetricsKey);
    }
    lsn.onBatteryTipHandled(mBatteryTip);
}
Also used : BatteryTipListener(com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController.BatteryTipListener) BatteryTipAction(com.android.settings.fuelgauge.batterytip.actions.BatteryTipAction)

Aggregations

BatteryTipListener (com.android.settings.fuelgauge.batterytip.BatteryTipPreferenceController.BatteryTipListener)2 BatteryTipAction (com.android.settings.fuelgauge.batterytip.actions.BatteryTipAction)2