version:1.9.9
fix: update:优化指示器颜色,优化个人中心,主页增加WiFi电池信息
8
PhotoPreview/local.properties
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
## This file must *NOT* be checked into Version Control Systems,
|
||||||
|
# as it contains information specific to your local configuration.
|
||||||
|
#
|
||||||
|
# Location of the SDK. This is only used by Gradle.
|
||||||
|
# For customization when using a Version Control System, please read the
|
||||||
|
# header note.
|
||||||
|
#Fri Oct 18 10:29:59 CST 2024
|
||||||
|
sdk.dir=F\:\\AndroidSDK
|
||||||
@@ -16,8 +16,8 @@ android {
|
|||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
versionCode 88
|
versionCode 90
|
||||||
versionName "1.9.7"
|
versionName "1.9.9"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:resizeableActivity="true"
|
android:resizeableActivity="true"
|
||||||
android:resumeWhilePausing="true"
|
android:resumeWhilePausing="true"
|
||||||
android:screenOrientation="userLandscape"
|
android:screenOrientation="landscape"
|
||||||
android:stateNotNeeded="true"
|
android:stateNotNeeded="true"
|
||||||
android:windowSoftInputMode="adjustPan">
|
android:windowSoftInputMode="adjustPan">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -115,59 +115,65 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".activity.NoticeActivity"
|
android:name=".activity.NoticeActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:screenOrientation="userLandscape"
|
android:screenOrientation="landscape"
|
||||||
android:theme="@style/DialogCloseOnTouchOutside" />
|
android:theme="@style/DialogCloseOnTouchOutside" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.homework.UpdateActivity"
|
android:name=".activity.homework.UpdateActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/DialogCloseOnTouchOutside" />
|
android:theme="@style/DialogCloseOnTouchOutside" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.PasswordActivity"
|
android:name=".activity.PasswordActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
|
android:theme="@style/AppThemeWithoutFitsSystemWindows"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="landscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.AddIconActivity"
|
android:name=".activity.AddIconActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="landscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.PolicyActivity"
|
android:name=".activity.PolicyActivity"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.more.MoreAppActivity"
|
android:name=".activity.more.MoreAppActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="landscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.ExitActivity"
|
android:name=".activity.ExitActivity"
|
||||||
android:configChanges="keyboardHidden"
|
android:configChanges="keyboardHidden"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
|
android:theme="@style/AppThemeWithoutFitsSystemWindows"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.ManualActivity"
|
android:name=".activity.ManualActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="landscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.AboutActivity"
|
android:name=".activity.AboutActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="landscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.ServiceActivity"
|
android:name=".activity.ServiceActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
android:theme="@style/DialogCloseOnTouchOutside" />
|
android:theme="@style/DialogCloseOnTouchOutside" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.update.UpdateActivity"
|
android:name=".activity.update.UpdateActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape"
|
android:screenOrientation="landscape"
|
||||||
android:theme="@style/DialogCloseOnTouchOutside" />
|
android:theme="@style/DialogCloseOnTouchOutside" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.edit.EditActivity"
|
android:name=".activity.edit.EditActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape"
|
android:screenOrientation="landscape"
|
||||||
android:theme="@style/activity_styles_full" />
|
android:theme="@style/activity_styles_full" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.selectegrade.SelecteGradeActivity"
|
android:name=".activity.selectegrade.SelecteGradeActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape"
|
android:screenOrientation="landscape"
|
||||||
android:theme="@style/DialogCloseOnTouchOutside" />
|
android:theme="@style/DialogCloseOnTouchOutside" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.permission.PermissionActivity"
|
android:name=".activity.permission.PermissionActivity"
|
||||||
@@ -176,12 +182,14 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".activity.user.UserActivity"
|
android:name=".activity.user.UserActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="landscape" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.homework.HomeworkActivity"
|
android:name=".activity.homework.HomeworkActivity"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.homework.HomeworkDetailsActivity"
|
android:name=".activity.homework.HomeworkDetailsActivity"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.uiui.zyos.activity;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.AudioAttributes;
|
import android.media.AudioAttributes;
|
||||||
import android.media.SoundPool;
|
import android.media.SoundPool;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -12,7 +11,6 @@ import android.view.View;
|
|||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import com.tuo.customview.VerificationCodeView;
|
import com.tuo.customview.VerificationCodeView;
|
||||||
@@ -21,6 +19,7 @@ import com.uiui.zyos.base.BaseDataBindingActivity;
|
|||||||
import com.uiui.zyos.config.CommonConfig;
|
import com.uiui.zyos.config.CommonConfig;
|
||||||
import com.uiui.zyos.databinding.ActivityExitBinding;
|
import com.uiui.zyos.databinding.ActivityExitBinding;
|
||||||
import com.uiui.zyos.utils.Utils;
|
import com.uiui.zyos.utils.Utils;
|
||||||
|
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||||
|
|
||||||
public class ExitActivity extends BaseDataBindingActivity {
|
public class ExitActivity extends BaseDataBindingActivity {
|
||||||
private static final String TAG = "ExitActivity";
|
private static final String TAG = "ExitActivity";
|
||||||
@@ -30,10 +29,10 @@ public class ExitActivity extends BaseDataBindingActivity {
|
|||||||
private SoundPool soundPool;
|
private SoundPool soundPool;
|
||||||
private int soundId;
|
private int soundId;
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public boolean setNightMode() {
|
// public boolean setNightMode() {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initDataBinding() {
|
protected void initDataBinding() {
|
||||||
@@ -97,6 +96,9 @@ public class ExitActivity extends BaseDataBindingActivity {
|
|||||||
mBinding.bt7.setOnClickListener(view1 -> add(mBinding.icv, "7"));
|
mBinding.bt7.setOnClickListener(view1 -> add(mBinding.icv, "7"));
|
||||||
mBinding.bt8.setOnClickListener(view1 -> add(mBinding.icv, "8"));
|
mBinding.bt8.setOnClickListener(view1 -> add(mBinding.icv, "8"));
|
||||||
mBinding.bt9.setOnClickListener(view1 -> add(mBinding.icv, "9"));
|
mBinding.bt9.setOnClickListener(view1 -> add(mBinding.icv, "9"));
|
||||||
|
|
||||||
|
// UltimateBarX.addStatusBarTopPadding(mBinding.clRoot);
|
||||||
|
// UltimateBarX.addNavigationBarBottomPadding(mBinding.clRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkPasswd() {
|
private void checkPasswd() {
|
||||||
|
|||||||
@@ -19,16 +19,17 @@ import com.uiui.zyos.R;
|
|||||||
import com.uiui.zyos.base.BaseDataBindingActivity;
|
import com.uiui.zyos.base.BaseDataBindingActivity;
|
||||||
import com.uiui.zyos.config.CommonConfig;
|
import com.uiui.zyos.config.CommonConfig;
|
||||||
import com.uiui.zyos.databinding.ActivityPasswdBinding;
|
import com.uiui.zyos.databinding.ActivityPasswdBinding;
|
||||||
|
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||||
|
|
||||||
public class PasswordActivity extends BaseDataBindingActivity {
|
public class PasswordActivity extends BaseDataBindingActivity {
|
||||||
private static final String TAG = "PasswordActivity";
|
private static final String TAG = "PasswordActivity";
|
||||||
|
|
||||||
private ActivityPasswdBinding mBinding;
|
private ActivityPasswdBinding mBinding;
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public boolean setNightMode() {
|
// public boolean setNightMode() {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initDataBinding() {
|
protected void initDataBinding() {
|
||||||
@@ -108,6 +109,9 @@ public class PasswordActivity extends BaseDataBindingActivity {
|
|||||||
setEmpty();
|
setEmpty();
|
||||||
mBinding.tvHint.setText("密码错误");
|
mBinding.tvHint.setText("密码错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UltimateBarX.addStatusBarTopPadding(mBinding.clRoot);
|
||||||
|
UltimateBarX.addNavigationBarBottomPadding(mBinding.clRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setEmpty() {
|
private void setEmpty() {
|
||||||
|
|||||||
@@ -54,18 +54,18 @@ public class HomeworkViewModel extends BaseViewModel<ActivityHomeworkBinding, Ac
|
|||||||
public void onNext(@NonNull BaseResponse<ArrayList<HomeworkBean>> listBaseResponse) {
|
public void onNext(@NonNull BaseResponse<ArrayList<HomeworkBean>> listBaseResponse) {
|
||||||
Log.e("getHomework", "onNext: " + listBaseResponse);
|
Log.e("getHomework", "onNext: " + listBaseResponse);
|
||||||
ArrayList<HomeworkBean> homeworkBeans = listBaseResponse.data;
|
ArrayList<HomeworkBean> homeworkBeans = listBaseResponse.data;
|
||||||
|
if (homeworkBeans != null) {
|
||||||
if (!BuildConfig.DEBUG) {
|
ArrayList<HomeworkBean> homeworkBeans2 = (ArrayList<HomeworkBean>) homeworkBeans.stream().filter(new Predicate<HomeworkBean>() {
|
||||||
homeworkBeans = (ArrayList<HomeworkBean>) homeworkBeans.stream().filter(new Predicate<HomeworkBean>() {
|
|
||||||
@Override
|
@Override
|
||||||
public boolean test(HomeworkBean homeworkBean) {
|
public boolean test(HomeworkBean homeworkBean) {
|
||||||
return TimeUtils.isHomeworkToday(homeworkBean.getCreated_at());
|
return TimeUtils.isHomeworkToday(homeworkBean.getCreated_at());
|
||||||
}
|
}
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
}
|
mHomeworkBeanListData.setValue(homeworkBeans2);
|
||||||
|
}else {
|
||||||
mHomeworkBeanListData.setValue(homeworkBeans);
|
mHomeworkBeanListData.setValue(homeworkBeans);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.uiui.zyos.activity.main;
|
package com.uiui.zyos.activity.main;
|
||||||
|
|
||||||
|
import android.app.ActionBar;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -127,8 +128,8 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
|||||||
|
|
||||||
scaleCircleNavigator = new ScaleCircleNavigator(this);
|
scaleCircleNavigator = new ScaleCircleNavigator(this);
|
||||||
scaleCircleNavigator.setCircleCount(1 + mSubjectFragment.getFragmentSize());
|
scaleCircleNavigator.setCircleCount(1 + mSubjectFragment.getFragmentSize());
|
||||||
scaleCircleNavigator.setNormalCircleColor(Color.DKGRAY);
|
scaleCircleNavigator.setNormalCircleColor(getResources().getColor(R.color.normal_circle));
|
||||||
scaleCircleNavigator.setSelectedCircleColor(Color.LTGRAY);
|
scaleCircleNavigator.setSelectedCircleColor(getResources().getColor(R.color.selected_circle));
|
||||||
scaleCircleNavigator.setCircleClickListener(new ScaleCircleNavigator.OnCircleClickListener() {
|
scaleCircleNavigator.setCircleClickListener(new ScaleCircleNavigator.OnCircleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(int index) {
|
public void onClick(int index) {
|
||||||
@@ -207,6 +208,23 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
|||||||
} else {
|
} else {
|
||||||
startService(intent);
|
startService(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 全屏展示
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
// 全屏显示,隐藏状态栏和导航栏,拉出状态栏和导航栏显示一会儿后消失。
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||||
|
} else {
|
||||||
|
// 全屏显示,隐藏状态栏
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -666,6 +684,8 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class BtnClick {
|
public class BtnClick {
|
||||||
public void openRobot(View view) {
|
public void openRobot(View view) {
|
||||||
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_VOICE_PACKAGE_NAME, JxwPackageConfig.JXW_VOICE_CLASS_NAME);
|
OpenApkUtils.getInstance().openAppWithoutArgs(JxwPackageConfig.JXW_VOICE_PACKAGE_NAME, JxwPackageConfig.JXW_VOICE_CLASS_NAME);
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
package com.uiui.zyos.activity.permission;
|
package com.uiui.zyos.activity.permission;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.text.Spannable;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.Spanned;
|
||||||
|
import android.text.TextPaint;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
|
import android.text.style.ClickableSpan;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@@ -49,8 +59,24 @@ public class PermissionActivity extends BaseMvvmActivity<PermissionViewModel, Ac
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
|
SpannableString spannableString = new SpannableString(getResources().getString(R.string.desktop_permission));
|
||||||
|
spannableString.setSpan(new ClickableSpan() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDrawState(TextPaint ds) {
|
||||||
|
super.updateDrawState(ds);
|
||||||
|
ds.setColor(Color.BLUE); // 设置文本颜色
|
||||||
|
ds.setUnderlineText(false); // 设置下划线
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(@NonNull View widget) {
|
||||||
|
Intent intent = new Intent(Settings.ACTION_SETTINGS);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
}, 12, 14, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
|
mViewDataBinding.tvNoti.setText(spannableString);
|
||||||
|
mViewDataBinding.tvNoti.setMovementMethod(LinkMovementMethod.getInstance()); // 设置移动方法以支持点击事件
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.NetworkInfo;
|
||||||
|
import android.net.wifi.WifiManager;
|
||||||
|
import android.os.BatteryManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -161,8 +165,10 @@ public class UserFragment extends BaseMvvmFragment<UserViewModel, FragmentUserBi
|
|||||||
setButtonVisibility();
|
setButtonVisibility();
|
||||||
String avatar = mMMKV.decodeString("USERINFO_AVATAR", "");
|
String avatar = mMMKV.decodeString("USERINFO_AVATAR", "");
|
||||||
|
|
||||||
Glide.with(mViewDataBinding.ivAvatar).load(avatar).error(R.drawable.default_avatar).into(mViewDataBinding.ivAvatar);
|
initWifiState();
|
||||||
|
|
||||||
|
Glide.with(mViewDataBinding.ivAvatar).load(avatar).error(R.drawable.default_avatar).into(mViewDataBinding.ivAvatar);
|
||||||
|
mViewDataBinding.tvTime.setText(TimeUtils.getNowTimeInMinute());
|
||||||
mViewDataBinding.tvDate1.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
mViewDataBinding.tvDate1.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
||||||
mViewDataBinding.tvDate2.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
mViewDataBinding.tvDate2.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
||||||
mViewDataBinding.tvDate3.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
mViewDataBinding.tvDate3.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
||||||
@@ -368,6 +374,8 @@ public class UserFragment extends BaseMvvmFragment<UserViewModel, FragmentUserBi
|
|||||||
registerRefreshReceiver();
|
registerRefreshReceiver();
|
||||||
registerUpdateDesktopReceiver();
|
registerUpdateDesktopReceiver();
|
||||||
registerAppChangedReceiver();
|
registerAppChangedReceiver();
|
||||||
|
registWiFiStatuReceiver();
|
||||||
|
registBateeryReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unregisterOwnReceiver() {
|
private void unregisterOwnReceiver() {
|
||||||
@@ -383,6 +391,12 @@ public class UserFragment extends BaseMvvmFragment<UserViewModel, FragmentUserBi
|
|||||||
if (mAppChangedReceiver != null) {
|
if (mAppChangedReceiver != null) {
|
||||||
mContext.unregisterReceiver(mAppChangedReceiver);
|
mContext.unregisterReceiver(mAppChangedReceiver);
|
||||||
}
|
}
|
||||||
|
if (mWiFiStatuReceiver != null) {
|
||||||
|
mContext.unregisterReceiver(mWiFiStatuReceiver);
|
||||||
|
}
|
||||||
|
if (mPowerConnectReceiver != null) {
|
||||||
|
mContext.unregisterReceiver(mPowerConnectReceiver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -413,6 +427,7 @@ public class UserFragment extends BaseMvvmFragment<UserViewModel, FragmentUserBi
|
|||||||
case Intent.ACTION_TIME_CHANGED:
|
case Intent.ACTION_TIME_CHANGED:
|
||||||
case Intent.ACTION_TIMEZONE_CHANGED:
|
case Intent.ACTION_TIMEZONE_CHANGED:
|
||||||
case Intent.ACTION_TIME_TICK:
|
case Intent.ACTION_TIME_TICK:
|
||||||
|
mViewDataBinding.tvTime.setText(TimeUtils.getNowTimeInMinute());
|
||||||
mViewDataBinding.tvDate1.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
mViewDataBinding.tvDate1.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
||||||
mViewDataBinding.tvDate2.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
mViewDataBinding.tvDate2.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
||||||
mViewDataBinding.tvDate3.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
mViewDataBinding.tvDate3.setText(TimeUtils.getDateAndWeek(System.currentTimeMillis()));
|
||||||
@@ -505,6 +520,123 @@ public class UserFragment extends BaseMvvmFragment<UserViewModel, FragmentUserBi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private WiFiStatuReceiver mWiFiStatuReceiver;
|
||||||
|
|
||||||
|
|
||||||
|
private void registWiFiStatuReceiver() {
|
||||||
|
if (mWiFiStatuReceiver != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mWiFiStatuReceiver = new WiFiStatuReceiver();
|
||||||
|
IntentFilter filter = new IntentFilter();
|
||||||
|
filter.addAction(NETWORK_STATE_CHANGE);
|
||||||
|
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
|
||||||
|
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||||
|
mContext.registerReceiver(mWiFiStatuReceiver, filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String NETWORK_STATE_CHANGE = "android.net.conn.CONNECTIVITY_CHANGE";
|
||||||
|
|
||||||
|
private class WiFiStatuReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction();
|
||||||
|
Log.d("fht", "action: " + action);
|
||||||
|
if (action.equals(NETWORK_STATE_CHANGE)) {
|
||||||
|
boolean isNetOK = isWifiConnect();
|
||||||
|
Log.d("fht", "网络状态发生变化,是否可用:" + isNetOK);
|
||||||
|
if (isNetOK) {
|
||||||
|
initWifiState();
|
||||||
|
} else {
|
||||||
|
mViewDataBinding.ivWifi.setImageDrawable(mContext.getDrawable(R.drawable.icon_wifi_disconnect));
|
||||||
|
mViewDataBinding.tvWifiStatus.setText("未连接");
|
||||||
|
}
|
||||||
|
} else if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {
|
||||||
|
int wifistate = intent.getIntExtra(
|
||||||
|
WifiManager.EXTRA_WIFI_STATE,
|
||||||
|
WifiManager.WIFI_STATE_DISABLED);
|
||||||
|
if (wifistate == WifiManager.WIFI_STATE_DISABLED) {
|
||||||
|
mViewDataBinding.ivWifi.setImageDrawable(mContext.getDrawable(R.drawable.icon_wifi_disconnect));
|
||||||
|
mViewDataBinding.tvWifiStatus.setText("未连接");
|
||||||
|
} else if (wifistate == WifiManager.WIFI_STATE_ENABLED) {
|
||||||
|
checkWifiState();
|
||||||
|
}
|
||||||
|
} else if (action.equals(WifiManager.RSSI_CHANGED_ACTION)) {
|
||||||
|
initWifiState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initWifiState() {
|
||||||
|
ConnectivityManager manager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
NetworkInfo info = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||||
|
Log.d("fht", "info.isConnected(): " + info.isConnected());
|
||||||
|
if (info.isConnected()) {
|
||||||
|
checkWifiState();
|
||||||
|
} else {
|
||||||
|
mViewDataBinding.ivWifi.setImageDrawable(mContext.getDrawable(R.drawable.icon_wifi_disconnect));
|
||||||
|
mViewDataBinding.tvWifiStatus.setText("未连接");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWifiConnect() {
|
||||||
|
ConnectivityManager connManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
NetworkInfo mWifiInfo = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||||
|
return mWifiInfo != null && mWifiInfo.isConnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkWifiState() {
|
||||||
|
if (isWifiConnect()) {
|
||||||
|
mViewDataBinding.ivWifi.setImageDrawable(mContext.getDrawable(R.drawable.icon_wifi_connect));
|
||||||
|
mViewDataBinding.tvWifiStatus.setText("已连接");
|
||||||
|
} else {
|
||||||
|
//无连接
|
||||||
|
Log.d("fht", "无wifi连接");
|
||||||
|
mViewDataBinding.ivWifi.setImageDrawable(mContext.getDrawable(R.drawable.icon_wifi_disconnect));
|
||||||
|
mViewDataBinding.tvWifiStatus.setText("未连接");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池广播
|
||||||
|
*/
|
||||||
|
private void registBateeryReceiver() {
|
||||||
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
|
intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
|
||||||
|
|
||||||
|
mContext.registerReceiver(mPowerConnectReceiver, intentFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private PowerConnectReceiver mPowerConnectReceiver = new PowerConnectReceiver();
|
||||||
|
|
||||||
|
class PowerConnectReceiver extends BroadcastReceiver {
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction();
|
||||||
|
Log.e("PowerConnectReceiver", "onReceive: " + action);
|
||||||
|
switch (action) {
|
||||||
|
case Intent.ACTION_BATTERY_CHANGED:
|
||||||
|
//你可以读到充电状态,如果在充电,可以读到是usb还是交流电
|
||||||
|
int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
|
||||||
|
boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
|
||||||
|
status == BatteryManager.BATTERY_STATUS_FULL;
|
||||||
|
|
||||||
|
//当前剩余电量
|
||||||
|
int level = intent.getIntExtra("level", 0);
|
||||||
|
//电量最大值
|
||||||
|
int scale = intent.getIntExtra("scale", 100);
|
||||||
|
|
||||||
|
//电量百分比
|
||||||
|
int batteryPer = (int) (level / (float) scale * 100);
|
||||||
|
mViewDataBinding.batteryView.setBatteryLevel(batteryPer, isCharging);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class BtnClick {
|
public class BtnClick {
|
||||||
|
|
||||||
public void exit(View view) {
|
public void exit(View view) {
|
||||||
@@ -544,5 +676,8 @@ public class UserFragment extends BaseMvvmFragment<UserViewModel, FragmentUserBi
|
|||||||
mViewModel.getHomework();
|
mViewModel.getHomework();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void toWifi(View view){
|
||||||
|
mContext.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.uiui.zyos.network.UrlAddress;
|
|||||||
import com.uiui.zyos.utils.ActivationUtil;
|
import com.uiui.zyos.utils.ActivationUtil;
|
||||||
import com.uiui.zyos.utils.ApkUtils;
|
import com.uiui.zyos.utils.ApkUtils;
|
||||||
import com.uiui.zyos.utils.CXAESUtil;
|
import com.uiui.zyos.utils.CXAESUtil;
|
||||||
|
import com.uiui.zyos.utils.TimeUtils;
|
||||||
import com.uiui.zyos.utils.Utils;
|
import com.uiui.zyos.utils.Utils;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
@@ -217,8 +218,18 @@ public class UserViewModel extends BaseViewModel<FragmentUserBinding, FragmentEv
|
|||||||
public void onNext(@NonNull BaseResponse<ArrayList<HomeworkBean>> listBaseResponse) {
|
public void onNext(@NonNull BaseResponse<ArrayList<HomeworkBean>> listBaseResponse) {
|
||||||
Log.e("getHomework", "onNext: " + listBaseResponse);
|
Log.e("getHomework", "onNext: " + listBaseResponse);
|
||||||
List<HomeworkBean> homeworkBeans = listBaseResponse.data;
|
List<HomeworkBean> homeworkBeans = listBaseResponse.data;
|
||||||
|
if (homeworkBeans != null) {
|
||||||
|
List<HomeworkBean> homeworkBeans2 = homeworkBeans.stream().filter(new Predicate<HomeworkBean>() {
|
||||||
|
@Override
|
||||||
|
public boolean test(HomeworkBean homeworkBean) {
|
||||||
|
return TimeUtils.isHomeworkToday(homeworkBean.getCreated_at());
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
mHomeworkBeanListData.setValue(homeworkBeans2);
|
||||||
|
} else {
|
||||||
mHomeworkBeanListData.setValue(homeworkBeans);
|
mHomeworkBeanListData.setValue(homeworkBeans);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
|
|||||||
@@ -4,12 +4,19 @@ import android.content.Context;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
import android.graphics.PixelFormat;
|
import android.graphics.PixelFormat;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.Typeface;
|
||||||
import android.graphics.drawable.AdaptiveIconDrawable;
|
import android.graphics.drawable.AdaptiveIconDrawable;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
|
import com.uiui.zyos.R;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
||||||
public class BitmapUtils {
|
public class BitmapUtils {
|
||||||
@@ -69,4 +76,54 @@ public class BitmapUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Bitmap getbatteryIcon(Context context, Bitmap bitmap, int level, boolean charging) {
|
||||||
|
String st_level = String.valueOf(level);
|
||||||
|
int paddingLeft = 6;
|
||||||
|
int paddingRight = 8;
|
||||||
|
int paddingTop = 6;
|
||||||
|
int paddingBottom = 6;
|
||||||
|
int width = bitmap.getWidth();
|
||||||
|
int height = bitmap.getHeight();
|
||||||
|
Bitmap background = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||||
|
Bitmap bitmapScale = Bitmap.createScaledBitmap(bitmap, width, height, true);
|
||||||
|
Canvas canvas = new Canvas();
|
||||||
|
canvas.setBitmap(background);
|
||||||
|
Paint paint = new Paint();
|
||||||
|
if (charging) {
|
||||||
|
paint.setColor(context.getColor(R.color.default_text_color));
|
||||||
|
} else {
|
||||||
|
if (level <= 20) {
|
||||||
|
paint.setColor(Color.RED);
|
||||||
|
} else {
|
||||||
|
paint.setColor(context.getColor(R.color.default_text_color));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//设置画笔类型
|
||||||
|
paint.setStyle(Paint.Style.FILL);
|
||||||
|
//使用画笔在画布上画矩形
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
Rect mSrcRect = new Rect(0, 0, width, height);
|
||||||
|
canvas.drawBitmap(bitmapScale, mSrcRect, mSrcRect, null);
|
||||||
|
RectF rectF = new RectF(paddingLeft, paddingTop, (bitmap.getWidth() - paddingRight) * level / 100, bitmap.getHeight() - paddingBottom);// 设置个新的长方形
|
||||||
|
canvas.drawRoundRect(rectF, 3, 3, paint);
|
||||||
|
|
||||||
|
final float mDensity = context.getResources().getDisplayMetrics().density;
|
||||||
|
Rect rect = new Rect();
|
||||||
|
Paint mDatePaint = new Paint();
|
||||||
|
mDatePaint.setTypeface(Typeface.SANS_SERIF);
|
||||||
|
mDatePaint.setTextSize((int) 9F * mDensity);//文字大小
|
||||||
|
mDatePaint.setColor(Color.BLACK);
|
||||||
|
mDatePaint.setAntiAlias(true);
|
||||||
|
|
||||||
|
mDatePaint.getTextBounds(st_level, 0, st_level.length(), rect);
|
||||||
|
//通过文字获取矩形的面积
|
||||||
|
int width1 = rect.right - rect.left;
|
||||||
|
int height1 = rect.bottom - rect.top;
|
||||||
|
int width2 = background.getWidth();
|
||||||
|
int height2 = background.getHeight();
|
||||||
|
canvas.drawText(st_level, (width2 - width1) / 2 - rect.left, (height2 - height1) / 2 - rect.top, mDatePaint);
|
||||||
|
return background;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,12 @@ public class TimeUtils {
|
|||||||
return sdf.format(date);
|
return sdf.format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getNowTimeInMinute() {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
||||||
|
Date date = new Date(System.currentTimeMillis());
|
||||||
|
return sdf.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
public static String getHomeworkNowTime() {
|
public static String getHomeworkNowTime() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
|||||||
226
app/src/main/java/com/uiui/zyos/view/BatteryView.java
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
package com.uiui.zyos.view;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.ColorUtils;
|
||||||
|
import com.blankj.utilcode.util.ImageUtils;
|
||||||
|
import com.uiui.zyos.R;
|
||||||
|
import com.uiui.zyos.utils.ScreenUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @CreateDate:
|
||||||
|
* @Author:lp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
public class BatteryView extends View {
|
||||||
|
|
||||||
|
private static final float OUTLINE_THICKNESS = 3.0f;//电池框厚度
|
||||||
|
private static final float CAP_WIDTH = 4.0f;//电池盖宽度
|
||||||
|
private static float CAP_HEIGHT;//电池盖高度
|
||||||
|
private static final float CAP_SPACE = 1.0f;//电池盖和电池的间隔
|
||||||
|
private static final float CAP_CORNER_RADIUS = 4;//电池盖矩形圆角
|
||||||
|
|
||||||
|
private static final float GAP_OF_SHAPE_BODY = 4.0f;//电池体与外框之间的间隙
|
||||||
|
private static final float ROUND_CORNER_RADIUS = 6;
|
||||||
|
private static final float TEXT_SIZE = 11f;
|
||||||
|
|
||||||
|
private int FLASH_WIDTH;//闪电的高度和宽度
|
||||||
|
private int FLASH_HEIGHT;
|
||||||
|
|
||||||
|
private float fullPowerWidth; //满电量时电池体的宽度。
|
||||||
|
|
||||||
|
private int mBatteryLevel = 20;
|
||||||
|
private boolean mCharging = false;
|
||||||
|
|
||||||
|
private Paint batteryBodyPainter;
|
||||||
|
private Paint batteryHeadPainter;
|
||||||
|
private Paint mPowerPaint;//电量画笔
|
||||||
|
private Paint backgroundPaint;//白色背景
|
||||||
|
private Paint mTextPaint;//文字
|
||||||
|
|
||||||
|
private RectF outlineRect;//电池矩形
|
||||||
|
private RectF mCapRect;//电池盖矩形
|
||||||
|
private RectF batteryRect;//电量矩形
|
||||||
|
private RectF backgroundRect;//背景矩形
|
||||||
|
private Rect mTextRect;//文字
|
||||||
|
|
||||||
|
|
||||||
|
private int left;
|
||||||
|
private int top;
|
||||||
|
|
||||||
|
public BatteryView(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BatteryView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
//电池外框
|
||||||
|
batteryBodyPainter = new Paint();
|
||||||
|
batteryBodyPainter.setColor(ColorUtils.getColor(R.color.battery_box));
|
||||||
|
batteryBodyPainter.setAntiAlias(true);
|
||||||
|
batteryBodyPainter.setStyle(Paint.Style.STROKE);
|
||||||
|
batteryBodyPainter.setStrokeWidth(OUTLINE_THICKNESS);
|
||||||
|
|
||||||
|
//电池盖
|
||||||
|
batteryHeadPainter = new Paint();
|
||||||
|
batteryHeadPainter.setColor(ColorUtils.getColor(R.color.battery_box));
|
||||||
|
batteryHeadPainter.setAntiAlias(true);
|
||||||
|
batteryHeadPainter.setStyle(Paint.Style.FILL);
|
||||||
|
|
||||||
|
//电量
|
||||||
|
mPowerPaint = new Paint();
|
||||||
|
mPowerPaint.setAntiAlias(true);
|
||||||
|
mPowerPaint.setColor(ColorUtils.getColor(R.color.battery_normal_power));
|
||||||
|
mPowerPaint.setStyle(Paint.Style.FILL);
|
||||||
|
|
||||||
|
backgroundPaint = new Paint();
|
||||||
|
backgroundPaint.setAntiAlias(true);
|
||||||
|
backgroundPaint.setColor(ColorUtils.getColor(R.color.battery_background));
|
||||||
|
backgroundPaint.setStyle(Paint.Style.FILL);
|
||||||
|
|
||||||
|
mTextPaint = new Paint();
|
||||||
|
mTextPaint.setTypeface(Typeface.DEFAULT_BOLD);
|
||||||
|
mTextPaint.setTextSize(dip2px(context, TEXT_SIZE));//文字大小
|
||||||
|
mTextPaint.setColor(ColorUtils.getColor(R.color.battery_text));
|
||||||
|
mTextPaint.setAntiAlias(true);
|
||||||
|
|
||||||
|
outlineRect = new RectF();
|
||||||
|
outlineRect.left = OUTLINE_THICKNESS;
|
||||||
|
outlineRect.top = OUTLINE_THICKNESS;
|
||||||
|
|
||||||
|
mCapRect = new RectF();
|
||||||
|
batteryRect = new RectF();
|
||||||
|
backgroundRect = new RectF();
|
||||||
|
mTextRect = new Rect();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBatteryLevel(int battery, boolean isChanrging) {
|
||||||
|
this.mBatteryLevel = battery > 100 ? 100 : Math.max(battery, 1);
|
||||||
|
// this.mBatteryLevel = battery;
|
||||||
|
this.mCharging = isChanrging;
|
||||||
|
requestLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBatteryLevel() {
|
||||||
|
return mBatteryLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
|
||||||
|
*/
|
||||||
|
public static int dip2px(Context context, float dpValue) {
|
||||||
|
final float scale = context.getResources().getDisplayMetrics().density;
|
||||||
|
return (int) (dpValue * scale + 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
int specWidthSize = MeasureSpec.getSize(widthMeasureSpec);//宽
|
||||||
|
int specHeightSize = MeasureSpec.getSize(heightMeasureSpec);//高
|
||||||
|
Log.e("onMeasure", "specWidthSize: " + specWidthSize);
|
||||||
|
Log.e("onMeasure", "specHeightSize: " + specHeightSize);
|
||||||
|
Log.e("dip2px", "onMeasure: " + ScreenUtils.dip2px(mContext, OUTLINE_THICKNESS));
|
||||||
|
|
||||||
|
FLASH_HEIGHT = (int) (specHeightSize - OUTLINE_THICKNESS * 2);
|
||||||
|
FLASH_WIDTH = FLASH_HEIGHT;
|
||||||
|
|
||||||
|
outlineRect.left = OUTLINE_THICKNESS + FLASH_WIDTH;
|
||||||
|
//设置电池外框
|
||||||
|
outlineRect.right = specWidthSize - OUTLINE_THICKNESS - CAP_SPACE - CAP_WIDTH;
|
||||||
|
outlineRect.bottom = specHeightSize - OUTLINE_THICKNESS;
|
||||||
|
Log.e("onMeasure", "outlineRect.right: " + outlineRect.right);
|
||||||
|
Log.e("onMeasure", "outlineRect.bottom: " + outlineRect.bottom);
|
||||||
|
|
||||||
|
backgroundRect.left = outlineRect.left;
|
||||||
|
backgroundRect.top = outlineRect.top;
|
||||||
|
backgroundRect.bottom = outlineRect.bottom;
|
||||||
|
backgroundRect.right = outlineRect.right;
|
||||||
|
Log.e("onMeasure", "backgroundRect.left : " + backgroundRect.left);
|
||||||
|
Log.e("onMeasure", "backgroundRect.top : " + backgroundRect.top);
|
||||||
|
Log.e("onMeasure", "backgroundRect.bottom : " + backgroundRect.bottom);
|
||||||
|
Log.e("onMeasure", "backgroundRect.right : " + backgroundRect.right);
|
||||||
|
|
||||||
|
//设置电池盖矩形
|
||||||
|
CAP_HEIGHT = specHeightSize / 2;
|
||||||
|
mCapRect.left = outlineRect.right + OUTLINE_THICKNESS + CAP_SPACE;
|
||||||
|
mCapRect.top = (float) specHeightSize / 2 - CAP_HEIGHT / 2;
|
||||||
|
mCapRect.right = specWidthSize;
|
||||||
|
mCapRect.bottom = (float) specHeightSize / 2 + CAP_HEIGHT / 2;
|
||||||
|
Log.e("onMeasure", "mCapRect.left: " + mCapRect.left);
|
||||||
|
Log.e("onMeasure", "mCapRect.top: " + mCapRect.top);
|
||||||
|
Log.e("onMeasure", "mCapRect.right: " + mCapRect.right);
|
||||||
|
Log.e("onMeasure", "mCapRect.bottom: " + mCapRect.bottom);
|
||||||
|
|
||||||
|
|
||||||
|
//设置电池体
|
||||||
|
batteryRect.left = outlineRect.left + GAP_OF_SHAPE_BODY;
|
||||||
|
batteryRect.top = outlineRect.top + GAP_OF_SHAPE_BODY;
|
||||||
|
batteryRect.bottom = outlineRect.bottom - GAP_OF_SHAPE_BODY;
|
||||||
|
Log.e("onMeasure", "batteryRect.left: " + batteryRect.left);
|
||||||
|
Log.e("onMeasure", "batteryRect.top: " + batteryRect.top);
|
||||||
|
Log.e("onMeasure", "batteryRect.bottom: " + batteryRect.bottom);
|
||||||
|
|
||||||
|
//闪电位置
|
||||||
|
left = (int) (specWidthSize / 2 - OUTLINE_THICKNESS * 2);
|
||||||
|
top = (int) (specHeightSize / 2 - OUTLINE_THICKNESS * 2);
|
||||||
|
|
||||||
|
fullPowerWidth = outlineRect.right - GAP_OF_SHAPE_BODY - batteryRect.left;
|
||||||
|
setMeasuredDimension(specWidthSize, specHeightSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
super.onDraw(canvas);
|
||||||
|
|
||||||
|
batteryRect.right = (float) mBatteryLevel / 100 * fullPowerWidth + batteryRect.left;
|
||||||
|
Log.e("onMeasure", "batteryRect.right : " + batteryRect.right);
|
||||||
|
|
||||||
|
if (mCharging) {
|
||||||
|
mPowerPaint.setColor(ColorUtils.getColor(R.color.battery_charing));
|
||||||
|
} else {
|
||||||
|
if (mBatteryLevel <= 20) {
|
||||||
|
mPowerPaint.setColor(ColorUtils.getColor(R.color.battery_low_power));
|
||||||
|
} else {
|
||||||
|
mPowerPaint.setColor(ColorUtils.getColor(R.color.battery_normal_power));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas.drawRoundRect(backgroundRect, ROUND_CORNER_RADIUS, ROUND_CORNER_RADIUS, backgroundPaint);
|
||||||
|
canvas.drawRoundRect(outlineRect, ROUND_CORNER_RADIUS, ROUND_CORNER_RADIUS, batteryBodyPainter);
|
||||||
|
canvas.drawRoundRect(mCapRect, CAP_CORNER_RADIUS, CAP_CORNER_RADIUS, batteryHeadPainter);
|
||||||
|
canvas.drawRoundRect(batteryRect, ROUND_CORNER_RADIUS - 1, ROUND_CORNER_RADIUS - 1, mPowerPaint);
|
||||||
|
|
||||||
|
String level = String.valueOf(mBatteryLevel);
|
||||||
|
mTextPaint.getTextBounds(level, 0, level.length(), mTextRect);
|
||||||
|
Log.e("onMeasure", "mTextRect.right : " + mTextRect.right);
|
||||||
|
Log.e("onMeasure", "mTextRect.left : " + mTextRect.left);
|
||||||
|
Log.e("onMeasure", "mTextRect.top : " + mTextRect.top);
|
||||||
|
Log.e("onMeasure", "mTextRect.bottom : " + mTextRect.bottom);
|
||||||
|
|
||||||
|
int width1 = mTextRect.width();
|
||||||
|
int height1 = mTextRect.height();
|
||||||
|
Log.e("onMeasure", "width1 : " + width1);
|
||||||
|
Log.e("onMeasure", "height1 : " + height1);
|
||||||
|
|
||||||
|
// canvas.drawText(level, (batteryRect.right - batteryRect.left - width1) - mTextRect.left, (batteryRect.bottom - batteryRect.top - height1) - mTextRect.top, mTextPaint);
|
||||||
|
canvas.drawText(level, backgroundRect.left + (backgroundRect.width() - width1 - OUTLINE_THICKNESS) / 2, backgroundRect.bottom - (backgroundRect.height() - height1 + OUTLINE_THICKNESS) / 2, mTextPaint);
|
||||||
|
|
||||||
|
|
||||||
|
if (mCharging) {
|
||||||
|
Bitmap bitmap = ImageUtils.getBitmap(R.drawable.ic_battery_charging);
|
||||||
|
Bitmap bitmapScale = Bitmap.createScaledBitmap(bitmap, FLASH_WIDTH, FLASH_HEIGHT, true);
|
||||||
|
canvas.drawBitmap(bitmapScale, 0, (CAP_HEIGHT * 2 - FLASH_HEIGHT) / 2, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
app/src/main/res/drawable-hdpi/ic_battery_charging.png
Normal file
|
After Width: | Height: | Size: 456 B |
BIN
app/src/main/res/drawable-hdpi/icon_wifi_connect.png
Normal file
|
After Width: | Height: | Size: 763 B |
BIN
app/src/main/res/drawable-hdpi/icon_wifi_disconnect.png
Normal file
|
After Width: | Height: | Size: 881 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 110 KiB |
@@ -3,7 +3,7 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<!-- 内部颜色 -->
|
<!-- 内部颜色 -->
|
||||||
<solid
|
<solid
|
||||||
android:color="#E5E5E5" />
|
android:color="@color/default_text_color_dis" />
|
||||||
<!-- 圆角的幅度 -->
|
<!-- 圆角的幅度 -->
|
||||||
<corners
|
<corners
|
||||||
android:topLeftRadius="@dimen/dp_6"
|
android:topLeftRadius="@dimen/dp_6"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<!-- 内部颜色 -->
|
<!-- 内部颜色 -->
|
||||||
<solid android:color="@color/contact_text_color" />
|
<solid android:color="@color/default_text_color_dis" />
|
||||||
<!-- 圆角的幅度 -->
|
<!-- 圆角的幅度 -->
|
||||||
<corners android:radius="@dimen/dp_16" />
|
<corners android:radius="@dimen/dp_16" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:drawable="@drawable/permission_auth_dis_bg" android:state_enabled="false" />
|
<item android:drawable="@drawable/permission_auth_bg" android:state_enabled="false" />
|
||||||
<item android:drawable="@drawable/permission_auth_bg" android:state_pressed="false" />
|
<item android:drawable="@drawable/permission_auth_dis_bg" android:state_pressed="false" />
|
||||||
<item android:drawable="@drawable/permission_auth_bg" android:state_pressed="true" />
|
<item android:drawable="@drawable/permission_auth_dis_bg" android:state_pressed="true" />
|
||||||
</selector>
|
</selector>
|
||||||
6
app/src/main/res/drawable/tv_permission.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_enabled="true" android:color="@color/default_blue" />
|
||||||
|
<item android:state_enabled="false" android:color="@color/white" />
|
||||||
|
<item android:color="@color/default_blue" />
|
||||||
|
</selector>
|
||||||
@@ -8,11 +8,16 @@
|
|||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/iv_wallpaper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
@@ -26,7 +31,7 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
@@ -390,4 +395,7 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -12,6 +12,11 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -356,4 +361,6 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -67,10 +67,73 @@
|
|||||||
android:textColor="@color/lightGray"
|
android:textColor="@color/lightGray"
|
||||||
android:textSize="@dimen/sp_8"
|
android:textSize="@dimen/sp_8"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toStartOf="@+id/constraintLayout13"
|
||||||
app:layout_constraintStart_toEndOf="@+id/iv_speaker"
|
app:layout_constraintStart_toEndOf="@+id/iv_speaker"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout13"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout14"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:onClick="@{click::toWifi}"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_wifi"
|
||||||
|
android:layout_width="@dimen/dp_16"
|
||||||
|
android:layout_height="@dimen/dp_16"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/icon_wifi_connect"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_wifi_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_4"
|
||||||
|
android:text="未连接"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_9"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.uiui.zyos.view.BatteryView
|
||||||
|
android:id="@+id/batteryView"
|
||||||
|
android:layout_width="@dimen/dp_30"
|
||||||
|
android:layout_height="@dimen/dp_10"
|
||||||
|
android:layout_marginStart="@dimen/dp_2"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout14"
|
||||||
|
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_4"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/batteryView"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="00:00" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
@@ -481,8 +544,8 @@
|
|||||||
android:id="@+id/imageView14"
|
android:id="@+id/imageView14"
|
||||||
android:layout_width="@dimen/dp_16"
|
android:layout_width="@dimen/dp_16"
|
||||||
android:layout_height="@dimen/dp_16"
|
android:layout_height="@dimen/dp_16"
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:onClick="@{click::refreshHomework}"
|
android:onClick="@{click::refreshHomework}"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/icon_homework_refresh"
|
android:src="@drawable/icon_homework_refresh"
|
||||||
|
|||||||
@@ -51,10 +51,73 @@
|
|||||||
android:textColor="@color/lightGray"
|
android:textColor="@color/lightGray"
|
||||||
android:textSize="@dimen/sp_8"
|
android:textSize="@dimen/sp_8"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toStartOf="@+id/constraintLayout13"
|
||||||
app:layout_constraintStart_toEndOf="@+id/iv_speaker"
|
app:layout_constraintStart_toEndOf="@+id/iv_speaker"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout13"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout14"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:onClick="@{click::toWifi}"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_wifi"
|
||||||
|
android:layout_width="@dimen/dp_12"
|
||||||
|
android:layout_height="@dimen/dp_12"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/icon_wifi_connect"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_wifi_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_4"
|
||||||
|
android:text="未连接"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_8"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.uiui.zyos.view.BatteryView
|
||||||
|
android:id="@+id/batteryView"
|
||||||
|
android:layout_width="@dimen/dp_24"
|
||||||
|
android:layout_height="@dimen/dp_8"
|
||||||
|
android:layout_marginStart="@dimen/dp_2"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout14"
|
||||||
|
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_4"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_9"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/batteryView"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="00:00" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
|||||||
@@ -12,7 +12,13 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/iv_wallpaper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
@@ -53,8 +59,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="@+id/imageView2"
|
app:layout_constraintEnd_toEndOf="@+id/imageView2"
|
||||||
app:layout_constraintStart_toStartOf="@+id/imageView2"
|
app:layout_constraintStart_toStartOf="@+id/imageView2"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
|
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
|
||||||
|
s
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -138,8 +143,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_1"
|
android:id="@+id/bt_1"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="1"
|
android:text="1"
|
||||||
@@ -159,8 +164,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_2"
|
android:id="@+id/bt_2"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="2"
|
android:text="2"
|
||||||
@@ -179,8 +184,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_3"
|
android:id="@+id/bt_3"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="3"
|
android:text="3"
|
||||||
@@ -208,8 +213,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_4"
|
android:id="@+id/bt_4"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="4"
|
android:text="4"
|
||||||
@@ -228,8 +233,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_5"
|
android:id="@+id/bt_5"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="5"
|
android:text="5"
|
||||||
@@ -248,8 +253,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_6"
|
android:id="@+id/bt_6"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="6"
|
android:text="6"
|
||||||
@@ -277,8 +282,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_7"
|
android:id="@+id/bt_7"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="7"
|
android:text="7"
|
||||||
@@ -298,8 +303,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_8"
|
android:id="@+id/bt_8"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="8"
|
android:text="8"
|
||||||
@@ -318,8 +323,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_9"
|
android:id="@+id/bt_9"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="9"
|
android:text="9"
|
||||||
@@ -352,8 +357,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_0"
|
android:id="@+id/bt_0"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="0"
|
android:text="0"
|
||||||
@@ -391,4 +396,6 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -12,6 +12,11 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -105,8 +110,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_1"
|
android:id="@+id/bt_1"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="1"
|
android:text="1"
|
||||||
@@ -126,8 +131,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_2"
|
android:id="@+id/bt_2"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="2"
|
android:text="2"
|
||||||
@@ -146,8 +151,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_3"
|
android:id="@+id/bt_3"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="3"
|
android:text="3"
|
||||||
@@ -175,8 +180,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_4"
|
android:id="@+id/bt_4"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="4"
|
android:text="4"
|
||||||
@@ -195,8 +200,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_5"
|
android:id="@+id/bt_5"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="5"
|
android:text="5"
|
||||||
@@ -215,8 +220,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_6"
|
android:id="@+id/bt_6"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="6"
|
android:text="6"
|
||||||
@@ -244,8 +249,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_7"
|
android:id="@+id/bt_7"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="7"
|
android:text="7"
|
||||||
@@ -265,8 +270,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_8"
|
android:id="@+id/bt_8"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="8"
|
android:text="8"
|
||||||
@@ -285,8 +290,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_9"
|
android:id="@+id/bt_9"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="9"
|
android:text="9"
|
||||||
@@ -319,8 +324,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bt_0"
|
android:id="@+id/bt_0"
|
||||||
android:layout_width="@dimen/dp_56"
|
android:layout_width="@dimen/dp_52"
|
||||||
android:layout_height="@dimen/dp_56"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:background="@drawable/bt_dialer_selector"
|
android:background="@drawable/bt_dialer_selector"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="0"
|
android:text="0"
|
||||||
@@ -358,4 +363,5 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_noti"
|
android:id="@+id/tv_noti"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minLines="2"
|
android:maxLines="1"
|
||||||
android:paddingStart="@dimen/dp_16"
|
android:minLines="1"
|
||||||
android:paddingEnd="@dimen/dp_16"
|
android:paddingStart="@dimen/dp_8"
|
||||||
|
android:paddingEnd="@dimen/dp_8"
|
||||||
android:text="桌面运行需要获取以上授权,请手动授予权限!"
|
android:text="@string/desktop_permission"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="存储权限"
|
android:text="存储权限"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -92,8 +92,8 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:onClick="@{click::openStorage}"
|
android:onClick="@{click::openStorage}"
|
||||||
android:text="去授权"
|
android:text="去授权"
|
||||||
android:textColor="@color/white"
|
android:textColor="@drawable/tv_permission"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_13"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="读取电话状态"
|
android:text="读取电话状态"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -150,8 +150,8 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:onClick="@{click::openReadPhone}"
|
android:onClick="@{click::openReadPhone}"
|
||||||
android:text="去授权"
|
android:text="去授权"
|
||||||
android:textColor="@color/white"
|
android:textColor="@drawable/tv_permission"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_13"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="修改系统设置"
|
android:text="修改系统设置"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -209,8 +209,8 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:onClick="@{click::openWriteSettings}"
|
android:onClick="@{click::openWriteSettings}"
|
||||||
android:text="去授权"
|
android:text="去授权"
|
||||||
android:textColor="@color/white"
|
android:textColor="@drawable/tv_permission"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_13"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="定位权限"
|
android:text="定位权限"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -267,8 +267,8 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:onClick="@{click::open_coarse_location}"
|
android:onClick="@{click::open_coarse_location}"
|
||||||
android:text="去授权"
|
android:text="去授权"
|
||||||
android:textColor="@color/white"
|
android:textColor="@drawable/tv_permission"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_13"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -298,7 +298,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="定位权限"
|
android:text="定位权限"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -325,8 +325,8 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:onClick="@{click::open_fine_location}"
|
android:onClick="@{click::open_fine_location}"
|
||||||
android:text="去授权"
|
android:text="去授权"
|
||||||
android:textColor="@color/white"
|
android:textColor="@drawable/tv_permission"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_13"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -356,7 +356,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="后台定位权限"
|
android:text="后台定位权限"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -383,8 +383,8 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:onClick="@{click::open_background_location}"
|
android:onClick="@{click::open_background_location}"
|
||||||
android:text="去授权"
|
android:text="去授权"
|
||||||
android:textColor="@color/white"
|
android:textColor="@drawable/tv_permission"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_13"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|||||||
@@ -67,10 +67,72 @@
|
|||||||
android:textColor="@color/lightGray"
|
android:textColor="@color/lightGray"
|
||||||
android:textSize="@dimen/sp_8"
|
android:textSize="@dimen/sp_8"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toStartOf="@+id/constraintLayout13"
|
||||||
app:layout_constraintStart_toEndOf="@+id/iv_speaker"
|
app:layout_constraintStart_toEndOf="@+id/iv_speaker"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout13"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/constraintLayout14"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:onClick="@{click::toWifi}"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_wifi"
|
||||||
|
android:layout_width="@dimen/dp_16"
|
||||||
|
android:layout_height="@dimen/dp_16"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/icon_wifi_connect"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_wifi_status"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_4"
|
||||||
|
android:text="未连接"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_9"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/iv_wifi"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.uiui.zyos.view.BatteryView
|
||||||
|
android:id="@+id/batteryView"
|
||||||
|
android:layout_width="@dimen/dp_30"
|
||||||
|
android:layout_height="@dimen/dp_10"
|
||||||
|
android:layout_marginStart="@dimen/dp_4"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout14"
|
||||||
|
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_4"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/batteryView"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="00:00" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
@@ -481,8 +543,8 @@
|
|||||||
android:id="@+id/imageView14"
|
android:id="@+id/imageView14"
|
||||||
android:layout_width="@dimen/dp_16"
|
android:layout_width="@dimen/dp_16"
|
||||||
android:layout_height="@dimen/dp_16"
|
android:layout_height="@dimen/dp_16"
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
android:onClick="@{click::refreshHomework}"
|
android:onClick="@{click::refreshHomework}"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/icon_homework_refresh"
|
android:src="@drawable/icon_homework_refresh"
|
||||||
|
|||||||
@@ -50,4 +50,17 @@
|
|||||||
<color name="homework_title">#3a3a3a</color>
|
<color name="homework_title">#3a3a3a</color>
|
||||||
<color name="homework_text">#646464</color>
|
<color name="homework_text">#646464</color>
|
||||||
<color name="unfinish_text">#ab9452</color>
|
<color name="unfinish_text">#ab9452</color>
|
||||||
|
<color name="default_text_color_dis">#e5e5e5</color>
|
||||||
|
|
||||||
|
|
||||||
|
<color name="battery_low_power">#e84446</color>
|
||||||
|
<color name="battery_normal_power">#ffffff</color>
|
||||||
|
<color name="battery_background">#ffffff</color>
|
||||||
|
<color name="battery_charing">#b7f0d3</color>
|
||||||
|
<color name="battery_box">#ffffff</color>
|
||||||
|
<color name="battery_text">#56478A</color>
|
||||||
|
|
||||||
|
<color name="normal_circle">#1AFFFFFF</color>
|
||||||
|
<color name="selected_circle">#E6FFFFFF</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -16,5 +16,6 @@
|
|||||||
<string name="app_size">%d款应用</string>
|
<string name="app_size">%d款应用</string>
|
||||||
<string name="today_study_time">学习时长%s</string>
|
<string name="today_study_time">学习时长%s</string>
|
||||||
<string name="unknown">未设置</string>
|
<string name="unknown">未设置</string>
|
||||||
|
<string name="desktop_permission">桌面运行需授予权限,点击设置</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -10,6 +10,14 @@
|
|||||||
<item name="android:fitsSystemWindows">true</item>
|
<item name="android:fitsSystemWindows">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="AppThemeWithoutFitsSystemWindows" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
<item name="android:windowBackground">@color/colorPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="AppWhiteTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppWhiteTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">@color/gray</item>
|
<item name="colorPrimary">@color/gray</item>
|
||||||
|
|||||||