use of androidx.fragment.app.FragmentActivity in project android-oss by kickstarter.
the class BaseBottomSheetDialogFragment method onPause.
@CallSuper
@Override
public void onPause() {
this.lifecycle.onNext(FragmentEvent.PAUSE);
super.onPause();
Timber.d("onPause %s", this.toString());
if (this.viewModel != null) {
this.viewModel.onPause();
final FragmentActivity activity = getActivity();
if (activity != null) {
activity.unregisterReceiver(this.optimizelyReadyReceiver);
}
}
}
use of androidx.fragment.app.FragmentActivity 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.fragment.app.FragmentActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DefaultAppPickerFragment method onRadioButtonClicked.
@Override
public void onRadioButtonClicked(RadioButtonPreference selected) {
final String selectedKey = selected.getKey();
final CharSequence confirmationMessage = getConfirmationMessage(getCandidate(selectedKey));
final FragmentActivity activity = getActivity();
if (TextUtils.isEmpty(confirmationMessage)) {
super.onRadioButtonClicked(selected);
} else if (activity != null) {
final DialogFragment fragment = newConfirmationDialogFragment(selectedKey, confirmationMessage);
fragment.show(activity.getSupportFragmentManager(), ConfirmationDialogFragment.TAG);
}
}
use of androidx.fragment.app.FragmentActivity in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PanelFragment method createPanelContent.
private void createPanelContent() {
final FragmentActivity activity = getActivity();
if (mLayoutView == null) {
activity.finish();
}
mPanelSlices = mLayoutView.findViewById(R.id.panel_parent_layout);
mSeeMoreButton = mLayoutView.findViewById(R.id.see_more);
mDoneButton = mLayoutView.findViewById(R.id.done);
mTitleView = mLayoutView.findViewById(R.id.panel_title);
// Make the panel layout gone here, to avoid janky animation when updating from old panel.
// We will make it visible once the panel is ready to load.
mPanelSlices.setVisibility(View.GONE);
final Bundle arguments = getArguments();
final String panelType = arguments.getString(SettingsPanelActivity.KEY_PANEL_TYPE_ARGUMENT);
final String callingPackageName = arguments.getString(SettingsPanelActivity.KEY_CALLING_PACKAGE_NAME);
final String mediaPackageName = arguments.getString(SettingsPanelActivity.KEY_MEDIA_PACKAGE_NAME);
// TODO (b/124399577) transform interface to take a context and bundle.
mPanel = FeatureFactory.getFactory(activity).getPanelFeatureProvider().getPanel(activity, panelType, mediaPackageName);
if (mPanel == null) {
activity.finish();
}
mMetricsProvider = FeatureFactory.getFactory(activity).getMetricsFeatureProvider();
mPanelSlices.setLayoutManager(new LinearLayoutManager((activity)));
// Add predraw listener to remove the animation and while we wait for Slices to load.
mLayoutView.getViewTreeObserver().addOnPreDrawListener(mOnPreDrawListener);
// Start loading Slices. When finished, the Panel will animate in.
loadAllSlices();
mTitleView.setText(mPanel.getTitle());
mSeeMoreButton.setOnClickListener(getSeeMoreListener());
mDoneButton.setOnClickListener(getCloseListener());
// If getSeeMoreIntent() is null, hide the mSeeMoreButton.
if (mPanel.getSeeMoreIntent() == null) {
mSeeMoreButton.setVisibility(View.GONE);
}
// Log panel opened.
mMetricsProvider.action(0, /* attribution */
SettingsEnums.PAGE_VISIBLE, /* opened panel - Action */
mPanel.getMetricsCategory(), callingPackageName, 0);
}
use of androidx.fragment.app.FragmentActivity in project FirebaseUI-Android by firebase.
the class EmailLinkCrossDeviceLinkingFragment method onActivityCreated.
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
FragmentActivity activity = getActivity();
if (!(activity instanceof FinishEmailLinkSignInListener)) {
throw new IllegalStateException("Activity must implement EmailLinkPromptEmailListener");
}
mListener = (FinishEmailLinkSignInListener) activity;
}
Aggregations