Search in sources :

Example 41 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Android-ObservableScrollView by ksoichiro.

the class FillGapRecyclerViewActivity method createScrollable.

@Override
protected ObservableRecyclerView createScrollable() {
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scroll);
    recyclerView.setScrollViewCallbacks(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(false);
    setDummyDataWithHeader(recyclerView, mFlexibleSpaceImageHeight);
    return recyclerView;
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 42 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Android-ObservableScrollView by ksoichiro.

the class StickyHeaderRecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_stickyheaderrecyclerview);
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    mHeaderView = findViewById(R.id.header);
    ViewCompat.setElevation(mHeaderView, getResources().getDimension(R.dimen.toolbar_elevation));
    mToolbarView = findViewById(R.id.toolbar);
    mRecyclerView = (ObservableRecyclerView) findViewById(R.id.recycler);
    mRecyclerView.setScrollViewCallbacks(this);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setHasFixedSize(false);
    View headerView = LayoutInflater.from(this).inflate(R.layout.recycler_header, null);
    setDummyDataWithHeader(mRecyclerView, headerView);
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) View(android.view.View)

Example 43 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Android-ObservableScrollView by ksoichiro.

the class FillGap2RecyclerViewActivity method createScrollable.

@Override
protected ObservableRecyclerView createScrollable() {
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scroll);
    recyclerView.setScrollViewCallbacks(this);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(false);
    setDummyDataWithHeader(recyclerView, mFlexibleSpaceImageHeight);
    return recyclerView;
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 44 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class ContactSelectionListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.contact_selection_list_fragment, container, false);
    emptyText = ViewUtil.findById(view, android.R.id.empty);
    recyclerView = ViewUtil.findById(view, R.id.recycler_view);
    swipeRefresh = ViewUtil.findById(view, R.id.swipe_refresh);
    fastScroller = ViewUtil.findById(view, R.id.fast_scroller);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    swipeRefresh.setEnabled(getActivity().getIntent().getBooleanExtra(REFRESHABLE, true) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN);
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 45 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class ConversationListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
    final View view = inflater.inflate(R.layout.conversation_list_fragment, container, false);
    reminderView = ViewUtil.findById(view, R.id.reminder);
    list = ViewUtil.findById(view, R.id.list);
    fab = ViewUtil.findById(view, R.id.fab);
    if (archive)
        fab.setVisibility(View.GONE);
    else
        fab.setVisibility(View.VISIBLE);
    reminderView.setOnDismissListener(new OnDismissListener() {

        @Override
        public void onDismiss() {
            updateReminders();
        }
    });
    list.setHasFixedSize(true);
    list.setLayoutManager(new LinearLayoutManager(getActivity()));
    list.setItemAnimator(new DeleteItemAnimator());
    new ItemTouchHelper(new ArchiveListenerCallback()).attachToRecyclerView(list);
    return view;
}
Also used : ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) OnDismissListener(org.thoughtcrime.securesms.components.reminder.ReminderView.OnDismissListener) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) View(android.view.View) ReminderView(org.thoughtcrime.securesms.components.reminder.ReminderView) RecyclerView(android.support.v7.widget.RecyclerView) DeleteItemAnimator(org.thoughtcrime.securesms.components.recyclerview.DeleteItemAnimator)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1979 RecyclerView (android.support.v7.widget.RecyclerView)1087 View (android.view.View)824 TextView (android.widget.TextView)353 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)234 ArrayList (java.util.ArrayList)204 ImageView (android.widget.ImageView)186 Intent (android.content.Intent)150 Toolbar (android.support.v7.widget.Toolbar)134 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)131 BindView (butterknife.BindView)126 GridLayoutManager (android.support.v7.widget.GridLayoutManager)125 Bundle (android.os.Bundle)109 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)107 Nullable (android.support.annotation.Nullable)98 ViewGroup (android.view.ViewGroup)82 Context (android.content.Context)81 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)81 AdapterView (android.widget.AdapterView)70 List (java.util.List)69