RecyclerView - Orange168/NotesOnReading GitHub Wiki
Important Method
// allows for optimizations if all items are of the same size:
recyclerView.setHasFixedSize(true);
View view = recyclerView.findChildViewUnder(e.getX(), e.getY()); //e is MotionEvent
// you can set the first visible item like this:
layoutManager.scrollToPosition(6);
recyclerView.addItemDecoration(itemDecoration); //set divider
recyclerView.setItemAnimator(new DefaultItemAnimator());
int pos = recyclerView.getChildAdapterPosition(childView) ;
Boilerplate
- implement ActionMode.Callback
- Activity.startActionMode(this); //mWindow.getDecorView().startActionMode(callback);
- onCreateActionMode
actionMode.getMenuInflater().inflate(R.menu., menu); return ture
- actionMode.finish(); actionMode.setTitle(title);
<string name="selected_count">%1$s selected</string>
getString(R.string.selected_count, 100);
-%1$s
is xliff:g标签
%n$ms:代表输出的是字符串,n代表是第几个参数,m表示输出之前放置空格数 %s = %1$0s=%1$s,%1$1s ==>
100 selected
, %1$6s ==>(6space)100 selected