Improved spacing

This commit is contained in:
daniel oeh 2014-04-27 21:59:31 +02:00
parent 95c5f0309f
commit f8c2c42fc9
15 changed files with 62 additions and 183 deletions

View File

@ -9,40 +9,24 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginRight="16dp">
android:layout_marginRight="8dp">
<ImageView
android:id="@+id/imgvImage"
android:contentDescription="@string/cover_label"
android:layout_width="@dimen/thumbnail_length_itemlist"
android:layout_width="@dimen/thumbnail_length_downloaded_item"
android:layout_height="@dimen/thumbnail_length_itemlist"
android:layout_alignParentLeft="true"
android:scaleType="centerCrop"/>
<ImageView
android:id="@+id/statusPlaying"
android:contentDescription="@string/status_playing_label"
android:layout_width="@dimen/status_indicator_width"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:background="@color/status_playing"
android:gravity="center"
android:padding="2dp"
android:src="@drawable/av_play_dark"/>
<TextView
android:id="@+id/txtvPublished"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/imgvImage"
android:layout_toLeftOf="@id/statusPlaying"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:attr/textColorTertiary"
@ -57,36 +41,23 @@
android:layout_marginRight="4dp"
android:layout_marginTop="2dp"
android:layout_toRightOf="@id/imgvImage"
android:layout_toLeftOf="@id/statusPlaying"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:lines="2"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/text_size_small"/>
<LinearLayout
android:layout_width="0dp"
<TextView
android:id="@+id/txtvSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/imgvImage"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/txtvSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_alignParentLeft="true"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"/>
</RelativeLayout>
</LinearLayout>
android:layout_alignParentTop="true"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"/>
</RelativeLayout>
<View

View File

@ -18,7 +18,8 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="8dp"
android:textColor="?android:attr/textColorSecondary" />
android:textSize="@dimen/text_size_small"
android:textColor="?android:attr/textColorTertiary" />
<TextView
android:id="@+id/txtvTitle"
@ -27,26 +28,43 @@
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/txtvType"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/text_size_medium"
android:ellipsize="end"
android:maxLines="2" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
>
<TextView
android:id="@+id/txtvDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp" />
android:layout_marginRight="8dp"
android:lines="1"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_small"
android:layout_alignParentLeft="true"/>
<TextView
android:id="@+id/txtvStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp" />
android:lines="1"
android:textSize="@dimen/text_size_small"
android:layout_alignParentRight="true"/>
</RelativeLayout>
<TextView
android:id="@+id/txtvReason"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"
android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp" />

View File

@ -97,20 +97,6 @@
android:textSize="@dimen/text_size_micro"
android:textStyle="bold"/>
<ImageView
android:id="@+id/statusPlaying"
android:contentDescription="@string/status_playing_label"
android:layout_width="@dimen/status_indicator_width"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="8dp"
android:layout_marginBottom="8dp"
android:background="@color/status_playing"
android:gravity="center"
android:padding="2dp"
android:src="@drawable/av_play_dark"/>
</RelativeLayout>
<View

View File

@ -8,8 +8,6 @@
<com.mobeta.android.dslv.DragSortListView
android:id="@android:id/list"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:scrollbarStyle="outsideOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -10,7 +10,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginRight="16dp">
android:layout_marginRight="8dp">
<ImageView
android:id="@+id/imgvImage"
@ -20,21 +20,6 @@
android:layout_alignParentLeft="true"
android:scaleType="centerCrop"/>
<ImageView
android:id="@+id/statusPlaying"
android:contentDescription="@string/status_playing_label"
android:layout_width="@dimen/status_indicator_width"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="8dp"
android:background="@color/status_playing"
android:gravity="center"
android:padding="2dp"
android:src="@drawable/av_play_dark"/>
<TextView
android:id="@+id/txtvPublished"
android:layout_width="0dp"
@ -43,7 +28,7 @@
android:layout_marginRight="8dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/imgvImage"
android:layout_toLeftOf="@id/statusPlaying"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:attr/textColorTertiary"
@ -55,10 +40,9 @@
android:layout_height="wrap_content"
android:layout_below="@id/txtvPublished"
android:layout_marginLeft="8dp"
android:layout_marginRight="4dp"
android:layout_marginTop="2dp"
android:layout_toRightOf="@id/imgvImage"
android:layout_toLeftOf="@id/statusPlaying"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:lines="2"
android:textColor="?android:attr/textColorPrimary"

View File

