Disable Copied toast on android 13+ (#1139)

This commit is contained in:
o13e 2022-10-15 13:07:24 +02:00 committed by GitHub
parent 9b8cd3816f
commit 48dcf2293c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 6 deletions

View File

@ -148,7 +148,9 @@ public class GiveAwardActivity extends BaseActivity {
if (clipboard != null) { if (clipboard != null) {
ClipData clip = ClipData.newPlainText("simple text", text); ClipData clip = ClipData.newPlainText("simple text", text);
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toast.makeText(GiveAwardActivity.this, R.string.copy_success, Toast.LENGTH_SHORT).show(); if (android.os.Build.VERSION.SDK_INT < 33) {
Toast.makeText(GiveAwardActivity.this, R.string.copy_success, Toast.LENGTH_SHORT).show();
}
} else { } else {
Toast.makeText(GiveAwardActivity.this, R.string.copy_failed, Toast.LENGTH_SHORT).show(); Toast.makeText(GiveAwardActivity.this, R.string.copy_failed, Toast.LENGTH_SHORT).show();
} }

View File

@ -157,7 +157,9 @@ public class WebViewActivity extends BaseActivity {
if (clipboard != null) { if (clipboard != null) {
ClipData clip = ClipData.newPlainText("simple text", url); ClipData clip = ClipData.newPlainText("simple text", url);
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toast.makeText(this, R.string.copy_success, Toast.LENGTH_SHORT).show(); if (android.os.Build.VERSION.SDK_INT < 33) {
Toast.makeText(this, R.string.copy_success, Toast.LENGTH_SHORT).show();
}
} else { } else {
Toast.makeText(this, R.string.copy_link_failed, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.copy_link_failed, Toast.LENGTH_SHORT).show();
} }

View File

@ -294,7 +294,9 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
if (clipboard != null) { if (clipboard != null) {
ClipData clip = ClipData.newPlainText("simple text", message.getBody()); ClipData clip = ClipData.newPlainText("simple text", message.getBody());
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toast.makeText(mViewPrivateMessagesActivity, R.string.copy_success, Toast.LENGTH_SHORT).show(); if (android.os.Build.VERSION.SDK_INT < 33) {
Toast.makeText(mViewPrivateMessagesActivity, R.string.copy_success, Toast.LENGTH_SHORT).show();
}
} else { } else {
Toast.makeText(mViewPrivateMessagesActivity, R.string.copy_failed, Toast.LENGTH_SHORT).show(); Toast.makeText(mViewPrivateMessagesActivity, R.string.copy_failed, Toast.LENGTH_SHORT).show();
} }

View File

@ -134,7 +134,9 @@ public class CopyTextBottomSheetFragment extends LandscapeExpandedRoundedBottomS
if (clipboard != null) { if (clipboard != null) {
ClipData clip = ClipData.newPlainText("simple text", text); ClipData clip = ClipData.newPlainText("simple text", text);
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toast.makeText(activity, R.string.copy_success, Toast.LENGTH_SHORT).show(); if (android.os.Build.VERSION.SDK_INT < 33) {
Toast.makeText(activity, R.string.copy_success, Toast.LENGTH_SHORT).show();
}
} else { } else {
Toast.makeText(activity, R.string.copy_link_failed, Toast.LENGTH_SHORT).show(); Toast.makeText(activity, R.string.copy_link_failed, Toast.LENGTH_SHORT).show();
} }

View File

@ -140,7 +140,9 @@ public class ShareLinkBottomSheetFragment extends LandscapeExpandedRoundedBottom
if (clipboard != null) { if (clipboard != null) {
ClipData clip = ClipData.newPlainText("simple text", link); ClipData clip = ClipData.newPlainText("simple text", link);
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toast.makeText(activity, R.string.copy_success, Toast.LENGTH_SHORT).show(); if (android.os.Build.VERSION.SDK_INT < 33) {
Toast.makeText(activity, R.string.copy_success, Toast.LENGTH_SHORT).show();
}
} else { } else {
Toast.makeText(activity, R.string.copy_link_failed, Toast.LENGTH_SHORT).show(); Toast.makeText(activity, R.string.copy_link_failed, Toast.LENGTH_SHORT).show();
} }

View File

@ -80,7 +80,9 @@ public class UrlMenuBottomSheetFragment extends LandscapeExpandedRoundedBottomSh
if (clipboard != null) { if (clipboard != null) {
ClipData clip = ClipData.newPlainText("simple text", url); ClipData clip = ClipData.newPlainText("simple text", url);
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
Toast.makeText(activity, R.string.copy_success, Toast.LENGTH_SHORT).show(); if (android.os.Build.VERSION.SDK_INT < 33) {
Toast.makeText(activity, R.string.copy_success, Toast.LENGTH_SHORT).show();
}
} else { } else {
Toast.makeText(activity, R.string.copy_link_failed, Toast.LENGTH_SHORT).show(); Toast.makeText(activity, R.string.copy_link_failed, Toast.LENGTH_SHORT).show();
} }