Search in sources :

Example 6 with ObservableRecyclerView

use of com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView in project Android-ObservableScrollView by ksoichiro.

the class ActionBarControlRecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_actionbarcontrolrecyclerview);
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.recycler);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    setDummyData(recyclerView);
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 7 with ObservableRecyclerView

use of com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView 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 8 with ObservableRecyclerView

use of com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView in project Android-ObservableScrollView by ksoichiro.

the class ViewPagerTab2RecyclerViewFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_recyclerview, container, false);
    Activity parentActivity = getActivity();
    final ObservableRecyclerView recyclerView = (ObservableRecyclerView) view.findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(parentActivity));
    recyclerView.setHasFixedSize(false);
    UiTestUtils.setDummyData(getActivity(), recyclerView);
    recyclerView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) Activity(android.app.Activity) ObservableScrollViewCallbacks(com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) View(android.view.View)

Example 9 with ObservableRecyclerView

use of com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView in project Android-ObservableScrollView by ksoichiro.

the class ViewPagerTabRecyclerViewFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_recyclerview, container, false);
    Activity parentActivity = getActivity();
    final ObservableRecyclerView recyclerView = (ObservableRecyclerView) view.findViewById(R.id.scroll);
    recyclerView.setLayoutManager(new LinearLayoutManager(parentActivity));
    recyclerView.setHasFixedSize(false);
    View headerView = LayoutInflater.from(parentActivity).inflate(R.layout.padding, null);
    UiTestUtils.setDummyDataWithHeader(getActivity(), recyclerView, headerView);
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        // Scroll to the specified offset after layout
        Bundle args = getArguments();
        if (args != null && args.containsKey(ARG_INITIAL_POSITION)) {
            final int initialPosition = args.getInt(ARG_INITIAL_POSITION, 0);
            ScrollUtils.addOnGlobalLayoutListener(recyclerView, new Runnable() {

                @Override
                public void run() {
                    recyclerView.scrollVerticallyToPosition(initialPosition);
                }
            });
        }
        recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) Bundle(android.os.Bundle) Activity(android.app.Activity) ObservableScrollViewCallbacks(com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) View(android.view.View)

Example 10 with ObservableRecyclerView

use of com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView in project Android-ObservableScrollView by ksoichiro.

the class TouchInterceptionRecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_touchinterception_recyclerview);
    ((TextView) findViewById(R.id.title)).setText(getClass().getSimpleName());
    mScrollable = (Scrollable) findViewById(R.id.scrollable);
    mScrollable.setScrollViewCallbacks(this);
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) mScrollable;
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    UiTestUtils.setDummyData(this, recyclerView);
    mIntersectionHeight = getResources().getDimensionPixelSize(R.dimen.intersection_height);
    mHeaderBarHeight = getResources().getDimensionPixelSize(R.dimen.header_bar_height);
    mInterceptionLayout = (TouchInterceptionFrameLayout) findViewById(R.id.scroll_wrapper);
    mInterceptionLayout.setScrollInterceptionListener(mInterceptionListener);
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) TextView(android.widget.TextView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

ObservableRecyclerView (com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView)27 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)23 View (android.view.View)16 ObservableScrollViewCallbacks (com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks)6 Activity (android.app.Activity)5 TextView (android.widget.TextView)5 Bundle (android.os.Bundle)4 RecyclerView (android.support.v7.widget.RecyclerView)4 Fragment (android.support.v4.app.Fragment)3 ImageView (android.widget.ImageView)3 ArrayList (java.util.ArrayList)3 SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)2 ArtistInfoFragment (com.wm.remusic.fragmentnet.ArtistInfoFragment)2 ArtistInfoMusicFragment (com.wm.remusic.fragmentnet.ArtistInfoMusicFragment)2 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 ViewGroup (android.view.ViewGroup)1 ViewTreeObserver (android.view.ViewTreeObserver)1 LinearLayout (android.widget.LinearLayout)1 TintImageView (com.bilibili.magicasakura.widgets.TintImageView)1