本文整理匯總了Java中android.support.v7.widget.RecyclerView.setOverScrollMode方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.setOverScrollMode方法的具體用法?Java RecyclerView.setOverScrollMode怎麽用?Java RecyclerView.setOverScrollMode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.setOverScrollMode方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRecyclerViewDialog
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static AlertDialog.Builder getRecyclerViewDialog(Context context, BaseRecyclerAdapter.OnItemClickListener listener) {
RecyclerView recyclerView = new RecyclerView(context);
RecyclerView.LayoutParams params =
new GridLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
recyclerView.setPadding(Util.dipTopx(context, 16), Util.dipTopx(context, 16),
Util.dipTopx(context, 16), Util.dipTopx(context, 16));
recyclerView.setLayoutParams(params);
recyclerView.setLayoutManager(new GridLayoutManager(context, 3));
CommentItemAdapter adapter = new CommentItemAdapter(context);
adapter.setOnItemClickListener(listener);
recyclerView.setAdapter(adapter);
recyclerView.setOverScrollMode(OVER_SCROLL_NEVER);
return getDialog(context)
.setView(recyclerView)
.setPositiveButton(null, null);
}
示例2: ensureGlow
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static void ensureGlow(RecyclerView recyclerView, int color) {
if (!UIIViewImpl.isLollipop()) {
if (recyclerView != null) {
recyclerView.setOverScrollMode(OVER_SCROLL_NEVER);
}
return;
}
try {
Reflect.invokeMethod(RecyclerView.class, recyclerView, "ensureTopGlow");
Reflect.invokeMethod(RecyclerView.class, recyclerView, "ensureBottomGlow");
Reflect.invokeMethod(RecyclerView.class, recyclerView, "ensureRightGlow");
Reflect.invokeMethod(RecyclerView.class, recyclerView, "ensureLeftGlow");
setEdgeEffect(recyclerView, color);
} catch (Exception e) {
L.e(e.getMessage());
}
}
示例3: initRecyclerView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initRecyclerView(View view) {
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.content_list);
recyclerView.setOnTouchListener(new VerticalVPOnTouchListener((DummyViewPager) getArguments().getSerializable("viewpager")));//set the vertical scroll controller
recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
recyclerView.setAdapter(new ContentAdapter(getPosition()));
}
示例4: initView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initView() {
mPullRereshLayout = new PullToRefreshLayout(mContext);
addView(mPullRereshLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
mRecyclerView = new RecyclerView(mContext);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setOverScrollMode(SCROLL_AXIS_NONE);
mPullRereshLayout.addView(mRecyclerView,
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
init();
}
示例5: HeaderViewHolder
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
HeaderViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
RecyclerView recyclerView = itemView.findViewById(R.id.recyclerview);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, true));
recyclerView.setHasFixedSize(true);
String[] urls = mContext.getResources().getStringArray(R.array.about_social_links);
if (urls.length == 0) {
recyclerView.setVisibility(View.GONE);
subtitle.setPadding(
subtitle.getPaddingLeft(),
subtitle.getPaddingTop(),
subtitle.getPaddingRight(),
subtitle.getPaddingBottom() + mContext.getResources().getDimensionPixelSize(R.dimen.content_margin));
} else {
if (recyclerView.getLayoutParams() instanceof LinearLayout.LayoutParams) {
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) recyclerView.getLayoutParams();
if (urls.length < 7) {
params.width = LinearLayout.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.CENTER_HORIZONTAL;
recyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
}
}
recyclerView.setAdapter(new AboutSocialAdapter(mContext, urls));
}
subtitle.setHtml(mContext.getResources().getString(R.string.about_desc));
CardView card = itemView.findViewById(R.id.card);
if (!Preferences.get(mContext).isShadowEnabled()) {
if (card != null) card.setCardElevation(0);
profile.setShadowRadius(0f);
profile.setShadowColor(Color.TRANSPARENT);
}
}
示例6: initListView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initListView() {
// RecyclerView
messageListView = (RecyclerView) rootView.findViewById(R.id.messageListView);
messageListView.setLayoutManager(new LinearLayoutManager(container.activity));
messageListView.requestDisallowInterceptTouchEvent(true);
messageListView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState != RecyclerView.SCROLL_STATE_IDLE) {
container.proxy.shouldCollapseInputPanel();
}
}
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
messageListView.setOverScrollMode(View.OVER_SCROLL_NEVER);
}
// adapter
items = new LinkedList<>();
adapter = new ChatRoomMsgAdapter(messageListView, items, container);
adapter.closeLoadAnimation();
adapter.setFetchMoreView(new MsgListFetchLoadMoreView());
adapter.setLoadMoreView(new MsgListFetchLoadMoreView());
adapter.setEventListener(new MsgItemEventListener());
adapter.setOnFetchMoreListener(new MessageLoader()); // load from start
messageListView.setAdapter(adapter);
}
示例7: initListView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initListView(IMMessage anchor) {
listviewBk = (ImageView) rootView.findViewById(R.id.message_activity_background);
// RecyclerView
messageListView = (RecyclerView) rootView.findViewById(R.id.messageListView);
messageListView.setLayoutManager(new LinearLayoutManager(container.activity));
messageListView.requestDisallowInterceptTouchEvent(true);
messageListView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState != RecyclerView.SCROLL_STATE_IDLE) {
container.proxy.shouldCollapseInputPanel();
}
}
});
messageListView.setOverScrollMode(View.OVER_SCROLL_NEVER);
// adapter
items = new ArrayList<>();
adapter = new MsgAdapter(messageListView, items, container);
adapter.setFetchMoreView(new MsgListFetchLoadMoreView());
adapter.setLoadMoreView(new MsgListFetchLoadMoreView());
adapter.setEventListener(new MsgItemEventListener());
initFetchLoadListener(anchor);
messageListView.setAdapter(adapter);
messageListView.addOnItemTouchListener(listener);
}
示例8: setupRecyclerView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void setupRecyclerView(@IdRes int id, RealmRecyclerViewAdapter adapter) {
RecyclerView view = (RecyclerView) findViewById(id);
view.setLayoutManager(new LinearLayoutManager(this));
view.setAdapter(adapter);
view.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS);
}