This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "models": [ | |
| "viot.light.ebl40a" | |
| ], | |
| "cards": { | |
| "card_items": [ | |
| { | |
| "param_delta": 0, | |
| "cardType": 1, | |
| "prop_key": "spec.2.1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "models": [ | |
| "viot.fridge.u71" | |
| ], | |
| "cards": { | |
| "card_items": [ | |
| { | |
| "param_delta": 0, | |
| "cardType": 200, | |
| "prop_key": "spec.3.2", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "models": [ | |
| "viot.aircondition.sd24" | |
| ], | |
| "cards": { | |
| "card_items": [ | |
| { | |
| "param_delta": 0, | |
| "cardType": 1, | |
| "prop_key": "spec.2.1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author 林威 | |
| * @createdAt 2024/5/17 | |
| */ | |
| fun Window.translucentStatusBar(lightIcon: Boolean = true) { | |
| try {//添加Flag把状态栏设为可绘制模式 | |
| addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) | |
| //如果为全透明模式,取消设置Window半透明的Flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PackageManager pm = getApplicationContext().getPackageManager(); | |
| for(PackageInfo p : pm.getInstalledPackages(0)){ | |
| String label = p.applicationInfo.loadLabel(pm).toString(); // 应用的label | |
| Drawable icon = p.applicationInfo.loadIcon(pm); // 应用的icon图标 | |
| String version = p.versionName; // 应用的版本号 | |
| } | |
| PackageInfo 对应整个AndroidManifest.xml清单文件 | |
| PackageInfo.permissions 对应uses-permission列表 | |
| PackageInfo.activities 对应清单中声明的activity列表 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(); | |
| layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; // 窗体在应用窗体上面,在系统窗体下面 | |
| layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; // 不获取输入焦点,这样后面的应用窗体就可以进行输入了 | |
| layoutParams.format = PixelFormat.RGBA_8888; // 透明背景 | |
| /** | |
| * x,y和gravity需要结合使用来设置窗体的位置 | |
| * 指定gravity后,x和y表示窗体距离gravity的offset | |
| * gravity默认屏幕居中 | |
| */ | |
| layoutParams.gravity = Gravity.TOP | Gravity.LEFT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 读取联系人URI:ContactsContract.Contacts.CONTENT_URI | |
| 字段:ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME | |
| 联系人号码URI:ContactsContract.CommonDataKinds.Phone.CONTENT_URI | |
| 字段:ContactsContract.CommonDataKinds.Phone.NUMBER | |
| 查询条件:ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = <contact id>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //大图遍历字段 | |
| private static final String[] STORE_IMAGES = { | |
| MediaStore.Images.Media._ID, | |
| MediaStore.Images.Media.DATA, | |
| MediaStore.Images.Media.ORIENTATION | |
| }; | |
| //小图遍历字段 | |
| private static final String[] THUMBNAIL_STORE_IMAGE = { | |
| MediaStore.Images.Thumbnails._ID, | |
| MediaStore.Images.Thumbnails.DATA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 从本地相册里选一张相片 | |
| Intent intent = new Intent(Intent.ACTION_PICK); | |
| intent.setType("image/*");//相片类型 | |
| startActivityForResult(intent, REQUEST_CODE_PICK_IMAGE); | |
| // 从相机拍张相片 | |
| Intent getImageByCamera = new Intent("android.media.action.IMAGE_CAPTURE"); | |
| startActivityForResult(getImageByCamera, REQUEST_CODE_CAPTURE_CAMEIA); | |
| // 取得用户选的相片 |