editText получает фокус при открытии дополнительного списка опций, и я также хочу знать, как очистить фокус, когда KeyBoard выключается, как в приложении Google Keep - PullRequest
0 голосов
/ 10 мая 2018

это моя стрелка Просмотр в сжатом состоянии. это моя обычная панорама

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <ScrollView
        android:fillViewport="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
            <EditText
                android:maxLength="50"
                android:maxLines="2"
                android:focusableInTouchMode="true"
                android:padding="10dp"
                android:textSize="20sp"
                android:textStyle="bold"
                android:hint="Title"
                android:gravity="left|top"
                android:background="@android:color/transparent"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
            <EditText
                android:padding="10dp"
                android:textSize="18sp"
                android:textColor="#000"
                android:gravity="top|left"
                android:hint="Enter Text Here"
                android:background="@android:color/transparent"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"/>
        </LinearLayout>
    </ScrollView>
    <android.support.v7.widget.CardView
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        app:cardElevation="5dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <LinearLayout
                android:id="@+id/symbolId"
                android:visibility="gone"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <ImageView
                    android:scaleX=".75"
                    android:scaleY=".75"
                    android:layout_gravity="center"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="match_parent"
                    android:src="@drawable/ic_grade_black_24dp"/>
                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:text="Symbol"
                    android:layout_weight="1"
                    android:textColor="@color/gray"
                    android:padding="10dp"
                    android:textSize="16sp"
                    android:gravity="center"/>
            </LinearLayout>
            <LinearLayout
                android:id="@+id/extraOptions"
                android:visibility="gone"
                android:layout_margin="5dp"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                    <ImageView
                        android:scaleX="1.25"
                        android:scaleY="1.25"
                        android:padding="10dp"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:src="@drawable/ic_camera_black_24dp"/>
                    <ImageView
                        android:scaleX="1.25"
                        android:scaleY="1.25"
                        android:padding="10dp"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:src="@drawable/ic_settings_voice_black_24dp"/>
                    <ImageView
                        android:scaleX="1.25"
                        android:scaleY="1.25"
                        android:padding="10dp"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:src="@drawable/ic_format_list_bulleted_black_24dp"/>
           </LinearLayout>
           <LinearLayout
               android:orientation="horizontal"
               android:layout_width="match_parent"
               android:layout_height="wrap_content">
               <TextView
                   android:textSize="16sp"
                   android:textColor="@color/gray"
                   android:gravity="center"
                   android:text="last edited "
                   android:layout_width="0dp"
                   android:layout_height="match_parent"
                   android:layout_weight="2"/>
               <TextView
                   android:id="@+id/expandableArrowId"
                   android:background="@drawable/ic_arrow_drop_down_black_24dp"
                   android:layout_width="0dp"
                   android:paddingTop="10dp"
                   android:paddingBottom="10dp"
                   android:paddingStart="25dp"
                   android:paddingEnd="25dp"
                   android:scaleX=".6"
                   android:scaleY=".7"
                   android:layout_height="wrap_content"
                   android:layout_weight=".5"/>
        </LinearLayout>
    </LinearLayout>
</android.support.v7.widget.CardView>

Когда я нажимаю на стрелку textView,тогда мой editText получает фокус, но я хочу расширить список дополнительных опций, чтобы не фокусировать editText, и он сам по себе не теряет фокус, даже когда я нажимаю на любой текстовый вид в дополнительном списке опций.Я хочу, чтобы editText был таким же, как Google Keep editText, и, во-вторых, я хочу спросить, как я могу убедиться, что моя стрелка textView будет четко нажимаемой.Я проверил много статей в stackOverFlow, чтобы editText терял фокус, когда клавиатура не работает, но ничего не получалось.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...