From df817e4a38f79857af50f03b986f59bc71c081cc Mon Sep 17 00:00:00 2001 From: tom79 Date: Fri, 16 Jun 2017 19:23:41 +0200 Subject: [PATCH] Improves media display --- .../mastodon/drawers/StatusListAdapter.java | 41 +++++-- .../main/res/drawable-hdpi/ic_play_arrow.png | Bin 0 -> 195 bytes .../main/res/drawable-ldpi/ic_play_arrow.png | Bin 0 -> 193 bytes .../main/res/drawable-mdpi/ic_play_arrow.png | Bin 0 -> 157 bytes .../main/res/drawable-xhdpi/ic_play_arrow.png | Bin 0 -> 235 bytes .../res/drawable-xxhdpi/ic_play_arrow.png | Bin 0 -> 312 bytes .../res/drawable-xxxhdpi/ic_play_arrow.png | Bin 0 -> 388 bytes app/src/main/res/layout/drawer_status.xml | 103 ++++++++++++++---- 8 files changed, 113 insertions(+), 31 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_play_arrow.png create mode 100644 app/src/main/res/drawable-ldpi/ic_play_arrow.png create mode 100644 app/src/main/res/drawable-mdpi/ic_play_arrow.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_play_arrow.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_play_arrow.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_play_arrow.png diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java index b01d7f87c..13befb065 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java @@ -151,6 +151,10 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf holder.status_prev2 = (ImageView) convertView.findViewById(R.id.status_prev2); holder.status_prev3 = (ImageView) convertView.findViewById(R.id.status_prev3); holder.status_prev4 = (ImageView) convertView.findViewById(R.id.status_prev4); + holder.status_prev1_play = (ImageView) convertView.findViewById(R.id.status_prev1_play); + holder.status_prev2_play = (ImageView) convertView.findViewById(R.id.status_prev2_play); + holder.status_prev3_play = (ImageView) convertView.findViewById(R.id.status_prev3_play); + holder.status_prev4_play = (ImageView) convertView.findViewById(R.id.status_prev4_play); holder.status_container2 = (LinearLayout) convertView.findViewById(R.id.status_container2); holder.status_container3 = (LinearLayout) convertView.findViewById(R.id.status_container3); holder.status_reply = (ImageView) convertView.findViewById(R.id.status_reply); @@ -465,14 +469,31 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf } for(final Attachment attachment: attachments){ ImageView imageView; - if( i == 0) - imageView = holder.status_prev1; - else if( i == 1) - imageView = holder.status_prev2; - else if(i == 2) - imageView = holder.status_prev3; - else - imageView = holder.status_prev4; + if( i == 0) { + imageView = holder.status_prev1; + if( attachment.getType().equals("image")) + holder.status_prev1_play.setVisibility(View.GONE); + else + holder.status_prev1_play.setVisibility(View.VISIBLE); + }else if( i == 1) { + imageView = holder.status_prev2; + if( attachment.getType().equals("image")) + holder.status_prev2_play.setVisibility(View.GONE); + else + holder.status_prev2_play.setVisibility(View.VISIBLE); + }else if(i == 2) { + imageView = holder.status_prev3; + if( attachment.getType().equals("image")) + holder.status_prev3_play.setVisibility(View.GONE); + else + holder.status_prev3_play.setVisibility(View.VISIBLE); + }else { + imageView = holder.status_prev4; + if( attachment.getType().equals("image")) + holder.status_prev4_play.setVisibility(View.GONE); + else + holder.status_prev4_play.setVisibility(View.VISIBLE); + } String url = attachment.getPreview_url(); if( url == null || url.trim().equals("")) url = attachment.getUrl(); @@ -644,6 +665,10 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf ImageView status_prev2; ImageView status_prev3; ImageView status_prev4; + ImageView status_prev1_play; + ImageView status_prev2_play; + ImageView status_prev3_play; + ImageView status_prev4_play; ImageView status_reply; ImageView status_privacy; LinearLayout status_container2; diff --git a/app/src/main/res/drawable-hdpi/ic_play_arrow.png b/app/src/main/res/drawable-hdpi/ic_play_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..9211546a03db638d2e0e70ee3a5e847fd724cff2 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8m#2$kNX4zUQ_k`_IEb*R=ADxY zV6uJDq_v_+Z-tYfR|K!cZcn#wZ_1w*Zwfx3^1JLFH&cH)|4gqfmxMH3rgg?BZ~AgX zO7P4Ssfnoy7dsLbs)cmuJnq)8IA+UruCTi)d!Bot@+%Rg#TB=_7E65dSjDj^h($AU t;!LNFTjoCMkvN)I{QpIN|NiIvIZ;mvua;Q{0v*M`;OXk;vd$@?2>?bcNcI2# literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-ldpi/ic_play_arrow.png b/app/src/main/res/drawable-ldpi/ic_play_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..15d2eb3ba4a27d2583cd2e65befea99c48b06351 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rhe4o?@ykcwN$2@*yQE-o!rZ8A0$ z0U^%L%~OM#UE=mumHxT4HCxf)aLdUu*((de|Nr}2&ACL3fj5L%>V#jXqrwN~j`xhb zrx~Qw_@*SOTvw2&;1;>XWO9KcL%}@o-qAz>jz3I~+8tIpEoh8k;a$AdQDJ@VvLo3c qoH?sp>_dfAN;h#_HG12?#GsjeanrVX_b)&0;ZURMRElP&fQw-uJw>jZO32lU*`HP`vojAWE*DBJk=1iq?|!Wdn@D8 z$p;xvyfI;$qIXQ(G0oUN$X#9R^V*5$e3FeWZ+QIMiNEIlDu1^Bj}3tKF?hQAxvX^pFnn&zBDqxdGd<*@!5&_q8;VJzAf07K`N% z!on3-KItRy=FUY42wCa10N9vllz@;YH!T2m9<)k8$csS>2+5YW6p$@%IUrNsIzWcJ zwSc6&M*yPo9s`KT`y+szS$Rd$N8T8fnyz%ps_@FHkd~dat|LO8{>w}XS-ZA$%Eiko l7ccqhSUCnTfC0V$_yA6vJSVR$awY%(002ovPDHLkV1kI>T!R1r literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_play_arrow.png b/app/src/main/res/drawable-xxhdpi/ic_play_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..8a54ba21a0550d54aec46fa42bfd2ec7c0cb80c2 GIT binary patch literal 312 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhauJY5_^DsH{Kahms#fdETD@k0;B zkc6xST&oOX9Yim<&hp?dIWRX{Px1-hpPO6VPWqhl@aMAbGiPxP6ak`l35O&PzF+yD z^TT0TcC~23P5g(3B+q){0*YacF&|lstvA*A3ahMxMY`Cu&%Tf zTg_+g)$bU$$5pvi`}~fwFkIXEQtbJ;eg`H_l?gy%OX&r9^UTSi&YSIBfI-3F>FVdQ I&MBb@0I&^vQ2+n{ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_play_arrow.png b/app/src/main/res/drawable-xxxhdpi/ic_play_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..73db57c0382316268696bdd32a8c278500a8646f GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7!07Gi;uunK>+P(wzRZRqY}2{j zxfU?3Xw(X7z1+HzX_tra%SOJU=d--+o^V~L`aAEhr|~{_sZ8Tf=Wm+<4FQ1{PU3sB zW^eEN-|}Vk=6Q2irNZ}Cb9bCo8(zla+_RwB&9k*?7Btc zk{!pmRF0TNDcG!&WLj8wR*<77d!9o;Off6dqglEJHtUR8+K!d>9XPP#oUnw*^_fi0 zkF25}6vTuJScqIVW#KzgD%*H&$2ye@qSvpolpQa%ZJb-^s_;PgSJA(gHUE#4hd%F# z`}%CpRE=}doUhN$`C3+$ZeSV2XL}|5xpQs0LHN!aTIa;0uZ4GCo4(t*=_IrJbK&69 zx+E#7Gk?;rJ^FJd>+gkJ+bjVIpJTcIWGhykWA^7f*dy~x` + android:orientation="horizontal" + android:baselineAligned="false"> - + + > + + + - + android:layout_weight="1"> + + + + - - + + android:layout_height="wrap_content"> + + + + + + + +