Fix edit not clickable sometimes

(cherry picked from commit e3f0c4cdff)
This commit is contained in:
NekoInverter 2020-03-28 16:34:32 +08:00 committed by 世界
parent d55848e77a
commit b58a7bd7bb
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
1 changed files with 14 additions and 14 deletions

View File

@ -1993,22 +1993,22 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
nameTextView[a].setAlpha(a == 0 ? 0.0f : 1.0f);
if (a == 1) {
nameTextView[a].setScrollNonFitText(true);
}
nameTextView[a].setOnLongClickListener(v -> {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setItems(new CharSequence[]{LocaleController.getString("Copy", R.string.Copy)}, (dialogInterface, i) -> {
if (i == 0) {
try {
AndroidUtilities.addToClipboard(((SimpleTextView) v).getText());
Toast.makeText(getParentActivity(), LocaleController.getString("TextCopied", R.string.TextCopied), Toast.LENGTH_SHORT).show();
} catch (Exception e) {
FileLog.e(e);
nameTextView[a].setOnLongClickListener(v -> {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setItems(new CharSequence[]{LocaleController.getString("Copy", R.string.Copy)}, (dialogInterface, i) -> {
if (i == 0) {
try {
AndroidUtilities.addToClipboard(((SimpleTextView) v).getText());
Toast.makeText(getParentActivity(), LocaleController.getString("TextCopied", R.string.TextCopied), Toast.LENGTH_SHORT).show();
} catch (Exception e) {
FileLog.e(e);
}
}
}
});
showDialog(builder.create());
return false;
});
showDialog(builder.create());
return false;
});
}
frameLayout.addView(nameTextView[a], LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 118, 0, a == 0 ? 48 : 0, 0));
}
for (int a = 0; a < onlineTextView.length; a++) {