Search in sources :

Example 11 with FragmentActivity

use of androidx.fragment.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class ItemForumTopicListResource method attachTo.

public static ItemForumTopicListResource attachTo(CollectableItem.Type itemType, long itemId, Integer episode, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    ItemForumTopicListResource instance = FragmentUtils.findByTag(activity, tag);
    if (instance == null) {
        instance = newInstance(itemType, itemId, episode);
        FragmentUtils.add(instance, activity, tag);
    }
    instance.setTarget(fragment, requestCode);
    return instance;
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity)

Example 12 with FragmentActivity

use of androidx.fragment.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class MovieFragmentResource method attachTo.

public static MovieFragmentResource attachTo(long movieId, SimpleMovie simpleMovie, Movie movie, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    MovieFragmentResource instance = FragmentUtils.findByTag(activity, tag);
    if (instance == null) {
        instance = newInstance(movieId, simpleMovie, movie);
        FragmentUtils.add(instance, activity, tag);
    }
    instance.setTarget(fragment, requestCode);
    return instance;
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity)

Example 13 with FragmentActivity

use of androidx.fragment.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class MusicFragmentResource method attachTo.

public static MusicFragmentResource attachTo(long musicId, SimpleMusic simpleMusic, Music music, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    MusicFragmentResource instance = FragmentUtils.findByTag(activity, tag);
    if (instance == null) {
        instance = newInstance(musicId, simpleMusic, music);
        FragmentUtils.add(instance, activity, tag);
    }
    instance.setTarget(fragment, requestCode);
    return instance;
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity)

Example 14 with FragmentActivity

use of androidx.fragment.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class GameGuideListResource method attachTo.

public static GameGuideListResource attachTo(long itemId, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    GameGuideListResource instance = FragmentUtils.findByTag(activity, tag);
    if (instance == null) {
        instance = newInstance(itemId);
        FragmentUtils.add(instance, activity, tag);
    }
    instance.setTarget(fragment, requestCode);
    return instance;
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity)

Example 15 with FragmentActivity

use of androidx.fragment.app.FragmentActivity in project Douya by DreaminginCodeZH.

the class UserResource method attachTo.

public static UserResource attachTo(String userIdOrUid, SimpleUser simpleUser, User user, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    UserResource instance = FragmentUtils.findByTag(activity, tag);
    if (instance == null) {
        instance = newInstance(userIdOrUid, simpleUser, user);
        FragmentUtils.add(instance, activity, tag);
    }
    instance.setTarget(fragment, requestCode);
    return instance;
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity)

Aggregations

FragmentActivity (androidx.fragment.app.FragmentActivity)181 Test (org.junit.Test)71 Intent (android.content.Intent)25 Bundle (android.os.Bundle)19 View (android.view.View)11 Config (org.robolectric.annotation.Config)11 TextView (android.widget.TextView)10 Before (org.junit.Before)10 BroadcastReceiver (android.content.BroadcastReceiver)8 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)8 Resources (android.content.res.Resources)7 Fragment (androidx.fragment.app.Fragment)7 FragmentManager (androidx.fragment.app.FragmentManager)7 Activity (android.app.Activity)6 IntentFilter (android.content.IntentFilter)6 UserHandle (android.os.UserHandle)6 Preference (androidx.preference.Preference)6 SwitchPreference (androidx.preference.SwitchPreference)6 RestrictedSwitchPreference (com.android.settingslib.RestrictedSwitchPreference)6 Tile (com.android.settingslib.drawer.Tile)6