當前位置: 首頁>>代碼示例>>Java>>正文


Java RecyclerView.setOverScrollMode方法代碼示例

本文整理匯總了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);
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:17,代碼來源:DialogHelper.java

示例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());
    }
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:20,代碼來源:RRecyclerView.java

示例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()));
}
 
開發者ID:chadguo,項目名稱:VerticalViewPager,代碼行數:8,代碼來源:ContentFragment.java

示例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();
}
 
開發者ID:GaoGersy,項目名稱:MultiSelecter,代碼行數:15,代碼來源:SmartRecycleView.java

示例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);
    }
}
 
開發者ID:danimahardhika,項目名稱:wallpaperboard,代碼行數:40,代碼來源:AboutAdapter.java

示例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);
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:29,代碼來源:ChatRoomMsgListPanel.java

示例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);
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:29,代碼來源:MessageListPanelEx.java

示例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);
}
 
開發者ID:SeriousBug,項目名稱:Kutuk,代碼行數:7,代碼來源:ObjectDetailActivity.java


注:本文中的android.support.v7.widget.RecyclerView.setOverScrollMode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。