2016-06-26 2 views
0

FloatingActionButtonは、音楽がアプリで再生されない時間までうまく動作します。これはlibraryを使用しています。FloatingActionButtonが音楽の再生を開始したときに表示されない - SlideupPanelLayout

問題は、私は工場のボタンをクリックすることで、音楽を再生すると、それは罰金

を働いていた前にアンドロイド6.0に来ている、とFABボタンが見えなくなっスライドパネルを移動を開始します。

Issues-:

の1- Slideupアニメーションがslideupレイアウトのドラッグ、うまく機能していないが動作を停止します。

2- Fabボタンが見えなくなります。

ここで重要なことは、音楽が再生されていないときまで、すべてがうまくいくことです。

音楽を再生するために、私はバックグラウンドサービスを使用しています。

メモリの問題など何か問題がありますか?ライブラリの問題リストhere

<com.sothree.slidinguppanel.FloatingActionButtonLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:sothree="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    sothree:umanoFabMode="circular_reveal"> 
    <com.sothree.slidinguppanel.SlidingUpPanelLayout 
     xmlns:sothree="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/sliding_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="bottom" 
     sothree:umanoAnchorPoint="@+id/handle" 
     sothree:umanoPanelHeight="58dp" 
     sothree:umanoShadowHeight="4dp" 
     sothree:umanoParallaxOffset="100dp" 
     sothree:umanoDragView="@+id/trackdetails" 
     sothree:umanoOverlay="true" 
     sothree:umanoScrollableView="@+id/now_playlist"> 
     <android.support.v4.widget.DrawerLayout 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:id="@+id/drawer" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:fitsSystemWindows="true" 
      tools:context="com.ultimo.musicplayer.activity.MainActivity"> 
     <android.support.design.widget.CoordinatorLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 
      <!--Main Content goes here--> 
      <android.support.v4.view.ViewPager 
       android:id="@+id/viewpager" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 
      <!--Toolbar and tabs--> 
      <android.support.design.widget.AppBarLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 
       <android.support.v7.widget.Toolbar 
        android:id="@+id/toolbar" 
        android:popupTheme="@style/PopupMenu" 
        android:layout_height="wrap_content" 
        android:layout_width="match_parent" 
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
        app:layout_scrollFlags="scroll|enterAlways"/> 
       <android.support.design.widget.TabLayout 
        android:id="@+id/tab_layout" 
        android:layout_height="wrap_content" 
        android:layout_width="match_parent" 
        app:tabGravity="fill" 
        sothree:tabIndicatorHeight="3dp" 
        app:tabMode="scrollable" 
        app:layout_scrollFlags="scroll|enterAlways"/> 
      </android.support.design.widget.AppBarLayout> 

     </android.support.design.widget.CoordinatorLayout> 
      <android.support.design.widget.NavigationView 
       android:id="@+id/navigation_view" 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:layout_gravity="start" 
       app:menu="@menu/drawer"/> 
     </android.support.v4.widget.DrawerLayout> 
     <include layout="@layout/mediaplayer_layout"/> 
    </com.sothree.slidinguppanel.SlidingUpPanelLayout> 
    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab_play" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom|end" 
     android:src="@drawable/play" 
     android:clickable="true"/> 
</com.sothree.slidinguppanel.FloatingActionButtonLayout> 

すでに掲載質問 -

は、以下の活動のレイアウトです。

+0

SlidingUpPanelレイアウトには2つの子ビューしかないので、修正する必要があります。 –

+0

2つのチャイルドのみがあります。 – Vijay

答えて

0

作成したレイアウトに問題があると思います。また、UmanoSlidingPanelLayoutを使用してMusicPlayerを作成しています。

これを試してください。

<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/drawer" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
tools:openDrawer="start" 
tools:context="com.ultimo.musicplayer.activity.MainActivity"> 

<com.sothree.slidinguppanel.FloatingActionButtonLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:sothree="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    sothree:umanoFabMode="circular_reveal"> 

    <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/sliding_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="bottom" 
     sothree:umanoAnchorPoint="@+id/handle" 
     sothree:umanoDragView="@+id/trackdetails" 
     sothree:umanoOverlay="true" 
     sothree:umanoPanelHeight="58dp" 
     sothree:umanoParallaxOffset="100dp" 
     sothree:umanoScrollableView="@+id/now_playlist" 
     sothree:umanoShadowHeight="4dp"> 

     <android.support.design.widget.CoordinatorLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 
      <!--Main Content goes here--> 
      <android.support.v4.view.ViewPager 
       android:id="@+id/viewpager" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 
      <!--Toolbar and tabs--> 
      <android.support.design.widget.AppBarLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <android.support.v7.widget.Toolbar 
        android:id="@+id/toolbar" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:popupTheme="@style/PopupMenu" 
        app:layout_scrollFlags="scroll|enterAlways" 
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> 

       <android.support.design.widget.TabLayout 
        android:id="@+id/tab_layout" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        app:layout_scrollFlags="scroll|enterAlways" 
        app:tabGravity="fill" 
        app:tabMode="scrollable" 
        sothree:tabIndicatorHeight="3dp" /> 
      </android.support.design.widget.AppBarLayout> 

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

     <include layout="@layout/mediaplayer_layout" /> 
    </com.sothree.slidinguppanel.SlidingUpPanelLayout> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab_play" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom|end" 
     android:clickable="true" 
     android:src="@drawable/play" /> 
</com.sothree.slidinguppanel.FloatingActionButtonLayout> 

<android.support.design.widget.NavigationView 
    android:id="@+id/navigation_view" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:layout_gravity="start" 
    app:menu="@menu/drawer" /> 

</android.support.v4.widget.DrawerLayout> 
+0

以前はこの同じレイアウトを使用していましたが、レイアウトのレンダリングでアンドロイド6.0のいくつかの問題のために変更しなければなりませんでした。 – Vijay

関連する問題