Fix issue #279 - Improve behavior

This commit is contained in:
Thomas 2022-07-26 19:08:10 +02:00
parent 21ccde5c6a
commit 74921e6d16
2 changed files with 15 additions and 7 deletions

View File

@ -239,12 +239,17 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
}
});
});
if (attachments.get(position).translation != null) {
binding.mediaDescription.setVisibility(View.GONE);
binding.mediaDescriptionTranslated.setText(attachments.get(position).translation);
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
if (!fullscreen) {
if (attachments.get(position).translation != null) {
binding.mediaDescription.setVisibility(View.GONE);
binding.mediaDescriptionTranslated.setText(attachments.get(position).translation);
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
} else {
binding.mediaDescription.setVisibility(View.VISIBLE);
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
}
} else {
binding.mediaDescription.setVisibility(View.VISIBLE);
binding.mediaDescription.setVisibility(View.GONE);
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
}
}
@ -362,7 +367,7 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
handler = new Handler();
if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) {
binding.mediaDescription.setText(description);
if (attachments.get(mediaPosition - 1).translation != null) {
if (attachments.get(binding.mediaViewpager.getCurrentItem()).translation != null) {
binding.mediaDescription.setVisibility(View.GONE);
binding.mediaDescriptionTranslated.setText(attachments.get(binding.mediaViewpager.getCurrentItem()).translation);
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
@ -372,6 +377,8 @@ public class MediaActivity extends BaseActivity implements OnDownloadInterface {
}
} else {
binding.translate.setVisibility(View.GONE);
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
binding.mediaDescription.setVisibility(View.GONE);
}
} else {
binding.translate.setVisibility(View.GONE);

View File

@ -77,7 +77,8 @@
style="@style/Widget.App.Button.IconOnly.Outline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible"
android:contentDescription="@string/translate"
app:icon="@drawable/ic_baseline_translate_24"
app:iconPadding="0dp"