Android initialExpandedChildrenCount高级菜单折叠项或铺展折叠项

/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/system_dashboard_fragment.xml

<PreferenceScreen

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:settings="http://schemas.android.com/apk/res-auto"

android:key="system_dashboard_screen"

android:title="@string/header_category_system"

settings:initialExpandedChildrenCount="4">

意思是,超过4个菜单则折叠隐藏起来,否则没超过直接平铺展开显示!

@Override

public void onCreate(Bundle icicle) {

super.onCreate(icicle);

final PreferenceScreen screen = getPreferenceScreen();
// We do not want to display an advanced button if only one setting is hidden
if (getVisiblePreferenceCount(screen) == screen.getInitialExpandedChildrenCount() + 1) {
screen.setInitialExpandedChildrenCount(Integer.MAX_VALUE);
}

}

相关推荐
weixin_394758036 小时前
CRMEB Pro 优惠券:下单怎么核销,取消/退款怎么返券
android
alexhilton8 小时前
Android 17 内存预算成为必修课
android·kotlin·android jetpack
AI2中文网10 小时前
App Inventor 对接 OneNet:手机收数据
android·鸿蒙·app inventor
好的佩奇10 小时前
Dart 之文件读写
android·flutter·dart
砚底藏山河12 小时前
量化行情横截面中性化闭式与回归实现
android·java·python·金融·kotlin
明君68912 小时前
APK 签名绕过方案(Android 10~17)
android
芝麻别开门13 小时前
Android libmpv 源码下载与编译
android·mpv·libmpv
FLJwu13 小时前
运动相机代工模具风控③:试模样品、结构公差、装配干涉,提前规避大货装配不良
android·开发语言·数码相机·运动相机·oem 量产
应用市场14 小时前
安卓底层拆解(四)· 属性要成套:abilist 与 zygote 的连锁反应
android·zygote
齊家治國平天下14 小时前
Android Automotive(AAOS)系统入门:从五层架构到车载机制
android·架构·车载系统·aaos·智能座舱