Search in sources :

Example 16 with FragmentActivity

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

the class NotificationListResource method attachTo.

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

Example 17 with FragmentActivity

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

the class NotificationCountResource method attachTo.

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

Example 18 with FragmentActivity

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

the class FollowerListResource method attachTo.

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

Example 19 with FragmentActivity

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

the class FollowingListResource method attachTo.

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

Example 20 with FragmentActivity

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

the class ProfileResource method attachTo.

public static ProfileResource attachTo(String userIdOrUid, me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser simpleUser, User user, Fragment fragment, String tag, int requestCode) {
    FragmentActivity activity = fragment.getActivity();
    ProfileResource 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