use of androidx.fragment.app.Fragment in project Douya by DreaminginCodeZH.
the class RingtonePreferenceActivityFragmentCompat method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle arguments = getArguments();
String preferenceKey = arguments.getString(ARGUMENT_KEY);
Fragment fragment = getTargetFragment();
if (!(fragment instanceof DialogPreference.TargetFragment)) {
throw new IllegalStateException("Target fragment must implement TargetFragment" + " interface");
}
DialogPreference.TargetFragment targetFragment = (DialogPreference.TargetFragment) fragment;
if (savedInstanceState == null) {
mPreference = (RingtonePreference) targetFragment.findPreference(preferenceKey);
}
}
use of androidx.fragment.app.Fragment in project Douya by DreaminginCodeZH.
the class TableOfContentsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Calls ensureSubDecor().
findViewById(android.R.id.content);
if (savedInstanceState == null) {
Intent intent = getIntent();
Book book = intent.getParcelableExtra(EXTRA_BOOK);
Fragment fragment = TableOfContentsFragment.newInstance(book);
FragmentUtils.add(fragment, this, android.R.id.content);
}
}
use of androidx.fragment.app.Fragment in project AntennaPod by AntennaPod.
the class MainActivity method loadFeedFragmentById.
public void loadFeedFragmentById(long feedId, Bundle args) {
Fragment fragment = FeedItemlistFragment.newInstance(feedId);
if (args != null) {
fragment.setArguments(args);
}
NavDrawerFragment.saveLastNavFragment(this, String.valueOf(feedId));
loadFragment(fragment);
}
use of androidx.fragment.app.Fragment in project AntennaPod by AntennaPod.
the class MainActivity method loadFragment.
public void loadFragment(String tag, Bundle args) {
Log.d(TAG, "loadFragment(tag: " + tag + ", args: " + args + ")");
Fragment fragment;
switch(tag) {
case QueueFragment.TAG:
fragment = new QueueFragment();
break;
case EpisodesFragment.TAG:
fragment = new EpisodesFragment();
break;
case DownloadsFragment.TAG:
fragment = new DownloadsFragment();
break;
case PlaybackHistoryFragment.TAG:
fragment = new PlaybackHistoryFragment();
break;
case AddFeedFragment.TAG:
fragment = new AddFeedFragment();
break;
case SubscriptionFragment.TAG:
fragment = new SubscriptionFragment();
break;
default:
// default to the queue
fragment = new QueueFragment();
tag = QueueFragment.TAG;
args = null;
break;
}
if (args != null) {
fragment.setArguments(args);
}
NavDrawerFragment.saveLastNavFragment(this, tag);
loadFragment(fragment);
}
use of androidx.fragment.app.Fragment in project Conversations by siacs.
the class StartConversationActivity method onBackendConnected.
@Override
protected void onBackendConnected() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || checkSelfPermission(Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {
xmppConnectionService.getQuickConversationsService().considerSyncBackground(false);
}
if (mPostponedActivityResult != null) {
onActivityResult(mPostponedActivityResult.first, RESULT_OK, mPostponedActivityResult.second);
this.mPostponedActivityResult = null;
}
this.mActivatedAccounts.clear();
this.mActivatedAccounts.addAll(AccountUtils.getEnabledAccounts(xmppConnectionService));
configureHomeButton();
Intent intent = pendingViewIntent.pop();
if (intent != null && processViewIntent(intent)) {
filter(null);
} else {
if (mSearchEditText != null) {
filter(mSearchEditText.getText().toString());
} else {
filter(null);
}
}
Fragment fragment = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
if (fragment instanceof OnBackendConnected) {
Log.d(Config.LOGTAG, "calling on backend connected on dialog");
((OnBackendConnected) fragment).onBackendConnected();
}
if (QuickConversationsService.isQuicksy()) {
setRefreshing(xmppConnectionService.getQuickConversationsService().isSynchronizing());
}
if (QuickConversationsService.isConversations() && AccountUtils.hasEnabledAccounts(xmppConnectionService) && this.contacts.size() == 0 && this.conferences.size() == 0 && mOpenedFab.compareAndSet(false, true)) {
binding.speedDial.open();
}
}
Aggregations