有没有办法阻止用户截取屏幕截图或捕获视频文件的屏幕?与 Netflix 的实现方式类似。每当我们尝试单击屏幕时,它都会返回黑屏。我只需要一些正确方向的起点。谢谢!编辑:它与 DRM 更相关。Netflix 已经在实施它,所以肯定有一些解决办法。
所以,我正在开发一个小项目,我想添加StaggeredGridLayoutManager到文件中。如果我不在布局中添加itemDecoratorand no marginor ,它就会起作用。padding一旦我添加边距,它就会将列表推到一侧。我附上屏幕截图来澄清问题。
这是我的代码:
recyclerView.setHasFixedSize(true);
StaggeredGridLayoutManager gridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
recyclerView.addItemDecoration(new EqualSpaceItemDecoration(8));
recyclerView.setLayoutManager(gridLayoutManager);
recyclerView.setAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)
以及该项目的布局文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/wallpaper_item_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/cardview_light_background"
app:cardCornerRadius="4dp"
app:cardElevation="4dp"
app:cardPreventCornerOverlap="false">
<ImageView
android:id="@+id/wallpaper_item_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</android.support.v7.widget.CardView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我已经环顾了一段时间,但无法找到解决问题的方法。任何帮助表示赞赏。谢谢。
java android android-layout staggered-gridview android-recyclerview