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));
}
use of android.support.v4.app.FragmentActivity in project material-dialogs by afollestad.
the class FolderChooserDialog method show.
public void show(FragmentActivity context) {
final String tag = getBuilder().tag;
Fragment frag = context.getSupportFragmentManager().findFragmentByTag(tag);
if (frag != null) {
((DialogFragment) frag).dismiss();
context.getSupportFragmentManager().beginTransaction().remove(frag).commit();
}
show(context.getSupportFragmentManager(), tag);
}
use of android.support.v4.app.FragmentActivity in project scdl by passy.
the class PreferencesMenuTest method shouldStartPreferencesInActivity.
private void shouldStartPreferencesInActivity(Fragment fragment) {
final ActivityController<FragmentActivity> controller = Robolectric.buildActivity(FragmentActivity.class);
controller.create().start().resume();
final FragmentActivity activity = controller.get();
activity.getSupportFragmentManager().beginTransaction().add(fragment, null).commit();
final MenuItem item = new TestMenuItem(R.id.preferences);
fragment.onOptionsItemSelected(item);
final ShadowActivity shadowActivity = Robolectric.shadowOf(activity);
final Intent startedActivity = shadowActivity.getNextStartedActivity();
// Intent was actually started
assertThat(startedActivity, notNullValue());
final ShadowIntent intent = Robolectric.shadowOf(startedActivity);
assertThat(intent.getComponent().getClassName(), equalTo(ApplicationPreferencesActivity.class.getName()));
}
use of android.support.v4.app.FragmentActivity in project fitscales by paulburton.
the class BoardFragment method dataReport.
private void dataReport(float tl, float tr, float bl, float br) {
synchronized (this) {
if (stabiliseThread != null)
stabiliseThread.setData(tl, tr, bl, br);
if (stabiliseWeighinThread != null)
stabiliseWeighinThread.setData(tl, tr, bl, br);
}
boardView.setWeightData(tl, tr, bl, br);
FragmentActivity act = BoardFragment.this.getActivity();
if (act instanceof Listener)
((Listener) act).onBoardData(tl, tr, bl, br);
}
use of android.support.v4.app.FragmentActivity in project Qachee by nicolasjafelle.
the class CharacterListFragment method replace.
public void replace(FragmentActivity activity, Fragment newFragment) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.addToBackStack(null);
fragmentTransaction.replace(R.id.container, newFragment).commit();
}
Aggregations