Fix issue #279 - Improve behavior
This commit is contained in:
parent
21ccde5c6a
commit
74921e6d16
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue