Fixes issue #190 - Improves with a message when media fully loaded

This commit is contained in:
stom79 2017-12-24 08:37:13 +01:00
parent 1ffb8177f9
commit e0a6abaa19
4 changed files with 47 additions and 4 deletions

View File

@ -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;

View File

@ -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>

View File

@ -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>

View File

@ -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>