@ -7,8 +7,6 @@
<com.mobeta.android.dslv.DragSortListView
android:id="@android:id/list"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:scrollbarStyle="outsideOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -19,58 +19,30 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginRight="16dp">
android:layout_marginRight="8dp">
<ImageView
android:id="@+id/imgvImage"
android:contentDescription="@string/cover_label"
android:layout_width="@dimen/thumbnail_length_itemlist"
android:layout_height="@dimen/thumbnail_length_itemlist"
android:layout_width="@dimen/thumbnail_length_queue_item"
android:layout_height="@dimen/thumbnail_length_queue_item"
android:layout_alignParentLeft="true"
android:scaleType="centerCrop"/>
<ImageView
android:id="@+id/statusPlaying"
android:contentDescription="@string/status_playing_label"
android:layout_width="@dimen/status_indicator_width"
android:layout_height="18dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="@color/status_playing"
android:gravity="center"
android:padding="2dp"
android:src="@drawable/av_play_dark"/>
<TextView
android:id="@+id/txtvPublished"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/imgvImage"
android:layout_toLeftOf="@id/statusPlaying"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"/>
<TextView
android:id="@+id/txtvTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@id/txtvPublished"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="4dp"
android:layout_marginTop="2dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_toRightOf="@id/imgvImage"
android:layout_toLeftOf="@id/statusPlaying"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:lines="2"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/text_size_small"/>
android:textSize="@dimen/queue_title_text_size"/>
<LinearLayout
android:layout_width="0dp"
@ -96,16 +68,6 @@
android:layout_marginRight="8dp"
android:layout_alignParentLeft="true"/>
<TextView
android:id="@+id/txtvDuration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -2,6 +2,7 @@
<resources>
<dimen name="thumbnail_length">170dp</dimen>
<dimen name="thumbnail_length_itemlist">70dp</dimen>
<dimen name="thumbnail_length_queue_item">80dp</dimen>
<dimen name="thumbnail_length_downloaded_item">80dp</dimen>
<dimen name="queue_title_text_size">@dimen/text_size_medium</dimen>
</resources>

View File

@ -11,10 +11,14 @@
<dimen name="text_size_navdrawer">16sp</dimen>
<dimen name="text_size_medium">18sp</dimen>
<dimen name="text_size_large">22sp</dimen>
<dimen name="status_indicator_width">36dp</dimen>
<dimen name="status_indicator_width">32dp</dimen>
<dimen name="thumbnail_length_itemlist">80dp</dimen>
<dimen name="thumbnail_length_queue_item">70dp</dimen>
<dimen name="thumbnail_length_downloaded_item">70dp</dimen>
<dimen name="thumbnail_length_onlinefeedview">110dp</dimen>
<dimen name="thumbnail_length_navlist">42dp</dimen>
<dimen name="listview_secondary_button_width">48dp</dimen>
<dimen name="drawer_width">280dp</dimen>
<dimen name="queue_title_text_size">@dimen/text_size_small</dimen>
</resources>

View File

@ -102,8 +102,8 @@
<string name="skip_episode_label">Skip episode</string>
<!-- Download messages and labels -->
<string name="download_successful">Download successful</string>
<string name="download_failed">Download failed</string>
<string name="download_successful">successful</string>
<string name="download_failed">failed</string>
<string name="download_pending">Download pending</string>
<string name="download_running">Download running</string>
<string name="download_error_device_not_found">Storage device not found</string>

View File

@ -23,7 +23,7 @@ public class ActionButtonUtils {
if (context == null) throw new IllegalArgumentException("context = null");
this.context = context;
drawables = context.obtainStyledAttributes(new int[]{
R.attr.av_play, R.attr.navigation_cancel, R.attr.av_download});
R.attr.av_play, R.attr.navigation_cancel, R.attr.av_download, R.attr.navigation_chapters});
labels = new int[]{R.string.play_label, R.string.cancel_download_label, R.string.download_label};
}
@ -52,8 +52,12 @@ public class ActionButtonUtils {
} else {
// item is not being downloaded
butSecondary.setVisibility(View.VISIBLE);
butSecondary
.setImageDrawable(drawables.getDrawable(0));
if (media.isPlaying()) {
butSecondary.setImageDrawable(drawables.getDrawable(3));
} else {
butSecondary
.setImageDrawable(drawables.getDrawable(0));
}
butSecondary.setContentDescription(context.getString(labels[0]));
}
} else {

View File

@ -60,8 +60,6 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
.findViewById(R.id.txtvPublished);
holder.butSecondary = (ImageButton) convertView
.findViewById(R.id.butSecondaryAction);
holder.statusPlaying = (ImageView) convertView
.findViewById(R.id.statusPlaying);
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
holder.txtvSize = (TextView) convertView.findViewById(R.id.txtvSize);
convertView.setTag(holder);
@ -75,11 +73,9 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
FeedItem.State state = item.getState();
if (state == FeedItem.State.PLAYING) {
holder.statusPlaying.setVisibility(View.VISIBLE);
holder.butSecondary.setEnabled(false);
} else {
holder.butSecondary.setEnabled(true);
holder.statusPlaying.setVisibility(View.INVISIBLE);
}
holder.butSecondary.setFocusable(false);
@ -109,7 +105,6 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
TextView title;
TextView pubDate;
ImageView imageView;
ImageView statusPlaying;
TextView txtvSize;
ImageButton butSecondary;
}

View File

