OSDN Git Service

Eleven: redlines for ArtistDetail
authorWilhelm Fitzpatrick <rafial@cyngn.com>
Tue, 21 Oct 2014 00:52:10 +0000 (17:52 -0700)
committerlinus_lee <llee@cyngn.com>
Thu, 20 Nov 2014 20:51:34 +0000 (12:51 -0800)
https://cyanogen.atlassian.net/browse/MUSIC-57

Change-Id: I48484c5c01eaa7ff7da3037bf16437a91b9a45b7

res/layout/activity_album_detail.xml
res/layout/artist_detail_album.xml
res/layout/artist_detail_header.xml
src/com/cyngn/eleven/adapters/ArtistDetailAlbumAdapter.java

index 9c87539..ed77578 100644 (file)
@@ -17,7 +17,8 @@
             android:layout_height="108dp"
             android:layout_marginRight="@dimen/standard_padding"
             android:layout_alignParentTop="true"
-            android:layout_alignParentLeft="true" />
+            android:layout_alignParentLeft="true"
+            android:scaleType="centerCrop" />
 
         <RelativeLayout
             android:id="@+id/header_info"
index 5ee0cb4..978ee6f 100644 (file)
@@ -1,47 +1,49 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="120dp"
-    android:layout_height="161dp"
-    android:layout_marginRight="4dp"
+    android:layout_width="104dp"
+    android:layout_height="148dp"
+    android:layout_marginRight="8dp"
     android:background="@drawable/cardcontainer" >
 
     <ImageView
         android:id="@+id/album_art"
-        android:layout_width="120dp"
-        android:layout_height="120dp"
+        android:layout_width="104dp"
+        android:layout_height="104dp"
         android:layout_alignParentTop="true"
-        android:layout_alignParentLeft="true" />
+        android:layout_alignParentLeft="true"
+        android:scaleType="centerCrop" />
 
-    <!-- FIXME: hide this until we know what goes in the popup menu -->
     <com.cyngn.eleven.widgets.PopupMenuButton
         android:id="@+id/overflow"
         android:layout_width="@dimen/overflow_width"
-        android:layout_height="40dp"
-        android:layout_alignParentBottom="true"
+        android:layout_height="match_parent"
+        android:layout_below="@id/album_art"
         android:layout_alignParentRight="true"
         android:layout_marginBottom="1dp"
-        android:layout_marginRight="-2dp"
-        android:gravity="center"
+        android:gravity="center_vertical"
         android:src="@drawable/menu_button" />
 
-    <TextView
-        android:id="@+id/title"
-        style="@style/ListItemMainText.Single"
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:gravity="center_vertical"
         android:layout_below="@id/album_art"
         android:layout_toLeftOf="@id/overflow"
         android:layout_alignParentLeft="true"
-        android:layout_marginLeft="8dp"
-        android:layout_marginTop="3dp" />
+        android:layout_marginLeft="8dp" >
 
-    <TextView
-        android:id="@+id/year"
-        style="@style/ListItemSecondaryText.Single"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/title"
-        android:layout_alignParentLeft="true"
-        android:layout_toLeftOf="@id/overflow"
-        android:layout_marginLeft="8dp"
-        android:layout_marginTop="-4dp" />
+        <TextView
+            android:id="@+id/title"
+            style="@style/ListItemMainText.Single"
+            android:textSize="@dimen/text_size_micro"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content" />
+
+        <TextView
+            android:id="@+id/year"
+            style="@style/ListItemSecondaryText.Single"
+            android:textSize="@dimen/text_size_extra_micro"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content" />
+    </LinearLayout>
 </RelativeLayout>
\ No newline at end of file
index dbe7458..fbbd330 100644 (file)
@@ -6,14 +6,14 @@
     <ImageView
         android:id="@+id/hero"
         android:layout_width="match_parent"
-        android:layout_height="220dp"
+        android:layout_height="222dp"
         android:gravity="center" />
 
     <TextView
         android:id="@+id/albums_label"
         android:layout_width="wrap_content"
         android:layout_height="40dp"
-        android:layout_marginLeft="10dp"
+        android:layout_marginLeft="@dimen/list_item_general_margin"
         android:layout_below="@id/hero"
         android:gravity="center_vertical"
         android:fontFamily="sans-serif-light"
         android:id="@+id/albums"
         android:scrollbars="none"
         android:layout_width="match_parent"
-        android:layout_height="161dp"
+        android:layout_height="148dp"
         android:layout_below="@id/albums_label" />
 
     <TextView
         android:id="@+id/songs_label"
         android:layout_width="wrap_content"
         android:layout_height="30dp"
-        android:layout_marginLeft="10dp"
+        android:layout_marginLeft="@dimen/list_item_general_margin"
         android:layout_below="@id/albums"
         android:gravity="bottom"
         android:fontFamily="sans-serif-light"
index 9f5e636..f4fb4f3 100644 (file)
@@ -37,11 +37,14 @@ implements LoaderCallbacks<List<Album>>, IPopupMenuCallback {
     private final LayoutInflater mInflater;
     private List<Album> mAlbums = Collections.emptyList();
     private IListener mListener;
+    private int mListMargin;
 
     public ArtistDetailAlbumAdapter(final Activity activity) {
         mActivity = activity;
         mImageFetcher = ApolloUtils.getImageFetcher(activity);
         mInflater = LayoutInflater.from(activity);
+        mListMargin = activity.getResources().
+            getDimensionPixelSize(R.dimen.list_item_general_margin);
     }
 
     @Override
@@ -58,8 +61,8 @@ implements LoaderCallbacks<List<Album>>, IPopupMenuCallback {
         View v = mInflater.inflate(R.layout.artist_detail_album, parent, false);
         // add extra margin to the first and last elements
         ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams)v.getLayoutParams();
-        if     (viewType == TYPE_FIRST) { params.leftMargin = 30; }
-        else if(viewType == TYPE_LAST)  { params.rightMargin = 30; }
+        if     (viewType == TYPE_FIRST) { params.leftMargin = mListMargin; }
+        else if(viewType == TYPE_LAST)  { params.rightMargin = mListMargin; }
         return new ViewHolder(v);
     }