Android12/13 解决WiFi输入框被遮挡问题

/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/wifi/

WifiConfigController2.java

public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
int mode) {
mConfigUi = parent;
mView = view;
mWifiEntry = wifiEntry;
mContext = mConfigUi.getContext();

// Init Wi-Fi manager
mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
initWifiConfigController2(wifiEntry, mode);
//*/ 20230508,solve inputmethod popup causing Edit Error && Cast Exception 1
(scanForActivity(mContext)).getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
//*/

}
//*/2023058,solve inputmethod popup cause Edit Error && Cast Exception 2
private static Activity scanForActivity(Context cont) {

if (cont == null)
return null;
else if (cont instanceof Activity)
return (Activity)cont;
else if (cont instanceof ContextWrapper)
return scanForActivity(((ContextWrapper)cont).getBaseContext());
return null;
}
//*/
@VisibleForTesting
public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
int mode, WifiManager wifiManager) {
mConfigUi = parent;

mView = view;
mWifiEntry = wifiEntry;
mContext = mConfigUi.getContext();
mWifiManager = wifiManager;
initWifiConfigController2(wifiEntry, mode);
}

相关推荐
Maynor9968 分钟前
AI Coding 零基础实战教程|第五部分:完整项目案例实操
java·前端·人工智能·claude code·ai coding
生戎马25 分钟前
Tomcat Container容器之Engine:StandardEngine _
java·tomcat
zhangjw3439 分钟前
第29篇:Java伪共享与对象分配:并发性能优化的关键
java·开发语言·性能优化
宠友信息1 小时前
内容社区源码多端数据协议与 Spring Boot 状态流转实现思路
java·spring boot·websocket·uni-app
玩机达人881 小时前
一加12/Ace5/Ace3pro手机ColorOS16降级回锁BL熔断变黑砖怎么办
android·智能手机·电脑
一路向北North2 小时前
Spring Security OAuth2.0(19):JWT令牌
java·后端·spring
玛卡巴卡ldf2 小时前
【LeetCode 手撕算法】(细节知识点总结)
java·数据结构·算法·leetcode·力扣
Digitally2 小时前
使用 USB 数据线将文件从安卓设备传输到电脑
android·电脑
一叶飘零_sweeeet2 小时前
IDEA 插件 Trae AI 最新全攻略(基于 TRAE AI: Coding Assistant 1.7.0.0)
java·intellij-idea·trae
KobeSacre2 小时前
CyclicBarrier 源码
java·jvm·算法