Я хотел реализовать масштабирование в моем плеере. Я следовал этому учебнику
Я столкнулся с проблемой сенсорного события. потому что у моей viewGroup есть еще один интерактивный вид внутри этого масштабируемого класса, который не работает для меня. затем в своей деятельности я попытался обработать событие касания, чтобы передать его моему игроку, но это не удалось. Я попробовал это с этим кодом в своей деятельности:
@Override
public boolean onTouchEvent(MotionEvent event) {
if(event.getPointerCount()>1){
playerView.onTouchEvent(event);
return true;
}else
return super.onTouchEvent(event);
}
это также мой xml-файл:
<app.zoomabletv.com.ZoomableViewGroup
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="match_parent"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_buffering="when_playing" />
<ImageView
android:id="@+id/imgChannelLogo"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center|center_vertical"
android:visibility="invisible" />
<LinearLayout
android:id="@+id/layoutRunRadioInBackground"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_gravity="bottom"
android:layout_marginBottom="80dp"
android:gravity="center"
android:visibility="invisible">
<androidx.cardview.widget.CardView
android:id="@+id/btnRunRadioInBackground"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
app:cardBackgroundColor="@color/ui_yellow"
app:cardCornerRadius="25dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/byekan"
android:gravity="center"
android:padding="15dp"
android:textColor="@color/cardview_dark_background"
android:textSize="16sp" />
</androidx.cardview.widget.CardView>
</LinearLayout>
</FrameLayout>
</app.zoomabletv.com.ZoomableViewGroup>
может кто-нибудь помочь мне решить эту проблему? цель состоит в том, чтобы сделать мой вид игрока масштабируемым (например, учебник). Спасибо