Search in sources :

Example 91 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager 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 92 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager 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)

Example 93 with LinearLayoutManager

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

the class ConditionFooterContextualCardRendererTest method bindView_clickView_shouldSetTrueToIsConditionExpanded.

@Test
public void bindView_clickView_shouldSetTrueToIsConditionExpanded() {
    final RecyclerView recyclerView = new RecyclerView(mContext);
    recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
    final ContextualCard card = generateConditionFooterContextualCard();
    final View view = LayoutInflater.from(mContext).inflate(card.getViewType(), recyclerView, false);
    final RecyclerView.ViewHolder viewHolder = mRenderer.createViewHolder(view, card.getViewType());
    when(mControllerRendererPool.getController(mContext, ContextualCard.CardType.CONDITIONAL_FOOTER)).thenReturn(mController);
    mRenderer.bindView(viewHolder, card);
    assertThat(viewHolder.itemView).isNotNull();
    viewHolder.itemView.performClick();
    verify(mController).setIsExpanded(false);
    verify(mController).onConditionsChanged();
}
Also used : ContextualCard(com.android.settings.homepage.contextualcards.ContextualCard) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Test(org.junit.Test)

Example 94 with LinearLayoutManager

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

the class ConditionHeaderContextualCardRendererTest method bindView_clickView_shouldSetTrueToIsConditionExpanded.

@Test
public void bindView_clickView_shouldSetTrueToIsConditionExpanded() {
    final RecyclerView recyclerView = new RecyclerView(mActivity);
    recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
    final ContextualCard card = generateConditionHeaderContextualCard();
    final View view = LayoutInflater.from(mActivity).inflate(card.getViewType(), recyclerView, false);
    final RecyclerView.ViewHolder viewHolder = mRenderer.createViewHolder(view, card.getViewType());
    when(mControllerRendererPool.getController(mActivity, ContextualCard.CardType.CONDITIONAL_HEADER)).thenReturn(mController);
    mRenderer.bindView(viewHolder, generateConditionHeaderContextualCard());
    assertThat(viewHolder.itemView).isNotNull();
    viewHolder.itemView.performClick();
    verify(mController).setIsExpanded(true);
    verify(mController).onConditionsChanged();
}
Also used : ContextualCard(com.android.settings.homepage.contextualcards.ContextualCard) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Test(org.junit.Test)

Example 95 with LinearLayoutManager

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

the class SwipeDismissalDelegateTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    final ActivityController<Activity> activityController = Robolectric.buildActivity(Activity.class);
    mActivity = activityController.get();
    mActivity.setTheme(R.style.Theme_Settings_Home);
    activityController.create();
    mRecyclerView = new RecyclerView(mActivity);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
    mDismissalDelegate = new SwipeDismissalDelegate(mDismissalDelegateListener);
}
Also used : Activity(android.app.Activity) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) Before(org.junit.Before)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)470 RecyclerView (androidx.recyclerview.widget.RecyclerView)281 View (android.view.View)183 TextView (android.widget.TextView)65 ArrayList (java.util.ArrayList)37 Nullable (androidx.annotation.Nullable)33 Bundle (android.os.Bundle)32 Toolbar (androidx.appcompat.widget.Toolbar)32 Intent (android.content.Intent)30 ImageView (android.widget.ImageView)27 List (java.util.List)24 Test (org.junit.Test)24 Context (android.content.Context)23 NonNull (androidx.annotation.NonNull)23 ViewGroup (android.view.ViewGroup)22 AlertDialog (androidx.appcompat.app.AlertDialog)21 ContextualCard (com.android.settings.homepage.contextualcards.ContextualCard)20 LayoutInflater (android.view.LayoutInflater)18 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)16 SwipeRefreshLayout (androidx.swiperefreshlayout.widget.SwipeRefreshLayout)16