Fixes issue #190 - Improves with a message when media fully loaded
This commit is contained in:
parent
1ffb8177f9
commit
e0a6abaa19
|
@ -94,6 +94,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
|||
private boolean canSwipe;
|
||||
private AppBarLayout appBar;
|
||||
private ProgressBar pbar_inf;
|
||||
private TextView message_ready;
|
||||
|
||||
|
||||
private enum actionSwipe{
|
||||
|
@ -126,7 +127,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
|||
}else {
|
||||
main_container_media.setBackgroundResource(R.color.mastodonC1_);
|
||||
}
|
||||
|
||||
message_ready = findViewById(R.id.message_ready);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
if( getSupportActionBar() != null) {
|
||||
|
@ -338,11 +339,24 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
|
|||
})
|
||||
.into(new SimpleTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
|
||||
public void onResourceReady(final Bitmap resource, Transition<? super Bitmap> transition) {
|
||||
loader.setVisibility(View.GONE);
|
||||
downloadedImage = resource;
|
||||
imageView.setImageBitmap(resource);
|
||||
if( imageView.getScale() < 1.1) {
|
||||
downloadedImage = resource;
|
||||
imageView.setImageBitmap(resource);
|
||||
}else{
|
||||
message_ready.setVisibility(View.VISIBLE);
|
||||
}
|
||||
message_ready.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
downloadedImage = resource;
|
||||
imageView.setImageBitmap(resource);
|
||||
message_ready.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
fileVideo = null;
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/mastodonC1__"/>
|
||||
|
||||
<stroke android:width="1dp"
|
||||
android:color="@color/mastodonC1"
|
||||
/>
|
||||
|
||||
<padding android:left="1dp"
|
||||
android:top="1dp"
|
||||
android:right="1dp"
|
||||
android:bottom="1dp"
|
||||
/>
|
||||
|
||||
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
|
||||
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
|
||||
</shape>
|
|
@ -113,6 +113,17 @@
|
|||
android:layout_height="20dp"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/media_message_border"
|
||||
android:id="@+id/message_ready"
|
||||
android:textColor="@color/dark_text"
|
||||
android:text="@string/media_ready"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"/>
|
||||
</RelativeLayout>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
</android.support.v4.widget.DrawerLayout>
|
|
@ -460,4 +460,5 @@
|
|||
- If it still does not work, please raise an issue on Github at https://github.com/stom79/mastalab/issues
|
||||
</string>
|
||||
|
||||
<string name="media_ready">Media has been loaded. Click here to display it.</string>
|
||||
</resources>
|
Loading…
Reference in New Issue