Search in sources :

Example 11 with RequestManager

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

the class RequestManagerRetrieverTest method testChecksIfContextIsActivity.

@Test
public void testChecksIfContextIsActivity() {
    RetrieverHarness harness = new DefaultRetrieverHarness();
    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 12 with RequestManager

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

the class RequestManagerRetrieverTest method testCanGetRequestManagerFromFragment.

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

Example 13 with RequestManager

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

the class RequestManagerRetrieverTest method testSupportCanGetRequestManagerFromActivity.

@Test
public void testSupportCanGetRequestManagerFromActivity() {
    FragmentActivity fragmentActivity = Robolectric.buildActivity(FragmentActivity.class).create().start().get();
    RequestManager manager = retriever.get(fragmentActivity);
    assertEquals(manager, retriever.get(fragmentActivity));
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) RequestManager(com.bumptech.glide.RequestManager) Test(org.junit.Test)

Example 14 with RequestManager

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

the class RequestManagerRetrieverTest method testCanGetRequestManagerFromActivity.

@Test
public void testCanGetRequestManagerFromActivity() {
    Activity activity = Robolectric.buildActivity(Activity.class).create().start().get();
    RequestManager manager = retriever.get(activity);
    assertEquals(manager, retriever.get(activity));
}
Also used : RequestManager(com.bumptech.glide.RequestManager) FragmentActivity(android.support.v4.app.FragmentActivity) Activity(android.app.Activity) Test(org.junit.Test)

Example 15 with RequestManager

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

the class RequestManagerRetrieverTest method testSavesNewRequestManagerToFragmentIfCreatesRequestManagerForExistingFragment.

@Test
public void testSavesNewRequestManagerToFragmentIfCreatesRequestManagerForExistingFragment() {
    for (RetrieverHarness harness : harnesses) {
        harness.addFragmentWithTag(RequestManagerRetriever.FRAGMENT_TAG, null);
        RequestManager first = harness.doGet();
        RequestManager second = harness.doGet();
        assertEquals(first, second);
    }
}
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