2012-11-14 4 views
0

음악 앱에서 작업 중이며 xyz 음악이 재생되는 주 화면 (알림 팝업과 같은 알림 표시 줄)에 알림을 표시하려고합니다.화면에 맞춤 알림 표시 줄을 재생하는 음악을 구현하는 방법

재생 목록 끝에 알림 표시 줄을 어떻게 표시 할 수 있습니까? 음악이 재생 중이고 사용자가 해당 막대를 클릭하면 음악 재생 화면으로 리디렉션됩니다.

어떤 음악도 자동으로 숨기고 얻을 줄을 재생하지 숨어있는 동안 그 줄을 애니메이션을 적용 할 방법은 내가 enter image description here

답변

2

에서 아래 찾아보세요 예를 들어 바닥

에서 목록보기를 통해 표시 할 수 있습니다 힘을 써, 루크. RelativeLayout의 힘 :

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

    <ListView 
      android:id="@+id/playlist" 
      android:layout_above="@+id/notification" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"/> 

    <RelativeLayout 
      android:id="@+id/notification" 
      android:layout_alignParentBottom="true" 
      android:layout_height="wrap_content" 
      android:layout_width="match_parent"> 

      <ImageView 
        android:id="@+id/imgview_album_art" 
        android:src="image" 
        android:layout_centerVertical="true" 
        android:layout_alignParentLeft="true" 
        android:layout_width="48dp" 
        android:layout_height="48dp"/> 

      <LinearLayout 
        android:orientation="vertical" 
        android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:layout_centerVertical="true" 
        android:layout_toLeftOf="@+id/btn_play_pause" 
        android:layout_toRightOf="@+id/imgview_album_art"> 

       <TextView 
         android:text="Paradise" 
         android:id="@+id/textview_song_name" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content"/> 

       <TextView 
         android:text="Coldplay - Mylo Xyloto" 
         android:id="@+id/textview_artist_album" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content"/> 

      </LinearLayout> 

      <ImageButton 
        android:id="@+id/btn_play_pause" 
        android:padding="8dp" 
        android:background="@android:color/transparent" 
        android:src="@android:drawable/ic_media_pause" 
        android:layout_centerVertical="true" 
        android:layout_alignParentRight="true" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"/> 


    </RelativeLayout> 

</RelativeLayout> 
관련 문제