Improves media display

This commit is contained in:
tom79 2017-06-16 19:23:41 +02:00
parent 5ce1e09957
commit df817e4a38
8 changed files with 113 additions and 31 deletions

View File

@ -151,6 +151,10 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
holder.status_prev2 = (ImageView) convertView.findViewById(R.id.status_prev2); holder.status_prev2 = (ImageView) convertView.findViewById(R.id.status_prev2);
holder.status_prev3 = (ImageView) convertView.findViewById(R.id.status_prev3); holder.status_prev3 = (ImageView) convertView.findViewById(R.id.status_prev3);
holder.status_prev4 = (ImageView) convertView.findViewById(R.id.status_prev4); 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_container2 = (LinearLayout) convertView.findViewById(R.id.status_container2);
holder.status_container3 = (LinearLayout) convertView.findViewById(R.id.status_container3); holder.status_container3 = (LinearLayout) convertView.findViewById(R.id.status_container3);
holder.status_reply = (ImageView) convertView.findViewById(R.id.status_reply); 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){ for(final Attachment attachment: attachments){
ImageView imageView; ImageView imageView;
if( i == 0) if( i == 0) {
imageView = holder.status_prev1; imageView = holder.status_prev1;
else if( i == 1) if( attachment.getType().equals("image"))
imageView = holder.status_prev2; holder.status_prev1_play.setVisibility(View.GONE);
else if(i == 2) else
imageView = holder.status_prev3; holder.status_prev1_play.setVisibility(View.VISIBLE);
else }else if( i == 1) {
imageView = holder.status_prev4; 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(); String url = attachment.getPreview_url();
if( url == null || url.trim().equals("")) if( url == null || url.trim().equals(""))
url = attachment.getUrl(); url = attachment.getUrl();
@ -644,6 +665,10 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
ImageView status_prev2; ImageView status_prev2;
ImageView status_prev3; ImageView status_prev3;
ImageView status_prev4; ImageView status_prev4;
ImageView status_prev1_play;
ImageView status_prev2_play;
ImageView status_prev3_play;
ImageView status_prev4_play;
ImageView status_reply; ImageView status_reply;
ImageView status_privacy; ImageView status_privacy;
LinearLayout status_container2; LinearLayout status_container2;

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

View File

@ -29,7 +29,8 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal"
android:baselineAligned="false">
<RelativeLayout <RelativeLayout
android:layout_height="60dp" android:layout_height="60dp"
android:layout_width="60dp" android:layout_width="60dp"
@ -145,14 +146,28 @@
android:id="@+id/status_document_container" android:id="@+id/status_document_container"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="200dp"> android:layout_height="200dp"
<ImageView android:baselineAligned="false">
android:id="@+id/status_prev1" <RelativeLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:scaleType="centerCrop"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:ignore="ContentDescription" /> >
<ImageView
android:id="@+id/status_prev1"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev1_play"
android:visibility="gone"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:src="@drawable/ic_play_arrow"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="0dp" android:layout_width="0dp"
@ -161,36 +176,78 @@
android:id="@+id/status_container2" android:id="@+id/status_container2"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <RelativeLayout
android:id="@+id/status_prev2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_weight="1"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:layout_height="0dp" android:layout_height="0dp"
tools:ignore="ContentDescription" /> android:layout_weight="1">
<ImageView
android:id="@+id/status_prev2"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:visibility="gone"
android:id="@+id/status_prev2_play"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:src="@drawable/ic_play_arrow"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
</RelativeLayout>
<LinearLayout <LinearLayout
android:layout_weight="1" android:layout_weight="1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:id="@+id/status_container3" android:id="@+id/status_container3"
android:layout_height="0dp"> android:layout_height="0dp"
<ImageView android:baselineAligned="false">
android:id="@+id/status_prev3" <RelativeLayout
android:layout_weight="1"
android:layout_width="0dp"
android:scaleType="centerCrop"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
<ImageView
android:layout_marginLeft="2dp" android:layout_marginLeft="2dp"
android:layout_marginStart="2dp" android:layout_marginStart="2dp"
android:id="@+id/status_prev4"
android:layout_weight="1" android:layout_weight="1"
android:layout_width="0dp" android:layout_width="0dp"
android:scaleType="centerCrop" android:layout_height="wrap_content">
android:layout_height="wrap_content" <ImageView
tools:ignore="ContentDescription" /> android:id="@+id/status_prev3"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev3_play"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:src="@drawable/ic_play_arrow"
android:visibility="gone"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
</RelativeLayout>
<RelativeLayout
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/status_prev4"
android:layout_width="match_parent"
android:scaleType="centerCrop"
android:layout_height="match_parent"
tools:ignore="ContentDescription" />
<ImageView
android:id="@+id/status_prev4_play"
android:layout_centerInParent="true"
android:visibility="gone"
android:layout_width="wrap_content"
android:src="@drawable/ic_play_arrow"
android:layout_height="wrap_content"
tools:ignore="ContentDescription" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>