1,判断 RecyclerView滑动到底部
loadingMoreListener = new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if(!loading && !recyclerView.canScrollVertically(1)){
loading = true;
loadMoreDate();
}
}
}
2,android studio 3.1版本依赖库中的libs jar 文件正确依赖方法为 api 。而不是
implementation
https://stackoverflow.com/questions/49628149/import-class-from-3rd-party-library-android-studio-3-1-graddle-3-1?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
这是最新版as3.1发现的问题。
3,view加阴影需要设置背景颜色和elevation属性值
4,模拟touch事件
val motionEvent = MotionEvent.obtain(
SystemClock.uptimeMillis(),
SystemClock.uptimeMillis() + 100,
MotionEvent.ACTION_UP,
0f,
0f,
0
)
video_view.dispatchTouchEvent(motionEvent)
5,跳转应用市场评分
lin_shop.setOnClickListener {
val appPackageName = packageName // getPackageName() from Context or Activity object
try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$appPackageName")))
} catch (anfe: android.content.ActivityNotFoundException) {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://www.daywin.tv")))
}
}
6,使用系统的播放视频控件videoview,点击事件需要使用touch方法。onclick是没有效果的
video_view.setOnTouchListener { p0