В моем проекте Android я разработал один . xml макет , где я использовал один Webview . И внутри этого webView я добавил некоторые другие android компоненты, такие как - Linearlayout, Buttons, SeekBar, TextView .
Вот код для моего. xml макет-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/relativeWebview"
tools:context=".new_package.reader_version_2.reader_v2.ReaderV2Activity">
<WebView
android:id="@+id/activity_checkout_webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="0dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"
>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="168dp"
android:layout_y="223dp"
android:visibility="gone"
/>
</WebView>
<WebView
android:id="@+id/web_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:paddingBottom="60dp"
/>
<LinearLayout
android:id="@+id/linearSeekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:background="#ffffff"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginTop="5dp"
android:max="100"
android:progressTint="#cdcdcd"
android:thumbTint="#000000"
/>
<TextView
android:id="@+id/tvProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginBottom="2dp"
android:text="Brightness"
android:textAlignment="center"
android:textStyle="bold"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/btnBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="background"
/>
<Button
android:id="@+id/btnFontSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="font"
/>
<Button
android:id="@+id/btnSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="save"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
Вот результат этого макета -
![enter image description here](https://i.stack.imgur.com/8IBUG.png)
***** * Итак, теперь проблема в *******
Я хочу, чтобы LinearLayout (внизу экрана) скрывался одним нажатием на экране, и его также не будет видно, пока я прокручиваю экран. Он появится снова, когда я снова сделаю одно касание на экране.
Короче говоря, мне нужно решение для этого, чтобы я мог скрыть и показать этот макет внутри веб-просмотра одним нажатием.
Я пробовал следующие решения, но ни одно из них не сработало для меня - Как скрыть и показать кнопки при альтернативных событиях касания