|
|
|
@ -196,6 +196,9 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
binding.mediaDescriptionTranslated.setText(translated);
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Toasty.error(MediaActivity.this, getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
|
|
|
|
|
}
|
|
|
|
@ -203,10 +206,16 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
});
|
|
|
|
|
if (attachments.get(mediaPosition - 1).translation != null) {
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setText(attachments.get(mediaPosition - 1).translation);
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
|
|
|
|
|
} else {
|
|
|
|
|
binding.mediaDescription.setVisibility(View.VISIBLE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(true);
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -236,6 +245,9 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
binding.mediaDescriptionTranslated.setText(translated);
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Toasty.error(MediaActivity.this, getString(R.string.toast_error_translate), Toast.LENGTH_LONG).show();
|
|
|
|
|
}
|
|
|
|
@ -244,14 +256,23 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
if (!fullscreen) {
|
|
|
|
|
if (attachments.get(position).translation != null) {
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setText(attachments.get(position).translation);
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
|
|
|
|
|
} else {
|
|
|
|
|
binding.mediaDescription.setVisibility(View.VISIBLE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(true);
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -407,10 +428,16 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
binding.mediaDescription.setText(linkify(MediaActivity.this, description), TextView.BufferType.SPANNABLE);
|
|
|
|
|
if (attachments.get(binding.mediaViewpager.getCurrentItem()).translation != null) {
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setText(attachments.get(binding.mediaViewpager.getCurrentItem()).translation);
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.VISIBLE);
|
|
|
|
|
} else {
|
|
|
|
|
binding.mediaDescription.setVisibility(View.VISIBLE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(true);
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -422,12 +449,18 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
}
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
binding.originalMessage.setVisibility(View.INVISIBLE);
|
|
|
|
|
binding.translate.setVisibility(View.GONE);
|
|
|
|
|
binding.mediaDescriptionTranslated.setVisibility(View.GONE);
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -476,6 +509,9 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
if (!fullscreen) {
|
|
|
|
|
showSystemUI();
|
|
|
|
|
binding.mediaDescription.setVisibility(View.VISIBLE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(true);
|
|
|
|
|
}
|
|
|
|
|
binding.translate.setVisibility(View.VISIBLE);
|
|
|
|
|
if (mediaFromProfile) {
|
|
|
|
|
binding.originalMessage.setVisibility(View.VISIBLE);
|
|
|
|
@ -483,6 +519,9 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|
|
|
|
} else {
|
|
|
|
|
hideSystemUI();
|
|
|
|
|
binding.mediaDescription.setVisibility(View.GONE);
|
|
|
|
|
if(mCurrentFragment != null) {
|
|
|
|
|
mCurrentFragment.toggleController(false);
|
|
|
|
|
}
|
|
|
|
|
binding.translate.setVisibility(View.GONE);
|
|
|
|
|
binding.originalMessage.setVisibility(View.INVISIBLE);
|
|
|
|
|
}
|
|
|
|
|