Search in sources :

Example 51 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project qualitymatters by artem-zinnatullin.

the class DeveloperSettingsFragment method onRestartAppClick.

@OnClick(R.id.developer_settings_restart_app_button)
void onRestartAppClick() {
    final FragmentActivity activity = getActivity();
    ProcessPhoenix.triggerRebirth(activity, new Intent(activity, activity.getClass()));
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) Intent(android.content.Intent) OnClick(butterknife.OnClick)

Example 52 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project glide by bumptech.

the class RequestManagerRetrieverTest method testSupportCanGetRequestManagerFromFragment.

@Test
public void testSupportCanGetRequestManagerFromFragment() {
    FragmentActivity activity = Robolectric.buildActivity(FragmentActivity.class).create().start().resume().get();
    Fragment fragment = new Fragment();
    activity.getSupportFragmentManager().beginTransaction().add(fragment, PARENT_TAG).commit();
    activity.getSupportFragmentManager().executePendingTransactions();
    RequestManager manager = retriever.get(fragment);
    assertEquals(manager, retriever.get(fragment));
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) RequestManager(com.bumptech.glide.RequestManager) Fragment(android.support.v4.app.Fragment) Test(org.junit.Test)

Example 53 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project photo-picker-plus-android by chute.

the class FragmentUtil method replaceContentWithSingleFragment.

public static void replaceContentWithSingleFragment(FragmentActivity activity, AccountModel account, String folderId, List<Integer> selectedItemPositions) {
    FragmentTransaction fragmentTransaction = activity.getSupportFragmentManager().beginTransaction();
    fragmentTransaction.replace(R.id.gcFragments, FragmentSingle.newInstance(account, folderId, selectedItemPositions), TAG_FRAGMENT_FILES);
    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 54 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project photo-picker-plus-android by chute.

the class FragmentUtil method replaceContentWithRootFragment.

public static void replaceContentWithRootFragment(FragmentActivity activity, AccountModel account, PhotoFilterType filterType, List<Integer> accountItemPositions, List<Integer> imageItemPositions, List<Integer> videoItemPositions) {
    FragmentTransaction fragmentTransaction = activity.getSupportFragmentManager().beginTransaction();
    fragmentTransaction.replace(R.id.gcFragments, FragmentRoot.newInstance(account, filterType, accountItemPositions, imageItemPositions, videoItemPositions), TAG_FRAGMENT_FOLDER);
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 55 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project PhotoPicker by donglua.

the class PhotoPickerFragment method onActivityResult.

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == ImageCaptureManager.REQUEST_TAKE_PHOTO && resultCode == RESULT_OK) {
        if (captureManager == null) {
            FragmentActivity activity = getActivity();
            captureManager = new ImageCaptureManager(activity);
        }
        captureManager.galleryAddPic();
        if (directories.size() > 0) {
            String path = captureManager.getCurrentPhotoPath();
            PhotoDirectory directory = directories.get(INDEX_ALL_PHOTOS);
            directory.getPhotos().add(INDEX_ALL_PHOTOS, new Photo(path.hashCode(), path));
            directory.setCoverPath(path);
            photoGridAdapter.notifyDataSetChanged();
        }
    }
}
Also used : PhotoDirectory(me.iwf.photopicker.entity.PhotoDirectory) FragmentActivity(android.support.v4.app.FragmentActivity) Photo(me.iwf.photopicker.entity.Photo) ImageCaptureManager(me.iwf.photopicker.utils.ImageCaptureManager)

Aggregations

FragmentActivity (android.support.v4.app.FragmentActivity)91 FragmentTransaction (android.app.FragmentTransaction)16 FragmentManager (android.support.v4.app.FragmentManager)16 FragmentTransaction (android.support.v4.app.FragmentTransaction)16 Fragment (android.support.v4.app.Fragment)11 MediaControllerCompat (android.support.v4.media.session.MediaControllerCompat)11 Intent (android.content.Intent)7 Bundle (android.os.Bundle)5 View (android.view.View)5 TextView (android.widget.TextView)4 DialogFragment (android.support.v4.app.DialogFragment)3 SearchView (android.widget.SearchView)3 Fragment (android.app.Fragment)2 ActionBar (android.support.v7.app.ActionBar)2 AppCompatActivity (android.support.v7.app.AppCompatActivity)2 MediaRouteDialogFactory (android.support.v7.app.MediaRouteDialogFactory)2 RecyclerView (android.support.v7.widget.RecyclerView)2 ImageView (android.widget.ImageView)2 InjectView (butterknife.InjectView)2 RequestManager (com.bumptech.glide.RequestManager)2