Просмотр исходного кода

[New]图文记录 initial commit

litchi98 1 месяц назад
Родитель
Сommit
8b1cbc1972
49 измененных файлов с 188 добавлено и 237 удалено
  1. 3 3
      app/src/main/java/com/datarecovery/master/data/consts/Constants.java
  2. 13 6
      app/src/main/java/com/datarecovery/master/module/homepage/FunctionBean.java
  3. 8 2
      app/src/main/java/com/datarecovery/master/module/homepage/HomePageFragment.java
  4. 35 41
      app/src/main/java/com/datarecovery/master/module/homepage/HomePageViewModel.java
  5. 1 1
      app/src/main/java/com/datarecovery/master/module/homepage/OtherFunctionAdapter.java
  6. 4 25
      app/src/main/java/com/datarecovery/master/utils/GridLayoutItemDecoration.java
  7. 3 0
      app/src/main/java/com/datarecovery/master/widget/InformationSwitchBanner.java
  8. BIN
      app/src/main/res/drawable-xxhdpi/bg_home_banner.webp
  9. BIN
      app/src/main/res/drawable-xxhdpi/bg_home_page_audio_recovery.webp
  10. BIN
      app/src/main/res/drawable-xxhdpi/bg_home_page_file_recovery.webp
  11. BIN
      app/src/main/res/drawable-xxhdpi/bg_home_page_helper.webp
  12. BIN
      app/src/main/res/drawable-xxhdpi/bg_home_page_img_clearing.webp
  13. BIN
      app/src/main/res/drawable-xxhdpi/bg_home_page_img_recover.webp
  14. BIN
      app/src/main/res/drawable-xxhdpi/bg_home_page_video_recovery.webp
  15. BIN
      app/src/main/res/drawable-xxhdpi/bg_splash.webp
  16. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_expand.webp
  17. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_page_audio_recovery.webp
  18. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_page_file_recovery.webp
  19. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_page_helper.webp
  20. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_page_img_clearing.webp
  21. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_page_img_recover.webp
  22. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_page_video_recovery.webp
  23. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_qq.webp
  24. BIN
      app/src/main/res/drawable-xxhdpi/icon_home_wechat.webp
  25. BIN
      app/src/main/res/drawable-xxhdpi/icon_splash_logo.webp
  26. 6 0
      app/src/main/res/drawable/bg_home_page_area.xml
  27. 6 0
      app/src/main/res/drawable/bg_main_tab.xml
  28. 2 2
      app/src/main/res/drawable/bg_theme_splash.xml
  29. 2 2
      app/src/main/res/drawable/selector_home_page_information.xml
  30. 10 4
      app/src/main/res/layout/activity_main.xml
  31. 1 1
      app/src/main/res/layout/fragment_example.xml
  32. 40 122
      app/src/main/res/layout/fragment_home_page.xml
  33. 1 1
      app/src/main/res/layout/fragment_mine.xml
  34. 38 14
      app/src/main/res/layout/item_home_page_other_function.xml
  35. 4 4
      app/src/main/res/layout/view_home_page_switch_text.xml
  36. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  37. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  38. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  39. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  40. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  41. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  42. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  43. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  44. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  45. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  46. 1 1
      app/src/main/res/values/dimens.xml
  47. 4 2
      app/src/main/res/values/strings.xml
  48. 1 1
      build.gradle
  49. 5 5
      gradle.properties

+ 3 - 3
app/src/main/java/com/datarecovery/master/data/consts/Constants.java

