diff --git a/app/build.gradle b/app/build.gradle index e04e0c2..03d6464 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,7 +27,7 @@ android { } manifestPlaceholders = [ - AMAP_KEY: "372937d213ff288dc150c31967a200cd" + AMAP_KEY: "723704391181f6b0b478eecf8e6fcde6" ] } @@ -198,6 +198,9 @@ dependencies { implementation 'com.github.wuao:FlycoTabLayout2:Tag1.1.3' implementation 'com.contrarywind:Android-PickerView:4.1.9' implementation 'com.github.ForgetAll:LoadingDialog:v1.1.2' + //autosize会改变第三方view的大小 + //https://github.com/JessYanCoding/AndroidAutoSize + implementation 'me.jessyan:autosize:1.2.1' //动态权限框架 implementation 'com.github.getActivity:XXPermissions:16.6' // 吐司框架:https://github.com/getActivity/Toaster diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 0d8a671..68d1922 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -85,6 +85,10 @@ -keep @androidx.annotation.Keep class * -keepclassmembers class * {@androidx.annotation.Keep *;} +###排除所有注解类 +-keep class * extends java.lang.annotation.Annotation { *; } +-keep interface * extends java.lang.annotation.Annotation { *; } + #不混淆View中的set***() 和 get***()方法 以保证属性动画正常工作 某个类中的某个方法不混淆 #自定义View的set get方法 和 构造方法不混淆 -keep public class * extends android.view.View{ @@ -213,8 +217,20 @@ #----------------------------- 第三方类库 ------------------------------------------ #Aria +-dontwarn com.arialyy.annotations.** +-keep class com.arialyy.annotations.**{*;} + -dontwarn com.arialyy.aria.** -keep class com.arialyy.aria.**{*;} +-keep class **$$DownloadListenerProxy{ *; } +-keep class **$$UploadListenerProxy{ *; } +-keep class **$$DownloadGroupListenerProxy{ *; } +-keepclasseswithmembernames class * { + @Download.* ; + @Upload.* ; + @DownloadGroup.* ; +} + #QWeather -dontwarn com.qweather.sdk.** diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 00a6f88..dcf3f35 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -68,15 +68,10 @@ - - - - - @@ -461,19 +456,6 @@ android:name="com.amap.api.v2.apikey" android:value="${AMAP_KEY}" /> - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/app/src/main/java/com/xxpatx/os/activity/main/MainActivity.java b/app/src/main/java/com/xxpatx/os/activity/main/MainActivity.java index e6c17f7..561f86e 100644 --- a/app/src/main/java/com/xxpatx/os/activity/main/MainActivity.java +++ b/app/src/main/java/com/xxpatx/os/activity/main/MainActivity.java @@ -62,6 +62,7 @@ import com.xxpatx.os.utils.ApkUtils; import com.xxpatx.os.utils.AppUsedTimeUtils; import com.xxpatx.os.utils.DayUtils; import com.xxpatx.os.view.ScaleCircleNavigator; +import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX; import net.lucode.hackware.magicindicator.ViewPagerHelper; @@ -114,11 +115,6 @@ public class MainActivity extends BaseMvvmActivity stringIntegerHashMap = new HashMap<>(); - WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); - DisplayMetrics dm = new DisplayMetrics(); - wm.getDefaultDisplay().getRealMetrics(dm); - float density = dm.density; // 屏幕密度(0.75 / 1.0 / 1.5) - stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.TOP_DECORATION, (int) (density * 4));//top间距 - stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.BOTTOM_DECORATION, (int) (density * 40));//底部间距 - stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.LEFT_DECORATION, (int) (density * 4));//左间距 - stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.RIGHT_DECORATION, (int) (density * 4));//右间距 - mViewDataBinding.rvApp.addItemDecoration(new RecyclerViewSpacesItemDecoration(stringIntegerHashMap)); - mHomeAppAdapter = new HomeAppAdapter(); - mViewDataBinding.rvApp.setAdapter(mHomeAppAdapter); +// mViewDataBinding.rvApp.setLayoutManager(new GridLayoutManager(mContext, 3)); +// HashMap stringIntegerHashMap = new HashMap<>(); +// WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); +// DisplayMetrics dm = new DisplayMetrics(); +// wm.getDefaultDisplay().getRealMetrics(dm); +// float density = dm.density; // 屏幕密度(0.75 / 1.0 / 1.5) +// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.TOP_DECORATION, (int) (density * 4));//top间距 +// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.BOTTOM_DECORATION, (int) (density * 40));//底部间距 +// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.LEFT_DECORATION, (int) (density * 4));//左间距 +// stringIntegerHashMap.put(RecyclerViewSpacesItemDecoration.RIGHT_DECORATION, (int) (density * 4));//右间距 +// mViewDataBinding.rvApp.addItemDecoration(new RecyclerViewSpacesItemDecoration(stringIntegerHashMap)); +// mHomeAppAdapter = new HomeAppAdapter(); +// mViewDataBinding.rvApp.setAdapter(mHomeAppAdapter); } @Override @@ -443,16 +443,16 @@ public class HomeFragment extends BaseMvvmFragment 80) { - mViewDataBinding.cpv.setProgressColor(mShaderColorsRed); - } else { - mViewDataBinding.cpv.setProgressColor(mShaderColors); - } - mViewDataBinding.cpv.showAnimation(0, x, 1000); - float x2 = (((total - avail) / (float) total)); +// long avail = AppUtil.getAvailMemory(mContext); +// long total = AppUtil.getTotalMemory(mContext); +// int x = (int) (((total - avail) / (double) total) * 100); +// if (x > 80) { +// mViewDataBinding.cpv.setProgressColor(mShaderColorsRed); +// } else { +// mViewDataBinding.cpv.setProgressColor(mShaderColors); +// } +// mViewDataBinding.cpv.showAnimation(0, x, 1000); +// float x2 = (((total - avail) / (float) total)); } private void setTime() { diff --git a/app/src/main/java/com/xxpatx/os/fragment/settings/SettingsFragment.java b/app/src/main/java/com/xxpatx/os/fragment/settings/SettingsFragment.java index f376663..b22b3ec 100644 --- a/app/src/main/java/com/xxpatx/os/fragment/settings/SettingsFragment.java +++ b/app/src/main/java/com/xxpatx/os/fragment/settings/SettingsFragment.java @@ -21,7 +21,7 @@ import com.qweather.sdk.bean.weather.WeatherNowBean; import com.tencent.mmkv.MMKV; import com.xxpatx.os.BuildConfig; import com.xxpatx.os.R; -import com.xxpatx.os.activity.contact.AddContactActivity; +import com.xxpatx.os.activity.contact.AddWechatContactActivity; import com.xxpatx.os.activity.weather.WeatherActivity; import com.xxpatx.os.base.mvvm.fragment.BaseMvvmFragment; import com.xxpatx.os.bean.MapBean; @@ -261,7 +261,7 @@ public class SettingsFragment extends BaseMvvmFragment + app:layout_constraintTop_toBottomOf="@+id/sliding_tab_layout" /> + android:layout_height="match_parent"> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> @@ -45,11 +45,11 @@ android:id="@+id/tv_time" 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="16dp" + android:layout_marginTop="16dp" android:maxLines="1" android:textColor="@color/white" - android:textSize="@dimen/sp_44" + android:textSize="44sp" android:textStyle="bold" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -59,20 +59,20 @@ android:id="@+id/tv_data" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_4" + android:layout_marginTop="4dp" android:maxLines="1" android:textColor="@color/white" - android:textSize="@dimen/sp_12" + android:textSize="12sp" app:layout_constraintStart_toStartOf="@+id/tv_time" app:layout_constraintTop_toBottomOf="@+id/tv_time" tools:text="20230621" /> @@ -95,7 +95,7 @@ android:gravity="center_vertical" android:text="--℃" android:textColor="@color/white" - android:textSize="@dimen/sp_20" + android:textSize="20sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:text="0℃" /> @@ -104,10 +104,10 @@ android:id="@+id/tv_weather" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_8" + android:layout_marginTop="8dp" android:text="--" android:textColor="@color/white" - android:textSize="@dimen/sp_10" + android:textSize="10sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_temp" tools:text="天气" /> @@ -115,14 +115,14 @@ @@ -194,35 +193,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -535,19 +319,16 @@ - - - - - - - - @@ -634,75 +374,22 @@ android:id="@+id/tv_app" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/dp_8" + android:layout_marginBottom="8dp" android:text="更多应用" android:textColor="@color/white" - android:textSize="@dimen/sp_17" + android:textSize="17sp" android:textStyle="bold" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_wechat_call.xml b/app/src/main/res/layout/activity_wechat_call.xml index 4218286..7b105e2 100644 --- a/app/src/main/res/layout/activity_wechat_call.xml +++ b/app/src/main/res/layout/activity_wechat_call.xml @@ -22,7 +22,6 @@ + android:layout_marginEnd="@dimen/dp_16" + android:visibility="gone"> + android:onClick="@{click::callPhone}" + android:visibility="gone"> + android:onClick="@{click::callWechatVideo}" + android:visibility="gone"> + android:onClick="@{click::callWechatVoice}" + android:visibility="gone"> + android:onClick="@{click::exit}" + android:visibility="gone"> + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_contact_home.xml b/app/src/main/res/layout/fragment_contact_home.xml index e21f00e..e4c0b5d 100644 --- a/app/src/main/res/layout/fragment_contact_home.xml +++ b/app/src/main/res/layout/fragment_contact_home.xml @@ -16,17 +16,18 @@ android:layout_height="match_parent"> + android:layout_width="330dp" + android:layout_height="633dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> @@ -34,11 +35,11 @@ android:id="@+id/tv_time" 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="16dp" + android:layout_marginTop="16dp" android:maxLines="1" android:textColor="@color/white" - android:textSize="@dimen/sp_44" + android:textSize="44sp" android:textStyle="bold" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -48,20 +49,20 @@ android:id="@+id/tv_data" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_4" + android:layout_marginTop="4dp" android:maxLines="1" android:textColor="@color/white" - android:textSize="@dimen/sp_12" + android:textSize="12sp" app:layout_constraintStart_toStartOf="@+id/tv_time" app:layout_constraintTop_toBottomOf="@+id/tv_time" tools:text="20230621" /> @@ -84,7 +85,7 @@ android:gravity="center_vertical" android:text="--℃" android:textColor="@color/white" - android:textSize="@dimen/sp_20" + android:textSize="20sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:text="0℃" /> @@ -93,10 +94,10 @@ android:id="@+id/tv_weather" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_8" + android:layout_marginTop="8dp" android:text="--" android:textColor="@color/white" - android:textSize="@dimen/sp_10" + android:textSize="10sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_temp" tools:text="天气" /> @@ -104,14 +105,14 @@ + android:layout_height="match_parent"> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> @@ -41,11 +41,11 @@ android:id="@+id/tv_time" 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="16dp" + android:layout_marginTop="16dp" android:maxLines="1" android:textColor="@color/white" - android:textSize="@dimen/sp_44" + android:textSize="44sp" android:textStyle="bold" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -55,20 +55,20 @@ android:id="@+id/tv_data" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_4" + android:layout_marginTop="4dp" android:maxLines="1" android:textColor="@color/white" - android:textSize="@dimen/sp_12" + android:textSize="12sp" app:layout_constraintStart_toStartOf="@+id/tv_time" app:layout_constraintTop_toBottomOf="@+id/tv_time" tools:text="20230621" /> @@ -91,7 +91,7 @@ android:gravity="center_vertical" android:text="--℃" android:textColor="@color/white" - android:textSize="@dimen/sp_20" + android:textSize="20sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:text="0℃" /> @@ -100,10 +100,10 @@ android:id="@+id/tv_weather" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_8" + android:layout_marginTop="8dp" android:text="--" android:textColor="@color/white" - android:textSize="@dimen/sp_10" + android:textSize="10sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_temp" tools:text="天气" /> @@ -111,14 +111,14 @@ - @@ -230,30 +227,28 @@ @@ -277,24 +273,22 @@ @@ -319,17 +314,15 @@ diff --git a/app/src/main/res/layout/phone_activity_main.xml b/app/src/main/res/layout/phone_activity_main.xml index 3785451..88802dc 100644 --- a/app/src/main/res/layout/phone_activity_main.xml +++ b/app/src/main/res/layout/phone_activity_main.xml @@ -13,8 +13,7 @@ + android:layout_height="match_parent"> @@ -99,10 +98,10 @@ @@ -131,10 +130,10 @@ @@ -163,10 +162,10 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e356319..e0a8019 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - 爱来伴 + 孝心平安通讯OS %d款应用 连接到 \"%s\" @@ -11,8 +11,8 @@ "安装快捷方式" "添加到主屏幕" - 关爱守护快捷服务 - 关爱守护一键拨打视频 + 孝心平安通讯OS快捷服务 + 孝心平安通讯OS一键拨打视频 Settings