本文整理匯總了Java中com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks類的典型用法代碼示例。如果您正苦於以下問題:Java ObservableScrollViewCallbacks類的具體用法?Java ObservableScrollViewCallbacks怎麽用?Java ObservableScrollViewCallbacks使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ObservableScrollViewCallbacks類屬於com.github.ksoichiro.android.observablescrollview包,在下文中一共展示了ObservableScrollViewCallbacks類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initSlide
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
private void initSlide() {
ScrollUtils.addOnGlobalLayoutListener(rvDetailEvents, new Runnable() {
@Override
public void run() {
mLayoutFinished = true;
updateScroll(rvDetailEvents.getCurrentScrollY());
}
});
rvDetailEvents.setScrollViewCallbacks(new ObservableScrollViewCallbacks() {
@Override
public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) {
if (!mLayoutFinished) return;
updateScroll(scrollY);
}
@Override
public void onDownMotionEvent() {
}
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
}
});
}
示例2: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_recyclerview, container, false);
final ObservableRecyclerView recyclerView = (ObservableRecyclerView) view.findViewById(R.id.scroll);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setHasFixedSize(false);
setDummyData(recyclerView);
Fragment parentFragment = getParentFragment();
ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
if (viewGroup != null) {
recyclerView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
if (parentFragment instanceof ObservableScrollViewCallbacks) {
recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
}
}
return view;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:20,代碼來源:ViewPagerTabFragmentRecyclerViewFragment.java
示例3: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_gridview, container, false);
final ObservableGridView gridView = (ObservableGridView) view.findViewById(R.id.scroll);
setDummyData(gridView);
Fragment parentFragment = getParentFragment();
ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
if (viewGroup != null) {
gridView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
if (parentFragment instanceof ObservableScrollViewCallbacks) {
gridView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
}
}
return view;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:18,代碼來源:ViewPagerTabFragmentGridViewFragment.java
示例4: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_listview, container, false);
final ObservableListView listView = (ObservableListView) view.findViewById(R.id.scroll);
setDummyData(listView);
Fragment parentFragment = getParentFragment();
ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
if (viewGroup != null) {
listView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
if (parentFragment instanceof ObservableScrollViewCallbacks) {
listView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
}
}
return view;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:18,代碼來源:ViewPagerTabFragmentListViewFragment.java
示例5: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@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;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:17,代碼來源:ViewPagerTab2RecyclerViewFragment.java
示例6: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_webview, container, false);
final ObservableWebView webView = (ObservableWebView) view.findViewById(R.id.scroll);
webView.loadUrl("file:///android_asset/lipsum.html");
Fragment parentFragment = getParentFragment();
ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
if (viewGroup != null) {
webView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
if (parentFragment instanceof ObservableScrollViewCallbacks) {
webView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
}
}
return view;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:17,代碼來源:ViewPagerTabFragmentWebViewFragment.java
示例7: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@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);
UiTestUtils.setDummyDataWithHeader(getActivity(), listView, inflater.inflate(R.layout.padding, null));
if (parentActivity instanceof ObservableScrollViewCallbacks) {
// Scroll to the specified position after layout
Bundle args = getArguments();
if (args != null && args.containsKey(ARG_INITIAL_POSITION)) {
final int initialPosition = args.getInt(ARG_INITIAL_POSITION, 0);
ScrollUtils.addOnGlobalLayoutListener(listView, new Runnable() {
@Override
public void run() {
// scrollTo() doesn't work, should use setSelection()
listView.setSelection(initialPosition);
}
});
}
listView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:26,代碼來源:ViewPagerTabListViewFragment.java
示例8: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_scrollview, container, false);
final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
Activity parentActivity = getActivity();
if (parentActivity instanceof ObservableScrollViewCallbacks) {
// Scroll to the specified offset after layout
Bundle args = getArguments();
if (args != null && args.containsKey(ARG_SCROLL_Y)) {
final int scrollY = args.getInt(ARG_SCROLL_Y, 0);
ScrollUtils.addOnGlobalLayoutListener(scrollView, new Runnable() {
@Override
public void run() {
scrollView.scrollTo(0, scrollY);
}
});
}
scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:23,代碼來源:ViewPagerTabScrollViewFragment.java
示例9: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@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;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:17,代碼來源:ViewPagerTab2RecyclerViewFragment.java
示例10: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@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);
setDummyDataWithHeader(listView, inflater.inflate(R.layout.padding, null));
if (parentActivity instanceof ObservableScrollViewCallbacks) {
// Scroll to the specified position after layout
Bundle args = getArguments();
if (args != null && args.containsKey(ARG_INITIAL_POSITION)) {
final int initialPosition = args.getInt(ARG_INITIAL_POSITION, 0);
ScrollUtils.addOnGlobalLayoutListener(listView, new Runnable() {
@Override
public void run() {
// scrollTo() doesn't work, should use setSelection()
listView.setSelection(initialPosition);
}
});
}
listView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
return view;
}
示例11: initViews
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
void initViews() {
final Activity parentActivity = getActivity();
final int spanCount = parentActivity.getResources().getInteger(R.integer.span_count);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), spanCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return parentActivity.getResources().getInteger(R.integer.span_size);
}
});
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.setHasFixedSize(false);
ScaleInAnimator scaleInAnimator = new ScaleInAnimator();
scaleInAnimator.setAddDuration(350);
scaleInAnimator.setRemoveDuration(350);
scaleInAnimator.setMoveDuration(350);
scaleInAnimator.setChangeDuration(350);
recyclerView.setItemAnimator(scaleInAnimator);
if (parentActivity instanceof ObservableScrollViewCallbacks) {
recyclerView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
}
示例12: registerScrollView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
public void registerScrollView(final ObservableScrollView scrollView) {
scrolls.add(scrollView);
if (scrollView.getParent() != null && scrollView.getParent().getParent() != null && scrollView.getParent().getParent() instanceof ViewGroup)
scrollView.setTouchInterceptionViewGroup((ViewGroup) scrollView.getParent().getParent());
scrollView.setScrollViewCallbacks(new ObservableScrollViewCallbacks() {
@Override
public void onScrollChanged(int i, boolean b, boolean b1) {
onScroll(scrollView, i);
}
@Override
public void onDownMotionEvent() {
}
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
}
});
}
示例13: initViews
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
protected void initViews(View view) {
super.initViews(view);
Activity parentActivity = getActivity();
mRecycleView.setTouchInterceptionViewGroup((ViewGroup) parentActivity.findViewById(R.id.container));
if (parentActivity instanceof ObservableScrollViewCallbacks) {
mRecycleView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentActivity);
}
mErrorLayout.setOnLayoutClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCatalog > 0) {
if (AppContext.instance().isLogin()) {
requestData(false);
} else {
UIHelper.showLogin(getActivity());
}
} else {
requestData(false);
}
}
});
}
示例14: onCreateView
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@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);
Fragment parentFragment = getParentFragment();
ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
if (viewGroup != null) {
scrollView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
if (parentFragment instanceof ObservableScrollViewCallbacks) {
scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
}
}
return view;
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:16,代碼來源:ViewPagerTabFragmentScrollViewFragment.java
示例15: onUpOrCancelMotionEvent
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; //導入依賴的package包/類
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
if (getActivity() != null && getActivity() instanceof ObservableScrollViewCallbacks) {
((ObservableScrollViewCallbacks) getActivity()).onUpOrCancelMotionEvent(scrollState);
}
if (scrollState == ScrollState.UP) {
hideFab();
} else if (scrollState == ScrollState.DOWN) {
showFab();
}
}
開發者ID:LeMinhAn,項目名稱:AndroidObservableScrollView-master,代碼行數:13,代碼來源:ViewPagerTabScrollViewWithFabFragment.java