@@ -8,12 +8,12 @@ public class Constants {
 
     public static final String Atmob_Server_Base_URL = BuildConfig.HOST;
 
-    public static final String App_DefaultChannel = "SDLTJLBFCCOP";
+    public static final String App_DefaultChannel = "SDTWJLBFZSHW";
     public static final int App_DefaultAppId = 0;
     public static final int App_DefaultTgPlatformId = 0;
 
-    public static final String PRIVACY_POLICY = "https://doc.v8dashen.com/doc/230effac21758b18";
-    public static final String USER_AGREEMENT = "https://doc.v8dashen.com/doc/254ebea85603b26e";
+    public static final String PRIVACY_POLICY = "https://doc.v8dashen.com/doc/ffa61dab45614af5";
+    public static final String USER_AGREEMENT = "https://doc.v8dashen.com/doc/402965bc75b42028";
     public static final String KID_PROTECTION = "https://cdn.myaskai.cn/static/default-kid-privacy.html";
     public static final String USER_INFO_LIST = "";
     public static final String THREE_SDK_LIST = "";

+ 13 - 6
app/src/main/java/com/datarecovery/master/module/homepage/FunctionBean.java

@@ -13,23 +13,22 @@ public class FunctionBean {
     public static final int VIDEO_RECOVERY = 3;
     public static final int AUDIO_RECOVERY = 4;
     public static final int IMG_CLEARING = 5;
-
-    @IntDef({IMG_RECOVERY, FILE_RECOVERY, VIDEO_RECOVERY, AUDIO_RECOVERY, IMG_CLEARING})
-    @Retention(RetentionPolicy.SOURCE)
-    public @interface FunctionId {
-    }
+    public static final int BACKUP_HELPER = 6;
 
     private final int functionId;
     private final String functionName;
     private final String functionDesc;
     @DrawableRes
     private final int functionIcon;
+    @DrawableRes
+    private final int functionBg;
 
-    public FunctionBean(@FunctionId int functionId, String functionName, String functionDesc, int functionIcon) {
+    public FunctionBean(@FunctionId int functionId, String functionName, String functionDesc, int functionIcon, int functionBg) {
         this.functionId = functionId;
         this.functionName = functionName;
         this.functionDesc = functionDesc;
         this.functionIcon = functionIcon;
+        this.functionBg = functionBg;
     }
 
     @FunctionId
@@ -49,4 +48,12 @@ public class FunctionBean {
         return functionIcon;
     }
 
+    public int getFunctionBg() {
+        return functionBg;
+    }
+
+    @IntDef({IMG_RECOVERY, FILE_RECOVERY, VIDEO_RECOVERY, AUDIO_RECOVERY, IMG_CLEARING, BACKUP_HELPER})
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface FunctionId {
+    }
 }

+ 8 - 2
app/src/main/java/com/datarecovery/master/module/homepage/HomePageFragment.java

@@ -3,12 +3,14 @@ package com.datarecovery.master.module.homepage;
 import android.os.Bundle;
 import android.view.Gravity;
 import android.view.View;
+import android.view.ViewGroup;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.recyclerview.widget.GridLayoutManager;
 
 import com.atmob.app.lib.base.BaseFragment;
+import com.atmob.common.ui.SizeUtil;
 import com.atmob.mediation.api.AdError;
 import com.datarecovery.master.R;
 import com.datarecovery.master.data.consts.AdFuncId;
@@ -35,7 +37,6 @@ public class HomePageFragment extends BaseFragment<FragmentHomePageBinding> {
 
     private CommonSureDialog requestManageDialog;
     private CommonSureDialog requestAndroidDataDialog;
-    private int savedScrollPosition;
 
     @Override
     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
@@ -85,6 +86,11 @@ public class HomePageFragment extends BaseFragment<FragmentHomePageBinding> {
 
 
     private void initView() {
+        ViewGroup.LayoutParams layoutParams = binding.vInformationBg.getLayoutParams();
+        if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
+            ((ViewGroup.MarginLayoutParams) layoutParams).topMargin
+                    = (int) (SizeUtil.getStatusBarHeight() + SizeUtil.dp2px(10));
+        }
         initTextViewBanner();
         initHotFunction();
         initOtherFunction();
@@ -97,7 +103,7 @@ public class HomePageFragment extends BaseFragment<FragmentHomePageBinding> {
     private void initOtherFunction() {
         otherFunctionAdapter = new OtherFunctionAdapter(getViewLifecycleOwner(), homePageViewModel.getFunctionList());
         binding.ryOtherFunction.setAdapter(otherFunctionAdapter);
-        binding.ryOtherFunction.setLayoutManager(new GridLayoutManager(requireContext(), 2));
+        binding.ryOtherFunction.setLayoutManager(new GridLayoutManager(requireContext(), 3));
         otherFunctionAdapter.setOnItemClick(bean -> AtmobAdHelper.showVideo(AdFuncId.REWARD_BEFORE_SCAN, new RewardVideoListenerAdapter() {
             boolean isRewarded = false;
 

+ 35 - 41
app/src/main/java/com/datarecovery/master/module/homepage/HomePageViewModel.java

@@ -15,8 +15,6 @@ import com.atmob.mediation.api.AdError;
 import com.datarecovery.master.R;
 import com.datarecovery.master.data.consts.AdFuncId;
 import com.datarecovery.master.data.consts.EventId;
-import com.datarecovery.master.data.repositories.ConfigRepository;
-import com.datarecovery.master.data.repositories.DeviceFuncRepository;
 import com.datarecovery.master.handler.EventHelper;
 import com.datarecovery.master.module.audiorecover.AudioRecoverActivity;
 import com.datarecovery.master.module.backup_helper.BackupHelperActivity;
@@ -26,6 +24,7 @@ import com.datarecovery.master.module.member.MemberType;
 import com.datarecovery.master.module.videorecover.VideoRecoverActivity;
 import com.datarecovery.master.sdk.ad.AtmobAdHelper;
 import com.datarecovery.master.sdk.ad.RewardVideoListenerAdapter;
+import com.datarecovery.master.utils.BoxingUtil;
 import com.datarecovery.master.utils.Maps;
 import com.datarecovery.master.utils.ToastUtil;
 
@@ -40,9 +39,6 @@ import dagger.hilt.android.lifecycle.HiltViewModel;
 @HiltViewModel
 public class HomePageViewModel extends BaseViewModel {
 
-    private final DeviceFuncRepository deviceFuncRepository;
-    private final ConfigRepository configRepository;
-
     private final List<Pair<CharSequence, CharSequence>> informationList = new ArrayList<>();
     private final List<FunctionBean> functionList = new ArrayList<>();
     private final SingleLiveEvent<?> requestManagePermission = new SingleLiveEvent<>();
@@ -50,9 +46,7 @@ public class HomePageViewModel extends BaseViewModel {
     private final MutableLiveData<Boolean> isQQSelected = new MutableLiveData<>(false);
 
     @Inject
-    public HomePageViewModel(DeviceFuncRepository deviceFuncRepository, ConfigRepository configRepository) {
-        this.deviceFuncRepository = deviceFuncRepository;
-        this.configRepository = configRepository;
+    public HomePageViewModel() {
         initList();
     }
 
@@ -60,27 +54,6 @@ public class HomePageViewModel extends BaseViewModel {
         return isQQSelected;
     }
 
-    public LiveData<Boolean> getIsOpenTrialMembership() {
-        return configRepository.getIsOpenTrialMembership();
-    }
-
-    public LiveData<Boolean> getIsShowAudioTrialTag() {
-        return deviceFuncRepository.getIsShowAudioTrialTag();
-    }
-
-    public LiveData<Boolean> getIsShowFileTrialTag() {
-        return deviceFuncRepository.getIsShowFileTrialTag();
-    }
-
-    public LiveData<Boolean> getIsShowImageTrialTag() {
-        return deviceFuncRepository.getIsShowImageTrialTag();
-    }
-
-    public LiveData<Boolean> getIsShowVideoTrialTag() {
-        return deviceFuncRepository.getIsShowVideoTrialTag();
-    }
-
-
     public List<FunctionBean> getFunctionList() {
         return functionList;
     }
@@ -90,33 +63,43 @@ public class HomePageViewModel extends BaseViewModel {
     }
 
     private void initList() {
-        informationList.add(new Pair<>("163*****974 购买了微信消息备份", "2分钟前"));
-        informationList.add(new Pair<>("183*****823 购买了图片备份", "4分钟前"));
-        informationList.add(new Pair<>("172*****194 购买了微信好友备份", "5分钟前"));
-        informationList.add(new Pair<>("193*****347 购买了微信消息备份", "9分钟前"));
-        informationList.add(new Pair<>("153*****912 购买了音频备份", "11分钟前"));
-        informationList.add(new Pair<>("159*****864 购买了视频备份", "15分钟前"));
-
+        informationList.add(new Pair<>("华为用户 使用了微信消息备份", ""));
+        informationList.add(new Pair<>("小米用户 使用了图片备份", ""));
+        informationList.add(new Pair<>("OPPO用户 使用了微信好友备份", ""));
+        informationList.add(new Pair<>("VIVO用户 使用了微信消息备份", ""));
+        informationList.add(new Pair<>("荣耀用户 使用了音频备份", ""));
+        informationList.add(new Pair<>("iPhone用户 使用了视频备份", ""));
+
+        functionList.add(new FunctionBean(FunctionBean.BACKUP_HELPER,
+                ContextUtil.getContext().getString(R.string.home_page_backup_helper),
+                ContextUtil.getContext().getString(R.string.home_page_backup_helper_desc),
+                R.drawable.icon_home_page_helper,
+                R.drawable.bg_home_page_helper));
         functionList.add(new FunctionBean(FunctionBean.IMG_RECOVERY,
                 ContextUtil.getContext().getString(R.string.home_page_img_recovery),
                 ContextUtil.getContext().getString(R.string.home_page_img_recovery_desc),
-                R.drawable.icon_home_page_img_recover));
+                R.drawable.icon_home_page_img_recover,
+                R.drawable.bg_home_page_img_recover));
         functionList.add(new FunctionBean(FunctionBean.FILE_RECOVERY,
                 ContextUtil.getContext().getString(R.string.home_page_file_recovery),
                 ContextUtil.getContext().getString(R.string.home_page_file_recovery_desc),
-                R.drawable.icon_home_page_file_recovery));
+                R.drawable.icon_home_page_file_recovery,
+                R.drawable.bg_home_page_file_recovery));
         functionList.add(new FunctionBean(FunctionBean.VIDEO_RECOVERY,
                 ContextUtil.getContext().getString(R.string.home_page_video_recovery),
                 ContextUtil.getContext().getString(R.string.home_page_video_recovery_desc),
-                R.drawable.icon_home_page_video_recovery));
+                R.drawable.icon_home_page_video_recovery,
+                R.drawable.bg_home_page_video_recovery));
         functionList.add(new FunctionBean(FunctionBean.AUDIO_RECOVERY,
                 ContextUtil.getContext().getString(R.string.home_page_audio_recovery),
                 ContextUtil.getContext().getString(R.string.home_page_audio_recovery_desc),
-                R.drawable.icon_home_page_audio_recovery));
+                R.drawable.icon_home_page_audio_recovery,
+                R.drawable.bg_home_page_audio_recovery));
         functionList.add(new FunctionBean(FunctionBean.IMG_CLEARING,
                 ContextUtil.getContext().getString(R.string.home_page_img_clearing),
                 ContextUtil.getContext().getString(R.string.home_page_img_clearing_desc),
-                R.drawable.icon_home_page_img_clearing));
+                R.drawable.icon_home_page_img_clearing,
+                R.drawable.bg_home_page_img_clearing));
     }
 
     public LiveData<?> getRequestManagePermission() {
@@ -127,6 +110,14 @@ public class HomePageViewModel extends BaseViewModel {
         return requestAndroidDataPermission;
     }
 
+    public void toggleAreaSwitch() {
+        if (BoxingUtil.boxing(isQQSelected.getValue())) {
+            onWeChatAreaClick();
+        } else {
+            onQQAreaClick();
+        }
+    }
+
     public void onQQAreaClick() {
         isQQSelected.setValue(true);
 
@@ -311,6 +302,9 @@ public class HomePageViewModel extends BaseViewModel {
                     }
                 }
                 break;
+            case FunctionBean.BACKUP_HELPER:
+                onBackupHelperClick();
+                break;
         }
     }
 }

