-8

Я хочу знать, как создать этот макет в Android? Размытие фона и listView с обложкой альбома? Какие данные мне нужно получить?Как создать макет, как на этом изображении?

image

Моя текущая раскладка выглядит следующим образом. My app layout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:tools="http://schemas.android.com/tools" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:orientation="vertical" 
       android:background="#FF330000" 
       tools:context=".MainActivity" > 

      <ListView 
        android:id="@+id/song_list" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" > 
      </ListView> 

    </LinearLayout> 

И ниже Java код карты макет песни

public View getView(int position, View convertView, ViewGroup parent) { 
     //map to song layout 
     LinearLayout songLay = (LinearLayout)songInf.inflate 
    (R.layout.song, parent, false); 
    //get title and artist views 
    TextView songView = (TextView)songLay.findViewById(R.id.song_title); 
    TextView artistView = (TextView)songLay.findViewById(R.id.song_artist); 
    //get song using position 
    Song currSong = songs.get(position); 
     //get title and artist strings 
     songView.setText(currSong.getTitle()); 
     artistView.setText(currSong.getArtist()); 
    //set position as tag 
    songLay.setTag(position); 
    return songLay; 
    } 
+1

узнать о различных макетах и ​​чертежах. –

+0

вы хотите listView с изображением? – Tony

+0

Спасибо за ваш ответ. любые ресурсы? @Radix –

ответ

-1

Не уверен, это то, что вы хотите. Вы можете попробовать.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:gravity="start" 
    android:background="@android:color/white" 
    android:padding="12dp"> 

    <ImageView 
     android:id="@+id/image" 
     android:layout_width="80dp" 
     android:layout_height="70dp" 
     android:layout_centerVertical="true" 
     android:layout_gravity="left"/> 

    <RelativeLayout 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_toRightOf="@+id/image" 
     android:layout_centerVertical="true" 
     android:paddingLeft="6dp" 
     android:orientation="vertical" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentEnd="true"> 
     <LinearLayout 
      android:id="@+id/ll1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 
      <TextView 
       android:id="@+id/name" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textSize="18sp" 
       android:text="Depeche Mode" 
       android:singleLine="true" /> 

     </LinearLayout> 

     <LinearLayout 
      android:id="@+id/ll2" 
      android:layout_below="@+id/ll1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 
      <TextView 
       android:id="@+id/type" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textSize="14sp" 
       android:textColor="@android:color/secondary_text_dark_nodisable" 
       android:text="Remixes 81-04" 
       android:maxLines="1" 
       android:ellipsize="end" /> 


     </LinearLayout> 

     <LinearLayout 
      android:id="@+id/ll3" 
      android:layout_below="@+id/ll2" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textSize="14sp" 
       android:textColor="@android:color/secondary_text_dark_nodisable" 
       android:text="12 songs 1:18:53" 
       android:maxLines="1" 
       android:layout_below="@+id/Amount" /> 



     </LinearLayout> 


    </RelativeLayout> 

</RelativeLayout> 
+0

Эй, с тони ваш код работал, но до этого песня играла, но после изменений песни не воспроизводятся. Я добавил код Java к вопросу. Линейная компоновка должна быть изменена соответствующим образом, но как? –

+0

Извините, я не знаю, как решить вашу следующую проблему :( – Tony

Смежные вопросы