version:3.6
fix:去点腾讯推送 update:去掉系统节点
@@ -1,5 +1,4 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: "com.tencent.android.tpns"
|
||||
|
||||
def appName() {
|
||||
return "AIOS系统"
|
||||
@@ -16,8 +15,8 @@ android {
|
||||
applicationId "com.uiuios.aios"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 26
|
||||
versionName "3.5"
|
||||
versionCode 27
|
||||
versionName "3.6"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -49,6 +48,14 @@ android {
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
tuixin {
|
||||
storeFile file("keystore/tuixin.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "universal"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
zhanRui {
|
||||
storeFile file("keystore/zhanxun.keystore")
|
||||
storePassword "123456"
|
||||
@@ -95,41 +102,41 @@ android {
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
MTK8183Debug.initWith(debug)
|
||||
MTK8183Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.MTK8183
|
||||
}
|
||||
|
||||
MTK8183Release.initWith(release)
|
||||
MTK8183Release {
|
||||
signingConfig signingConfigs.MTK8183
|
||||
}
|
||||
|
||||
G10PDebug.initWith(debug)
|
||||
G10PDebug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.G10P
|
||||
}
|
||||
|
||||
G10PRelease.initWith(release)
|
||||
G10PRelease {
|
||||
signingConfig signingConfigs.G10P
|
||||
}
|
||||
|
||||
zhanRuiRelease.initWith(release)
|
||||
zhanRuiRelease {
|
||||
signingConfig signingConfigs.zhanRui
|
||||
}
|
||||
|
||||
zhanRuiDebug.initWith(debug)
|
||||
zhanRuiDebug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.zhanRui
|
||||
}
|
||||
// MTK8183Debug.initWith(debug)
|
||||
// MTK8183Debug {
|
||||
// versionNameSuffix "-debug"
|
||||
// debuggable true
|
||||
// signingConfig signingConfigs.MTK8183
|
||||
// }
|
||||
//
|
||||
// MTK8183Release.initWith(release)
|
||||
// MTK8183Release {
|
||||
// signingConfig signingConfigs.MTK8183
|
||||
// }
|
||||
//
|
||||
// G10PDebug.initWith(debug)
|
||||
// G10PDebug {
|
||||
// versionNameSuffix "-debug"
|
||||
// debuggable true
|
||||
// signingConfig signingConfigs.G10P
|
||||
// }
|
||||
//
|
||||
// G10PRelease.initWith(release)
|
||||
// G10PRelease {
|
||||
// signingConfig signingConfigs.G10P
|
||||
// }
|
||||
//
|
||||
// zhanRuiRelease.initWith(release)
|
||||
// zhanRuiRelease {
|
||||
// signingConfig signingConfigs.zhanRui
|
||||
// }
|
||||
//
|
||||
// zhanRuiDebug.initWith(debug)
|
||||
// zhanRuiDebug {
|
||||
// versionNameSuffix "-debug"
|
||||
// debuggable true
|
||||
// signingConfig signingConfigs.zhanRui
|
||||
// }
|
||||
|
||||
debug {
|
||||
// 显示Log
|
||||
@@ -137,7 +144,7 @@ android {
|
||||
minifyEnabled false
|
||||
//Zipalign优化
|
||||
zipAlignEnabled true
|
||||
signingConfig signingConfigs.mtk
|
||||
signingConfig signingConfigs.tuixin
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
if (outputFile != null) {
|
||||
@@ -157,7 +164,7 @@ android {
|
||||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.mtk
|
||||
signingConfig signingConfigs.tuixin
|
||||
// 将release版本的包名重命名,加上版本及日期
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
@@ -174,9 +181,10 @@ android {
|
||||
|
||||
dependencies {
|
||||
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compileOnly files('libs/framework.jar')
|
||||
// compileOnly files('libs/framework.jar')
|
||||
implementation files('libs/QWeather_Public_Android_V4.9.jar')
|
||||
implementation project(path: ':niceimageview')
|
||||
implementation project(path: ':verification-view')
|
||||
|
||||
//保持1.3.1 更新会报错
|
||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||
@@ -230,8 +238,6 @@ dependencies {
|
||||
// implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.1.8'
|
||||
//MMKV
|
||||
implementation 'com.tencent:mmkv-static:1.2.14'
|
||||
//腾讯移动推送 TPNS
|
||||
implementation 'com.tencent.tpns:tpns:1.3.8.0-release'
|
||||
//阿里云推送
|
||||
implementation 'com.aliyun.ams:alicloud-android-push:3.8.0'
|
||||
//状态栏透明
|
||||
@@ -255,6 +261,8 @@ dependencies {
|
||||
// implementation 'com.jacktuotuo.customview:verificationcodeview:1.0.5'
|
||||
implementation 'com.contrarywind:Android-PickerView:4.1.9'
|
||||
implementation 'com.github.ForgetAll:LoadingDialog:v1.1.2'
|
||||
//动态权限框架
|
||||
implementation 'com.github.getActivity:XXPermissions:16.6'
|
||||
}
|
||||
|
||||
preBuild {
|
||||
|
||||
BIN
app/keystore/tuixin.jks
Normal file
@@ -1,10 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.uiuios.aios"
|
||||
android:sharedUserId="android.uid.system">
|
||||
package="com.uiuios.aios">
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<!-- 清单文件中, 申明监听通话精确状态权限,该权限需要android:sharedUserId="android.uid.system" -->
|
||||
<uses-permission android:name="android.permission.READ_PRECISE_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
|
||||
@@ -43,15 +41,8 @@
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<!-- 允许读设备等信息,用于问题排查 -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS SDK VIP版本所需权限 -->
|
||||
<permission
|
||||
android:name="${applicationId}.permission.XGPUSH_RECEIVE"
|
||||
android:protectionLevel="signature" />
|
||||
|
||||
<uses-permission android:name="${applicationId}.permission.XGPUSH_RECEIVE" />
|
||||
<!-- 【必须】 移动推送 TPNS SDK 所需权限 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
@@ -74,15 +65,6 @@
|
||||
android:restoreAnyVersion="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".activity.ControlActivity" />
|
||||
<activity android:name=".activity.QuickAppActivity" />
|
||||
<activity android:name=".activity.SpikeListActivity" />
|
||||
<activity android:name=".activity.InfoListActivity" />
|
||||
<activity android:name=".activity.ArticleActivity" />
|
||||
<activity
|
||||
android:name=".activity.DetailsActivity"
|
||||
android:screenOrientation="userPortrait"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name=".activity.main.MainActivity"
|
||||
android:clearTaskOnLaunch="true"
|
||||
@@ -91,7 +73,6 @@
|
||||
android:launchMode="singleTask"
|
||||
android:resizeableActivity="true"
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="userLandscape"
|
||||
android:stateNotNeeded="true"
|
||||
android:taskAffinity="com.example.taskaffinity.newtask"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
@@ -105,6 +86,15 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activity.ControlActivity" />
|
||||
<activity android:name=".activity.QuickAppActivity" />
|
||||
<activity android:name=".activity.SpikeListActivity" />
|
||||
<activity android:name=".activity.InfoListActivity" />
|
||||
<activity android:name=".activity.ArticleActivity" />
|
||||
<activity
|
||||
android:name=".activity.DetailsActivity"
|
||||
android:screenOrientation="userPortrait"
|
||||
android:theme="@style/AppTheme" />
|
||||
<activity
|
||||
android:name=".activity.contact.AddContactActivity"
|
||||
android:launchMode="singleTask"
|
||||
@@ -160,6 +150,11 @@
|
||||
android:name=".activity.alarm.AlarmClockEditActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="userPortrait" />
|
||||
<activity
|
||||
android:name=".activity.ScreenLockActivity"
|
||||
android:configChanges="keyboardHidden"
|
||||
android:launchMode="singleTask" />
|
||||
|
||||
<receiver
|
||||
android:name=".receiver.BootReceiver"
|
||||
android:enabled="true"
|
||||
@@ -208,7 +203,7 @@
|
||||
</service>
|
||||
|
||||
<receiver
|
||||
android:name="com.uiuios.aios.push.alipush.AliyunMessageReceiver"
|
||||
android:name=".push.alipush.AliyunMessageReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
||||
@@ -221,149 +216,6 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name="com.uiuios.aios.push.alipush.AliMessageIntentService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS 默认通知 -->
|
||||
<activity
|
||||
android:name="com.tencent.android.tpush.TpnsActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<intent-filter>
|
||||
<action android:name="${applicationId}.OPEN_TPNS_ACTIVITY" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<data
|
||||
android:host="com.uiuios.aios"
|
||||
android:scheme="tpns" />
|
||||
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.tencent.android.tpush.InnerTpnsActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleInstance"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<intent-filter>
|
||||
<action android:name="${applicationId}.OPEN_TPNS_ACTIVITY_V2" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<data
|
||||
android:host="com.uiuios.aios"
|
||||
android:scheme="stpns" />
|
||||
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- 【必须】 信鸽receiver广播接收 -->
|
||||
<receiver
|
||||
android:name="com.tencent.android.tpush.XGPushReceiver"
|
||||
android:exported="false"
|
||||
android:process=":xg_vip_service">
|
||||
<intent-filter android:priority="0x7fffffff">
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS SDK的内部广播 -->
|
||||
<action android:name="com.tencent.android.xg.vip.action.SDK" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
|
||||
|
||||
<!-- 【可选】 系统广播:网络切换 -->
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
|
||||
<!-- 【可选】 系统广播:开屏 -->
|
||||
<action android:name="android.intent.action.USER_PRESENT" />
|
||||
|
||||
<!-- 【必须】 信鸽SDK的内部广播 -->
|
||||
<action android:name="com.tencent.android.xg.vip.action.SDK" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- 【必须】移动推送 TPNS service -->
|
||||
<service
|
||||
android:name="com.tencent.android.tpush.service.XGVipPushService"
|
||||
android:persistent="true"
|
||||
android:process=":xg_vip_service" />
|
||||
<!-- 【必须】通知 service ,android:name 部分改为包名.XGVIP_PUSH_ACTION -->
|
||||
<service
|
||||
android:name="com.tencent.android.tpush.rpc.XGRemoteService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
|
||||
<!-- 【必须】请修改为当前APP名包.XGVIP_PUSH_ACTION -->
|
||||
<action android:name="${applicationId}.XGVIP_PUSH_ACTION" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- 【必须】【注意】authorities 修改为包名.XGVIP_PUSH_AUTH -->
|
||||
<provider
|
||||
android:name="com.tencent.android.tpush.XGPushProvider"
|
||||
android:authorities="${applicationId}.XGVIP_PUSH_AUTH" />
|
||||
<!-- 【必须】【注意】authorities 修改为包名.TPUSH_PROVIDER -->
|
||||
<provider
|
||||
android:name="com.tencent.android.tpush.SettingsContentProvider"
|
||||
android:authorities="${applicationId}.TPUSH_PROVIDER" />
|
||||
<!-- 【可选】用于增强保活能力 -->
|
||||
<provider
|
||||
android:name="com.tencent.android.tpush.XGVipPushKAProvider"
|
||||
android:authorities="${applicationId}.AUTH_XGPUSH_KEEPALIVE"
|
||||
android:exported="true"
|
||||
tools:replace="android:exported" />
|
||||
<!-- 【可选】APP实现的Receiver,用于接收消息透传和操作结果的回调,请根据需要添加 -->
|
||||
|
||||
<!-- YOUR_PACKAGE_PATH.CustomPushReceiver需要改为自己的Receiver: -->
|
||||
<receiver android:name=".push.tpush.MessageReceiver">
|
||||
<intent-filter>
|
||||
|
||||
<!-- 接收消息透传 -->
|
||||
<action android:name="com.tencent.android.xg.vip.action.PUSH_MESSAGE" />
|
||||
<!-- 监听注册、反注册、设置/删除标签、通知被点击等处理结果 -->
|
||||
<action android:name="com.tencent.android.xg.vip.action.FEEDBACK" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- MQTT START -->
|
||||
<service
|
||||
android:name="com.tencent.tpns.mqttchannel.services.MqttService"
|
||||
android:exported="false"
|
||||
android:process=":xg_vip_service" />
|
||||
|
||||
<provider
|
||||
android:name="com.tencent.tpns.baseapi.base.SettingsContentProvider"
|
||||
android:authorities="${applicationId}.XG_SETTINGS_PROVIDER"
|
||||
android:exported="false" />
|
||||
<!-- MQTT END -->
|
||||
|
||||
<!-- 【必须】 请修改为 APP 的 AccessId,“15”开头的10位数字,中间没空格 -->
|
||||
<meta-data
|
||||
android:name="XG_V2_ACCESS_ID"
|
||||
|
||||
@@ -11,21 +11,21 @@ interface IGetInfoInterface {
|
||||
void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
|
||||
double aDouble, String aString);
|
||||
|
||||
//获取sn
|
||||
/*获取sn*/
|
||||
String getSerial();
|
||||
//获取用户信息
|
||||
String getUserInfo();
|
||||
//获取隐藏APP
|
||||
List<String> getHideAPP();
|
||||
//获取禁止打开的APP
|
||||
List<String> getForbidAPP();
|
||||
|
||||
//获取app设置
|
||||
String getAppTimeControl();
|
||||
//获取整机设置
|
||||
String getSnTimeControl();
|
||||
//获取系统设置
|
||||
String getSetting();
|
||||
//获取定位结果
|
||||
/*获取定位结果*/
|
||||
String getMapResult();
|
||||
}
|
||||
/*获取WiFi名*/
|
||||
String getWifiSsid();
|
||||
/*获取蓝牙名*/
|
||||
String getBluetoothSsid();
|
||||
/*写入系统数据库*/
|
||||
boolean SystemPutInt(String name, int value);
|
||||
/*结束进程*/
|
||||
void killBackgroundProcesses(String pkg);
|
||||
/*设置launcher3为默认*/
|
||||
void openLauncher3();
|
||||
/*设置默认桌面*/
|
||||
void setDefaultDesktop(String pkgName, String className);
|
||||
|
||||
}
|
||||
@@ -59,18 +59,11 @@ public class ControlActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.iv_back)
|
||||
ImageView iv_back;
|
||||
|
||||
@BindView(R.id.tv_wifi)
|
||||
TextView tv_wifi;
|
||||
@BindView(R.id.tv_wifi_ssid)
|
||||
TextView tv_wifi_ssid;
|
||||
@BindView(R.id.tv_bt)
|
||||
TextView tv_bt;
|
||||
@BindView(R.id.tv_bt_ssid)
|
||||
TextView tv_bt_ssid;
|
||||
|
||||
// @BindView(R.id.tv_font_size)
|
||||
// TextView tv_font_size;
|
||||
@BindView(R.id.seekBar)
|
||||
RulerSeekBar seekBar;
|
||||
@BindView(R.id.seekbar_brightness)
|
||||
@@ -80,21 +73,14 @@ public class ControlActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.tv_sound)
|
||||
TextView tv_sound;
|
||||
|
||||
@BindView(R.id.tv_battery)
|
||||
TextView tv_battery;
|
||||
@BindView(R.id.tv_electricity)
|
||||
TextView tv_electricity;
|
||||
@BindView(R.id.tv_flashlight)
|
||||
TextView tv_flashlight;
|
||||
@BindView(R.id.tv_flashlight_switch)
|
||||
TextView tv_flashlight_switch;
|
||||
|
||||
@BindView(R.id.tv_brightness)
|
||||
TextView tv_brightness;
|
||||
@BindView(R.id.tv_location)
|
||||
TextView tv_location;
|
||||
|
||||
@BindView(R.id.cl_wifi)
|
||||
ConstraintLayout cl_wifi;
|
||||
@BindView(R.id.cl_bt)
|
||||
@@ -153,6 +139,12 @@ public class ControlActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
});
|
||||
cl_battery.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(Settings.ACTION_BATTERY_SAVER_SETTINGS));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -164,15 +156,15 @@ public class ControlActivity extends BaseActivity {
|
||||
cl_wifi.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
|
||||
startActivity(new Intent(ControlActivity.this, WiFiManagerActivity.class));
|
||||
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
|
||||
// startActivity(new Intent(ControlActivity.this, WiFiManagerActivity.class));
|
||||
}
|
||||
});
|
||||
if (isWifiEnabled()) {
|
||||
tv_wifi_ssid.setText(getConnectWifiSsid());
|
||||
// tv_wifi_ssid.setText(getConnectWifiSsid());
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
} else {
|
||||
tv_wifi_ssid.setText("未连接");
|
||||
// tv_wifi_ssid.setText("未连接");
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
}
|
||||
}
|
||||
@@ -205,8 +197,6 @@ public class ControlActivity extends BaseActivity {
|
||||
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.NETWORK_IDS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
|
||||
filter.addAction(WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
|
||||
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
registerReceiver(mWifiReceiver, filter);
|
||||
@@ -226,14 +216,14 @@ public class ControlActivity extends BaseActivity {
|
||||
NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
|
||||
if (info.getState().equals(NetworkInfo.State.DISCONNECTED)) {
|
||||
Log.e(TAG, "wifi断开");
|
||||
tv_wifi_ssid.setText("未连接");
|
||||
// tv_wifi_ssid.setText("未连接");
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
} else if (info.getState().equals(NetworkInfo.State.CONNECTED)) {
|
||||
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//获取当前wifi名称
|
||||
String newSSID = wifiInfo.getSSID();
|
||||
tv_wifi_ssid.setText(newSSID.replaceAll("\"", ""));
|
||||
// tv_wifi_ssid.setText(getConnectWifiSsid());
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
}
|
||||
break;
|
||||
@@ -242,7 +232,7 @@ public class ControlActivity extends BaseActivity {
|
||||
int wifistate = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED);
|
||||
if (wifistate == WifiManager.WIFI_STATE_DISABLED) {
|
||||
Log.e(TAG, "系统关闭wifi");
|
||||
tv_wifi_ssid.setText("关");
|
||||
// tv_wifi_ssid.setText("关");
|
||||
cl_wifi.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
} else if (wifistate == WifiManager.WIFI_STATE_ENABLED) {
|
||||
Log.e(TAG, "系统开启wifi");
|
||||
@@ -271,17 +261,17 @@ public class ControlActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private String getConnectWifiSsid() {
|
||||
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
// //去掉带引号的字符串方法一
|
||||
// String wifiInfo1 = wifiInfo.getSSID();
|
||||
// if (wifiInfo1.contains("\"")) {
|
||||
// wifiInfo1 = wifiInfo1.substring(1, wifiInfo1.length() - 1);
|
||||
// }
|
||||
//去掉带引号的字符串方法二
|
||||
String wifiSSID = wifiInfo.getSSID();
|
||||
String wifiInfo1 = wifiSSID.replaceAll("\"", "");
|
||||
return wifiInfo1;
|
||||
// WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
|
||||
// WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//// //去掉带引号的字符串方法一
|
||||
//// String wifiInfo1 = wifiInfo.getSSID();
|
||||
//// if (wifiInfo1.contains("\"")) {
|
||||
//// wifiInfo1 = wifiInfo1.substring(1, wifiInfo1.length() - 1);
|
||||
//// }
|
||||
////去掉带引号的字符串方法二
|
||||
// String wifiSSID = wifiInfo.getSSID();
|
||||
// String wifiInfo1 = wifiSSID.replaceAll("\"", "");
|
||||
return RemoteManager.getInstance().getConnectWifiSsid();
|
||||
}
|
||||
|
||||
private BluetoothAdapter bluetoothAdapter;
|
||||
@@ -289,16 +279,16 @@ public class ControlActivity extends BaseActivity {
|
||||
private void getBluetooth() {
|
||||
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (bluetoothAdapter.isEnabled()) {
|
||||
if (isConnected()) {
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
tv_bt_ssid.setText(getBluetoothDeviceName());
|
||||
} else {
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
tv_bt_ssid.setText("未连接");
|
||||
}
|
||||
// if (isConnected()) {
|
||||
// cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
// tv_bt_ssid.setText(getBluetoothDeviceName());
|
||||
// } else {
|
||||
// cl_bt.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
// tv_bt_ssid.setText("未连接");
|
||||
// }
|
||||
} else {
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
tv_bt_ssid.setText("已关闭");
|
||||
// tv_bt_ssid.setText("已关闭");
|
||||
}
|
||||
getConnectedDevicesV1();
|
||||
cl_bt.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -309,31 +299,31 @@ public class ControlActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
Set<BluetoothDevice> bondedDevices = bluetoothAdapter.getBondedDevices();
|
||||
List<BluetoothDevice> deviceList = bondedDevices.stream().filter(new Predicate<BluetoothDevice>() {
|
||||
@Override
|
||||
public boolean test(BluetoothDevice bluetoothDevice) {
|
||||
return bluetoothDevice.isConnected();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
return deviceList.size() > 0;
|
||||
}
|
||||
// public boolean isConnected() {
|
||||
// Set<BluetoothDevice> bondedDevices = bluetoothAdapter.getBondedDevices();
|
||||
// List<BluetoothDevice> deviceList = bondedDevices.stream().filter(new Predicate<BluetoothDevice>() {
|
||||
// @Override
|
||||
// public boolean test(BluetoothDevice bluetoothDevice) {
|
||||
// return bluetoothDevice.isConnected();
|
||||
// }
|
||||
// }).collect(Collectors.toList());
|
||||
// return deviceList.size() > 0;
|
||||
// }
|
||||
|
||||
public String getBluetoothDeviceName() {
|
||||
Set<BluetoothDevice> bondedDevices = bluetoothAdapter.getBondedDevices();
|
||||
List<BluetoothDevice> deviceList = bondedDevices.stream().filter(new Predicate<BluetoothDevice>() {
|
||||
@Override
|
||||
public boolean test(BluetoothDevice bluetoothDevice) {
|
||||
return bluetoothDevice.isConnected();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
if (deviceList.size() == 0) {
|
||||
return "未连接";
|
||||
} else {
|
||||
return deviceList.get(0).getName();
|
||||
}
|
||||
}
|
||||
// public String getBluetoothDeviceName() {
|
||||
// Set<BluetoothDevice> bondedDevices = bluetoothAdapter.getBondedDevices();
|
||||
// List<BluetoothDevice> deviceList = bondedDevices.stream().filter(new Predicate<BluetoothDevice>() {
|
||||
// @Override
|
||||
// public boolean test(BluetoothDevice bluetoothDevice) {
|
||||
// return bluetoothDevice.isConnected();
|
||||
// }
|
||||
// }).collect(Collectors.toList());
|
||||
// if (deviceList.size() == 0) {
|
||||
// return "未连接";
|
||||
// } else {
|
||||
// return deviceList.get(0).getName();
|
||||
// }
|
||||
// }
|
||||
|
||||
//TODO 根据mac地址判断是否已连接(这里参数可以直接用BluetoothDevice对象)
|
||||
//但这么写其实更通用。
|
||||
@@ -437,30 +427,30 @@ public class ControlActivity extends BaseActivity {
|
||||
int blueState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, 0);
|
||||
switch (blueState) {
|
||||
case BluetoothAdapter.STATE_TURNING_ON:
|
||||
tv_bt_ssid.setText("正在打开");
|
||||
// tv_bt_ssid.setText("正在打开");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothAdapter.STATE_ON:
|
||||
tv_bt_ssid.setText("已打开");
|
||||
// tv_bt_ssid.setText("已打开");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothAdapter.STATE_TURNING_OFF:
|
||||
tv_bt_ssid.setText("正在关闭");
|
||||
// tv_bt_ssid.setText("正在关闭");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothAdapter.STATE_OFF:
|
||||
tv_bt_ssid.setText("已关闭");
|
||||
// tv_bt_ssid.setText("已关闭");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
break;
|
||||
case BluetoothDevice.ACTION_ACL_CONNECTED:
|
||||
tv_bt_ssid.setText(getBluetoothDeviceName());
|
||||
// tv_bt_ssid.setText(getBluetoothDeviceName());
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
break;
|
||||
case BluetoothDevice.ACTION_ACL_DISCONNECTED:
|
||||
tv_bt_ssid.setText("未连接");
|
||||
// tv_bt_ssid.setText("未连接");
|
||||
cl_bt.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
break;
|
||||
default:
|
||||
@@ -471,7 +461,7 @@ public class ControlActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void getBattery() {
|
||||
tv_electricity.setText(getBatteryCapacity() + "%");
|
||||
// tv_electricity.setText(getBatteryCapacity() + "%");
|
||||
if (isBatteryCharging()) {
|
||||
cl_battery.setBackground(getDrawable(R.drawable.control_background_item));
|
||||
} else {
|
||||
@@ -523,7 +513,7 @@ public class ControlActivity extends BaseActivity {
|
||||
filter.addAction(Intent.ACTION_POWER_CONNECTED);
|
||||
filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
|
||||
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
|
||||
filter.addAction(Intent.ACTION_BATTERY_LEVEL_CHANGED);
|
||||
// filter.addAction(Intent.ACTION_BATTERY_LEVEL_CHANGED);
|
||||
filter.addAction(Intent.ACTION_BATTERY_LOW);
|
||||
filter.addAction(Intent.ACTION_BATTERY_OKAY);
|
||||
registerReceiver(mBatteryReceiver, filter);
|
||||
@@ -546,9 +536,9 @@ public class ControlActivity extends BaseActivity {
|
||||
case Intent.ACTION_POWER_DISCONNECTED:
|
||||
cl_battery.setBackground(getDrawable(R.drawable.control_background_item_dis));
|
||||
break;
|
||||
case Intent.ACTION_BATTERY_LEVEL_CHANGED:
|
||||
tv_electricity.setText(getBatteryCapacity() + "%");
|
||||
break;
|
||||
// case Intent.ACTION_BATTERY_LEVEL_CHANGED:
|
||||
// tv_electricity.setText(getBatteryCapacity() + "%");
|
||||
// break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -707,9 +697,9 @@ public class ControlActivity extends BaseActivity {
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isFlashlightEnabled() {
|
||||
return Settings.Secure.getInt(crv, Settings.Secure.FLASHLIGHT_ENABLED, 0) == 1;
|
||||
}
|
||||
// private boolean isFlashlightEnabled() {
|
||||
// return Settings.Secure.getInt(crv, Settings.Secure.FLASHLIGHT_ENABLED, 0) == 1;
|
||||
// }
|
||||
|
||||
private void getFontSize() {
|
||||
float fontScale = Settings.System.getFloat(crv, Settings.System.FONT_SCALE, 0.0f);
|
||||
@@ -775,7 +765,7 @@ public class ControlActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
|
||||
Log.e(TAG, "onProgressChanged: i = " + i);
|
||||
Settings.System.putInt(crv, Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
RemoteManager.getInstance().putSystemInt(Settings.System.SCREEN_BRIGHTNESS, i);
|
||||
int gamma = BrightnessUtils.convertLinearToGamma(i, 1, 255);
|
||||
Log.e(TAG, "onProgressChanged: gamma = " + gamma);
|
||||
long percentage = Math.round((((double) gamma / 65535) * 100f));
|
||||
|
||||
@@ -167,7 +167,7 @@ public class EmergencyActivity extends AppCompatActivity {
|
||||
if (phoneListSet == null || phoneListSet.size() == 0) {
|
||||
return;
|
||||
}
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Intent intent1 = new Intent(Intent.ACTION_CALL);
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.uiuios.aios.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.SoundPool;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.tuo.customview.VerificationCodeView;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.base.BaseActivity;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class ScreenLockActivity extends BaseActivity {
|
||||
|
||||
private static final String TAG = ScreenLockActivity.class.getSimpleName();
|
||||
|
||||
|
||||
@BindView(R.id.iv_back)
|
||||
ImageView iv_back;
|
||||
@BindView(R.id.bt_0)
|
||||
TextView bt0;
|
||||
@BindView(R.id.bt_1)
|
||||
TextView bt1;
|
||||
@BindView(R.id.bt_2)
|
||||
TextView bt2;
|
||||
@BindView(R.id.bt_3)
|
||||
TextView bt3;
|
||||
@BindView(R.id.bt_4)
|
||||
TextView bt4;
|
||||
@BindView(R.id.bt_5)
|
||||
TextView bt5;
|
||||
@BindView(R.id.bt_6)
|
||||
TextView bt6;
|
||||
@BindView(R.id.bt_7)
|
||||
TextView bt7;
|
||||
@BindView(R.id.bt_8)
|
||||
TextView bt8;
|
||||
@BindView(R.id.bt_9)
|
||||
TextView bt9;
|
||||
@BindView(R.id.bt_del)
|
||||
TextView bt_del;
|
||||
@BindView(R.id.bt_confirm)
|
||||
TextView bt_confirm;
|
||||
|
||||
@BindView(R.id.textView)
|
||||
TextView textView;
|
||||
@BindView(R.id.tv_hint)
|
||||
TextView tv_hint;
|
||||
@BindView(R.id.ll_keyboard)
|
||||
LinearLayout ll_keyboard;
|
||||
@BindView(R.id.icv)
|
||||
VerificationCodeView codeView;
|
||||
|
||||
private SoundPool soundPool;
|
||||
private int soundId;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
|
||||
AudioAttributes attr = new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_GAME) // 设置音效使用场景
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC).build(); // 设置音效的类型
|
||||
soundPool = new SoundPool.Builder().setAudioAttributes(attr) // 设置音效池的属性
|
||||
.setMaxStreams(1) // 设置最多可容纳10个音频流
|
||||
.build(); // ①
|
||||
// load方法加载指定音频文件,并返回所加载的音效ID
|
||||
// 此处使用HashMap来管理这些音频流
|
||||
soundId = soundPool.load(this, R.raw.click, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_screen_lock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
InputMethodManager imm = (InputMethodManager) ScreenLockActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(codeView.getWindowToken(), 0);
|
||||
codeView.getEditText().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ll_keyboard.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
codeView.setInputCompleteListener(new VerificationCodeView.InputCompleteListener() {
|
||||
@Override
|
||||
public void inputComplete() {
|
||||
checkPasswd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteContent() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
bt_del.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
tv_hint.setText("");
|
||||
codeView.clearInputContent();
|
||||
}
|
||||
});
|
||||
bt_confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
checkPasswd();
|
||||
}
|
||||
});
|
||||
iv_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
bt0.setOnClickListener(view1 -> add(codeView, "0"));
|
||||
bt1.setOnClickListener(view1 -> add(codeView, "1"));
|
||||
bt2.setOnClickListener(view1 -> add(codeView, "2"));
|
||||
bt3.setOnClickListener(view1 -> add(codeView, "3"));
|
||||
bt4.setOnClickListener(view1 -> add(codeView, "4"));
|
||||
bt5.setOnClickListener(view1 -> add(codeView, "5"));
|
||||
bt6.setOnClickListener(view1 -> add(codeView, "6"));
|
||||
bt7.setOnClickListener(view1 -> add(codeView, "7"));
|
||||
bt8.setOnClickListener(view1 -> add(codeView, "8"));
|
||||
bt9.setOnClickListener(view1 -> add(codeView, "9"));
|
||||
}
|
||||
|
||||
private void checkPasswd() {
|
||||
String content = codeView.getInputContent();
|
||||
if (TextUtils.isEmpty(content) || content.length() != 4) {
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "inputComplete: " + content);
|
||||
String password = Settings.Global.getString(getContentResolver(), CommonConfig.LOCK_SCREEN_PASSWORD);
|
||||
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password))) {
|
||||
if (password.equals(content)) {
|
||||
exitDesktop();
|
||||
} else {
|
||||
setEmpty();
|
||||
tv_hint.setText("密码错误");
|
||||
}
|
||||
} else if (CommonConfig.DEFAULT_PASSWORD.equals(content)) {
|
||||
exitDesktop();
|
||||
} else {
|
||||
setEmpty();
|
||||
tv_hint.setText("密码错误");
|
||||
}
|
||||
}
|
||||
|
||||
private void setEmpty() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
codeView.clearInputContent();
|
||||
tv_hint.setText("");
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
|
||||
private void add(VerificationCodeView codeView, String text) {
|
||||
Log.e(TAG, "add: text = " + text);
|
||||
String oldText = codeView.getEditText().getText().toString();
|
||||
Log.e(TAG, "add: " + oldText);
|
||||
codeView.getEditText().setText(text);
|
||||
// soundPool.play(soundId, 1, 1, 0, 0, 1);
|
||||
}
|
||||
|
||||
private void exitDesktop() {
|
||||
RemoteManager.getInstance().openLauncher3();
|
||||
finish();
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ import com.uiuios.aios.alarm.AlarmUtils;
|
||||
import com.uiuios.aios.base.GlideEngine;
|
||||
import com.uiuios.aios.bean.AlarmClockId;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.FFmpegUtils;
|
||||
import com.uiuios.aios.utils.FileUtil;
|
||||
@@ -318,7 +319,7 @@ public class AlarmClockAddActivity extends BaseLifecycleActivity {
|
||||
alarmClockData.setIs_onoff(1);
|
||||
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("time", timeStamp);
|
||||
params.put("type", String.valueOf(mType));
|
||||
params.put("title", et_activation.getText().toString());
|
||||
@@ -365,7 +366,6 @@ public class AlarmClockAddActivity extends BaseLifecycleActivity {
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkContent", "onError: " + e.getMessage());
|
||||
ToastUtil.show("已保存到本地");
|
||||
ToastUtil.show("添加成功");
|
||||
ThreadLocalRandom random = ThreadLocalRandom.current();
|
||||
int fakeId = random.nextInt(Integer.MAX_VALUE);
|
||||
Log.e(TAG, "onError: fakeId = " + fakeId);
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.uiuios.aios.alarm.AlarmClockData;
|
||||
import com.uiuios.aios.alarm.AlarmUtils;
|
||||
import com.uiuios.aios.base.GlideEngine;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.FFmpegUtils;
|
||||
import com.uiuios.aios.utils.FileUtil;
|
||||
@@ -432,7 +433,7 @@ public class AlarmClockEditActivity extends AppCompatActivity implements Lifecyc
|
||||
|
||||
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("id", String.valueOf(mId));
|
||||
params.put("type", String.valueOf(mType));
|
||||
params.put("time", timeStamp);
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.base.BaseLightActivity;
|
||||
import com.uiuios.aios.base.GlideEngine;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.GlideLoadUtils;
|
||||
import com.uiuios.aios.utils.ToastUtil;
|
||||
@@ -149,7 +150,7 @@ public class AddContactActivity extends BaseLightActivity {
|
||||
RequestBody requestBody = RequestBody.Companion.create(avatarFile, mediaType);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("avatar", avatarFile.getName(), requestBody);
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("name", name);
|
||||
params.put("mobile", phone);
|
||||
params.put("is_urgent", String.valueOf(toggleButton.isToggleOn()));
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.content.ServiceConnection;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
@@ -26,15 +27,20 @@ import androidx.viewpager.widget.ViewPager;
|
||||
import com.alarmclock.uiui.IAlarmAidlInterface;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.Permission;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.base.BaseActivity;
|
||||
import com.uiuios.aios.bean.AlarmItem;
|
||||
import com.uiuios.aios.bean.DesktopIcon;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.fragment.AppListFragment;
|
||||
import com.uiuios.aios.base.BaseFragmentPagerAdapter;
|
||||
import com.uiuios.aios.fragment.custom.CustomFragment;
|
||||
import com.uiuios.aios.fragment.second.SecondFragment;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.service.NotificationService;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
import com.uiuios.aios.utils.AppUsedTimeUtils;
|
||||
@@ -100,13 +106,13 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
// fragmentTransaction.add(R.id.viewPager, appListFragment);
|
||||
// fragmentTransaction.commit();
|
||||
|
||||
is_twoscreen = Settings.Global.getInt(getContentResolver(), "is_twoscreen", 1) == 1;
|
||||
if (is_twoscreen) {
|
||||
appListIndex = 2;
|
||||
defaultCurrent = 1;
|
||||
mSecondFragment = new SecondFragment();
|
||||
mFragments.add(mSecondFragment);
|
||||
}
|
||||
// is_twoscreen = Settings.Global.getInt(getContentResolver(), "is_twoscreen", 1) == 1;
|
||||
// if (is_twoscreen) {
|
||||
// appListIndex = 2;
|
||||
// defaultCurrent = 1;
|
||||
// mSecondFragment = new SecondFragment();
|
||||
// mFragments.add(mSecondFragment);
|
||||
// }
|
||||
mCustomFragment = new CustomFragment();
|
||||
mFragments.add(mCustomFragment);
|
||||
|
||||
@@ -167,6 +173,12 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
}
|
||||
};
|
||||
bindAlarmService();
|
||||
RemoteManager.getInstance().setListener(new RemoteManager.ConnectedListener() {
|
||||
@Override
|
||||
public void onConnected() {
|
||||
setDefaultDesktop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ServiceConnection mAlarmServiceConnection;
|
||||
@@ -301,10 +313,76 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
if (!isNotificationListenersEnabled()) {
|
||||
ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权");
|
||||
gotoNotificationAccessSetting(this);
|
||||
} else {
|
||||
getPermission();
|
||||
}
|
||||
addData();
|
||||
}
|
||||
|
||||
public static final String Launcher3 = "com.android.launcher3";
|
||||
public static final String Launcher3Class = "com.android.launcher3.Launcher";
|
||||
public static final String Launcher3QuickstepClass = "com.android.launcher3.uioverrides.QuickstepLauncher";
|
||||
|
||||
private void setDefaultDesktop() {
|
||||
int is_activation = Settings.Global.getInt(getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
Log.e(TAG, "onResume: is_activation = " + is_activation);
|
||||
if (is_activation == 1) {
|
||||
RemoteManager.getInstance().setDefaultDesktop(BuildConfig.APPLICATION_ID, this.getClass().getName());
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
|
||||
RemoteManager.getInstance().setDefaultDesktop(Launcher3, Launcher3QuickstepClass);
|
||||
} else {
|
||||
RemoteManager.getInstance().setDefaultDesktop(Launcher3, Launcher3Class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String[] permission = new String[]{
|
||||
Permission.CALL_PHONE,
|
||||
// Permission.REQUEST_INSTALL_PACKAGES,
|
||||
Permission.WRITE_EXTERNAL_STORAGE,
|
||||
Permission.READ_PHONE_STATE,
|
||||
Permission.WRITE_SETTINGS,
|
||||
};
|
||||
|
||||
private void getPermission() {
|
||||
XXPermissions.with(this)
|
||||
// 申请单个权限
|
||||
// .permission(Permission.RECORD_AUDIO)
|
||||
// 申请多个权限
|
||||
.permission(permission)
|
||||
// 设置权限请求拦截器(局部设置)
|
||||
//.interceptor(new PermissionInterceptor())
|
||||
// 设置不触发错误检测机制(局部设置)
|
||||
//.unchecked()
|
||||
.request(new OnPermissionCallback() {
|
||||
|
||||
@Override
|
||||
public void onGranted(@NonNull List<String> permissions, boolean allGranted) {
|
||||
if (!allGranted) {
|
||||
ToastUtil.show("获取部分权限成功,但部分权限未正常授予");
|
||||
return;
|
||||
}
|
||||
// ToastUtil.show("获取录音和日历权限成功");
|
||||
Log.e(TAG, "onGranted: 获取存储权限成功");
|
||||
addData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(@NonNull List<String> permissions, boolean doNotAskAgain) {
|
||||
if (doNotAskAgain) {
|
||||
ToastUtil.show("被永久拒绝授权,请手动授予存储权限");
|
||||
// 如果是被永久拒绝就跳转到应用权限系统设置页面
|
||||
XXPermissions.startPermissionActivity(MainActivity.this, permissions);
|
||||
} else {
|
||||
// ToastUtil.show("获取录音和日历权限失败");
|
||||
Log.e(TAG, "onGranted: 获取存储权限权限失败");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners";
|
||||
|
||||
private boolean isNotificationListenersEnabled() {
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.Contact;
|
||||
import com.uiuios.aios.bean.NetDesktopIcon;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
import com.uiuios.aios.utils.AppUsedTimeUtils;
|
||||
@@ -122,7 +123,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
Log.e(TAG, "onRestart: " + ApkUtils.getAppNameByPackage(mContext, packagename));
|
||||
Log.e(TAG, "onRestart: " + packagename);
|
||||
NetInterfaceManager.getInstance().getAppUsageRecordControl()
|
||||
.sendappUsageRecord(Utils.getSerial(),
|
||||
.sendappUsageRecord(RemoteManager.getInstance().getSerial(),
|
||||
ApkUtils.getAppNameByPackage(mContext, packagename),
|
||||
packagename,
|
||||
AppUsedTimeUtils.getInstance().getStartTime() / 1000,
|
||||
|
||||
@@ -25,7 +25,7 @@ import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
*/
|
||||
public class WeatherPresenter implements WeatherContact.Presenter {
|
||||
private static final String TAG = WeatherPresenter.class.getSimpleName();
|
||||
private static final String WEATHER_DAILY_KEY = "WEATHER_DAILY_JSON_STRING";
|
||||
public static final String WEATHER_DAILY_KEY = "WEATHER_DAILY_JSON_STRING";
|
||||
private WeatherContact.WeatherView mView;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Holder holder, int position) {
|
||||
AlarmClockData alarmClockData = dataList.get(position);
|
||||
holder.tv_title.setText("提醒事件:" + alarmClockData.getTitle());
|
||||
// holder.tv_title.setText("提醒事件:" + alarmClockData.getTitle());
|
||||
String time = alarmClockData.getTime();
|
||||
if (time.length() > 5) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
@@ -109,9 +109,9 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
}
|
||||
});
|
||||
if (TextUtils.isEmpty(voice)) {
|
||||
holder.cl_voice.setVisibility(View.GONE);
|
||||
// holder.cl_voice.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.cl_voice.setVisibility(View.VISIBLE);
|
||||
// holder.cl_voice.setVisibility(View.VISIBLE);
|
||||
MediaPlayer mMediaPlayer = new MediaPlayer();
|
||||
mMediaPlayer.setAudioAttributes(
|
||||
new AudioAttributes.Builder()
|
||||
@@ -137,7 +137,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull Integer integer) {
|
||||
holder.tv_voice.setText(integer + "秒");
|
||||
// holder.tv_voice.setText(integer + "秒");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,12 +150,12 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
|
||||
}
|
||||
});
|
||||
holder.cl_voice.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mMediaPlayer.start();
|
||||
}
|
||||
});
|
||||
// holder.cl_voice.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// mMediaPlayer.start();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,20 +165,20 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
|
||||
}
|
||||
|
||||
class Holder extends RecyclerView.ViewHolder {
|
||||
TextView tv_title;
|
||||
// TextView tv_title;
|
||||
TextView tv_time;
|
||||
TextView tv_voice;
|
||||
ConstraintLayout cl_voice;
|
||||
// TextView tv_voice;
|
||||
// ConstraintLayout cl_voice;
|
||||
ConstraintLayout root;
|
||||
NiceImageView iv_cover;
|
||||
|
||||
public Holder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.root);
|
||||
tv_title = itemView.findViewById(R.id.tv_title);
|
||||
// tv_title = itemView.findViewById(R.id.tv_title);
|
||||
tv_time = itemView.findViewById(R.id.tv_time);
|
||||
tv_voice = itemView.findViewById(R.id.tv_voice);
|
||||
cl_voice = itemView.findViewById(R.id.cl_voice);
|
||||
// tv_voice = itemView.findViewById(R.id.tv_voice);
|
||||
// cl_voice = itemView.findViewById(R.id.cl_voice);
|
||||
iv_cover = itemView.findViewById(R.id.iv_cover);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.uiuios.aios.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@@ -14,9 +12,6 @@ import com.alibaba.sdk.android.push.CommonCallback;
|
||||
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.qweather.sdk.view.HeConfig;
|
||||
import com.tencent.android.tpush.XGIOperateCallback;
|
||||
import com.tencent.android.tpush.XGPushConfig;
|
||||
import com.tencent.android.tpush.XGPushManager;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.BuildConfig;
|
||||
import com.uiuios.aios.alarm.AlarmUtils;
|
||||
@@ -28,12 +23,8 @@ import com.uiuios.aios.push.PushManager;
|
||||
import com.uiuios.aios.service.main.MainService;
|
||||
import com.uiuios.aios.utils.AppUsedTimeUtils;
|
||||
import com.uiuios.aios.utils.JGYUtils;
|
||||
import com.uiuios.aios.utils.Utils;
|
||||
import com.uiuios.aios.utils.WiFiUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BaseApplication extends Application {
|
||||
private static final String TAG = BaseApplication.class.getSimpleName();
|
||||
|
||||
@@ -46,7 +37,6 @@ public class BaseApplication extends Application {
|
||||
String rootDir = MMKV.initialize(this);
|
||||
Log.e(TAG, "mmkv root: " + rootDir);
|
||||
|
||||
tpushInit();
|
||||
aliyunPushInit();
|
||||
PushManager.init(this);
|
||||
|
||||
@@ -67,35 +57,6 @@ public class BaseApplication extends Application {
|
||||
startService(new Intent(this, MainService.class));
|
||||
}
|
||||
|
||||
private void tpushInit() {
|
||||
XGPushConfig.enableDebug(this, true);
|
||||
XGPushManager.registerPush(this, new XGIOperateCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object data, int flag) {
|
||||
//token在设备卸载重装的时候有可能会变
|
||||
Log.e("TPush", "注册成功,设备token为:" + data);
|
||||
List<XGPushManager.AccountInfo> accountInfoList = new ArrayList<>();
|
||||
accountInfoList.add(new XGPushManager.AccountInfo(XGPushManager.AccountType.CUSTOM.getValue(), Utils.getSerial()));
|
||||
XGPushManager.upsertAccounts(getApplicationContext(), accountInfoList, new XGIOperateCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object data, int flag) {
|
||||
Log.e("TPush", "onSuccess, data:" + data + ", flag:" + flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Object data, int errCode, String msg) {
|
||||
Log.e("TPush", "onFail, data:" + data + ", code:" + errCode + ", msg:" + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(Object data, int errCode, String msg) {
|
||||
Log.e("TPush", "注册失败,错误码:" + errCode + ",错误信息:" + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void aliyunPushInit() {
|
||||
PushServiceFactory.init(this);
|
||||
final CloudPushService pushService = PushServiceFactory.getCloudPushService();
|
||||
@@ -105,7 +66,7 @@ public class BaseApplication extends Application {
|
||||
public void onSuccess(String response) {
|
||||
Log.e("AliyunPush", "init cloudchannel success");
|
||||
Log.e("AliyunPush", "init cloudchannel success " + pushService.getDeviceId());
|
||||
String sn = Utils.getSerial();
|
||||
String sn = RemoteManager.getInstance().getSerial();
|
||||
if (TextUtils.isEmpty(sn)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,15 +23,15 @@ public class DesktopIcon implements Serializable, Parcelable {
|
||||
}
|
||||
|
||||
private DesktopIcon(Parcel in) {
|
||||
packageName = in.readStringNoHelper();
|
||||
lable = in.readStringNoHelper();
|
||||
packageName = in.readString();
|
||||
lable = in.readString();
|
||||
position = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeStringNoHelper(packageName);
|
||||
dest.writeStringNoHelper(lable);
|
||||
dest.writeString(packageName);
|
||||
dest.writeString(lable);
|
||||
dest.writeInt(position);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,19 @@ import java.io.Serializable;
|
||||
public class UserAvatarInfo implements Serializable {
|
||||
private static final long serialVersionUID = 7700643058775210597L;
|
||||
|
||||
String username;
|
||||
String avatar;
|
||||
String gread;
|
||||
int id;
|
||||
String avatar;
|
||||
String mobile;
|
||||
String sn_name;
|
||||
String class_name;
|
||||
String username;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
@@ -26,19 +28,35 @@ public class UserAvatarInfo implements Serializable {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getGread() {
|
||||
return gread;
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setGread(String gread) {
|
||||
this.gread = gread;
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
public String getSn_name() {
|
||||
return sn_name;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
public void setSn_name(String sn_name) {
|
||||
this.sn_name = sn_name;
|
||||
}
|
||||
|
||||
public String getClass_name() {
|
||||
return class_name;
|
||||
}
|
||||
|
||||
public void setClass_name(String class_name) {
|
||||
this.class_name = class_name;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ public class CommonConfig {
|
||||
public static final String MAP_ADDRESS_KEY = "map_address_key";
|
||||
public static final String MAP_ERROR_KEY = "map_error_key";
|
||||
|
||||
public static final String LOCK_SCREEN_PASSWORD ="aios_lockScreenPasswordKey";
|
||||
public static final String DEFAULT_PASSWORD = "6666";
|
||||
|
||||
/*是否激活接口请求缓存*/
|
||||
public static final String ACTIVATION_BEAN_KEY = "AIOS_UIUI_ACTIVATION_BEAN_KEY";
|
||||
/*是否激活*/
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.FragmentEvent;
|
||||
import com.uiuios.aios.R;
|
||||
import com.uiuios.aios.activity.DailyAppActivity;
|
||||
import com.uiuios.aios.activity.ScreenLockActivity;
|
||||
import com.uiuios.aios.base.BaseFragment;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.bean.DesktopIcon;
|
||||
@@ -30,6 +31,7 @@ import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.dialog.CustomDialog;
|
||||
import com.uiuios.aios.dialog.DailyAppDialog;
|
||||
import com.uiuios.aios.manager.AppStatusManager;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.service.NotificationService;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
@@ -201,6 +203,13 @@ public class AppListFragment extends BaseFragment {
|
||||
startActivity(new Intent(mContext, DailyAppActivity.class));
|
||||
break;
|
||||
case "aios.exit":
|
||||
int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
if (is_activation == 0) {
|
||||
RemoteManager.getInstance().openLauncher3();
|
||||
} else {
|
||||
startScreenLockActivity();
|
||||
}
|
||||
break;
|
||||
case "aios.family":
|
||||
// startActivity(new Intent(mContext, FamilySpaceActivity.class));
|
||||
ApkUtils.openApp(mContext, "com.uiui.videoplayer");
|
||||
@@ -297,6 +306,11 @@ public class AppListFragment extends BaseFragment {
|
||||
});
|
||||
}
|
||||
|
||||
private void startScreenLockActivity() {
|
||||
Intent intent = new Intent(mContext, ScreenLockActivity.class);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
private void showHideDialog(DesktopIcon desktopIcon) {
|
||||
String label = desktopIcon.getLable();
|
||||
String pkg = desktopIcon.getPackageName();
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.uiuios.aios.fragment.custom;
|
||||
import com.uiuios.aios.base.BasePresenter;
|
||||
import com.uiuios.aios.base.BaseView;
|
||||
import com.uiuios.aios.bean.SnInfo;
|
||||
import com.uiuios.aios.bean.UserAvatarInfo;
|
||||
|
||||
public class CustomContact {
|
||||
public interface Presenter extends BasePresenter<CustomView> {
|
||||
@@ -10,6 +11,6 @@ public class CustomContact {
|
||||
}
|
||||
|
||||
public interface CustomView extends BaseView {
|
||||
void setSnInfo(SnInfo snInfo);
|
||||
void setSnInfo(UserAvatarInfo userAvatarInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.king.view.circleprogressview.CircleProgressView;
|
||||
import com.qweather.sdk.bean.base.Code;
|
||||
import com.qweather.sdk.bean.base.Lang;
|
||||
import com.qweather.sdk.bean.base.Unit;
|
||||
import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
||||
import com.qweather.sdk.bean.weather.WeatherHourlyBean;
|
||||
import com.qweather.sdk.bean.weather.WeatherNowBean;
|
||||
import com.qweather.sdk.view.QWeather;
|
||||
@@ -56,6 +57,7 @@ import com.uiuios.aios.activity.alarm.AlarmClockActivity;
|
||||
import com.uiuios.aios.activity.code.FamilySpaceActivity;
|
||||
import com.uiuios.aios.activity.contact.ContactActivity;
|
||||
import com.uiuios.aios.activity.weather.WeatherActivity;
|
||||
import com.uiuios.aios.activity.weather.WeatherPresenter;
|
||||
import com.uiuios.aios.activity.wifi.WiFiManagerActivity;
|
||||
import com.uiuios.aios.adapter.NotificationAdapter;
|
||||
import com.uiuios.aios.adapter.SOSNnmberAdapter;
|
||||
@@ -66,14 +68,17 @@ import com.uiuios.aios.bean.AlarmItem;
|
||||
import com.uiuios.aios.bean.Contact;
|
||||
import com.uiuios.aios.bean.HealthCode;
|
||||
import com.uiuios.aios.bean.SnInfo;
|
||||
import com.uiuios.aios.bean.UserAvatarInfo;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.dialog.PasswordDialog;
|
||||
import com.uiuios.aios.dialog.SingleDialog;
|
||||
import com.uiuios.aios.disklrucache.CacheHelper;
|
||||
import com.uiuios.aios.gson.GsonUtils;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.network.UrlAddress;
|
||||
import com.uiuios.aios.push.PushManager;
|
||||
import com.uiuios.aios.service.main.MainService;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
import com.uiuios.aios.utils.AppUtil;
|
||||
import com.uiuios.aios.utils.BitmapUtils;
|
||||
@@ -84,7 +89,11 @@ import com.uiuios.aios.utils.Utils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
@@ -97,8 +106,6 @@ import butterknife.ButterKnife;
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class CustomFragment extends BaseFragment implements CustomContact.CustomView, NetworkUtils.OnNetworkStatusChangedListener {
|
||||
// @BindView(R.id.cl_alarm)
|
||||
// ConstraintLayout cl_alarm;
|
||||
|
||||
@BindView(R.id.cl_weather)
|
||||
ConstraintLayout cl_weather;
|
||||
@@ -122,15 +129,12 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
ConstraintLayout cl_wifi;
|
||||
@BindView(R.id.cl_activation)
|
||||
ConstraintLayout cl_activation;
|
||||
|
||||
// @BindView(R.id.cl_exit)
|
||||
// ConstraintLayout cl_exit;
|
||||
@BindView(R.id.cl_control)
|
||||
ConstraintLayout cl_control;
|
||||
// @BindView(R.id.cl_battery)
|
||||
// ConstraintLayout cl_battery;
|
||||
// @BindView(R.id.tv_add)
|
||||
// TextView tv_add;
|
||||
@BindView(R.id.tv_time)
|
||||
TextView tv_time;
|
||||
@BindView(R.id.tv_data)
|
||||
TextView tv_data;
|
||||
@BindView(R.id.tv_battery)
|
||||
TextView tv_battery;
|
||||
@BindView(R.id.tv_location)
|
||||
@@ -143,12 +147,8 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
TextView tv_temp;
|
||||
@BindView(R.id.cpv)
|
||||
CircleProgressView cpv;
|
||||
// @BindView(R.id.iv_charging)
|
||||
// ImageView iv_charging;
|
||||
@BindView(R.id.rv_noti)
|
||||
RecyclerView rv_noti;
|
||||
// @BindView(R.id.rv_clock)
|
||||
// RecyclerView rv_clock;
|
||||
@BindView(R.id.iv_wifi)
|
||||
ImageView iv_wifi;
|
||||
@BindView(R.id.wifi_ssid)
|
||||
@@ -159,8 +159,6 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
RecyclerView rv_sos;
|
||||
@BindView(R.id.iv_note_nodata)
|
||||
ImageView iv_note_nodata;
|
||||
// @BindView(R.id.iv_head)
|
||||
// ImageView iv_head;
|
||||
@BindView(R.id.tv_name)
|
||||
TextView tv_name;
|
||||
@BindView(R.id.iv_app)
|
||||
@@ -248,9 +246,9 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
if (networkType == NetworkUtils.NetworkType.NETWORK_WIFI) {
|
||||
iv_wifi.setImageDrawable(mContext.getDrawable(R.drawable.wifi_connect));
|
||||
if (isNetworkOnline1()) {
|
||||
wifi_ssid.setText(getConnectWifiSsid() + "(已连接)");
|
||||
wifi_ssid.setText("已连接");
|
||||
} else {
|
||||
wifi_ssid.setText("(未连接)");
|
||||
wifi_ssid.setText("未连接");
|
||||
}
|
||||
} else {
|
||||
wifi_ssid.setText("WiFi未连接");
|
||||
@@ -326,7 +324,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
String action = intent.getAction();
|
||||
Log.e(TAG, "onReceive: " + action);
|
||||
if (PushManager.SET_ALARMCLOCK.equals(action)) {
|
||||
Handler.getMain().postDelayed(new Runnable() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getAlarmClock();
|
||||
@@ -404,6 +402,62 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
}
|
||||
};
|
||||
|
||||
//监听时间和日期变化
|
||||
public void registerTimeReceiver() {
|
||||
mTimeChangedReceiver = new TimeChangedReceiver();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(Intent.ACTION_DATE_CHANGED);
|
||||
filter.addAction(Intent.ACTION_TIME_CHANGED);
|
||||
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
|
||||
filter.addAction(Intent.ACTION_TIME_TICK);
|
||||
mContext.registerReceiver(mTimeChangedReceiver, filter);
|
||||
}
|
||||
|
||||
private TimeChangedReceiver mTimeChangedReceiver;
|
||||
|
||||
private class TimeChangedReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (Intent.ACTION_DATE_CHANGED.equals(intent.getAction())) {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "data changed");
|
||||
} else if (Intent.ACTION_TIME_CHANGED.equals(intent.getAction())) {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "time changed");
|
||||
} else if (Intent.ACTION_TIMEZONE_CHANGED.equals(intent.getAction())) {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "timezone changed");
|
||||
} else if (Intent.ACTION_TIME_TICK.equals(intent.getAction())) {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "time tick");
|
||||
}
|
||||
setTiem();
|
||||
}
|
||||
}
|
||||
|
||||
private void setTiem() {
|
||||
long time = System.currentTimeMillis();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
||||
Date date = new Date(time);
|
||||
tv_time.setText(sdf.format(date));
|
||||
SimpleDateFormat sdf2 = new SimpleDateFormat("MM月-dd日");
|
||||
Date date2 = new Date(time);
|
||||
tv_data.setText(sdf2.format(date2) + "\t" + getWeek());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 根据日期取得星期几
|
||||
*/
|
||||
public static String getWeek() {
|
||||
Date date = new Date();
|
||||
String[] weeks = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
int weekIndex = cal.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
if (weekIndex < 0) {
|
||||
weekIndex = 0;
|
||||
}
|
||||
return weeks[weekIndex];
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
@@ -425,8 +479,9 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
registerRefreshReceiver();
|
||||
registerBatteryReceiver();
|
||||
registerAlarmClockReceiver();
|
||||
registerTimeReceiver();
|
||||
wifi_ssid.requestFocus();
|
||||
|
||||
setTiem();
|
||||
mContext.registerReceiver(mbatteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
|
||||
if (Settings.Global.getInt(mCRv, "is_aihealth", 0) == 1) {
|
||||
cl_appstore.setVisibility(View.GONE);
|
||||
@@ -472,9 +527,9 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
if (isWifiConnect()) {
|
||||
iv_wifi.setImageDrawable(mContext.getDrawable(R.drawable.wifi_connect));
|
||||
if (isNetworkOnline1()) {
|
||||
wifi_ssid.setText(getConnectWifiSsid() + "(已连接)");
|
||||
wifi_ssid.setText("已连接");
|
||||
} else {
|
||||
wifi_ssid.setText("(未连接)");
|
||||
wifi_ssid.setText("未连接");
|
||||
}
|
||||
} else {
|
||||
wifi_ssid.setText("WiFi未连接");
|
||||
@@ -568,10 +623,10 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
cl_wifi.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// startActivity(intent);
|
||||
startActivity(new Intent(mContext, WiFiManagerActivity.class));
|
||||
Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
// startActivity(new Intent(mContext, WiFiManagerActivity.class));
|
||||
}
|
||||
});
|
||||
cl_activation.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -596,15 +651,15 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSnInfo(SnInfo snInfo) {
|
||||
if (snInfo != null) {
|
||||
if (TextUtils.isEmpty(snInfo.getSn_name())) {
|
||||
// tv_name.setText("未设置");
|
||||
public void setSnInfo(UserAvatarInfo userAvatarInfo) {
|
||||
if (userAvatarInfo != null) {
|
||||
if (TextUtils.isEmpty(userAvatarInfo.getSn_name())) {
|
||||
tv_name.setText("未设置");
|
||||
} else {
|
||||
// tv_name.setText(snInfo.getSn_name());
|
||||
tv_name.setText(userAvatarInfo.getSn_name());
|
||||
}
|
||||
} else {
|
||||
// tv_name.setText("未设置");
|
||||
tv_name.setText("未设置");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -701,7 +756,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
// Log.e("getUserAvatarInfoControl", "onComplete: ");
|
||||
// }
|
||||
// });
|
||||
// mCustomPresenter.getSnInfo();
|
||||
mCustomPresenter.getSnInfo();
|
||||
initAmap();
|
||||
getAlarmCache();
|
||||
}
|
||||
@@ -728,9 +783,9 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
private void checkActivation() {
|
||||
int activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
if (activation == 0) {
|
||||
tv_name.setText("未激活");
|
||||
// tv_name.setText("未激活");
|
||||
} else {
|
||||
tv_name.setText("已激活");
|
||||
// tv_name.setText("已激活");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,7 +911,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
}
|
||||
|
||||
private void getAlarmCache() {
|
||||
String jsonString = mCacheHelper.getAsString(UrlAddress.GET_ALARM_CLOCK);
|
||||
String jsonString = mMMKV.decodeString(UrlAddress.GET_ALARM_CLOCK);
|
||||
Gson gson = new Gson();
|
||||
Type type = new TypeToken<List<AlarmClockData>>() {
|
||||
}.getType();
|
||||
@@ -865,7 +920,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
rv_noti.setVisibility(View.GONE);
|
||||
iv_note_nodata.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
notificationAdapter.setDataList(list);
|
||||
notificationAdapter.setDataList(list.subList(0, 1));
|
||||
rv_noti.setVisibility(View.VISIBLE);
|
||||
iv_note_nodata.setVisibility(View.GONE);
|
||||
}
|
||||
@@ -937,6 +992,8 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
});
|
||||
}
|
||||
|
||||
private String nowString;
|
||||
|
||||
private void getweather(double longitude, double latitude) {
|
||||
String location = longitude + "," + latitude;
|
||||
Log.e(TAG, "getweather: " + location);
|
||||
@@ -963,6 +1020,7 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
// String imageName = "he" + now.getIcon();
|
||||
// int resId = getResources().getIdentifier(imageName, "drawable", mContext.getPackageName());
|
||||
// iv_pic.setImageDrawable(mContext.getDrawable(resId));
|
||||
nowString = now.getText();
|
||||
tv_temp.setText(now.getTemp() + "℃");
|
||||
tv_weather.setText(now.getText());
|
||||
String iconDay = weatherBean.getNow().getIcon();
|
||||
@@ -970,11 +1028,13 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
switch (iconDay) {
|
||||
case "100":
|
||||
case "150":
|
||||
cl_weather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun));
|
||||
break;
|
||||
case "102":
|
||||
case "152":
|
||||
cl_weather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sunny));
|
||||
if (isnight()) {
|
||||
cl_weather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun));
|
||||
} else {
|
||||
cl_weather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_sun_night));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
cl_weather.setBackground(ContextCompat.getDrawable(mContext, R.drawable.background_weather_rain));
|
||||
@@ -1020,6 +1080,34 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
QWeather.getWeather7D(mContext, location, new QWeather.OnResultWeatherDailyListener() {
|
||||
@Override
|
||||
public void onError(Throwable throwable) {
|
||||
Log.e("getWeather", "onError: " + throwable.getMessage());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(WeatherDailyBean weatherDailyBean) {
|
||||
String jsonString = new Gson().toJson(weatherDailyBean);
|
||||
Log.d("getWeather", "onSuccess: " + jsonString);
|
||||
mMMKV.encode(WeatherPresenter.WEATHER_DAILY_KEY, jsonString);
|
||||
List<WeatherDailyBean.DailyBean> dailyBeans = weatherDailyBean.getDaily();
|
||||
if (dailyBeans != null && dailyBeans.size() != 0) {
|
||||
WeatherDailyBean.DailyBean dailyBean = weatherDailyBean.getDaily().get(0);
|
||||
tv_weather.setText(nowString + "\t" + dailyBean.getTempMin() + "℃ - " + dailyBean.getTempMax() + "℃");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isnight() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
int minute = calendar.get(Calendar.MINUTE);
|
||||
int second = calendar.get(Calendar.SECOND);
|
||||
return hour >= 16 && minute >= 30;
|
||||
}
|
||||
|
||||
private void killBackgroundApp() {
|
||||
@@ -1032,20 +1120,21 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
}
|
||||
|
||||
private void killBackgroundProcesses(String packageName) {
|
||||
ActivityManager activityManager;
|
||||
try {
|
||||
activityManager = (ActivityManager)
|
||||
mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
activityManager.killBackgroundProcesses(packageName);
|
||||
Method forceStopPackage = activityManager.getClass()
|
||||
.getDeclaredMethod("forceStopPackage", String.class);
|
||||
// Log.e(TAG, "killBackgroundProcesses: " + packageName);
|
||||
forceStopPackage.setAccessible(true);
|
||||
forceStopPackage.invoke(activityManager, packageName);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
// ActivityManager activityManager;
|
||||
// try {
|
||||
// activityManager = (ActivityManager)
|
||||
// mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
// activityManager.killBackgroundProcesses(packageName);
|
||||
// Method forceStopPackage = activityManager.getClass()
|
||||
// .getDeclaredMethod("forceStopPackage", String.class);
|
||||
//// Log.e(TAG, "killBackgroundProcesses: " + packageName);
|
||||
// forceStopPackage.setAccessible(true);
|
||||
// forceStopPackage.invoke(activityManager, packageName);
|
||||
// } catch (Exception e) {
|
||||
// Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
RemoteManager.getInstance().killBackgroundProcesses(packageName);
|
||||
}
|
||||
|
||||
private void refreshMemory() {
|
||||
@@ -1075,5 +1164,8 @@ public class CustomFragment extends BaseFragment implements CustomContact.Custom
|
||||
if (mAlarmClockReceiver != null) {
|
||||
mContext.unregisterReceiver(mAlarmClockReceiver);
|
||||
}
|
||||
if (mTimeChangedReceiver != null) {
|
||||
mContext.unregisterReceiver(mTimeChangedReceiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.annotation.NonNull;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.trello.rxlifecycle4.android.FragmentEvent;
|
||||
import com.uiuios.aios.bean.SnInfo;
|
||||
import com.uiuios.aios.bean.UserAvatarInfo;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
@@ -43,11 +44,11 @@ public class CustomPresenter implements CustomContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getSnInfo() {
|
||||
// NetInterfaceManager.getInstance().getSnInfo(new NetInterfaceManager.SnInfoCallback() {
|
||||
// @Override
|
||||
// public void setSnInfo(SnInfo snInfo) {
|
||||
// mView.setSnInfo(snInfo);
|
||||
// }
|
||||
// });
|
||||
NetInterfaceManager.getInstance().getUserAvatarInfo(lifecycle, new NetInterfaceManager.UserAvatarInfoCallback() {
|
||||
@Override
|
||||
public void setUserAvatarInfo(UserAvatarInfo info) {
|
||||
mView.setSnInfo(info);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -18,20 +19,26 @@ import com.uiuios.aios.disklrucache.CacheHelper;
|
||||
import com.uiuios.sn.IGetInfoInterface;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class RemoteManager {
|
||||
private static final String TAG = RemoteManager.class.getSimpleName();
|
||||
|
||||
private static final String SN_KEY = "sn_serial_key";
|
||||
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static RemoteManager sInstance;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private CacheHelper mCacheHelper;
|
||||
|
||||
private IGetInfoInterface getInfoInterface;
|
||||
private IGetInfoInterface mGetInfoInterface;
|
||||
private ServiceConnection mIGetInfoConnection;
|
||||
|
||||
|
||||
private RemoteManager(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
@@ -42,14 +49,26 @@ public class RemoteManager {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
Log.e(TAG, "onServiceConnected: mIGetInfoConnection");
|
||||
getInfoInterface = IGetInfoInterface.Stub.asInterface(service);
|
||||
mGetInfoInterface = IGetInfoInterface.Stub.asInterface(service);
|
||||
for (ConnectedListener listener : mListeners) {
|
||||
if (listener != null) {
|
||||
listener.onConnected();
|
||||
}
|
||||
}
|
||||
try {
|
||||
String sn = mGetInfoInterface.getSerial();
|
||||
mMMKV.encode(SN_KEY, sn);
|
||||
Log.e(TAG, "onServiceConnected: sn = " + sn);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
Log.e(TAG, "onServiceDisconnected: mIGetInfoConnection");
|
||||
getInfoInterface = null;
|
||||
mGetInfoInterface = null;
|
||||
bindInfoService();
|
||||
}
|
||||
};
|
||||
@@ -70,8 +89,21 @@ public class RemoteManager {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public interface ConnectedListener {
|
||||
void onConnected();
|
||||
}
|
||||
|
||||
Set<ConnectedListener> mListeners = new HashSet<>();
|
||||
|
||||
public void setListener(ConnectedListener listener) {
|
||||
mListeners.add(listener);
|
||||
if (mGetInfoInterface != null) {
|
||||
listener.onConnected();
|
||||
}
|
||||
}
|
||||
|
||||
private void bindInfoService() {
|
||||
if (getInfoInterface == null) {
|
||||
if (mGetInfoInterface == null) {
|
||||
//这是连接aidl服务的代码
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.uiuios.sn.IGetInfoInterface");
|
||||
@@ -81,10 +113,26 @@ public class RemoteManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void getLocation() {
|
||||
if (getInfoInterface != null) {
|
||||
/**
|
||||
* @return 获取sn
|
||||
*/
|
||||
public String getSerial() {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
String jsonString = getInfoInterface.getMapResult();
|
||||
return mGetInfoInterface.getSerial();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getSerial: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
return mMMKV.decodeString(SN_KEY, "");
|
||||
}
|
||||
|
||||
public void getLocation() {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
String jsonString = mGetInfoInterface.getMapResult();
|
||||
mMMKV.encode(CommonConfig.MAP_LOCATION_JSON_KEY, jsonString);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getMapResult: " + e.getMessage());
|
||||
@@ -127,7 +175,7 @@ public class RemoteManager {
|
||||
getLocation();
|
||||
return "北京";
|
||||
} else {
|
||||
return mapBean.getCity() + "\t" + mapBean.getDistrict();
|
||||
return mapBean.getCity() + "\t" + mapBean.getDistrict();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,9 +205,82 @@ public class RemoteManager {
|
||||
getLocation();
|
||||
return "0.0";
|
||||
} else {
|
||||
return mapBean.getLongitude() + "," + mapBean.getLatitude();
|
||||
return mapBean.getLongitude() + "," + mapBean.getLatitude();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean putSystemInt(String name, int value) {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
return mGetInfoInterface.SystemPutInt(name, value);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "putSystemInt: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void killBackgroundProcesses(String pkg) {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
mGetInfoInterface.killBackgroundProcesses(pkg);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
}
|
||||
|
||||
public String getConnectWifiSsid() {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
return mGetInfoInterface.getWifiSsid();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
return "获取失败";
|
||||
}
|
||||
|
||||
public String getBluetoothDeviceName() {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
return mGetInfoInterface.getBluetoothSsid();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
return "获取失败";
|
||||
}
|
||||
|
||||
public void openLauncher3() {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
mGetInfoInterface.openLauncher3();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "openLauncher3: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
}
|
||||
|
||||
public void setDefaultDesktop(String pkgName, String className) {
|
||||
if (mGetInfoInterface != null) {
|
||||
try {
|
||||
mGetInfoInterface.setDefaultDesktop(pkgName, className);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setDefaultDesktop: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
bindInfoService();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.uiuios.aios.disklrucache.CacheHelper;
|
||||
import com.uiuios.aios.gson.GsonUtils;
|
||||
import com.uiuios.aios.manager.ConnectManager;
|
||||
import com.uiuios.aios.manager.ConnectMode;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.api.ActivityListApi;
|
||||
import com.uiuios.aios.network.api.AlarmClockAddApi;
|
||||
import com.uiuios.aios.network.api.AlarmClockApi;
|
||||
@@ -175,91 +176,91 @@ public class NetInterfaceManager {
|
||||
*/
|
||||
public Observable<BaseResponse<SnInfo>> getsnInfoControl() {
|
||||
return mRetrofit.create(SNInfoApi.class)
|
||||
.getsninfo(Utils.getSerial())
|
||||
.getsninfo(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<UserAvatarInfo>> getUserAvatarInfoControl() {
|
||||
return mRetrofit.create(UserInfoControl.class)
|
||||
.getUserAvatarInfo(Utils.getSerial())
|
||||
.getUserAvatarInfo(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getRunningAppObservable(String json) {
|
||||
return mRetrofit.create(RunNewApp.class)
|
||||
.sendRunningInfo(Utils.getSerial(), json)
|
||||
.sendRunningInfo(RemoteManager.getInstance().getSerial(), json)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<SystemSettings>> getsettingControl() {
|
||||
return mRetrofit.create(Setting.class)
|
||||
.getSetting(Utils.getSerial())
|
||||
.getSetting(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getSOSRecordObservable(String longitude, String latitude, String address) {
|
||||
return mRetrofit.create(SOSRecordApi.class)
|
||||
.sendSOSRecord(Utils.getSerial(), longitude, latitude, address)
|
||||
.sendSOSRecord(RemoteManager.getInstance().getSerial(), longitude, latitude, address)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateAlarmObservable(int id) {
|
||||
return mRetrofit.create(UpdateAlarmClockApi.class)
|
||||
.updateAlarm(Utils.getSerial(), id)
|
||||
.updateAlarm(RemoteManager.getInstance().getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateDesktopObservable(String jsonArray) {
|
||||
return mRetrofit.create(UpdateDesktopApi.class)
|
||||
.updateLayout(Utils.getSerial(), jsonArray)
|
||||
.updateLayout(RemoteManager.getInstance().getSerial(), jsonArray)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<NetDesktopIcon>>> getDesktopLayoutObservable() {
|
||||
return mRetrofit.create(GetDesktopApi.class)
|
||||
.getDesktopLayout(Utils.getSerial())
|
||||
.getDesktopLayout(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<GoodsInfo>>> getGoodsListObservable() {
|
||||
return mRetrofit.create(GoodsListApi.class)
|
||||
.getGoodsList(Utils.getSerial())
|
||||
.getGoodsList(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<ArticleInfo>>> getArticleListObservable() {
|
||||
return mRetrofit.create(ArticleListApi.class)
|
||||
.getArticleList(Utils.getSerial())
|
||||
.getArticleList(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<Contact>>> getContactListObservable() {
|
||||
return mRetrofit.create(GetMailList.class)
|
||||
.getContact(Utils.getSerial())
|
||||
.getContact(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getAdminSnSettingObservable() {
|
||||
return mRetrofit.create(GetAdminSnSettingApi.class)
|
||||
.getAdminSnSetting(Utils.getSerial())
|
||||
.getAdminSnSetting(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getUpdateAppIconObservable(String pkg, String label, int type) {
|
||||
return mRetrofit.create(UpdateAppIconApi.class)
|
||||
.appIconUpdate(Utils.getSerial(), pkg, type, label)
|
||||
.appIconUpdate(RemoteManager.getInstance().getSerial(), pkg, type, label)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -278,7 +279,7 @@ public class NetInterfaceManager {
|
||||
public Observable<BaseResponse<List<AlarmClockData>>> getAlarmClockObservable() {
|
||||
return mRetrofit
|
||||
.create(AlarmClockApi.class)
|
||||
.getAlarmClockApiApi(Utils.getSerial())
|
||||
.getAlarmClockApiApi(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -299,14 +300,14 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<AlarmClockData>> getAlarmClockByIdObservable(int id) {
|
||||
return mRetrofit.create(AlarmClockQueryApi.class)
|
||||
.getAlarmClockById(Utils.getSerial(), id)
|
||||
.getAlarmClockById(RemoteManager.getInstance().getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> deleteAlarmClockObservable(int id) {
|
||||
return mRetrofit.create(AlarmClockDeleteApi.class)
|
||||
.alarmClockDelete(Utils.getSerial(), id)
|
||||
.alarmClockDelete(RemoteManager.getInstance().getSerial(), id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -317,7 +318,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<UserId>> getUserIDObservable() {
|
||||
return mRetrofit.create(GetUserIDApi.class)
|
||||
.getUserID(Utils.getSerial())
|
||||
.getUserID(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -384,7 +385,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<List<ActivityBean>>> getActivityListObservable() {
|
||||
return mRetrofit.create(ActivityListApi.class)
|
||||
.getActivityList(Utils.getSerial(), 1, 1, getUserId())
|
||||
.getActivityList(RemoteManager.getInstance().getSerial(), 1, 1, getUserId())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -494,7 +495,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<List<DemandBean>>> getDemandListObservable() {
|
||||
return mRetrofit.create(DemandListApi.class)
|
||||
.getDemandList(Utils.getSerial(), 1, 1, getUserId())
|
||||
.getDemandList(RemoteManager.getInstance().getSerial(), 1, 1, getUserId())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -614,7 +615,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse<List<HealthCode>>> getHealthCodeObservable() {
|
||||
return mRetrofit.create(HealthCodeApi.class)
|
||||
.getArticleDetails(Utils.getSerial())
|
||||
.getArticleDetails(RemoteManager.getInstance().getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -1134,5 +1135,78 @@ public class NetInterfaceManager {
|
||||
};
|
||||
}
|
||||
|
||||
public interface UserAvatarInfoCallback {
|
||||
void setUserAvatarInfo(UserAvatarInfo info);
|
||||
}
|
||||
|
||||
// public void getUserAvatarInfo(boolean refresh, BehaviorSubject<FragmentEvent> lifecycle, UserAvatarInfoCallback callback) {
|
||||
// ConnectMode connectMode = ConnectMode.ONE_MINUTE;
|
||||
// if (refresh) {
|
||||
// connectMode = ConnectMode.DEFAULT;
|
||||
// }
|
||||
// if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_USER_AVATAR_INFO, connectMode)) {
|
||||
// getUserAvatarInfo(lifecycle, callback);
|
||||
// } else {
|
||||
// String jsonString = mCacheHelper.getAsString(UrlAddress.GET_USER_AVATAR_INFO);
|
||||
// //为 "" 是已经请求成功的
|
||||
// if (jsonString == null) {
|
||||
// getUserAvatarInfo(lifecycle, callback);
|
||||
// } else {
|
||||
// Gson gson = new Gson();
|
||||
// Type type = new TypeToken<UserAvatarInfo>() {
|
||||
// }.getType();
|
||||
// UserAvatarInfo userAvatarInfo = gson.fromJson(jsonString, type);
|
||||
// if (callback != null) {
|
||||
// callback.setUserAvatarInfo(userAvatarInfo);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public void getUserAvatarInfo(BehaviorSubject<FragmentEvent> lifecycle, UserAvatarInfoCallback callback) {
|
||||
getUserAvatarInfoControl()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, FragmentEvent.DESTROY))
|
||||
.subscribe(getUserAvatarInfoObserver(callback));
|
||||
}
|
||||
|
||||
public void getUserAvatarInfo(UserAvatarInfoCallback callback) {
|
||||
getUserAvatarInfoControl()
|
||||
.subscribe(getUserAvatarInfoObserver(callback));
|
||||
}
|
||||
|
||||
public void getUserAvatarInfo() {
|
||||
getUserAvatarInfoControl()
|
||||
.subscribe(getUserAvatarInfoObserver(null));
|
||||
}
|
||||
|
||||
public Observer<BaseResponse<UserAvatarInfo>> getUserAvatarInfoObserver(UserAvatarInfoCallback callback) {
|
||||
return new Observer<BaseResponse<UserAvatarInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getUserAvatarInfoControl", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<UserAvatarInfo> userAvatarInfoBaseResponse) {
|
||||
Log.e("getUserAvatarInfoControl", "onNext: " + userAvatarInfoBaseResponse);
|
||||
if (callback != null) {
|
||||
callback.setUserAvatarInfo(userAvatarInfoBaseResponse.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getUserAvatarInfoControl", "onError: " + e.getMessage());
|
||||
if (callback != null) {
|
||||
callback.setUserAvatarInfo(null);
|
||||
}
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getUserAvatarInfoControl", "onComplete: ");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,11 @@ public class RepeatRequestInterceptor implements Interceptor {
|
||||
// Response copy = response.newBuilder().body(responseBody).build();
|
||||
ResponseBody copy = ResponseBody.create(responseBody.contentType(), content);
|
||||
if (BuildConfig.DEBUG) {
|
||||
// Log.e(TAG, "请求体返回:| Response: " + request.url().encodedPath() + "\t body: " + content);
|
||||
if (content.length() < 1024) {
|
||||
Log.e(TAG, "请求体返回:| Response: " + request.url() + "\t body: " + content);
|
||||
}else {
|
||||
Log.e(TAG, "请求体返回:| Response: " + request.url() + "\t body: too long" );
|
||||
}
|
||||
}
|
||||
//相同的请求
|
||||
String requestKey = MD5Util.getUpperMD5Str(request.method() + request.url().toString() + requestBodyToString(request.body()));
|
||||
@@ -83,7 +87,7 @@ public class RepeatRequestInterceptor implements Interceptor {
|
||||
final Request copy = request.newBuilder().build();
|
||||
final Buffer buffer = new Buffer();
|
||||
copy.body().writeTo(buffer);
|
||||
if (buffer.size() > 4096) {
|
||||
if (buffer.size() > 1024) {
|
||||
return "-too long";
|
||||
}
|
||||
return buffer.readUtf8();
|
||||
@@ -96,7 +100,7 @@ public class RepeatRequestInterceptor implements Interceptor {
|
||||
try {
|
||||
final Buffer buffer = new Buffer();
|
||||
body.writeTo(buffer);
|
||||
if (buffer.size() > 4096) {
|
||||
if (buffer.size() > 1024) {
|
||||
return "-too long";
|
||||
}
|
||||
return buffer.readUtf8();
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.uiuios.aios.push.tpush;
|
||||
|
||||
/**
|
||||
* Created by chacewang on 2019/7/5.
|
||||
*/
|
||||
|
||||
public class Constants {
|
||||
public static final int TEST_LOCAL_NOTIFICATION = 1;
|
||||
public static final int TEST_NOTIFICATION = 2;
|
||||
public static final int TEST_SET_TAG = 3;
|
||||
public static final int TEST_DEL_TAG = 4;
|
||||
public static final int TEST_SET_ACCOUNT = 5;
|
||||
public static final int TEST_DEL_ACCOUNT = 6;
|
||||
|
||||
public static final String LOCAL_NOTIFICATION_TITLE = "localtest";
|
||||
public static final String TEST_TAG_NAME = "DiagnosisTag";
|
||||
}
|
||||
@@ -1,305 +0,0 @@
|
||||
package com.uiuios.aios.push.tpush;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.tencent.android.tpush.NotificationAction;
|
||||
import com.tencent.android.tpush.XGPushBaseReceiver;
|
||||
import com.tencent.android.tpush.XGPushClickedResult;
|
||||
import com.tencent.android.tpush.XGPushRegisterResult;
|
||||
import com.tencent.android.tpush.XGPushShowedResult;
|
||||
import com.tencent.android.tpush.XGPushTextMessage;
|
||||
import com.uiuios.aios.push.PushManager;
|
||||
import com.uiuios.aios.push.tpush.common.NotificationService;
|
||||
import com.uiuios.aios.push.tpush.po.XGNotification;
|
||||
import com.uiuios.aios.utils.ToastUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class MessageReceiver extends XGPushBaseReceiver {
|
||||
private static final String TAG = MessageReceiver.class.getSimpleName();
|
||||
|
||||
public static final String UPDATE_LISTVIEW_ACTION = "com.qq.xgdemo.activity.UPDATE_LISTVIEW";
|
||||
public static final String TEST_ACTION = "com.qq.xgdemo.activity.TEST_ACTION";
|
||||
public static final String LogTag = "xg.test";
|
||||
|
||||
private Context mContext;
|
||||
private ContentResolver mResolver;
|
||||
private PackageManager mPackageManager;
|
||||
|
||||
/**
|
||||
* 消息透传处理
|
||||
*
|
||||
* @param context
|
||||
* @param message 解析自定义的 JSON
|
||||
*/
|
||||
@Override
|
||||
public void onTextMessage(Context context, XGPushTextMessage message) {
|
||||
this.mContext = context;
|
||||
this.mResolver = context.getContentResolver();
|
||||
this.mPackageManager = context.getPackageManager();
|
||||
String text = "收到消息:" + message.toString();
|
||||
// 获取自定义key-value
|
||||
String customContent = message.getCustomContent();
|
||||
if (customContent != null && customContent.length() != 0) {
|
||||
JsonObject obj = JsonParser.parseString(customContent).getAsJsonObject();
|
||||
// key1为前台配置的key
|
||||
if (!TextUtils.isEmpty(obj.get("key").getAsString())) {
|
||||
String value = obj.get("key").getAsString();
|
||||
Log.d(LogTag, "get custom value:" + value);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
// APP自主处理消息的过程...
|
||||
Log.e(LogTag, text);
|
||||
show(context, text);
|
||||
processCustomMessage(context, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知展示
|
||||
*
|
||||
* @param context
|
||||
* @param notifiShowedRlt 包含通知的内容
|
||||
*/
|
||||
@Override
|
||||
public void onNotificationShowedResult(Context context, XGPushShowedResult notifiShowedRlt) {
|
||||
if (context == null || notifiShowedRlt == null) {
|
||||
return;
|
||||
}
|
||||
XGNotification notific = new XGNotification();
|
||||
notific.setMsg_id(notifiShowedRlt.getMsgId());
|
||||
notific.setTitle(notifiShowedRlt.getTitle());
|
||||
notific.setContent(notifiShowedRlt.getContent());
|
||||
// notificationActionType==1为Activity,2为url,3为intent
|
||||
notific.setNotificationActionType(notifiShowedRlt
|
||||
.getNotificationActionType());
|
||||
// Activity,url,intent都可以通过getActivity()获得
|
||||
notific.setActivity(notifiShowedRlt.getActivity());
|
||||
notific.setUpdate_time(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
.format(Calendar.getInstance().getTime()));
|
||||
NotificationService.getInstance(context).save(notific);
|
||||
|
||||
Intent testIntent = new Intent(TEST_ACTION);
|
||||
if (notifiShowedRlt.getTitle().equals(Constants.LOCAL_NOTIFICATION_TITLE)) {
|
||||
testIntent.putExtra("step", Constants.TEST_LOCAL_NOTIFICATION);
|
||||
} else {
|
||||
testIntent.putExtra("step", Constants.TEST_NOTIFICATION);
|
||||
}
|
||||
context.sendBroadcast(testIntent);
|
||||
|
||||
Intent viewIntent = new Intent(UPDATE_LISTVIEW_ACTION);
|
||||
context.sendBroadcast(viewIntent);
|
||||
show(context, "您有1条新消息, " + "通知被展示 , " + notifiShowedRlt.toString());
|
||||
Log.d(LogTag, "您有1条新消息, " + "通知被展示 , " + notifiShowedRlt.toString() + ", PushChannel:" + notifiShowedRlt.getPushChannel());
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册回调
|
||||
*
|
||||
* @param context
|
||||
* @param errorCode 0 为成功,其它为错误码
|
||||
*/
|
||||
@Override
|
||||
public void onRegisterResult(Context context, int errorCode, XGPushRegisterResult message) {
|
||||
if (context == null || message == null) {
|
||||
return;
|
||||
}
|
||||
String text = "";
|
||||
if (errorCode == XGPushBaseReceiver.SUCCESS) {
|
||||
// 在这里拿token
|
||||
String token = message.getToken();
|
||||
text = "注册成功1. token:" + token;
|
||||
} else {
|
||||
text = message + "注册失败,错误码:" + errorCode;
|
||||
}
|
||||
Log.d(LogTag, text);
|
||||
show(context, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反注册回调
|
||||
*
|
||||
* @param context
|
||||
* @param errorCode 0 为成功,其它为错误码
|
||||
*/
|
||||
@Override
|
||||
public void onUnregisterResult(Context context, int errorCode) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
String text = "";
|
||||
if (errorCode == XGPushBaseReceiver.SUCCESS) {
|
||||
text = "反注册成功";
|
||||
} else {
|
||||
text = "反注册失败" + errorCode;
|
||||
}
|
||||
Log.d(LogTag, text);
|
||||
show(context, text);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置标签回调
|
||||
*
|
||||
* @param context
|
||||
* @param errorCode 0 为成功,其它为错误码
|
||||
* @param tagName 设置的 TAG
|
||||
*/
|
||||
@Override
|
||||
public void onSetTagResult(Context context, int errorCode, String tagName) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
String text = "";
|
||||
if (errorCode == XGPushBaseReceiver.SUCCESS) {
|
||||
text = "\"" + tagName + "\"设置成功";
|
||||
} else {
|
||||
text = "\"" + tagName + "\"设置失败,错误码:" + errorCode;
|
||||
}
|
||||
Log.d(LogTag, text);
|
||||
show(context, text);
|
||||
|
||||
Intent testIntent = new Intent(TEST_ACTION);
|
||||
testIntent.putExtra("step", Constants.TEST_SET_TAG);
|
||||
context.sendBroadcast(testIntent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签的回调
|
||||
*
|
||||
* @param context
|
||||
* @param errorCode 0 为成功,其它为错误码
|
||||
* @param tagName 设置的 TAG
|
||||
*/
|
||||
@Override
|
||||
public void onDeleteTagResult(Context context, int errorCode, String tagName) {
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
String text = "";
|
||||
if (errorCode == XGPushBaseReceiver.SUCCESS) {
|
||||
text = "\"" + tagName + "\"删除成功";
|
||||
} else {
|
||||
text = "\"" + tagName + "\"删除失败,错误码:" + errorCode;
|
||||
}
|
||||
Log.d(LogTag, text);
|
||||
show(context, text);
|
||||
|
||||
Intent testIntent = new Intent(TEST_ACTION);
|
||||
testIntent.putExtra("step", Constants.TEST_DEL_TAG);
|
||||
context.sendBroadcast(testIntent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置账号回调
|
||||
*
|
||||
* @param context
|
||||
* @param errorCode 0 为成功,其它为错误码
|
||||
* @param account 设置的账号
|
||||
*/
|
||||
@Override
|
||||
public void onSetAccountResult(Context context, int errorCode, String account) {
|
||||
Intent testIntent = new Intent(TEST_ACTION);
|
||||
testIntent.putExtra("step", Constants.TEST_SET_ACCOUNT);
|
||||
context.sendBroadcast(testIntent);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除账号回调
|
||||
*
|
||||
* @param context
|
||||
* @param errorCode 0 为成功,其它为错误码
|
||||
* @param account 设置的账号
|
||||
*/
|
||||
@Override
|
||||
public void onDeleteAccountResult(Context context, int errorCode, String account) {
|
||||
Intent testIntent = new Intent(TEST_ACTION);
|
||||
testIntent.putExtra("step", Constants.TEST_DEL_ACCOUNT);
|
||||
context.sendBroadcast(testIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetAttributeResult(Context context, int i, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteAttributeResult(Context context, int i, String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueryTagsResult(Context context, int errorCode, String data, String operateName) {
|
||||
Log.i(LogTag, "action - onQueryTagsResult, errorCode:" + errorCode + ", operateName:" + operateName + ", data: " + data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知点击回调 actionType=1为该消息被清除,actionType=0为该消息被点击
|
||||
*
|
||||
* @param context
|
||||
* @param message 包含被点击通知的内容
|
||||
*/
|
||||
@Override
|
||||
public void onNotificationClickedResult(Context context, XGPushClickedResult message) {
|
||||
if (context == null || message == null) {
|
||||
return;
|
||||
}
|
||||
String text = "";
|
||||
if (message.getActionType() == NotificationAction.clicked.getType()) {
|
||||
// 通知在通知栏被点击啦。。。。。
|
||||
// APP自己处理点击的相关动作
|
||||
// 这个动作可以在activity的onResume也能监听,请看第3点相关内容
|
||||
text = "通知被打开 :" + message;
|
||||
} else if (message.getActionType() == NotificationAction.delete.getType()) {
|
||||
// 通知被清除啦。。。。
|
||||
// APP自己处理通知被清除后的相关动作
|
||||
text = "通知被清除 :" + message;
|
||||
}
|
||||
Toast.makeText(context, "广播接收到通知被点击:" + message.toString(),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
// 获取自定义key-value
|
||||
String customContent = message.getCustomContent();
|
||||
if (customContent != null && customContent.length() != 0) {
|
||||
JsonObject obj = JsonParser.parseString(customContent).getAsJsonObject();
|
||||
// key1为前台配置的key
|
||||
if (!TextUtils.isEmpty(obj.get("key").getAsString())) {
|
||||
String value = obj.get("key").getAsString();
|
||||
Log.d(LogTag, "get custom value:" + value);
|
||||
}
|
||||
// ...
|
||||
}
|
||||
// APP自主处理的过程。。。
|
||||
Log.d(LogTag, text);
|
||||
show(context, text);
|
||||
}
|
||||
|
||||
private void show(Context context, String text) {
|
||||
// Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
private void processCustomMessage(Context context, XGPushTextMessage message) {
|
||||
if (context == null || message == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String title = message.getTitle();
|
||||
String content = message.getContent();
|
||||
JsonObject extrasJson = JsonParser.parseString(content).getAsJsonObject();
|
||||
|
||||
String extras = "";
|
||||
if (extrasJson.get("extras") != null) {
|
||||
extras = extrasJson.get("extras").toString();
|
||||
}
|
||||
PushManager.getInstance().setPushContent(title, extras);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.uiuios.aios.push.tpush.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
public class DBOpenHelper extends SQLiteOpenHelper {
|
||||
|
||||
public DBOpenHelper(Context context) {
|
||||
super(context, "XGExample.db", null, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
db.execSQL("CREATE TABLE notification (id integer primary key autoincrement,msg_id varchar(64),title varchar(128),activity varchar(256),notificationActionType varchar(512),content text,update_time varchar(16))");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
package com.uiuios.aios.push.tpush.common;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
|
||||
|
||||
import com.uiuios.aios.push.tpush.po.XGNotification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NotificationService {
|
||||
private DBOpenHelper dbOpenHelper;
|
||||
private static NotificationService instance = null;
|
||||
|
||||
public NotificationService(Context context) {
|
||||
this.dbOpenHelper = new DBOpenHelper(context);
|
||||
}
|
||||
|
||||
public synchronized static NotificationService getInstance(Context ctx) {
|
||||
if (null == instance) {
|
||||
instance = new NotificationService(ctx);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void save(XGNotification notification) {
|
||||
SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("msg_id", notification.getMsg_id());
|
||||
values.put("title", notification.getTitle());
|
||||
values.put("content", notification.getContent());
|
||||
values.put("activity", notification.getActivity());
|
||||
values.put("notificationActionType", notification.getNotificationActionType());
|
||||
values.put("update_time", notification.getUpdate_time());
|
||||
db.insert("notification", null, values);
|
||||
}
|
||||
|
||||
public void delete(Integer id) {
|
||||
SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
|
||||
db.delete("notification", "id=?", new String[] { id.toString() });
|
||||
}
|
||||
|
||||
public void deleteAll() {
|
||||
SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
|
||||
db.delete("notification", "", null);
|
||||
}
|
||||
|
||||
public void update(XGNotification notification) {
|
||||
SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put("msg_id", notification.getMsg_id());
|
||||
values.put("title", notification.getTitle());
|
||||
values.put("content", notification.getContent());
|
||||
values.put("activity", notification.getActivity());
|
||||
values.put("notificationActionType", notification.getNotificationActionType());
|
||||
values.put("update_time", notification.getUpdate_time());
|
||||
db.update("notification", values, "id=?", new String[] { notification
|
||||
.getId().toString() });
|
||||
}
|
||||
|
||||
public XGNotification find(Integer id) {
|
||||
SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
|
||||
Cursor cursor = db
|
||||
.query("notification",
|
||||
new String[] { "id,msg_id,title,content,activity,notificationActionType,update_time" },
|
||||
"id=?", new String[] { id.toString() }, null, null,
|
||||
null, "1");
|
||||
try {
|
||||
if (cursor.moveToFirst()) {
|
||||
return new XGNotification(cursor.getInt(cursor
|
||||
.getColumnIndex("id")), cursor.getLong(cursor
|
||||
.getColumnIndex("msg_id")), cursor.getString(cursor
|
||||
.getColumnIndex("title")), cursor.getString(cursor
|
||||
.getColumnIndex("content")), cursor.getString(cursor
|
||||
.getColumnIndex("activity")), cursor.getInt(cursor
|
||||
.getColumnIndex("notificationActionType")), cursor.getString(cursor
|
||||
.getColumnIndex("update_time")));
|
||||
}
|
||||
return null;
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<XGNotification> getScrollData(int currentPage, int lineSize,
|
||||
String msg_id) {
|
||||
String firstResult = String.valueOf((currentPage - 1) * lineSize);
|
||||
SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
|
||||
Cursor cursor = null;
|
||||
try {
|
||||
if (msg_id == null || "".equals(msg_id)) {
|
||||
cursor = db
|
||||
.query("notification",
|
||||
new String[] { "id,msg_id,title,content,activity,notificationActionType,update_time" },
|
||||
null, null, null, null, "update_time DESC",
|
||||
firstResult + "," + lineSize);
|
||||
} else {
|
||||
cursor = db
|
||||
.query("notification",
|
||||
new String[] { "id,msg_id,title,content,activity,notificationActionType,update_time" },
|
||||
"msg_id like ?", new String[] { msg_id + "%" },
|
||||
null, null, "update_time DESC", firstResult
|
||||
+ "," + lineSize);
|
||||
}
|
||||
List<XGNotification> notifications = new ArrayList<XGNotification>();
|
||||
while (cursor.moveToNext()) {
|
||||
notifications.add(new XGNotification(cursor.getInt(cursor
|
||||
.getColumnIndex("id")), cursor.getLong(cursor
|
||||
.getColumnIndex("msg_id")), cursor.getString(cursor
|
||||
.getColumnIndex("title")), cursor.getString(cursor
|
||||
.getColumnIndex("content")), cursor.getString(cursor
|
||||
.getColumnIndex("activity")), cursor.getInt(cursor
|
||||
.getColumnIndex("notificationActionType")), cursor.getString(cursor
|
||||
.getColumnIndex("update_time"))));
|
||||
}
|
||||
return notifications;
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
|
||||
Cursor cursor = db.rawQuery("select count(*) from notification", null);
|
||||
try {
|
||||
cursor.moveToFirst();
|
||||
return cursor.getInt(0);
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.uiuios.aios.push.tpush.po;
|
||||
|
||||
public class XGNotification {
|
||||
private Integer id;
|
||||
private Long msg_id;
|
||||
private String title;
|
||||
private String content;
|
||||
private String activity;
|
||||
private int notificationActionType;
|
||||
private String update_time;
|
||||
|
||||
public XGNotification() {
|
||||
|
||||
}
|
||||
|
||||
public XGNotification(Integer id, Long msg_id, String title,
|
||||
String content, String activity, int notificationActionType, String update_time) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.msg_id = msg_id;
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
this.activity = activity;
|
||||
this.notificationActionType = notificationActionType;
|
||||
this.update_time = update_time;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getMsg_id() {
|
||||
return msg_id;
|
||||
}
|
||||
|
||||
public void setMsg_id(Long msg_id) {
|
||||
this.msg_id = msg_id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getUpdate_time() {
|
||||
return update_time;
|
||||
}
|
||||
|
||||
public void setUpdate_time(String update_time) {
|
||||
this.update_time = update_time;
|
||||
}
|
||||
|
||||
public String getActivity() {
|
||||
return activity;
|
||||
}
|
||||
|
||||
public void setActivity(String activity) {
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
public int getNotificationActionType() {
|
||||
return notificationActionType;
|
||||
}
|
||||
|
||||
public void setNotificationActionType(int notificationActionType) {
|
||||
this.notificationActionType = notificationActionType;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import com.uiuios.aios.alarm.AlarmUtils;
|
||||
import com.uiuios.aios.bean.AlarmClockId;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.Utils;
|
||||
|
||||
@@ -80,7 +81,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
addFinishStatu = 0;
|
||||
for (AlarmClockData alarmClockData : localAddAlarm) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("time", alarmClockData.getTime());
|
||||
params.put("type", String.valueOf(alarmClockData.getType()));
|
||||
params.put("title", alarmClockData.getTitle());
|
||||
@@ -168,7 +169,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
private Observable<BaseResponse<AlarmClockId>> getAddObservable(AlarmClockData alarmClockData) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("sn", Utils.getSerial());
|
||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||
params.put("time", alarmClockData.getTime());
|
||||
params.put("type", String.valueOf(alarmClockData.getType()));
|
||||
params.put("title", alarmClockData.getTitle());
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.uiuios.aios.alarm.AlarmUtils;
|
||||
import com.uiuios.aios.base.BaseService;
|
||||
import com.uiuios.aios.alarm.AlarmClockData;
|
||||
import com.uiuios.aios.bean.BaseResponse;
|
||||
import com.uiuios.aios.manager.RemoteManager;
|
||||
import com.uiuios.aios.network.NetInterfaceManager;
|
||||
import com.uiuios.aios.utils.ApkUtils;
|
||||
import com.uiuios.aios.utils.AppUsedTimeUtils;
|
||||
@@ -226,7 +227,6 @@ public class MainService extends BaseService implements MainSContact.MainSView,
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "timezone changed");
|
||||
} else if (Intent.ACTION_TIME_TICK.equals(intent.getAction())) {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "time tick");
|
||||
// isScreenshot();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ public class MainService extends BaseService implements MainSContact.MainSView,
|
||||
private static Observable<BaseResponse> getSendFile(String path, MultipartBody.Part body) {
|
||||
return NetInterfaceManager.getInstance()
|
||||
.getScreenshotApi()
|
||||
.sendScreenshot(Utils.getSerial(), body)
|
||||
.sendScreenshot(RemoteManager.getInstance().getSerial(), body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -397,7 +397,7 @@ public class MainService extends BaseService implements MainSContact.MainSView,
|
||||
// AppUsedTimeUtils.getInstance().setEndTime(System.currentTimeMillis());
|
||||
if (!TextUtils.isEmpty(packagename)) {
|
||||
NetInterfaceManager.getInstance().getAppUsageRecordControl()
|
||||
.sendappUsageRecord(Utils.getSerial(),
|
||||
.sendappUsageRecord(RemoteManager.getInstance().getSerial(),
|
||||
ApkUtils.getAppNameByPackage(context, packagename),
|
||||
packagename,
|
||||
AppUsedTimeUtils.getInstance().getStartTime() / 1000,
|
||||
|
||||
@@ -250,6 +250,12 @@ public class ApkUtils {
|
||||
familyIcon.setPackageName("aios.appstore");
|
||||
desktopIcons.add(1, familyIcon);
|
||||
|
||||
DesktopIcon exitIcon = new DesktopIcon();
|
||||
exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
||||
exitIcon.setLable("切换系统");
|
||||
exitIcon.setPackageName("aios.exit");
|
||||
desktopIcons.add(exitIcon);
|
||||
|
||||
return desktopIcons;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ import androidx.annotation.NonNull;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuios.aios.config.CommonConfig;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Type;
|
||||
@@ -24,6 +26,7 @@ public class AppUsedTimeUtils {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static AppUsedTimeUtils sInstance;
|
||||
private Context mContext;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private SimpleDateFormat ruleSDF = new SimpleDateFormat("HH:mm:ss");
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@@ -123,7 +126,7 @@ public class AppUsedTimeUtils {
|
||||
}
|
||||
|
||||
synchronized private AppTimeinfo getAppTimeinfo() {
|
||||
String jsonString = Settings.System.getString(mContext.getContentResolver(), "runningAppInfo");
|
||||
String jsonString = mMMKV.decodeString("runningAppInfo");
|
||||
if (TextUtils.isEmpty(jsonString)) {
|
||||
return new AppTimeinfo();
|
||||
}
|
||||
@@ -137,7 +140,7 @@ public class AppUsedTimeUtils {
|
||||
|
||||
synchronized private void setAppTimeinfo() {
|
||||
String jsonString = JsonParser.parseString(appTimeinfo.toString()).getAsJsonObject().toString();
|
||||
Settings.System.putString(mContext.getContentResolver(), "runningAppInfo", jsonString);
|
||||
mMMKV.encode("runningAppInfo", jsonString);
|
||||
}
|
||||
|
||||
private static final long DAY_TIME = 1000 * 60 * 60 * 24;
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
*/
|
||||
package com.uiuios.aios.utils;
|
||||
|
||||
import android.util.MathUtils;
|
||||
|
||||
public class BrightnessUtils {
|
||||
|
||||
public static final int GAMMA_SPACE_MIN = 0;
|
||||
|
||||
186
app/src/main/java/com/uiuios/aios/utils/MathUtils.java
Normal file
@@ -0,0 +1,186 @@
|
||||
package com.uiuios.aios.utils;
|
||||
|
||||
import android.graphics.Rect;
|
||||
|
||||
public final class MathUtils {
|
||||
private static final float DEG_TO_RAD = 0.017453292F;
|
||||
private static final float RAD_TO_DEG = 57.295784F;
|
||||
|
||||
private MathUtils() {
|
||||
}
|
||||
|
||||
public static float abs(float v) {
|
||||
return v > 0.0F ? v : -v;
|
||||
}
|
||||
|
||||
public static int constrain(int amount, int low, int high) {
|
||||
return amount < low ? low : (amount > high ? high : amount);
|
||||
}
|
||||
|
||||
public static long constrain(long amount, long low, long high) {
|
||||
return amount < low ? low : (amount > high ? high : amount);
|
||||
}
|
||||
|
||||
public static float constrain(float amount, float low, float high) {
|
||||
return amount < low ? low : (amount > high ? high : amount);
|
||||
}
|
||||
|
||||
public static float log(float a) {
|
||||
return (float)Math.log((double)a);
|
||||
}
|
||||
|
||||
public static float exp(float a) {
|
||||
return (float)Math.exp((double)a);
|
||||
}
|
||||
|
||||
public static float pow(float a, float b) {
|
||||
return (float)Math.pow((double)a, (double)b);
|
||||
}
|
||||
|
||||
public static float sqrt(float a) {
|
||||
return (float)Math.sqrt((double)a);
|
||||
}
|
||||
|
||||
public static float max(float a, float b) {
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
public static float max(int a, int b) {
|
||||
return a > b ? (float)a : (float)b;
|
||||
}
|
||||
|
||||
public static float max(float a, float b, float c) {
|
||||
return a > b ? (a > c ? a : c) : (b > c ? b : c);
|
||||
}
|
||||
|
||||
public static float max(int a, int b, int c) {
|
||||
return a > b ? (float)(a > c ? a : c) : (float)(b > c ? b : c);
|
||||
}
|
||||
|
||||
public static float min(float a, float b) {
|
||||
return a < b ? a : b;
|
||||
}
|
||||
|
||||
public static float min(int a, int b) {
|
||||
return a < b ? (float)a : (float)b;
|
||||
}
|
||||
|
||||
public static float min(float a, float b, float c) {
|
||||
return a < b ? (a < c ? a : c) : (b < c ? b : c);
|
||||
}
|
||||
|
||||
public static float min(int a, int b, int c) {
|
||||
return a < b ? (float)(a < c ? a : c) : (float)(b < c ? b : c);
|
||||
}
|
||||
|
||||
public static float dist(float x1, float y1, float x2, float y2) {
|
||||
float x = x2 - x1;
|
||||
float y = y2 - y1;
|
||||
return (float)Math.hypot((double)x, (double)y);
|
||||
}
|
||||
|
||||
public static float dist(float x1, float y1, float z1, float x2, float y2, float z2) {
|
||||
float x = x2 - x1;
|
||||
float y = y2 - y1;
|
||||
float z = z2 - z1;
|
||||
return (float)Math.sqrt((double)(x * x + y * y + z * z));
|
||||
}
|
||||
|
||||
public static float mag(float a, float b) {
|
||||
return (float)Math.hypot((double)a, (double)b);
|
||||
}
|
||||
|
||||
public static float mag(float a, float b, float c) {
|
||||
return (float)Math.sqrt((double)(a * a + b * b + c * c));
|
||||
}
|
||||
|
||||
public static float sq(float v) {
|
||||
return v * v;
|
||||
}
|
||||
|
||||
public static float dot(float v1x, float v1y, float v2x, float v2y) {
|
||||
return v1x * v2x + v1y * v2y;
|
||||
}
|
||||
|
||||
public static float cross(float v1x, float v1y, float v2x, float v2y) {
|
||||
return v1x * v2y - v1y * v2x;
|
||||
}
|
||||
|
||||
public static float radians(float degrees) {
|
||||
return degrees * 0.017453292F;
|
||||
}
|
||||
|
||||
public static float degrees(float radians) {
|
||||
return radians * 57.295784F;
|
||||
}
|
||||
|
||||
public static float acos(float value) {
|
||||
return (float)Math.acos((double)value);
|
||||
}
|
||||
|
||||
public static float asin(float value) {
|
||||
return (float)Math.asin((double)value);
|
||||
}
|
||||
|
||||
public static float atan(float value) {
|
||||
return (float)Math.atan((double)value);
|
||||
}
|
||||
|
||||
public static float atan2(float a, float b) {
|
||||
return (float)Math.atan2((double)a, (double)b);
|
||||
}
|
||||
|
||||
public static float tan(float angle) {
|
||||
return (float)Math.tan((double)angle);
|
||||
}
|
||||
|
||||
public static float lerp(float start, float stop, float amount) {
|
||||
return start + (stop - start) * amount;
|
||||
}
|
||||
|
||||
public static float lerpInv(float a, float b, float value) {
|
||||
return a != b ? (value - a) / (b - a) : 0.0F;
|
||||
}
|
||||
|
||||
public static float saturate(float value) {
|
||||
return constrain(value, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
public static float lerpInvSat(float a, float b, float value) {
|
||||
return saturate(lerpInv(a, b, value));
|
||||
}
|
||||
|
||||
public static float lerpDeg(float start, float end, float amount) {
|
||||
float minAngle = (end - start + 180.0F) % 360.0F - 180.0F;
|
||||
return minAngle * amount + start;
|
||||
}
|
||||
|
||||
public static float norm(float start, float stop, float value) {
|
||||
return (value - start) / (stop - start);
|
||||
}
|
||||
|
||||
public static float map(float minStart, float minStop, float maxStart, float maxStop, float value) {
|
||||
return maxStart + (maxStop - maxStart) * ((value - minStart) / (minStop - minStart));
|
||||
}
|
||||
|
||||
public static float constrainedMap(float rangeMin, float rangeMax, float valueMin, float valueMax, float value) {
|
||||
return lerp(rangeMin, rangeMax, lerpInvSat(valueMin, valueMax, value));
|
||||
}
|
||||
|
||||
public static float smoothStep(float start, float end, float x) {
|
||||
return constrain((x - start) / (end - start), 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
public static int addOrThrow(int a, int b) throws IllegalArgumentException {
|
||||
if (b == 0) {
|
||||
return a;
|
||||
} else if (b > 0 && a <= 2147483647 - b) {
|
||||
return a + b;
|
||||
} else if (b < 0 && a >= -2147483648 - b) {
|
||||
return a + b;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Addition overflow: " + a + " + " + b);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import android.graphics.PorterDuffXfermode;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -141,15 +140,15 @@ public class Utils {
|
||||
intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.AoleReceiver"));
|
||||
// TODO: 2022/7/6 有问题
|
||||
setDefaultLauncher(context, "com.android.transfer", "com.android.transfer.MainActivity");
|
||||
SystemProperties.set("persist.sys.launcher.pkgname", pkg);
|
||||
SystemProperties.set("persist.sys.launcher.classname", className);
|
||||
// SystemProperties.set("persist.sys.launcher.pkgname", pkg);
|
||||
// SystemProperties.set("persist.sys.launcher.classname", className);
|
||||
// }
|
||||
intent.setPackage("com.android.settings");
|
||||
context.sendBroadcast(intent);
|
||||
// ApkUtils.openPackage(mContext, pkg);
|
||||
Log.e(TAG, "setDefaultDesktop: " + pkg + ":" + className);
|
||||
Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.pkgname = " + SystemProperties.get("persist.sys.launcher.pkgname"));
|
||||
Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.classname = " + SystemProperties.get("persist.sys.launcher.classname"));
|
||||
// Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.pkgname = " + SystemProperties.get("persist.sys.launcher.pkgname"));
|
||||
// Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.classname = " + SystemProperties.get("persist.sys.launcher.classname"));
|
||||
}
|
||||
|
||||
public static void setDefaultLauncher(Context context, String defPackageName, String defClassName) {
|
||||
@@ -204,7 +203,7 @@ public class Utils {
|
||||
+ packageName);
|
||||
}
|
||||
};
|
||||
roleManager.addRoleHolderAsUser(roleName, packageName, flags, user, executor, callback);
|
||||
// roleManager.addRoleHolderAsUser(roleName, packageName, flags, user, executor, callback);
|
||||
Log.i("settingssssssstemf", "addRoleHolderAsUser done");
|
||||
// }
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-hdpi/app_exit.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 5.1 KiB |
BIN
app/src/main/res/drawable-hdpi/exit_icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 3.6 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_alarm.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 8.7 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_lock.png
Normal file
|
After Width: | Height: | Size: 900 B |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -4,14 +4,20 @@
|
||||
<solid android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp"
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp" />
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp"
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="-45"
|
||||
android:endColor="#8A56E9"
|
||||
android:startColor="#4D73E6"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -4,14 +4,20 @@
|
||||
<solid android:color="#fcebc3" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:bottomRightRadius="16dp"
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp" />
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp"
|
||||
android:topLeftRadius="10dp"
|
||||
android:topRightRadius="10dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="4dp"
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="-45"
|
||||
android:endColor="#536976"
|
||||
android:startColor="#bbd2c5"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#90a1b7" />
|
||||
<solid android:color="#fcebc3" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="16dp"
|
||||
@@ -14,4 +14,10 @@
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="-45"
|
||||
android:endColor="#4e4376"
|
||||
android:startColor="#2b5876"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -10,4 +10,10 @@
|
||||
android:topRightRadius="10dp"
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="-45"
|
||||
android:endColor="#FDB99B"
|
||||
android:startColor="#A770EF"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -10,4 +10,10 @@
|
||||
android:topRightRadius="10dp"
|
||||
android:bottomLeftRadius="10dp"
|
||||
android:bottomRightRadius="10dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="-45"
|
||||
android:endColor="#4B79A1"
|
||||
android:startColor="#2D465C"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
@@ -12,7 +12,7 @@
|
||||
<!-- android:width="1dp"-->
|
||||
<!-- android:color="#fff" />-->
|
||||
<corners android:radius="@dimen/dp_8" />
|
||||
<solid android:color="#32162136" />
|
||||
<solid android:color="#535353" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<solid android:color="#e1e8f0" />
|
||||
<solid android:color="#8cc0f6" />
|
||||
<size android:height="@dimen/dp_14" />
|
||||
<corners android:radius="@dimen/dp_14" />
|
||||
</shape>
|
||||
@@ -12,9 +12,9 @@
|
||||
<clip>
|
||||
<shape>
|
||||
<gradient
|
||||
android:centerColor="#e1e8f0"
|
||||
android:endColor="#e1e8f0"
|
||||
android:startColor="#e1e8f0" />
|
||||
android:centerColor="#8cc0f6"
|
||||
android:endColor="#8cc0f6"
|
||||
android:startColor="#8cc0f6" />
|
||||
<size android:height="@dimen/dp_14" />
|
||||
<corners android:radius="@dimen/dp_14" />
|
||||
</shape>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
android:height="@dimen/dp_14" />
|
||||
<stroke
|
||||
android:width="@dimen/dp_2"
|
||||
android:color="#e1e8f0" />
|
||||
<solid android:color="#33162136" />
|
||||
android:color="#8cc0f6" />
|
||||
<solid android:color="@color/default_blue" />
|
||||
</shape>
|
||||
18
app/src/main/res/drawable/tv_bg_alarm.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#FFFFFF" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_32"
|
||||
android:bottomRightRadius="@dimen/dp_32"
|
||||
android:topLeftRadius="@dimen/dp_32"
|
||||
android:topRightRadius="@dimen/dp_32" />
|
||||
|
||||
<padding
|
||||
android:bottom="@dimen/dp_8"
|
||||
android:left="@dimen/dp_16"
|
||||
android:right="@dimen/dp_16"
|
||||
android:top="@dimen/dp_8" />
|
||||
</shape>
|
||||
@@ -42,12 +42,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="控制中心"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textColor="@color/white" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -74,100 +74,6 @@
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_flashlight"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_flashlight"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/settings1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="系统设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.234"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_flashlight"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.32" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_flashlight_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="其他设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_flashlight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_flashlight"
|
||||
app:layout_constraintVertical_bias="0.2" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_flashlight"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_margin="@dimen/dp_8"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/control_background_item">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_flashlight"-->
|
||||
<!-- android:layout_width="@dimen/dp_40"-->
|
||||
<!-- android:layout_height="@dimen/dp_40"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_8"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="centerCrop"-->
|
||||
<!-- android:src="@drawable/time1"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_flashlight"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="00:00"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_15"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintHorizontal_bias="0.234"-->
|
||||
<!-- app:layout_constraintStart_toEndOf="@+id/iv_flashlight"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintVertical_bias="0.32" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_flashlight_switch"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="11月15日"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_12"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/tv_flashlight"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/tv_flashlight"-->
|
||||
<!-- app:layout_constraintVertical_bias="0.2" />-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="0dp"
|
||||
@@ -178,15 +84,17 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wifi"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/wifi1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wifi"
|
||||
@@ -194,26 +102,50 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="网络"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.234"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_wifi" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bt"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bt"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/bluetooth1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.32" />
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wifi_ssid"
|
||||
android:id="@+id/tv_bt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="ssid"
|
||||
android:text="蓝牙"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_wifi"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_wifi"
|
||||
app:layout_constraintVertical_bias="0.2" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_bt" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -375,52 +307,6 @@
|
||||
android:layout_weight="2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bt"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bt"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/bluetooth1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="蓝牙"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.234"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_bt"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.32" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bt_ssid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="ssid"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bt"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_bt"
|
||||
app:layout_constraintVertical_bias="0.2" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_battery"
|
||||
@@ -432,15 +318,17 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_battery"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/battery1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_battery"
|
||||
@@ -448,27 +336,50 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="电量"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.234"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_battery"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_battery" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_flashlight"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_flashlight"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/settings1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.32" />
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_electricity"
|
||||
android:id="@+id/tv_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100%"
|
||||
android:text="系统设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_battery"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_battery"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_battery"
|
||||
app:layout_constraintVertical_bias="0.2" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_flashlight" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
||||
@@ -57,17 +57,17 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="@dimen/dp_144"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_activation"
|
||||
app:layout_constraintEnd_toStartOf="@+id/constraintLayout6"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wifi"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/wifi_disconnect"
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wifi_ssid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:ellipsize="marquee"
|
||||
@@ -95,11 +95,11 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout6"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_wifi"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cl_control"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
@@ -192,72 +192,84 @@
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/custom_bg_weather">
|
||||
android:background="@drawable/background_weather_sun">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/he100"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="天气预报"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_temp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_36"
|
||||
android:gravity="center_vertical"
|
||||
android:text="10℃"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.34" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_location"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="位置"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_temp" />
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_temp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="10℃"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_30"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="位置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_temp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_weather"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="天气"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_location"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_weather"
|
||||
tools:text="00:00" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_time"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time"
|
||||
tools:text="20230621" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_weather"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:text="天气"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_location"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_location"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_location" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -268,7 +280,7 @@
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:layout_weight="3"
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/custom_bg_alarm">
|
||||
|
||||
<TextView
|
||||
@@ -278,7 +290,7 @@
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="爱心闹钟"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -303,7 +315,7 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/home_reminder_icon"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -312,9 +324,11 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_noti"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -336,7 +350,7 @@
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="紧急呼叫"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="提醒事件"
|
||||
android:textColor="@color/black"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="@dimen/dp_72"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:corner_radius="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/tv_bg_noti"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="提醒时间"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_voice"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/voice_background"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_voice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="0秒"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/voice"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -42,12 +42,12 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="控制中心"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textColor="@color/white" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -66,99 +66,6 @@
|
||||
android:layout_weight="4"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_flashlight"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_flashlight"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/settings1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="系统设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.234"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_flashlight"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.32" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_flashlight_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="其他设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_flashlight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_flashlight"
|
||||
app:layout_constraintVertical_bias="0.2" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/cl_flashlight"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_margin="@dimen/dp_8"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="@drawable/control_background_item">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_flashlight"-->
|
||||
<!-- android:layout_width="@dimen/dp_48"-->
|
||||
<!-- android:layout_height="@dimen/dp_48"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_24"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="centerCrop"-->
|
||||
<!-- android:src="@drawable/time1"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_flashlight"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="00:00"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_17"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintHorizontal_bias="0.2"-->
|
||||
<!-- app:layout_constraintStart_toEndOf="@+id/iv_flashlight"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintVertical_bias="0.3" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_flashlight_switch"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_6"-->
|
||||
<!-- android:text="11月15日"-->
|
||||
<!-- android:textColor="@color/white"-->
|
||||
<!-- android:textSize="@dimen/sp_12"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/tv_flashlight"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/tv_flashlight" />-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="0dp"
|
||||
@@ -171,13 +78,15 @@
|
||||
android:id="@+id/iv_wifi"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/wifi1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wifi"
|
||||
@@ -185,32 +94,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="网络"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.2"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.3" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_wifi" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wifi_ssid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:text="ssid"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_wifi"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_wifi" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="4"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bt"
|
||||
@@ -224,13 +114,15 @@
|
||||
android:id="@+id/iv_bt"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/bluetooth1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bt"
|
||||
@@ -238,26 +130,23 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="蓝牙"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.2"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_bt"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.3" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_bt" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bt_ssid"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:text="ssid"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bt"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_bt" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="4"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_battery"
|
||||
android:layout_width="0dp"
|
||||
@@ -270,13 +159,15 @@
|
||||
android:id="@+id/iv_battery"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/battery1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_battery"
|
||||
@@ -284,24 +175,47 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="电量"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.2"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_battery"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_battery" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_flashlight"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/control_background_item">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_flashlight"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/settings1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.3" />
|
||||
app:layout_constraintVertical_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_electricity"
|
||||
android:id="@+id/tv_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:text="100%"
|
||||
android:text="系统设置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_battery"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_battery" />
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_flashlight" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/sp_16">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/dp_16">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout5"
|
||||
@@ -57,17 +57,17 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_wifi"
|
||||
android:layout_width="@dimen/dp_128"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_activation"
|
||||
app:layout_constraintEnd_toStartOf="@+id/constraintLayout14"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wifi"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/wifi_disconnect"
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wifi_ssid"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:ellipsize="marquee"
|
||||
@@ -95,19 +95,17 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout14"
|
||||
android:layout_width="@dimen/dp_68"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cl_control"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_wifi"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_battery"
|
||||
android:layout_width="@dimen/dp_28"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_8"
|
||||
android:src="@drawable/battery_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -144,7 +142,6 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_settings_icon"
|
||||
app:is_circle="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView11"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -196,74 +193,83 @@
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:layout_weight="3"
|
||||
android:background="@drawable/custom_bg_weather">
|
||||
android:background="@drawable/background_weather_sun">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:layout_marginEnd="@dimen/dp_48"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/he100"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.495" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="天气预报"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_temp"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_48"
|
||||
android:gravity="center_vertical"
|
||||
android:text="10℃"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_38"
|
||||
android:textStyle="bold"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.34" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="位置"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_temp" />
|
||||
<TextView
|
||||
android:id="@+id/tv_temp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="10℃"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_weather"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="天气"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_location"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_location"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_temp" />
|
||||
<TextView
|
||||
android:id="@+id/tv_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="位置"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_temp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_weather"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="天气"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_location"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_30"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_temp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_weather"
|
||||
tools:text="00:00" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_time"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time"
|
||||
tools:text="20230621" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
@@ -289,10 +295,10 @@
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="爱心闹钟"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -317,7 +323,7 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/home_reminder_icon"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -326,12 +332,13 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_noti"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -355,15 +362,15 @@
|
||||
android:id="@+id/textView7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:text="紧急呼叫"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.286" />
|
||||
app:layout_constraintVertical_bias="0.12" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -426,16 +433,16 @@
|
||||
android:id="@+id/textView5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:text="一键加速"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.286" />
|
||||
app:layout_constraintVertical_bias="0.12" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -555,7 +562,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="健康码"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_17"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -614,7 +621,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="快捷应用"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -673,7 +680,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="家庭空间"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -710,7 +717,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="AI问诊"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -746,7 +753,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text="通讯录"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textColor="@color/default_text_color"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="提醒事件"
|
||||
android:textColor="@color/black"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="@dimen/dp_72"
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:layout_margin="@dimen/dp_4"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:corner_radius="@dimen/dp_8"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:background="@drawable/tv_bg_noti"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="提醒时间"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_cover" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_voice"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/voice_background"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_time">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_voice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="0秒"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/voice"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
250
app/src/main/res/layout/activity_screen_lock.xml
Normal file
@@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/control_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView5"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_lock"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.11" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/ll_keyboard"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView5"
|
||||
app:layout_constraintVertical_bias="0.347"
|
||||
tools:layout_editor_absoluteX="0dp">
|
||||
|
||||
<com.tuo.customview.VerificationCodeView
|
||||
android:id="@+id/icv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/sp_32"
|
||||
android:layout_centerHorizontal="true"
|
||||
app:icv_et_bg_focus="@color/transparent"
|
||||
app:icv_et_bg_normal="@color/transparent"
|
||||
app:icv_et_divider_drawable="@drawable/shape_divider_identifying"
|
||||
app:icv_et_number="4"
|
||||
app:icv_et_pwd="true"
|
||||
app:icv_et_pwd_radius="@dimen/dp_4"
|
||||
app:icv_et_text_color="@color/transparent"
|
||||
app:icv_et_width="@dimen/sp_32"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:text=""
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintEnd_toEndOf="@+id/icv"
|
||||
app:layout_constraintStart_toStartOf="@+id/icv"
|
||||
app:layout_constraintTop_toBottomOf="@+id/icv" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_48"
|
||||
android:layout_marginEnd="@dimen/dp_48"
|
||||
android:gravity="center"
|
||||
android:maxLines="2"
|
||||
android:minLines="2"
|
||||
android:text="退出系统"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_hint" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_keyboard"
|
||||
android:layout_width="@dimen/dp_200"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView5"
|
||||
app:layout_constraintVertical_bias="0.796">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="2"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="3"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="4"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="5"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="6"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_7"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="7"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_8"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="8"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_9"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="9"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_0"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_del"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="清除"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bt_confirm"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="确认"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
46
app/src/main/res/layout/item_notification.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/tv_bg_alarm"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_cover"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_alarm"
|
||||
app:corner_radius="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="提醒时间"
|
||||
android:textColor="@color/title_gray"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/raw/click.mp3
Normal file
@@ -26,11 +26,11 @@
|
||||
<color name="health_bg_color">#ecfafd</color>
|
||||
<color name="alarm_bg_color">#ffeeee</color>
|
||||
<color name="sos_bg_color">#e1e1ff</color>
|
||||
<color name="clean_bg_color">#d8fdfd</color>
|
||||
<color name="clean_bg_color">#ffffff</color>
|
||||
<color name="guard_bg_color">#e08c61</color>
|
||||
<color name="contact_bg_color">#47e08e</color>
|
||||
<color name="appstore_bg_color">#fcf3e7</color>
|
||||
<color name="app_bg_color">#fdf6dc</color>
|
||||
<color name="contact_bg_color">#47E08E</color>
|
||||
<color name="appstore_bg_color">#E3E8FE</color>
|
||||
<color name="app_bg_color">#FDF6DC</color>
|
||||
|
||||
<color name="noti_color">#eae8e8</color>
|
||||
<color name="noti_font_color">#bbbaba</color>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"tpns": {
|
||||
"access_id": "1500033697",
|
||||
"access_key": "A0PFUHEPEKKM"
|
||||
},
|
||||
"com.uiuios.aios": {
|
||||
"channel": {
|
||||
"enable": true
|
||||
}
|
||||
},
|
||||
"debug": false,
|
||||
"version": "1.3.3.3-release",
|
||||
"upgrade": true
|
||||
}
|
||||
@@ -12,7 +12,6 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.6.4'
|
||||
classpath "com.tencent.android.tpns:tpnsplugin:1.8.0"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||