+ 1 - 1
app/src/main/java/com/datarecovery/master/module/homepage/OtherFunctionAdapter.java

@@ -37,7 +37,7 @@ public class OtherFunctionAdapter extends RecyclerView.Adapter<OtherFunctionAdap
     public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
         super.onAttachedToRecyclerView(recyclerView);
         if (itemDecoration == null) {
-            itemDecoration = new GridLayoutItemDecoration(2, 0.0365853658536585f, 0.0365853658536585f);
+            itemDecoration = new GridLayoutItemDecoration(3, 0.0267857142857143F, 0.0267857142857143F);
         }
         recyclerView.addItemDecoration(itemDecoration);
     }

+ 4 - 25
app/src/main/java/com/datarecovery/master/utils/GridLayoutItemDecoration.java

@@ -8,16 +8,9 @@ import androidx.recyclerview.widget.RecyclerView;
 
 public class GridLayoutItemDecoration extends RecyclerView.ItemDecoration {
 
-    private int spanCount;
-    private float horizontalGapPercent;
-    private float verticalGapPercent;
-
-    private boolean showLastVertical;
-
-    public GridLayoutItemDecoration() {
-
-    }
-
+    private final int spanCount;
+    private final float horizontalGapPercent;
+    private final float verticalGapPercent;
 
     public GridLayoutItemDecoration(int spanCount, float horizontalGapPercent, float verticalGapPercent) {
         this.spanCount = spanCount;
@@ -25,16 +18,6 @@ public class GridLayoutItemDecoration extends RecyclerView.ItemDecoration {
         this.verticalGapPercent = verticalGapPercent;
     }
 
-    public void setParam(int spanCount, float horizontalGapPercent, float verticalGapPercent) {
-        this.spanCount = spanCount;
-        this.horizontalGapPercent = horizontalGapPercent;
-        this.verticalGapPercent = verticalGapPercent;
-    }
-
-    public void setShowLastVertical(boolean showLastVertical) {
-        this.showLastVertical = showLastVertical;
-    }
-
     @Override
     public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
         super.getItemOffsets(outRect, view, parent, state);
@@ -44,11 +27,7 @@ public class GridLayoutItemDecoration extends RecyclerView.ItemDecoration {
         int childAdapterPosition = parent.getChildAdapterPosition(view);
         int i = childAdapterPosition % spanCount;
         outRect.top = 0;
-        if (!showLastVertical && parent.getAdapter() != null && parent.getAdapter().getItemCount() - spanCount <= childAdapterPosition) {
-            outRect.bottom = 0;
-        } else {
-            outRect.bottom = verticalGap;
-        }
+        outRect.bottom = verticalGap;
         outRect.left = 0;
         outRect.right = 0;
         if (i == 0) {

+ 3 - 0
app/src/main/java/com/datarecovery/master/widget/InformationSwitchBanner.java

@@ -3,6 +3,7 @@ package com.datarecovery.master.widget;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.os.Handler;
+import android.text.TextUtils;
 import android.util.Pair;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -50,6 +51,8 @@ public class InformationSwitchBanner implements ViewSwitcher.ViewFactory, View.O
         ViewHomePageSwitchTextBinding binding = ViewHomePageSwitchTextBinding.bind(viewSwitcher.getNextView());
         binding.tvSwitchText.setText(left);
         binding.tvSwitchDate.setText(right);
+        binding.tvSwitchText.setVisibility(TextUtils.isEmpty(left) ? View.GONE : View.VISIBLE);
+        binding.tvSwitchDate.setVisibility(TextUtils.isEmpty(right) ? View.GONE : View.VISIBLE);
         viewSwitcher.showNext();
     }
 

BIN
app/src/main/res/drawable-xxhdpi/bg_home_banner.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_home_page_audio_recovery.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_home_page_file_recovery.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_home_page_helper.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_home_page_img_clearing.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_home_page_img_recover.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_home_page_video_recovery.webp


BIN
app/src/main/res/drawable-xxhdpi/bg_splash.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_expand.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_page_audio_recovery.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_page_file_recovery.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_page_helper.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_page_img_clearing.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_page_img_recover.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_page_video_recovery.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_qq.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_home_wechat.webp


BIN
app/src/main/res/drawable-xxhdpi/icon_splash_logo.webp


+ 6 - 0
app/src/main/res/drawable/bg_home_page_area.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/white20" />
+    <corners android:radius="100dp" />
+</shape>

+ 6 - 0
app/src/main/res/drawable/bg_main_tab.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="100dp" />
+    <solid android:color="@color/white" />
+</shape>

+ 2 - 2
app/src/main/res/drawable/bg_theme_splash.xml

@@ -16,9 +16,9 @@
         <bitmap android:src="@drawable/bg_splash" />
     </item>
 
-    <item android:top="510px">
+    <item android:bottom="210px">
         <bitmap
-            android:gravity="center|top"
+            android:gravity="center|bottom"
             android:src="@drawable/icon_splash_logo" />
     </item>
 </layer-list>

+ 2 - 2
app/src/main/res/drawable/selector_home_page_information.xml

@@ -3,14 +3,14 @@
     <item android:state_selected="true">
         <shape>
             <corners android:radius="3dp" />
-            <solid android:color="#0259FE" />
+            <solid android:color="#326DD8" />
         </shape>
     </item>
 
     <item>
         <shape>
             <corners android:radius="3dp" />
-            <solid android:color="#22bf03" />
+            <solid android:color="#326DD8" />
         </shape>
     </item>
 

+ 10 - 4
app/src/main/res/layout/activity_main.xml

@@ -2,7 +2,8 @@
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:background="#F5F8FF">
 
     <androidx.viewpager2.widget.ViewPager2
         android:id="@+id/main_view_pager"
@@ -13,11 +14,16 @@
 
     <com.google.android.material.tabs.TabLayout
         android:id="@+id/main_tab_layout"
-        android:layout_width="match_parent"
+        android:layout_width="0dp"
         android:layout_height="0dp"
-        android:translationZ="10dp"
+        android:layout_marginBottom="32dp"
+        android:background="@drawable/bg_main_tab"
+        android:translationZ="2dp"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintDimensionRatio="360:56"
+        app:layout_constraintDimensionRatio="264:47"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintWidth_percent="0.7333333333333333"
         app:tabIconTint="@android:color/transparent"
         app:tabIndicator="@null" />
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 1
app/src/main/res/layout/fragment_example.xml

@@ -15,7 +15,7 @@
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="#F8F8F8">
+        android:background="#F5F8FF">
 
         <ImageView
             android:layout_width="match_parent"

+ 40 - 122
app/src/main/res/layout/fragment_home_page.xml

@@ -15,12 +15,12 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:background="#F5F8FF">
 
         <androidx.core.widget.NestedScrollView
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:background="#F6F7F6"
             app:layout_constraintBottom_toBottomOf="parent">
 
             <androidx.constraintlayout.widget.ConstraintLayout
@@ -36,88 +36,19 @@
                     android:src="@drawable/bg_home_banner"
                     app:layout_constraintTop_toTopOf="parent" />
 
-                <TextView
-                    android:id="@+id/tv_recover_btn"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:background="@drawable/bg_home_recover_btn"
-                    android:gravity="center"
-                    app:layout_constraintBottom_toBottomOf="@id/iv_banner"
-                    app:layout_constraintDimensionRatio="110:35.5"
-                    app:layout_constraintHorizontal_bias="0.129"
-                    app:layout_constraintLeft_toLeftOf="@id/iv_banner"
-                    app:layout_constraintRight_toRightOf="@id/iv_banner"
-                    app:layout_constraintTop_toTopOf="@id/iv_banner"
-                    app:layout_constraintVertical_bias="0.72"
-                    app:layout_constraintWidth_percent="0.3055555555555556" />
-
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:drawablePadding="3dp"
-                    android:text="免费解锁"
-                    android:textColor="#1F49EB"
-                    android:textSize="12sp"
-                    android:textStyle="bold"
-                    app:drawableStartCompat="@drawable/icon_home_recover_btn"
-                    app:layout_constraintBottom_toBottomOf="@id/tv_recover_btn"
-                    app:layout_constraintLeft_toLeftOf="@id/tv_recover_btn"
-                    app:layout_constraintRight_toRightOf="@id/tv_recover_btn"
-                    app:layout_constraintTop_toTopOf="@id/tv_recover_btn" />
-
-                <ImageView
-                    android:id="@+id/home_tab_indicator"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="-21dp"
-                    android:adjustViewBounds="true"
-                    android:src="@drawable/selector_home_page_tab_indicator"
-                    app:Selected="@{homePageViewModel.isQQSelected}"
-                    app:layout_constraintTop_toBottomOf="@id/iv_banner" />
-
-                <View
-                    android:id="@+id/wechat_click_area"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:onClick="@{()-> homePageViewModel.onWeChatAreaClick()}"
-                    app:layout_constraintBottom_toBottomOf="@id/home_tab_indicator"
-                    app:layout_constraintLeft_toLeftOf="@id/home_tab_indicator"
-                    app:layout_constraintRight_toLeftOf="@id/qq_click_area"
-                    app:layout_constraintTop_toTopOf="@id/home_tab_indicator" />
-
-                <View
-                    android:id="@+id/qq_click_area"
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:onClick="@{()-> homePageViewModel.onQQAreaClick()}"
-                    app:layout_constraintBottom_toBottomOf="@id/home_tab_indicator"
-                    app:layout_constraintLeft_toRightOf="@id/wechat_click_area"
-                    app:layout_constraintRight_toRightOf="@id/home_tab_indicator"
-                    app:layout_constraintTop_toTopOf="@id/home_tab_indicator" />
-
-                <Space
-                    android:id="@+id/space3"
-                    android:layout_width="match_parent"
-                    android:layout_height="0dp"
-                    app:layout_constraintDimensionRatio="360:11"
-                    app:layout_constraintTop_toBottomOf="@+id/home_tab_indicator" />
-
                 <View
                     android:id="@+id/v_information_bg"
-                    android:layout_width="match_parent"
-                    android:layout_height="0dp"
+                    android:layout_width="0dp"
+                    android:layout_height="32dp"
                     android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
-                    android:background="@drawable/bg_home_page_scroll"
-                    app:layout_constraintDimensionRatio="328:32"
                     app:layout_constraintLeft_toLeftOf="parent"
-                    app:layout_constraintRight_toRightOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/space3" />
+                    app:layout_constraintRight_toLeftOf="@id/area_switch"
+                    app:layout_constraintTop_toTopOf="parent" />
 
                 <TextView
                     android:id="@+id/tv_information"
                     android:layout_width="0dp"
                     android:layout_height="0dp"
-                    android:layout_marginStart="8dp"
                     android:background="@drawable/selector_home_page_information"
                     android:gravity="center"
                     android:text="@string/home_page_information"
@@ -134,46 +65,46 @@
                     android:id="@+id/view_switcher"
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
-                    android:layout_marginHorizontal="8dp"
+                    android:layout_marginStart="8dp"
                     app:layout_constraintBottom_toBottomOf="@+id/v_information_bg"
                     app:layout_constraintLeft_toRightOf="@+id/tv_information"
                     app:layout_constraintRight_toRightOf="@+id/v_information_bg"
                     app:layout_constraintTop_toTopOf="@+id/v_information_bg" />
 
-                <Space
-                    android:id="@+id/space5"
-                    android:layout_width="match_parent"
-                    android:layout_height="0dp"
-                    app:layout_constraintDimensionRatio="360:16"
-                    app:layout_constraintTop_toBottomOf="@+id/v_information_bg" />
-
-                <View
-                    android:layout_width="0dp"
-                    android:layout_height="0dp"
-                    android:background="@drawable/selector_icon_hot_function_light"
-                    app:Selected="@{homePageViewModel.isQQSelected}"
-                    app:layout_constraintBottom_toBottomOf="@id/tv_hot_function"
-                    app:layout_constraintDimensionRatio="1:1"
-                    app:layout_constraintLeft_toRightOf="@id/tv_hot_function"
-                    app:layout_constraintRight_toRightOf="@id/tv_hot_function"
-                    app:layout_constraintWidth_percent="0.0361111111111111" />
-
-                <TextView
-                    android:id="@+id/tv_hot_function"
-                    style="@style/Home_Page_Title_Text"
+                <LinearLayout
+                    android:id="@+id/area_switch"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
-                    android:text="@string/home_page_hot_function"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/space5" />
-
-                <Space
-                    android:id="@+id/space6"
-                    android:layout_width="match_parent"
-                    android:layout_height="0dp"
-                    app:layout_constraintDimensionRatio="360:12"
-                    app:layout_constraintTop_toBottomOf="@+id/tv_hot_function" />
+                    android:layout_marginEnd="@dimen/app_common_page_horizontal_padding"
+                    android:background="@drawable/bg_home_page_area"
+                    android:gravity="center_vertical"
+                    android:onClick="@{()-> homePageViewModel.toggleAreaSwitch()}"
+                    android:paddingVertical="4dp"
+                    android:paddingStart="13dp"
+                    android:paddingEnd="8dp"
+                    app:layout_constraintBottom_toBottomOf="@id/v_information_bg"
+                    app:layout_constraintRight_toRightOf="parent"
+                    app:layout_constraintTop_toTopOf="@id/v_information_bg">
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@{homePageViewModel.isQQSelected ? @drawable/icon_home_qq : @drawable/icon_home_wechat}"
+                        tools:src="@drawable/icon_wechat" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginHorizontal="6dp"
+                        android:text='@{homePageViewModel.isQQSelected ? "QQ专区" : "微信专区"}'
+                        android:textColor="@color/white90"
+                        tools:text="微信专区" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@drawable/icon_home_expand" />
+                </LinearLayout>
 
                 <androidx.recyclerview.widget.RecyclerView
                     android:id="@+id/ry_other_function"
@@ -183,7 +114,7 @@
                     android:overScrollMode="never"
                     android:scrollbars="none"
                     app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
-                    app:layout_constraintTop_toBottomOf="@+id/space6"
+                    app:layout_constraintTop_toBottomOf="@+id/iv_banner"
                     app:spanCount="2"
                     tools:itemCount="6"
                     tools:listitem="@layout/item_home_page_other_function" />
@@ -197,18 +128,5 @@
 
             </androidx.constraintlayout.widget.ConstraintLayout>
         </androidx.core.widget.NestedScrollView>
-
-        <ImageView
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
-            android:adjustViewBounds="true"
-            android:onClick="@{()-> homePageViewModel.onBackupHelperClick()}"
-            android:src="@drawable/icon_backup_helper_enter"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toTopOf="parent"
-            app:layout_constraintVertical_bias="0.958"
-            app:layout_constraintWidth_percent="0.375" />
     </androidx.constraintlayout.widget.ConstraintLayout>
 </layout>

+ 1 - 1
app/src/main/res/layout/fragment_mine.xml

@@ -19,7 +19,7 @@
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:background="#F8F8F8">
+        android:background="#F5F8FF">
 
         <ImageView
             android:id="@+id/iv_mine_background"

+ 38 - 14
app/src/main/res/layout/item_home_page_other_function.xml

@@ -17,38 +17,62 @@
         android:layout_height="wrap_content">
 
         <ImageView
+            imageRes="@{bean.functionBg}"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintDimensionRatio="106:99"
+            app:layout_constraintTop_toBottomOf="@id/icon_space"
+            tools:src="@drawable/bg_home_page_helper" />
+
+        <Space
+            android:id="@+id/icon_space"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            app:layout_constraintDimensionRatio="106:16"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <ImageView
             android:id="@+id/iv_function_img"
             imageRes="@{bean.functionIcon}"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:adjustViewBounds="true"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:contentDescription="@{bean.functionName}"
+            app:layout_constraintDimensionRatio="1:1"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
-            tools:src="@drawable/icon_home_page_file_recovery" />
+            app:layout_constraintWidth_percent="0.5094339622641509"
+            tools:src="@drawable/icon_home_page_helper" />
 
         <TextView
             android:id="@+id/tv_function_name"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_margin="13dp"
+            android:layout_marginTop="8dp"
+            android:gravity="center"
             android:text="@{bean.functionName}"
-            android:textColor="#434343"
-            android:textSize="15sp"
+            android:textColor="#333333"
+            android:textSize="14sp"
             android:textStyle="bold"
-            app:layout_constraintLeft_toLeftOf="@id/iv_function_img"
-            app:layout_constraintTop_toTopOf="@id/iv_function_img"
-            tools:text="文件恢复" />
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/iv_function_img"
+            tools:text="备份教程" />
 
         <TextView
             android:id="@+id/tv_function_desc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_marginTop="2dp"
+            android:gravity="center"
             android:text="@{bean.functionDesc}"
             android:textColor="#666666"
-            android:textSize="10sp"
-            app:layout_constraintLeft_toLeftOf="@id/tv_function_name"
+            android:textSize="12sp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@id/tv_function_name"
-            tools:ignore="SmallSp"
-            tools:text="文件恢复" />
+            tools:text="数据防丢宝典" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 </layout>

+ 4 - 4
app/src/main/res/layout/view_home_page_switch_text.xml

@@ -6,15 +6,14 @@
     android:layout_height="wrap_content">
 
     <TextView
-        android:gravity="center_vertical"
         android:id="@+id/tv_switch_text"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginEnd="@dimen/app_common_page_horizontal_padding"
         android:ellipsize="end"
+        android:gravity="center_vertical"
         android:lines="1"
         android:singleLine="true"
-        android:textColor="#202020"
+        android:textColor="@color/white70"
         android:textSize="12sp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toStartOf="@+id/tv_switch_date"
@@ -26,7 +25,8 @@
         android:id="@+id/tv_switch_date"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:textColor="#A7A7A7"
+        android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
+        android:textColor="@color/white70"
         android:textSize="12sp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"

BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


+ 1 - 1
app/src/main/res/values/dimens.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <dimen name="app_common_page_horizontal_padding">16dp</dimen>
+    <dimen name="app_common_page_horizontal_padding">12dp</dimen>
     <dimen name="app_status_bar_height">24dp</dimen>
 </resources>

+ 4 - 2
app/src/main/res/values/strings.xml

@@ -1,4 +1,4 @@
-<!DOCTYPE resources [<!ENTITY app_name "聊天记录备份存储">]>
+<!DOCTYPE resources [<!ENTITY app_name "图文记录备份助手">]>
 <resources>
     <string name="app_name">&app_name;</string>
 
@@ -19,13 +19,15 @@
     <string name="agreement_two_step_content">您需要同意相关协议才能使用本产品</string>
     <string name="user_terms_text">《用户协议》</string>
     <string name="privacy_policy_text">《隐私政策》</string>
-    <string name="home_page_information">资讯</string>
+    <string name="home_page_information">公告</string>
     <string name="home_page_hot_function">热门功能</string>
     <string name="home_page_wx_msg_recovery">微信消息恢复</string>
     <string name="home_page_wx_msg_recovery_desc">微信聊天记录恢复</string>
     <string name="home_page_wx_friend_recovery">微信好友恢复</string>
     <string name="home_page_wx_friend_recovery_desc">微信好友误删恢复</string>
     <string name="home_page_other_function">其他服务</string>
+    <string name="home_page_backup_helper">备份教程</string>
+    <string name="home_page_backup_helper_desc">数据防丢宝典</string>
     <string name="home_page_img_recovery">图片备份</string>
     <string name="home_page_img_recovery_desc">手机丢失图片备份</string>
     <string name="home_page_file_recovery">文件备份</string>

+ 1 - 1
build.gradle

@@ -2,7 +2,7 @@
 buildscript {
     ext {
         compileSdkVersion = 33
-        applicationId = "com.ltjl.bfcc"
+        applicationId = "com.tuwen.jilu"
         minSdkVersion = 24
         targetSdkVersion = 32
 

+ 5 - 5
gradle.properties

@@ -24,12 +24,12 @@ android.injected.testOnly=false
 prod_server_host=http://project-api.atmob.com
 test_server_host=https://central-test.atmob.com
 local_server_host=http://192.168.10.171:8880
-wechat_app_id=wxc310ba29690a17ab
+wechat_app_id=wx39ef5c687758b7c4
 wework_crop_id=
 wechat_kf_id=
-gravity_access_token=fnSHspvjy27lGqreb4tzbfXixPhDucQi
-bugly_app_id=4509b4b430
-umeng_app_key=68b7ef4fe563686f42992634
+gravity_access_token=rKCw3novTxluA8Hcglmoj25DtI1xObqJ
+bugly_app_id=b04e8596b3
+umeng_app_key=6931017e9a7f376488f2a3de
 qiyu_app_key=
-atmob_central_key=58e640dfae0a44619717233944700101
+atmob_central_key=12109a8c64ac48889ac56c9d52f60937
 quick_login_id=