Раздувание другого макета с макетом ящика - PullRequest
0 голосов
/ 19 февраля 2019

Приветствую, мои коллеги-программисты,

Я думаю, у меня есть простой, но я все еще не знаю, почему это вызывает такое поведение.

Итак, сцена такая:У меня есть appliction, который воспроизводит музыку через сервис, и мини-проигрыватель внизу, который я добавил так, что я надувал основной макет.

Если я не надуваю макет с помощью мини-плеера, я могу использоватьМетод (элементы меню) внутри ящика обычно (он переводит меня в нужное место назначения и без проблем запускает операции скольжения), как только я начинаю воспроизводить музыку, я вставляю макет, поэтому я показываю плеер и могу сделать это с ящиком:

  1. Я могу открыть его от скольжения и от кнопки гамбургера
  2. Я могу открыть от скольжения и от кнопки гамбургера
  3. Я НЕ МОГУ ЗАКРЫТЬ его правым левым слайдом
  4. МЕТОДЫ НЕ работают внутри ящика

Любые идеи, почему надувание портит это?

PS В основном макете я использую Coordinator Layout в родительском представлении, поэтому я могу использовать плавающие кнопки

***** РЕДАКТИРОВАТЬ: ЗДЕСЬ ЭКРАНЫ ******

    <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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:id="@+id/cili_test"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.example.android.listenyo_41.MainActivity"
    android:background="@color/white">
    <!-- Loading indicator is only shown before the first load -->


<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"
    tools:context="com.example.android.listenyo_41.MainActivity"
    android:id="@+id/cili_test2"
    android:background="@color/black"
    >

    <!-- Loading indicator is only shown before the first load -->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/nesto_glupo"
        android:orientation="vertical"

        >
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="@color/black">

                <ImageButton     
                    />

                <android.support.v7.widget.Toolbar      
                    />

                <com.miguelcatalan.materialsearchview.MaterialSearchView
                    /> 
                    </RelativeLayout>
      <ListView

            />
        <RelativeLayout

            >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="true"
                android:orientation="vertical"
                android:background="@color/black"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:layout_marginBottom="5dp"
                android:id="@+id/test_fade"
                >

                <Button

                    />

                <android.support.v4.widget.SwipeRefreshLayout
                    android:id="@+id/activity_main_swipe_refresh_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <ListView

                        />
                </android.support.v4.widget.SwipeRefreshLayout>


                <!-- Empty view is only visible when the list has no items. -->

            </LinearLayout>
        </RelativeLayout>
    </LinearLayout>
    <TextView

        />
    <ProgressBar

        />

</RelativeLayout>

    <!-- Container for contents of drawer - use NavigationView to make configuration easier -->
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="@menu/drawer_view"
app:headerLayout="@layout/nav_header"

    app:itemIconTint="@color/white"
    android:background="@color/black"
    app:itemTextColor="@color/white"
    />
    </android.support.v4.widget.DrawerLayout>















            <ProgressBar
                android:id="@+id/picasso_progress"
                style="@android:style/Widget.Holo.Light.ProgressBar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:layout_gravity="center"
                android:visibility="gone" />

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:background="#75d9534f"
                android:id="@+id/crvena_traka"

                >


                <RelativeLayout
                    android:id="@+id/songName_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:visibility="gone">

                    <SeekBar
                        android:id="@+id/seekBar"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="10dp"
                        android:layout_marginRight="135dp"
                        android:layout_marginTop="5dp"
                        android:paddingEnd="6dp"
                        android:paddingLeft="6dp"
                        android:paddingRight="6dp"
                        android:paddingStart="6dp"
                        android:progressDrawable="@drawable/progress_drawable"
                        android:thumbTint="@color/black"
                        android:visibility="gone"

                        />


                    <TextView
                        android:id="@+id/songDuration"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_below="@id/seekBar"
                        android:layout_gravity="center"
                        android:layout_marginBottom="5dp"
                        android:layout_marginLeft="15dp"
                        android:layout_marginRight="140dp"
                        android:layout_marginTop="2dp"
                        android:text="00:00:00"
                        android:textColor="@color/white"
                        android:textStyle="bold"
                        android:visibility="gone"
                        />

                    <com.example.android.listenyo_41.ScrollTextView
                        android:id="@+id/songName"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_alignParentLeft="true"
                        android:layout_below="@id/seekBar"
                        android:layout_marginBottom="5dp"
                        android:layout_marginLeft="15dp"
                        android:layout_marginTop="2dp"
                        android:layout_toLeftOf="@id/songDuration"

                        android:textColor="@color/white"
                        android:textSize="14sp"
                        android:textStyle="bold"
                        android:visibility="gone"

                        />



                </RelativeLayout>


            </RelativeLayout>


        </RelativeLayout>

        <TextView
            android:id="@+id/btn_lay_textView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="7dp"
            android:text="Buffering"
            android:textAlignment="center"
            android:textColor="@color/gray"
            android:textSize="16sp"
            android:textStyle="bold"
            android:visibility="gone"

            android:layout_marginRight="5dp"
            android:layout_marginLeft="5dp"
            />
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_below="@id/player_controler"

            android:layout_weight="2">

            <ProgressBar
                android:id="@+id/loading_indicator2"
                style="?android:attr/progressBarStyleLarge"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="100dp"
                android:indeterminateDrawable="@drawable/my_border4"
                android:visibility="gone" />




            <RelativeLayout
                android:id="@+id/player_controler2"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_marginTop="5dp"
                android:background="@color/black"
                android:visibility="visible">


                <LinearLayout

                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_margin="5dp"
                    android:layout_marginTop="20dp"
                    android:orientation="vertical"

                    >


                    <android.support.v4.widget.SwipeRefreshLayout
                        android:id="@+id/activity_main_swipe_refresh_layout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@color/black">

                        <ListView
                            android:id="@+id/list"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:background="@color/black"
                            android:choiceMode="singleChoice"
                            android:divider="@null"
                            android:dividerHeight="5dp"
                            android:orientation="horizontal"


                            />
                    </android.support.v4.widget.SwipeRefreshLayout>


                </LinearLayout>


            </RelativeLayout>
        </RelativeLayout>


    </LinearLayout>


    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/activity_main_swipe_refresh_layout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:visibility="gone">

        <TextView
            android:id="@+id/empty_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginLeft="50dp"
            android:layout_marginRight="50dp"
            android:gravity="center"
            android:textAppearance="?android:textAppearanceMedium"

            />

    </android.support.v4.widget.SwipeRefreshLayout>

    </FrameLayout>

        <!-- Container for contents of drawer - use NavigationView to make configuration easier -->
        <android.support.design.widget.NavigationView
            android:id="@+id/nav_view"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:fitsSystemWindows="true"
            app:menu="@menu/drawer_view"
            app:headerLayout="@layout/nav_header"
            app:itemIconTint="@color/white"
            android:background="@color/black"
            app:itemTextColor="@color/white"
            />
    </android.support.v4.widget.DrawerLayout>


