use of com.android.settings.dashboard.conditional.Condition in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DashboardSummary method onStop.
@Override
public void onStop() {
super.onStop();
((SettingsDrawerActivity) getActivity()).remCategoryListener(this);
mSummaryLoader.setListening(false);
for (Condition c : mConditionManager.getConditions()) {
if (c.shouldShow()) {
MetricsLogger.hidden(getContext(), c.getMetricsConstant());
}
}
if (mAdapter.getSuggestions() == null) {
return;
}
if (!getActivity().isChangingConfigurations()) {
for (Tile suggestion : mAdapter.getSuggestions()) {
String id = DashboardAdapter.getSuggestionIdentifier(getContext(), suggestion);
if (!mSuggestionsHiddenLogged.contains(id)) {
mSuggestionsHiddenLogged.add(id);
MetricsLogger.action(getContext(), MetricsEvent.ACTION_HIDE_SETTINGS_SUGGESTION, id);
}
}
}
}
use of com.android.settings.dashboard.conditional.Condition in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DashboardSummary method onStart.
@Override
public void onStart() {
long startTime = System.currentTimeMillis();
super.onStart();
((SettingsDrawerActivity) getActivity()).addCategoryListener(this);
mSummaryLoader.setListening(true);
for (Condition c : mConditionManager.getConditions()) {
if (c.shouldShow()) {
MetricsLogger.visible(getContext(), c.getMetricsConstant());
}
}
if (mAdapter.getSuggestions() != null) {
for (Tile suggestion : mAdapter.getSuggestions()) {
MetricsLogger.action(getContext(), MetricsEvent.ACTION_SHOW_SETTINGS_SUGGESTION, DashboardAdapter.getSuggestionIdentifier(getContext(), suggestion));
}
}
if (DEBUG_TIMING)
Log.d(TAG, "onStart took " + (System.currentTimeMillis() - startTime) + " ms");
updateSettings();
}
use of com.android.settings.dashboard.conditional.Condition in project android_packages_apps_Settings by LineageOS.
the class DashboardSummary method onPause.
@Override
public void onPause() {
super.onPause();
((SettingsDrawerActivity) getActivity()).remCategoryListener(this);
mSummaryLoader.setListening(false);
for (Condition c : mConditionManager.getConditions()) {
if (c.shouldShow()) {
mMetricsFeatureProvider.hidden(getContext(), c.getMetricsConstant());
}
}
if (!getActivity().isChangingConfigurations()) {
mAdapter.onPause();
}
}
use of com.android.settings.dashboard.conditional.Condition in project android_packages_apps_Settings by LineageOS.
the class DashboardDataTest method testGetPositionByEntity_notExisted_returnNotFound.
@Test
public void testGetPositionByEntity_notExisted_returnNotFound() {
final Condition condition = mock(AirplaneModeCondition.class);
final int position = mDashboardDataWithOneConditions.getPositionByEntity(condition);
assertThat(position).isEqualTo(DashboardData.POSITION_NOT_FOUND);
}
use of com.android.settings.dashboard.conditional.Condition in project android_packages_apps_Settings by omnirom.
the class DashboardDataTest method testGetPositionByEntity_notExisted_returnNotFound.
@Test
public void testGetPositionByEntity_notExisted_returnNotFound() {
final Condition condition = mock(AirplaneModeCondition.class);
final int position = mDashboardDataWithOneConditions.getPositionByEntity(condition);
assertThat(position).isEqualTo(DashboardData.POSITION_NOT_FOUND);
}
Aggregations