This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TopStickyItemDecoration : ItemDecoration() { | |
// for logging purposes only (avoid multiple logs with same values). | |
private var lastChildTop: Int = -1 | |
override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) { | |
if (state.itemCount <= 0) return | |
val lm = requireNotNull(parent.layoutManager) as LinearLayoutManager | |
require(lm.orientation == VERTICAL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AnActivity extends FragmentActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
setContentView(R.layout.act_main); |