Search in sources :

Example 31 with RequestManager

use of com.bumptech.glide.RequestManager in project glide by bumptech.

the class RequestManagerRetrieverTest method testApplicationRequestManagerIsNotPausedWhenRetrieved.

@Test
public void testApplicationRequestManagerIsNotPausedWhenRetrieved() {
    RequestManager manager = retriever.get(RuntimeEnvironment.application);
    assertFalse(manager.isPaused());
}
Also used : RequestManager(com.bumptech.glide.RequestManager) Test(org.junit.Test)

Example 32 with RequestManager

use of com.bumptech.glide.RequestManager in project glide by bumptech.

the class RequestManagerRetrieverTest method testHandlesContextWrappersForActivities.

@Test
public void testHandlesContextWrappersForActivities() {
    RetrieverHarness harness = new DefaultRetrieverHarness();
    RequestManager requestManager = harness.doGet();
    ContextWrapper contextWrapper = new ContextWrapper(harness.getController().get());
    assertEquals(requestManager, retriever.get(contextWrapper));
}
Also used : RequestManager(com.bumptech.glide.RequestManager) ContextWrapper(android.content.ContextWrapper) Test(org.junit.Test)

Example 33 with RequestManager

use of com.bumptech.glide.RequestManager in project glide by bumptech.

the class RequestManagerRetrieverTest method testChecksIfContextIsFragmentActivity.

@Test
public void testChecksIfContextIsFragmentActivity() {
    RetrieverHarness harness = new SupportRetrieverHarness();
    RequestManager requestManager = harness.doGet();
    assertEquals(requestManager, retriever.get((Context) harness.getController().get()));
}
Also used : Context(android.content.Context) RequestManager(com.bumptech.glide.RequestManager) Test(org.junit.Test)

Example 34 with RequestManager

use of com.bumptech.glide.RequestManager 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 35 with RequestManager

use of com.bumptech.glide.RequestManager in project glide by bumptech.

the class RequestManagerRetrieverTest method testReturnsExistingRequestManagerIfExists.

@Test
public void testReturnsExistingRequestManagerIfExists() {
    for (RetrieverHarness harness : harnesses) {
        RequestManager requestManager = mock(RequestManager.class);
        harness.addFragmentWithTag(RequestManagerRetriever.FRAGMENT_TAG, requestManager);
        assertEquals(requestManager, harness.doGet());
    }
}
Also used : RequestManager(com.bumptech.glide.RequestManager) Test(org.junit.Test)

Aggregations

RequestManager (com.bumptech.glide.RequestManager)41 Context (android.content.Context)15 View (android.view.View)15 Bundle (android.os.Bundle)14 Glide (com.bumptech.glide.Glide)14 Test (org.junit.Test)14 Stream (com.annimon.stream.Stream)13 MusicUtils (com.simplecity.amp_library.utils.MusicUtils)13 List (java.util.List)13 PopupMenu (android.support.v7.widget.PopupMenu)11 MenuItem (android.view.MenuItem)11 Toast (android.widget.Toast)11 R (com.simplecity.amp_library.R)11 MenuUtils (com.simplecity.amp_library.utils.MenuUtils)11 Intent (android.content.Intent)10 LayoutInflater (android.view.LayoutInflater)10 ViewGroup (android.view.ViewGroup)10 Song (com.simplecity.amp_library.model.Song)10 ViewModel (com.simplecityapps.recycler_adapter.model.ViewModel)10 AndroidSchedulers (io.reactivex.android.schedulers.AndroidSchedulers)10