</android.support.design.widget.CoordinatorLayout>

И мини-плеер

 <?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"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true"
    android:id="@+id/play_test"
    android:visibility="visible"
    >





    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:layout_alignParentBottom="true"
        android:background="@color/myColor"
        android:elevation="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginBottom="5dp"
        android:id="@+id/play_lay"
        >


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:orientation="horizontal"
        android:background="@drawable/bl_tran_grad"
        >



        <RelativeLayout

            android:id="@+id/icon_layout"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_margin="5dp"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="10dp"
            android:layout_weight="1"
            android:onClick="player"
            >

            <ProgressBar
                style="@android:style/Widget.Holo.Light.ProgressBar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_centerInParent="true"
                android:visibility="gone"

                android:id="@+id/picasso_progress2"
                />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layout_gravity="center"
                android:id="@+id/error2"
                android:text="Error loading picture"
                android:textColor="@color/black"
                android:textSize="13sp"

                android:textStyle="bold"
                android:textAlignment="center"
                android:layout_centerInParent="true"

                />

        <ImageView
            android:id="@+id/player_img"
            android:layout_width="70dp"
            android:layout_height="70dp"
            android:layout_centerInParent="true"
            android:scaleType="centerCrop"
            >
        </ImageView>



        </RelativeLayout>

        <RelativeLayout

            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="2"
            android:layout_margin="5dp"
            android:onClick="player"
            >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxLines="2"
            android:id="@+id/songName2"
            android:textSize="14sp"
            android:layout_centerVertical="true"
            android:textColor="@color/white"

            android:textStyle="bold"
            />
        </RelativeLayout>


        <RelativeLayout

            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:onClick="player_2_pause"
            >

        <ImageView
            android:layout_width="50dp"
            android:layout_height="35dp"
            android:layout_centerInParent="true"
            android:src="@drawable/ic_launcher"
            android:onClick="player_2_resume"
            android:visibility="invisible"
            android:id="@+id/player_2_resume"

            />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Buffering"
                android:textColor="@color/white"
                android:layout_centerInParent="true"
                android:textSize="14sp"
                android:visibility="visible"
                android:id="@+id/buffering"
                />


        <ImageView
            android:layout_width="50dp"
            android:layout_height="35dp"
            android:src="@drawable/pause2"
            android:onClick="player_2_pause"
            android:visibility="invisible"
            android:id="@+id/player_2_pause"
            android:layout_centerInParent="true"
            />
        </RelativeLayout>

    </LinearLayout>
    </RelativeLayout>

    <SeekBar
        android:padding="0dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:id="@+id/seekBar_player2"
        android:layout_width="match_parent"
        android:layout_height="4.0dp"
        android:layout_above="@id/play_lay"
        android:background="#80000000"
        android:maxHeight="5dp"
        android:minHeight="4dp"
        android:progressDrawable="@drawable/progress_drawable"
        android:max="10"
        android:thumb="@color/white"
        android:paddingStart="0dp"
        android:paddingEnd="0dp"
        android:paddingLeft="0dp"
        android:paddingRight="0dp" />

</RelativeLayout>






When player active[1]
without player drawer[2]
both[3]




[1]: https://i.stack.imgur.com/gD0BY.jpg
  [2]: https://i.stack.imgur.com/0zcYP.jpg
  [3]: https://i.stack.imgur.com/qFY6q.jpg
...