Search in sources :

Example 26 with Fragment

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);
    }
}
Also used : DialogPreference(androidx.preference.DialogPreference) Bundle(android.os.Bundle) Fragment(androidx.fragment.app.Fragment)

Example 27 with Fragment

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);
    }
}
Also used : Book(me.zhanghai.android.douya.network.api.info.frodo.Book) Intent(android.content.Intent) Fragment(androidx.fragment.app.Fragment)

Example 28 with Fragment

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);
}
Also used : SearchFragment(de.danoeh.antennapod.fragment.SearchFragment) Fragment(androidx.fragment.app.Fragment) QueueFragment(de.danoeh.antennapod.fragment.QueueFragment) DownloadsFragment(de.danoeh.antennapod.fragment.DownloadsFragment) NavDrawerFragment(de.danoeh.antennapod.fragment.NavDrawerFragment) FeedItemlistFragment(de.danoeh.antennapod.fragment.FeedItemlistFragment) SubscriptionFragment(de.danoeh.antennapod.fragment.SubscriptionFragment) AudioPlayerFragment(de.danoeh.antennapod.fragment.AudioPlayerFragment) PlaybackHistoryFragment(de.danoeh.antennapod.fragment.PlaybackHistoryFragment) EpisodesFragment(de.danoeh.antennapod.fragment.EpisodesFragment) AddFeedFragment(de.danoeh.antennapod.fragment.AddFeedFragment)

Example 29 with 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);
}
Also used : DownloadsFragment(de.danoeh.antennapod.fragment.DownloadsFragment) AddFeedFragment(de.danoeh.antennapod.fragment.AddFeedFragment) PlaybackHistoryFragment(de.danoeh.antennapod.fragment.PlaybackHistoryFragment) QueueFragment(de.danoeh.antennapod.fragment.QueueFragment) EpisodesFragment(de.danoeh.antennapod.fragment.EpisodesFragment) SearchFragment(de.danoeh.antennapod.fragment.SearchFragment) Fragment(androidx.fragment.app.Fragment) QueueFragment(de.danoeh.antennapod.fragment.QueueFragment) DownloadsFragment(de.danoeh.antennapod.fragment.DownloadsFragment) NavDrawerFragment(de.danoeh.antennapod.fragment.NavDrawerFragment) FeedItemlistFragment(de.danoeh.antennapod.fragment.FeedItemlistFragment) SubscriptionFragment(de.danoeh.antennapod.fragment.SubscriptionFragment) AudioPlayerFragment(de.danoeh.antennapod.fragment.AudioPlayerFragment) PlaybackHistoryFragment(de.danoeh.antennapod.fragment.PlaybackHistoryFragment) EpisodesFragment(de.danoeh.antennapod.fragment.EpisodesFragment) AddFeedFragment(de.danoeh.antennapod.fragment.AddFeedFragment) SubscriptionFragment(de.danoeh.antennapod.fragment.SubscriptionFragment)

Example 30 with 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();
    }
}
Also used : OnBackendConnected(eu.siacs.conversations.ui.interfaces.OnBackendConnected) PendingIntent(android.app.PendingIntent) Intent(android.content.Intent) Fragment(androidx.fragment.app.Fragment) SwipeRefreshListFragment(eu.siacs.conversations.ui.widget.SwipeRefreshListFragment)

Aggregations

Fragment (androidx.fragment.app.Fragment)262 FragmentTransaction (androidx.fragment.app.FragmentTransaction)57 Bundle (android.os.Bundle)49 FragmentManager (androidx.fragment.app.FragmentManager)42 DialogFragment (androidx.fragment.app.DialogFragment)24 FileFragment (com.owncloud.android.ui.fragment.FileFragment)23 Intent (android.content.Intent)22 View (android.view.View)22 FileDetailFragment (com.owncloud.android.ui.fragment.FileDetailFragment)20 OCFileListFragment (com.owncloud.android.ui.fragment.OCFileListFragment)20 SortingOrderDialogFragment (com.owncloud.android.ui.dialog.SortingOrderDialogFragment)19 GalleryFragment (com.owncloud.android.ui.fragment.GalleryFragment)18 TaskRetainerFragment (com.owncloud.android.ui.fragment.TaskRetainerFragment)18 UnifiedSearchFragment (com.owncloud.android.ui.fragment.UnifiedSearchFragment)18 PreviewImageFragment (com.owncloud.android.ui.preview.PreviewImageFragment)18 PreviewMediaFragment (com.owncloud.android.ui.preview.PreviewMediaFragment)18 PreviewTextFileFragment (com.owncloud.android.ui.preview.PreviewTextFileFragment)18 PreviewTextFragment (com.owncloud.android.ui.preview.PreviewTextFragment)18 PreviewTextStringFragment (com.owncloud.android.ui.preview.PreviewTextStringFragment)18 PreviewPdfFragment (com.owncloud.android.ui.preview.pdf.PreviewPdfFragment)18