use of androidx.annotation.CallSuper in project android-oss by kickstarter.
the class BaseFragment method onResume.
@CallSuper
@Override
public void onResume() {
super.onResume();
Timber.d("onResume %s", this.toString());
this.lifecycle.onNext(FragmentEvent.RESUME);
assignViewModel(null);
if (this.viewModel != null) {
this.viewModel.onResume(this);
final FragmentActivity activity = getActivity();
if (activity != null) {
activity.registerReceiver(this.optimizelyReadyReceiver, new IntentFilter(ExperimentsClientTypeKt.EXPERIMENTS_CLIENT_READY));
}
}
}
use of androidx.annotation.CallSuper in project android-oss by kickstarter.
the class BaseFragment method onSaveInstanceState.
@CallSuper
@Override
public void onSaveInstanceState(@NonNull final Bundle outState) {
super.onSaveInstanceState(outState);
final Bundle viewModelEnvelope = new Bundle();
if (this.viewModel != null) {
FragmentViewModelManager.getInstance().save(this.viewModel, viewModelEnvelope);
}
outState.putBundle(VIEW_MODEL_KEY, viewModelEnvelope);
}
use of androidx.annotation.CallSuper in project Signal-Android by signalapp.
the class BaseAccountLockedFragment method onViewCreated.
@Override
@CallSuper
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
TextView description = view.findViewById(R.id.account_locked_description);
BaseRegistrationViewModel viewModel = getViewModel();
viewModel.getLockedTimeRemaining().observe(getViewLifecycleOwner(), t -> description.setText(getString(R.string.AccountLockedFragment__your_account_has_been_locked_to_protect_your_privacy, durationToDays(t))));
view.findViewById(R.id.account_locked_next).setOnClickListener(v -> onNext());
view.findViewById(R.id.account_locked_learn_more).setOnClickListener(v -> learnMore());
requireActivity().getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
onNext();
}
});
}
use of androidx.annotation.CallSuper in project android_packages_apps_Settings by omnirom.
the class BaseSearchIndexProvider method getNonIndexableKeys.
@Override
@CallSuper
public List<String> getNonIndexableKeys(Context context) {
if (!isPageSearchEnabled(context)) {
// Entire page should be suppressed, mark all keys from this page as non-indexable.
return getNonIndexableKeysFromXml(context, true);
}
final List<String> nonIndexableKeys = new ArrayList<>();
nonIndexableKeys.addAll(getNonIndexableKeysFromXml(context, false));
final List<AbstractPreferenceController> controllers = getPreferenceControllers(context);
if (controllers != null && !controllers.isEmpty()) {
for (AbstractPreferenceController controller : controllers) {
if (controller instanceof PreferenceControllerMixin) {
((PreferenceControllerMixin) controller).updateNonIndexableKeys(nonIndexableKeys);
} else if (controller instanceof BasePreferenceController) {
((BasePreferenceController) controller).updateNonIndexableKeys(nonIndexableKeys);
} else {
Log.e(TAG, controller.getClass().getName() + " must implement " + PreferenceControllerMixin.class.getName() + " treating the key non-indexable");
nonIndexableKeys.add(controller.getPreferenceKey());
}
}
}
return nonIndexableKeys;
}
use of androidx.annotation.CallSuper in project android_packages_apps_Settings by omnirom.
the class BaseSearchIndexProvider method getDynamicRawDataToIndex.
@Override
@CallSuper
public List<SearchIndexableRaw> getDynamicRawDataToIndex(Context context, boolean enabled) {
final List<SearchIndexableRaw> dynamicRaws = new ArrayList<>();
if (!isPageSearchEnabled(context)) {
// Entire page should be suppressed, do not add dynamic raw data.
return dynamicRaws;
}
final List<AbstractPreferenceController> controllers = getPreferenceControllers(context);
if (controllers == null || controllers.isEmpty()) {
return dynamicRaws;
}
for (AbstractPreferenceController controller : controllers) {
if (controller instanceof PreferenceControllerMixin) {
((PreferenceControllerMixin) controller).updateDynamicRawDataToIndex(dynamicRaws);
} else if (controller instanceof BasePreferenceController) {
((BasePreferenceController) controller).updateDynamicRawDataToIndex(dynamicRaws);
} else {
Log.e(TAG, controller.getClass().getName() + " must implement " + PreferenceControllerMixin.class.getName() + " treating the dynamic indexable");
}
}
return dynamicRaws;
}
Aggregations