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