fix: edit proxy info

This commit is contained in:
luvletter2333 2023-01-21 18:16:49 +08:00
parent 7ef3a53a2f
commit 12bbf436a1
No known key found for this signature in database
GPG Key ID: A26A8880836E1978
1 changed files with 22 additions and 1 deletions

View File

@ -207,7 +207,28 @@ public class ProxyListActivity extends BaseFragment implements NotificationCente
checkImageView.setScaleType(ImageView.ScaleType.CENTER);
checkImageView.setContentDescription(LocaleController.getString("Edit", R.string.Edit));
addView(checkImageView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP, 8, 8, 8, 0));
checkImageView.setOnClickListener(v -> presentFragment(new ProxySettingsActivity(currentInfo)));
checkImageView.setOnClickListener(v -> {
SharedConfig.ProxyInfo info = currentInfo;
if (info instanceof SharedConfig.VmessProxy) {
if (((SharedConfig.VmessProxy) info).bean.getConfigType() == V2RayConfig.EConfigType.Trojan) {
presentFragment(new TrojanSettingsActivity((SharedConfig.VmessProxy) info));
} else {
presentFragment(new VmessSettingsActivity((SharedConfig.VmessProxy) info));
}
} else if (info instanceof SharedConfig.ShadowsocksProxy) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
presentFragment(new ShadowsocksSettingsActivity((SharedConfig.ShadowsocksProxy) info));
}
} else if (info instanceof SharedConfig.ShadowsocksRProxy) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
presentFragment(new ShadowsocksRSettingsActivity((SharedConfig.ShadowsocksRProxy) info));
}
} else if (info instanceof SharedConfig.WsProxy) {
presentFragment(new WsSettingsActivity((SharedConfig.WsProxy) info));
} else {
presentFragment(new ProxySettingsActivity(info));
}
});
checkBox = new CheckBox2(context, 21);
checkBox.setColor(Theme.key_radioBackground, Theme.key_radioBackground, Theme.key_checkboxCheck);