mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2024-11-23 03:05:29 +01:00
fix more button in ProfileActivity
This commit is contained in:
parent
85688e84af
commit
8673b032af
@ -49,6 +49,7 @@ import org.telegram.messenger.LocaleController;
|
||||
import org.telegram.messenger.MessageObject;
|
||||
import org.telegram.messenger.R;
|
||||
import org.telegram.messenger.browser.Browser;
|
||||
import org.telegram.tgnet.TLRPC;
|
||||
import org.telegram.ui.ActionBar.BaseFragment;
|
||||
import org.telegram.ui.ActionBar.Theme;
|
||||
import org.telegram.ui.Components.AlertsCreator;
|
||||
@ -63,6 +64,8 @@ import org.telegram.ui.Components.URLSpanNoUnderline;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import kotlin.Unit;
|
||||
import tw.nekomimi.nekogram.NekoConfig;
|
||||
import tw.nekomimi.nekogram.parts.DialogTransKt;
|
||||
import tw.nekomimi.nekogram.ui.BottomBuilder;
|
||||
|
||||
public class AboutLinkCell extends FrameLayout {
|
||||
@ -385,9 +388,11 @@ public class AboutLinkCell extends FrameLayout {
|
||||
url = pressedLink.getSpan().toString();
|
||||
}
|
||||
|
||||
try {
|
||||
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
||||
} catch (Exception ignore) {}
|
||||
if (!NekoConfig.disableVibration.Bool()) {
|
||||
try {
|
||||
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
|
||||
} catch (Exception ignore) {}
|
||||
}
|
||||
|
||||
ClickableSpan pressedLinkFinal = (ClickableSpan) pressedLink.getSpan();
|
||||
BottomBuilder builder = new BottomBuilder(parentFragment.getParentActivity());
|
||||
|
@ -3308,45 +3308,6 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
if (userInfo != null) {
|
||||
presentFragment(new ChangeBioActivity());
|
||||
}
|
||||
} else if (position == channelInfoRow || position == userInfoRow || position == locationRow) {
|
||||
BottomBuilder builder = new BottomBuilder(getParentActivity());
|
||||
builder.addItem(LocaleController.getString("Copy", R.string.Copy), R.drawable.baseline_content_copy_24, __ -> {
|
||||
try {
|
||||
String about;
|
||||
if (position == locationRow) {
|
||||
about = chatInfo != null && chatInfo.location instanceof TLRPC.TL_channelLocation ? ((TLRPC.TL_channelLocation) chatInfo.location).address : null;
|
||||
} else if (position == channelInfoRow) {
|
||||
about = chatInfo != null ? chatInfo.about : null;
|
||||
} else {
|
||||
about = userInfo != null ? userInfo.about : null;
|
||||
}
|
||||
if (!TextUtils.isEmpty(about)) {
|
||||
AlertUtil.copyAndAlert(about);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
builder.addItem(LocaleController.getString("Translate", R.string.Translate), R.drawable.ic_translate, __ -> {
|
||||
try {
|
||||
String about;
|
||||
if (position == locationRow) {
|
||||
about = chatInfo != null && chatInfo.location instanceof TLRPC.TL_channelLocation ? ((TLRPC.TL_channelLocation) chatInfo.location).address : null;
|
||||
} else if (position == channelInfoRow) {
|
||||
about = chatInfo != null ? chatInfo.about : null;
|
||||
} else {
|
||||
about = userInfo != null ? userInfo.about : null;
|
||||
}
|
||||
if (!TextUtils.isEmpty(about)) {
|
||||
DialogTransKt.startTrans(getParentActivity(), about);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
});
|
||||
builder.show();
|
||||
} else if (position == numberRow) {
|
||||
TLRPC.User user = UserConfig.getInstance(currentAccount).getCurrentUser();
|
||||
String number;
|
||||
@ -8818,7 +8779,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
aboutLinkCell.setTextAndValue(LocaleController.getString("UserBioDetail", R.string.UserBioDetail), LocaleController.getString("UserBio", R.string.UserBio), false);
|
||||
currentBio = null;
|
||||
}
|
||||
// aboutLinkCell.setMoreButtonDisabled(true);
|
||||
aboutLinkCell.setMoreButtonDisabled(true);
|
||||
}
|
||||
break;
|
||||
case VIEW_TYPE_PREMIUM_TEXT_CELL:
|
||||
|
Loading…
Reference in New Issue
Block a user