@ -58,8 +58,6 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter {
holder.inPlaylist = (ImageView) convertView
.findViewById(R.id.imgvInPlaylist);
holder.type = (ImageView) convertView.findViewById(R.id.imgvType);
holder.statusPlaying = (View) convertView
.findViewById(R.id.statusPlaying);
holder.statusUnread = (View) convertView
.findViewById(R.id.statusUnread);
holder.episodeProgress = (ProgressBar) convertView
@ -89,21 +87,17 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter {
FeedItem.State state = item.getState();
switch (state) {
case PLAYING:
holder.statusPlaying.setVisibility(View.VISIBLE);
holder.statusUnread.setVisibility(View.GONE);
holder.episodeProgress.setVisibility(View.VISIBLE);
break;
case IN_PROGRESS:
holder.statusPlaying.setVisibility(View.GONE);
holder.statusUnread.setVisibility(View.GONE);
holder.episodeProgress.setVisibility(View.VISIBLE);
break;
case NEW:
holder.statusPlaying.setVisibility(View.GONE);
holder.statusUnread.setVisibility(View.VISIBLE);
break;
default:
holder.statusPlaying.setVisibility(View.GONE);
holder.statusUnread.setVisibility(View.GONE);
break;
}
@ -202,7 +196,6 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter {
ImageView inPlaylist;
ImageButton butAction;
View statusUnread;
View statusPlaying;
ProgressBar episodeProgress;
}

View File

@ -113,8 +113,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
.findViewById(R.id.butSecondaryAction);
holder.queueStatus = (ImageView) convertView
.findViewById(R.id.imgvInPlaylist);
holder.statusPlaying = (ImageView) convertView
.findViewById(R.id.statusPlaying);
holder.downloadProgress = (ProgressBar) convertView
.findViewById(R.id.pbar_download_progress);
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
@ -126,13 +124,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
holder.title.setText(item.getTitle());
holder.pubDate.setText(DateUtils.formatDateTime(context, item.getPubDate().getTime(), DateUtils.FORMAT_SHOW_DATE));
FeedItem.State state = item.getState();
if (state == FeedItem.State.PLAYING) {
holder.statusPlaying.setVisibility(View.VISIBLE);
} else {
holder.statusPlaying.setVisibility(View.INVISIBLE);
}
FeedMedia media = item.getMedia();
if (media != null) {
@ -195,7 +186,6 @@ public class NewEpisodesListAdapter extends BaseAdapter {
TextView pubDate;
ImageView queueStatus;
ImageView imageView;
ImageView statusPlaying;
ProgressBar downloadProgress;
TextView txtvDuration;
ImageButton butSecondary;

View File

@ -1,7 +1,6 @@
package de.danoeh.antennapod.adapter;
import android.content.Context;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -11,7 +10,6 @@ import de.danoeh.antennapod.asynctask.ImageLoader;
import de.danoeh.antennapod.feed.FeedItem;
import de.danoeh.antennapod.feed.FeedMedia;
import de.danoeh.antennapod.storage.DownloadRequester;
import de.danoeh.antennapod.util.Converter;
/**
* List adapter for the queue.
@ -61,46 +59,26 @@ public class QueueListAdapter extends BaseAdapter {
convertView = inflater.inflate(R.layout.queue_listitem,
null);
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
holder.pubDate = (TextView) convertView
.findViewById(R.id.txtvPublished);
holder.butSecondary = (ImageButton) convertView
.findViewById(R.id.butSecondaryAction);
holder.statusPlaying = (ImageView) convertView
.findViewById(R.id.statusPlaying);
holder.downloadProgress = (ProgressBar) convertView
.findViewById(R.id.pbar_download_progress);
holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
holder.txtvDuration = (TextView) convertView.findViewById(R.id.txtvDuration);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
}
holder.title.setText(item.getTitle());
holder.pubDate.setText(DateUtils.formatDateTime(context, item.getPubDate().getTime(), DateUtils.FORMAT_SHOW_DATE));
FeedItem.State state = item.getState();
if (state == FeedItem.State.PLAYING) {
holder.statusPlaying.setVisibility(View.VISIBLE);
} else {
holder.statusPlaying.setVisibility(View.INVISIBLE);
}
FeedMedia media = item.getMedia();
if (media != null) {
final boolean isDownloadingMedia = DownloadRequester.getInstance().isDownloadingFile(media);
if (media.getDuration() > 0) {
holder.txtvDuration.setText(Converter.getDurationStringLong(media.getDuration()));
} else {
holder.txtvDuration.setText("");
}
if (isDownloadingMedia) {
holder.downloadProgress.setVisibility(View.VISIBLE);
holder.txtvDuration.setVisibility(View.GONE);
} else {
holder.txtvDuration.setVisibility(View.VISIBLE);
holder.downloadProgress.setVisibility(View.GONE);
}
if (!media.isDownloaded()) {
@ -137,11 +115,8 @@ public class QueueListAdapter extends BaseAdapter {
static class Holder {
TextView title;
TextView pubDate;
ImageView imageView;
ImageView statusPlaying;
ProgressBar downloadProgress;
TextView txtvDuration;
ImageButton butSecondary;
}