本文整理匯總了Java中android.support.v7.widget.RecyclerView.setVerticalScrollBarEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.setVerticalScrollBarEnabled方法的具體用法?Java RecyclerView.setVerticalScrollBarEnabled怎麽用?Java RecyclerView.setVerticalScrollBarEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.setVerticalScrollBarEnabled方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initView() {
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.hide();
}
searchbarview = (SearchBarView) findViewById(R.id.searchbarview);
searchbarview.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// enter search activity
Toast.makeText(MainActivity.this, "enter search activity", Toast.LENGTH_SHORT).show();
}
});
AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbarlayout);
appBarLayout.addOnOffsetChangedListener(this);
toolbar = (Toolbar) findViewById(R.id.toolbar);
RecyclerView mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setVerticalScrollBarEnabled(true);
mRecyclerView.setNestedScrollingEnabled(false);
mRecyclerView.setAdapter(new MyAdapter());
}
示例2: initView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void initView(){
//initdata();
poemData = new ArrayList<SongCi>();
poemRecyclerView = (RecyclerView) cxt.findViewById(R.id.recycler_view);
poemAdapter = new PoemAdapter(cxt, poemData,poemRecyclerView);
poemRecyclerView.setAdapter(poemAdapter);//設置適配器
poemRecyclerView.setVerticalScrollBarEnabled(true);
//設置布局管理器 , 將布局設置成縱向
LinearLayoutManager
linerLayoutManager = new LinearLayoutManager(cxt, LinearLayoutManager.VERTICAL, false);
poemRecyclerView.setLayoutManager(linerLayoutManager);
//設置分隔線
poemRecyclerView.addItemDecoration(new DividerItemDecoration(cxt , DividerItemDecoration.VERTICAL));
//設置增加或刪除條目動畫
poemRecyclerView.setItemAnimator(new DefaultItemAnimator());
}
示例3: initView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initView(Context context) {
mContext = context;
View view = LayoutInflater.from(context).inflate(com.wuxiaolong.pullloadmorerecyclerview.R.layout.pull_loadmore_layout, null);
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(com.wuxiaolong.pullloadmorerecyclerview.R.id.swipeRefreshLayout);
mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_green_dark, android.R.color.holo_blue_dark, android.R.color.holo_orange_dark);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayoutOnRefresh(this));
mRecyclerView = (RecyclerView) view.findViewById(com.wuxiaolong.pullloadmorerecyclerview.R.id.recycler_view);
mRecyclerView.setVerticalScrollBarEnabled(true);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.addOnScrollListener(new RecyclerViewOnScroll(this));
mRecyclerView.setOnTouchListener(new onTouchRecyclerView());
mFooterView = view.findViewById(R.id.footerView);
loadMoreLayout = (LinearLayout) view.findViewById(R.id.loadMoreLayout);
loadMoreText = (TextView) view.findViewById(R.id.loadMoreText);
mFooterView.setVisibility(View.GONE);
this.addView(view);
}
示例4: initView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initView(Context context) {
mContext = context;
View view = LayoutInflater.from(context).inflate(com.wuxiaolong.pullloadmorerecyclerview.R.layout.pull_loadmore_layout, null);
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(com.wuxiaolong.pullloadmorerecyclerview.R.id.swipeRefreshLayout);
mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_green_dark, android.R.color.holo_blue_dark, android.R.color.holo_orange_dark);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayoutOnRefresh(this));
mRecyclerView = (RecyclerView) view.findViewById(com.wuxiaolong.pullloadmorerecyclerview.R.id.recycler_view);
mRecyclerView.setVerticalScrollBarEnabled(true);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.setOnTouchListener(new onTouchRecyclerView());
mFooterView = view.findViewById(R.id.footerView);
loadMoreLayout = (LinearLayout) view.findViewById(R.id.loadMoreLayout);
loadMoreText = (TextView) view.findViewById(R.id.loadMoreText);
mprogressBar = (ProgressBar)view.findViewById(R.id.loadMoreProgressBar) ;
mFooterView.setVisibility(View.GONE);
this.addView(view);
}
示例5: initView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void initView(Context context) {
mContext = context;
View view = LayoutInflater.from(context).inflate(R.layout.pull_loadmore_layout, null);
mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefreshLayout);
mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_green_dark, android.R.color.holo_blue_dark, android.R.color.holo_orange_dark);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayoutOnRefresh(this));
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
mRecyclerView.setVerticalScrollBarEnabled(true);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.addOnScrollListener(new RecyclerViewOnScroll(this));
mRecyclerView.setOnTouchListener(new onTouchRecyclerView());
mFooterView = view.findViewById(R.id.footerView);
loadMoreLayout = (LinearLayout) view.findViewById(R.id.loadMoreLayout);
loadMoreText = (TextView) view.findViewById(R.id.loadMoreText);
mFooterView.setVisibility(View.GONE);
this.addView(view);
}
示例6: onCreate
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
log.d("DetailActivity onCreate");
setContentView(R.layout.activity_detail);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
rvDetail=(RecyclerView)findViewById(R.id.rv_detail);
setSupportActionBar(toolbar);
Intent it=getIntent();
if(it==null || it.getParcelableExtra("tangshi")==null){
this.finish();
}
SongCi ts=it.getParcelableExtra("tangshi");
log.d("DetailActivity "+new Gson().toJson(ts,SongCi.class));
this.setTitle(ts.getAuthor());
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null)
.show();
}
});
dbManager = DBCiManager.getInstance(PoemApp.getContext());
tsDao=dbManager.getSongCiDao();
tsList=tsDao.queryBuilder().where(SongCiDao.Properties.Author.eq(ts.getAuthor())).list();
for (SongCi t : tsList){
log.d("DetailActivity where "+new Gson().toJson(t,SongCi.class));
}
poemDetailAdapter = new PoemDetailAdapter(this, tsList,rvDetail);
rvDetail.setAdapter(poemDetailAdapter);//設置適配器
rvDetail.setVerticalScrollBarEnabled(true);
//設置布局管理器 , 將布局設置成縱向
LinearLayoutManager
linerLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
rvDetail.setLayoutManager(linerLayoutManager);
//設置分隔線
rvDetail.addItemDecoration(new DividerItemDecoration(this , DividerItemDecoration.VERTICAL));
//設置增加或刪除條目動畫
rvDetail.setItemAnimator(new DefaultItemAnimator());
}
示例7: setAdapter
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@BindingAdapter("app:setAdapter")
public static void setAdapter(RecyclerView recyclerView, FileAdapter adapter) {
recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
recyclerView.setVerticalScrollBarEnabled(true);
recyclerView.setAdapter(adapter);
}