Search in sources :

Example 71 with RecyclerView

use of androidx.recyclerview.widget.RecyclerView in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class StorageDashboardFragmentTest method test_dontLoadWhenQuotaOffIfVolumeInfoNotLoaded.

@Test
public void test_dontLoadWhenQuotaOffIfVolumeInfoNotLoaded() {
    View fakeView = mock(View.class, RETURNS_DEEP_STUBS);
    RecyclerView fakeRecyclerView = mock(RecyclerView.class, RETURNS_DEEP_STUBS);
    when(fakeView.findViewById(anyInt())).thenReturn(fakeView);
    mFragment = spy(mFragment);
    when(mFragment.getView()).thenReturn(fakeView);
    when(mFragment.getListView()).thenReturn(fakeRecyclerView);
    PrivateStorageInfo info = new PrivateStorageInfo(0, 0);
    mFragment.setPrivateStorageInfo(info);
    mFragment.maybeSetLoading(false);
    verify(mFragment, never()).setLoading(true, false);
}
Also used : PrivateStorageInfo(com.android.settingslib.deviceinfo.PrivateStorageInfo) RecyclerView(androidx.recyclerview.widget.RecyclerView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Test(org.junit.Test)

Example 72 with RecyclerView

use of androidx.recyclerview.widget.RecyclerView in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SliceContextualCardRendererTest method getSliceViewHolder.

private RecyclerView.ViewHolder getSliceViewHolder() {
    final RecyclerView recyclerView = new RecyclerView(mActivity);
    recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
    final View view = LayoutInflater.from(mActivity).inflate(VIEW_TYPE_FULL_WIDTH, recyclerView, false);
    return mRenderer.createViewHolder(view, VIEW_TYPE_FULL_WIDTH);
}
Also used : RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 73 with RecyclerView

use of androidx.recyclerview.widget.RecyclerView in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SliceContextualCardRendererTest method getDeferredSetupViewHolder.

private RecyclerView.ViewHolder getDeferredSetupViewHolder() {
    final RecyclerView recyclerView = new RecyclerView(mActivity);
    recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
    final View view = LayoutInflater.from(mActivity).inflate(VIEW_TYPE_DEFERRED_SETUP, recyclerView, false);
    final RecyclerView.ViewHolder viewHolder = spy(new SliceDeferredSetupCardRendererHelper.DeferredSetupCardViewHolder(view));
    doReturn(VIEW_TYPE_DEFERRED_SETUP).when(viewHolder).getItemViewType();
    return viewHolder;
}
Also used : RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 74 with RecyclerView

use of androidx.recyclerview.widget.RecyclerView in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SliceDeferredSetupCardRendererHelperTest method getDeferredSetupCardViewHolder.

private RecyclerView.ViewHolder getDeferredSetupCardViewHolder() {
    final RecyclerView recyclerView = new RecyclerView(mActivity);
    recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
    final View view = LayoutInflater.from(mActivity).inflate(VIEW_TYPE_DEFERRED_SETUP, recyclerView, false);
    return mHelper.createViewHolder(view);
}
Also used : RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 75 with RecyclerView

use of androidx.recyclerview.widget.RecyclerView in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SliceHalfCardRendererHelperTest method getHalfCardViewHolder.

private RecyclerView.ViewHolder getHalfCardViewHolder() {
    final RecyclerView recyclerView = new RecyclerView(mActivity);
    recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
    final View view = LayoutInflater.from(mActivity).inflate(VIEW_TYPE_HALF_WIDTH, recyclerView, false);
    return mHelper.createViewHolder(view);
}
Also used : RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Aggregations

RecyclerView (androidx.recyclerview.widget.RecyclerView)272 View (android.view.View)174 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)115 TextView (android.widget.TextView)32 Test (org.junit.Test)24 Nullable (androidx.annotation.Nullable)22 GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)22 ImageView (android.widget.ImageView)18 Toolbar (androidx.appcompat.widget.Toolbar)18 NonNull (androidx.annotation.NonNull)16 Bundle (android.os.Bundle)15 ViewGroup (android.view.ViewGroup)15 ArrayList (java.util.ArrayList)15 Intent (android.content.Intent)14 Rect (android.graphics.Rect)13 LayoutInflater (android.view.LayoutInflater)11 SuppressLint (android.annotation.SuppressLint)10 Context (android.content.Context)10 ContextualCard (com.android.settings.homepage.contextualcards.ContextualCard)10 List (java.util.List)9