use of com.android.settingslib.drawer.SettingsDrawerActivity 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.settingslib.drawer.SettingsDrawerActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SummaryLoader method setSummary.
public void setSummary(SummaryProvider provider, final CharSequence summary) {
final ComponentName component = mSummaryMap.get(provider);
mHandler.post(new Runnable() {
@Override
public void run() {
// we need to always get the latest one.
if (!(mActivity instanceof SettingsDrawerActivity)) {
if (DEBUG) {
Log.d(TAG, "Can't get category list.");
}
return;
}
final List<DashboardCategory> categories = ((SettingsDrawerActivity) mActivity).getDashboardCategories();
final Tile tile = getTileFromCategory(categories, component);
if (tile == null) {
if (DEBUG) {
Log.d(TAG, "Can't find tile for " + component);
}
return;
}
if (DEBUG) {
Log.d(TAG, "setSummary " + tile.title + " - " + summary);
}
tile.summary = summary;
mAdapter.notifyChanged(tile);
}
});
}
use of com.android.settingslib.drawer.SettingsDrawerActivity 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();
}
Aggregations