Search in sources :

Example 6 with FragmentActivity

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

the class BroadcastRebroadcastListResource method attachTo.

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

Example 7 with FragmentActivity

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

the class GameResource method attachTo.

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

Example 8 with FragmentActivity

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

the class ItemRecommendationListResource method attachTo.

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

Example 9 with FragmentActivity

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

the class MovieResource method attachTo.

public static MovieResource attachTo(long movieId, SimpleMovie simpleMovie, Movie movie, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    MovieResource 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 10 with FragmentActivity

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

the class ItemAwardListResource method attachTo.

public static ItemAwardListResource attachTo(CollectableItem.Type itemType, long itemId, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    ItemAwardListResource instance = FragmentUtils.findByTag(activity, tag);
    if (instance == null) {
        instance = newInstance(itemType, itemId);
        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