Search in sources :

Example 16 with ObservableScrollViewCallbacks

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

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

the class ViewPagerTab2GridViewFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_gridview, container, false);
    Activity parentActivity = getActivity();
    final ObservableGridView gridView = (ObservableGridView) view.findViewById(R.id.scroll);
    setDummyData(gridView);
    gridView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        gridView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
Also used : Activity(android.app.Activity) ObservableGridView(com.github.ksoichiro.android.observablescrollview.ObservableGridView) ObservableScrollViewCallbacks(com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks) ObservableGridView(com.github.ksoichiro.android.observablescrollview.ObservableGridView) View(android.view.View)

Example 18 with ObservableScrollViewCallbacks

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

the class ViewPagerTab2ListViewFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_listview, container, false);
    Activity parentActivity = getActivity();
    final ObservableListView listView = (ObservableListView) view.findViewById(R.id.scroll);
    setDummyData(listView);
    listView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        listView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
Also used : ObservableListView(com.github.ksoichiro.android.observablescrollview.ObservableListView) Activity(android.app.Activity) ObservableScrollViewCallbacks(com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks) View(android.view.View) ObservableListView(com.github.ksoichiro.android.observablescrollview.ObservableListView)

Example 19 with ObservableScrollViewCallbacks

use of com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks 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);
    setDummyData(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 20 with ObservableScrollViewCallbacks

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

the class ViewPagerTab2ScrollViewFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scrollview_noheader, container, false);
    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    Activity parentActivity = getActivity();
    scrollView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
    if (parentActivity instanceof ObservableScrollViewCallbacks) {
        scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
    }
    return view;
}
Also used : ObservableScrollView(com.github.ksoichiro.android.observablescrollview.ObservableScrollView) Activity(android.app.Activity) ObservableScrollViewCallbacks(com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks) ObservableScrollView(com.github.ksoichiro.android.observablescrollview.ObservableScrollView) View(android.view.View)

Aggregations

View (android.view.View)26 ObservableScrollViewCallbacks (com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks)26 Activity (android.app.Activity)21 Bundle (android.os.Bundle)11 ObservableScrollView (com.github.ksoichiro.android.observablescrollview.ObservableScrollView)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 ObservableListView (com.github.ksoichiro.android.observablescrollview.ObservableListView)6 ObservableRecyclerView (com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView)6 Fragment (android.support.v4.app.Fragment)5 ViewGroup (android.view.ViewGroup)5 ObservableGridView (com.github.ksoichiro.android.observablescrollview.ObservableGridView)4 ObservableWebView (com.github.ksoichiro.android.observablescrollview.ObservableWebView)3 ViewTreeObserver (android.view.ViewTreeObserver)2 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 RecyclerView (android.support.v7.widget.RecyclerView)1 FrameLayout (android.widget.FrameLayout)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 TintImageView (com.bilibili.magicasakura.widgets.TintImageView)1 ArrayList (java.util.ArrayList)1