Browse Source

修改意见反馈部分样式

Pq 1 year ago
parent
commit
cd129ab658
22 changed files with 94 additions and 36 deletions
  1. 8 1
      BaseLibrary/src/main/java/com/cooleshow/base/constanst/StyleConfig.java
  2. 8 4
      BaseLibrary/src/main/java/com/cooleshow/base/ui/activity/BaseActivity.java
  3. 5 2
      BaseLibrary/src/main/java/com/cooleshow/base/utils/UiUtils.java
  4. BIN
      BaseLibrary/src/main/res/drawable-xhdpi/icon_arrow_top_red.png
  5. BIN
      BaseLibrary/src/main/res/drawable-xhdpi/jg_icon_empty_content.png
  6. BIN
      BaseLibrary/src/main/res/drawable-xxhdpi/icon_arrow_top_red.png
  7. BIN
      BaseLibrary/src/main/res/drawable-xxhdpi/jg_icon_empty_content.png
  8. 5 0
      BaseLibrary/src/main/res/drawable/shape_2dc7aa_22dp_dynamic.xml
  9. 1 0
      BaseLibrary/src/main/res/values/attrs.xml
  10. 2 0
      BaseLibrary/src/main/res/values/colors.xml
  11. 2 0
      BaseLibrary/src/main/res/values/styles.xml
  12. 2 1
      usercenter/src/main/java/com/cooleshow/usercenter/adapter/FeedBackAddPhotoListAdapter.java
  13. 0 3
      usercenter/src/main/java/com/cooleshow/usercenter/presenter/FeedBackPresenter.java
  14. 42 17
      usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/setting/FeedBackActivity.java
  15. 4 1
      usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/setting/FeedBackRecordActivity.java
  16. 6 4
      usercenter/src/main/java/com/cooleshow/usercenter/widget/FeedBackRecordFilterView.java
  17. 1 1
      usercenter/src/main/res/color/selector_333333_to_2dc7aa.xml
  18. BIN
      usercenter/src/main/res/drawable-xhdpi/jg_icon_feedback_add_img.png
  19. BIN
      usercenter/src/main/res/drawable-xxhdpi/jg_icon_feedback_add_img.png
  20. 1 1
      usercenter/src/main/res/drawable/selector_feedback_record_filter_item.xml
  21. 6 0
      usercenter/src/main/res/drawable/shape_feedback_record_filter_item_bg.xml
  22. 1 1
      usercenter/src/main/res/layout/view_feed_back_record_filter_layout.xml

+ 8 - 1
BaseLibrary/src/main/java/com/cooleshow/base/constanst/StyleConfig.java

@@ -20,7 +20,6 @@ import static androidx.appcompat.widget.TintTypedArray.obtainStyledAttributes;
 public class StyleConfig {
     public static boolean isStudentStyle = true;
     public static int default_main_color = R.color.colorAccent;
-
     public static void setTheme(Activity activity) {
         if (isStudentStyle) {
             activity.setTheme(R.style.Student_NORMAL_STYLE);
@@ -29,6 +28,13 @@ public class StyleConfig {
         }
     }
 
+    public static int getMainColor() {
+        if (isStudentStyle) {
+            return R.color.colorAccent;
+        }
+        return R.color.color_fe2451;
+    }
+
     public static int getMainColor(Activity context) {
         TypedArray tyar = context.obtainStyledAttributes(new int[]{
                 R.attr.klx_main_color
@@ -72,4 +78,5 @@ public class StyleConfig {
         }
         return drawable;
     }
+
 }

+ 8 - 4
BaseLibrary/src/main/java/com/cooleshow/base/ui/activity/BaseActivity.java

@@ -75,9 +75,13 @@ public abstract class BaseActivity<V extends ViewBinding> extends RxAppCompatAct
         }
     }
 
-    public void showLoading(String text){
-        if (mLoading != null && !mLoading.isShowing()) {
-            mLoading.showLoading(text);
+    public void showLoading(String text) {
+        if (mLoading != null) {
+            if (!mLoading.isShowing()) {
+                mLoading.showLoading(text);
+            } else {
+                updateLoadingText(text);
+            }
         }
     }
 
@@ -87,7 +91,7 @@ public abstract class BaseActivity<V extends ViewBinding> extends RxAppCompatAct
         }
     }
 
-    public void setLoadingCancelable(boolean cancelable){
+    public void setLoadingCancelable(boolean cancelable) {
         mLoading.setCancelable(cancelable);
         mLoading.setCanceledOnTouchOutside(cancelable);
     }

+ 5 - 2
BaseLibrary/src/main/java/com/cooleshow/base/utils/UiUtils.java

@@ -21,6 +21,7 @@ import android.widget.TextView;
 
 import com.cooleshow.base.R;
 import com.cooleshow.base.common.BaseApplication;
+import com.cooleshow.base.constanst.StyleConfig;
 import com.cooleshow.base.widgets.DialogUtil;
 import com.cooleshow.base.widgets.span.QMUIAlignMiddleImageSpan;
 import com.rui.common_base.widget.span.CenterImageSpan;
@@ -389,9 +390,11 @@ public class UiUtils {
         if (textView == null) {
             return;
         }
-        textView.setTextColor(textView.getContext().getResources().getColor(isShow ? R.color.color_2dc7aa : R.color.color_333333));
+        int mainColor = StyleConfig.getMainColor();
+        textView.setTextColor(textView.getContext().getResources().getColor(isShow ? mainColor : R.color.color_333333));
         int drawableRight = 0;
-        drawableRight = isShow ? R.drawable.icon_arrow_top_blue : R.drawable.icon_arrow_down3;
+        int selectDrawable = StyleConfig.isStudentStyle ? R.drawable.icon_arrow_top_blue:R.drawable.icon_arrow_top_red;
+        drawableRight = isShow ? selectDrawable : R.drawable.icon_arrow_down3;
         textView.setCompoundDrawablesWithIntrinsicBounds(0, 0, drawableRight, 0);
     }
 }

BIN
BaseLibrary/src/main/res/drawable-xhdpi/icon_arrow_top_red.png


BIN
BaseLibrary/src/main/res/drawable-xhdpi/jg_icon_empty_content.png


BIN
BaseLibrary/src/main/res/drawable-xxhdpi/icon_arrow_top_red.png


BIN
BaseLibrary/src/main/res/drawable-xxhdpi/jg_icon_empty_content.png


+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_2dc7aa_22dp_dynamic.xml

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

+ 1 - 0
BaseLibrary/src/main/res/values/attrs.xml

@@ -62,6 +62,7 @@
 
     <attr name="klx_main_color" format="color" />
     <attr name="klx_main_color2" format="color" />
+    <attr name="klx_solid_color" format="color" />
     <attr name="klx_main_bt_background" format="reference" />
     <attr name="klx_img_check" format="reference" />
 </resources>

+ 2 - 0
BaseLibrary/src/main/res/values/colors.xml

@@ -202,5 +202,7 @@
     <color name="color_eb6363">#EB6363</color>
     <color name="color_ff8057">#ff8057</color>
     <color name="color_e6ffffff">#e6ffffff</color>
+    <color name="color_f0fffc">#F0FFFC</color>
+    <color name="color_fff3f5">#FFF3F5</color>
 
 </resources>

+ 2 - 0
BaseLibrary/src/main/res/values/styles.xml

@@ -497,6 +497,7 @@
     <style name="Student_NORMAL_STYLE" parent="AppTheme">
         <item name="klx_main_color">@color/color_2dc7aa</item>
         <item name="klx_main_color2">@color/color_01c0b5</item>
+        <item name="klx_solid_color">@color/color_f0fffc</item>
         <item name="klx_img_check">@drawable/icon_check_select</item>
         <item name="klx_main_bt_background">@drawable/shape_2dc7aa_39dp</item>
     </style>
@@ -504,6 +505,7 @@
     <style name="Student_OTHER_STYLE" parent="AppTheme">
         <item name="klx_main_color">@color/color_fe2451</item>
         <item name="klx_main_color2">@color/color_fe2451</item>
+        <item name="klx_solid_color">@color/color_fff3f5</item>
         <item name="klx_img_check">@drawable/icon_img_check</item>
         <item name="klx_main_bt_background">@drawable/shape_fe2451_39dp</item>
     </style>

+ 2 - 1
usercenter/src/main/java/com/cooleshow/usercenter/adapter/FeedBackAddPhotoListAdapter.java

@@ -5,6 +5,7 @@ import android.widget.ImageView;
 
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.viewholder.BaseViewHolder;
+import com.cooleshow.base.constanst.StyleConfig;
 import com.cooleshow.base.utils.GlideUtils;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.base.utils.Utils;
@@ -43,7 +44,7 @@ public class FeedBackAddPhotoListAdapter extends BaseQuickAdapter<LocalMedia, Ba
         ImageView iv_del = helper.getView(R.id.iv_del);
         if (item.getPath().equals("123")) {
             iv_del.setVisibility(View.GONE);
-            ivIcon.setImageResource(R.drawable.icon_feedback_add_img);
+            ivIcon.setImageResource(StyleConfig.isStudentStyle ? R.drawable.icon_feedback_add_img : R.drawable.jg_icon_feedback_add_img);
         } else {
             iv_del.setVisibility(View.VISIBLE);
             GlideUtils.INSTANCE.loadRoundImageFitCenter(getContext(), item.getPath(), ivIcon, SizeUtils.dp2px(5));

+ 0 - 3
usercenter/src/main/java/com/cooleshow/usercenter/presenter/FeedBackPresenter.java

@@ -24,9 +24,6 @@ import org.json.JSONObject;
  */
 public class FeedBackPresenter extends BasePresenter<FeedBackContract.FeedBackView> implements FeedBackContract.Presenter {
     public void addSuggestion(String content, String mobileNo, String typeId, String imgUrls) {
-        if (getView() != null) {
-            getView().showLoading();
-        }
         JSONObject jsonObject = new JSONObject();
         try {
             if (TextUtils.isEmpty(mobileNo)) {

+ 42 - 17
usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/setting/FeedBackActivity.java

@@ -23,7 +23,9 @@ import com.cooleshow.base.constanst.UploadConstants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.JumpUtils;
+import com.cooleshow.base.utils.LOG;
 import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.utils.helper.GlideEngine;
 import com.cooleshow.base.utils.helper.QMUIDeviceHelper;
 import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
@@ -67,6 +69,7 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
     private FeedBackAddPhotoListAdapter mPhotoListAdapter;
 
     List<String> urlList = new ArrayList<>();
+    private int preUploadSize = 0;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -94,19 +97,6 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
             } else {
                 presenter.addSuggestion(content, "", currentSelectTypeId, "");
             }
-//            String mobileNo = viewBinding.etConnect.getText().toString().trim();
-//            if (TextUtils.isEmpty(mobileNo)) {
-//                mobileNo = UserHelper.getUserPhone();
-////                ToastUtil.getInstance().showShort("请输入您的邮箱或手机号");
-////                return;
-//            }
-//            boolean mobile = PhoneUtils.isMobile(mobileNo);
-//            boolean email = RegexUtils.isEmail(mobileNo);
-//            if (mobile || email) {
-//                presenter.addSuggestion(content, mobileNo);
-//            } else {
-//                ToastUtil.getInstance().showShort("请输入正确的邮箱或手机号");
-//            }
             return;
         }
 
@@ -150,10 +140,11 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
 
     private void uploadImg(int enableSelectSize) {
         urlList.clear();
+        this.preUploadSize = enableSelectSize;
         for (int i = 0; i < mPhotoListAdapter.getData().size(); i++) {
             String compressPath = mPhotoListAdapter.getData().get(i).getCompressPath();
             if (!TextUtils.isEmpty(compressPath)) {
-                upLoadVideo(this, compressPath, enableSelectSize);
+                upLoadVideo(this, compressPath);
             }
         }
     }
@@ -245,14 +236,19 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
         return false;
     }
 
-    public void upLoadVideo(Activity activity, String filePath, int enableSelectSize) {
-        UploadHelper uploadHelper = new UploadHelper(activity, UploadConstants.UPLOAD_TYPE_OTHER);
+    public void upLoadVideo(Activity activity, String filePath) {
+        UploadHelper uploadHelper = new UploadHelper(null, UploadConstants.UPLOAD_TYPE_OTHER);
         uploadHelper.uploadFile(new File(filePath));
+        setLoadingCancelable(false);
+        showUploadLoading(0);
         uploadHelper.setUpLoadCallBack(new UploadHelper.UpLoadCallBack() {
             @Override
             public void onSuccess(String url) {
                 urlList.add(url);
-                if (urlList.size() == enableSelectSize) {
+                LOG.i("upload success:" + urlList.size());
+                if (urlList.size() == preUploadSize) {
+                    showUploadLoading(100);
+                    hideLoading();
                     StringBuilder stringBuilder = new StringBuilder();
                     for (int i = 0; i < urlList.size(); i++) {
                         stringBuilder.append(urlList.get(i));
@@ -266,12 +262,40 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
             }
 
             @Override
+            public void onUploadProgress(double v) {
+                double v1 = countUploadProgress(v);
+                showUploadLoading(v1);
+            }
+
+            @Override
             public void onFailure() {
+                hideLoading();
                 ToastUtil.getInstance().showShort("上传失败,请重试");
             }
         });
     }
 
+    private void showUploadLoading(double value) {
+        String s = UiUtils.convertDouble(value);
+        String text = "上传中" + s + "%";
+        showLoading(text);
+    }
+
+    @Override
+    public void hideLoading() {
+        setLoadingCancelable(true);
+        super.hideLoading();
+    }
+
+    private double countUploadProgress(double currentProgress) {
+        int size = urlList.size();
+        double cPercent = currentProgress / 100.0;
+        double singleMaxProgress = 100d / preUploadSize;
+        double result = size * singleMaxProgress + cPercent * singleMaxProgress;
+        LOG.i("result:"+result+"-size:" + size + "-cPercent" + cPercent + "-singleMaxProgress:" + singleMaxProgress);
+        return result;
+    }
+
     private String getContent() {
         return viewBinding.etContent.getText().toString().trim();
     }
@@ -335,6 +359,7 @@ public class FeedBackActivity extends BaseMVPActivity<ActivityFeedbackLayoutBind
                     //自定义布局中的控件初始化及事件处理
                     final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
                     TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
+                    tvSubmit.setTextColor(StyleConfig.getMainColor(FeedBackActivity.this));
                     tvSubmit.setOnClickListener(v12 -> {
                         pvOptions.returnData();
                         pvOptions.dismiss();

+ 4 - 1
usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/setting/FeedBackRecordActivity.java

@@ -5,6 +5,7 @@ import android.view.View;
 
 import com.alibaba.android.arouter.facade.annotation.Route;
 import com.cooleshow.base.constanst.Constants;
+import com.cooleshow.base.constanst.StyleConfig;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.SizeUtils;
@@ -41,6 +42,7 @@ public class FeedBackRecordActivity extends BaseMVPActivity<AcFeedBackRecordLayo
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
+        StyleConfig.setTheme(this);
         super.onCreate(savedInstanceState);
         QMUIStatusBarHelper.setStatusBarLightMode(this);
     }
@@ -61,7 +63,8 @@ public class FeedBackRecordActivity extends BaseMVPActivity<AcFeedBackRecordLayo
         mAdapter = new FeedBackRecordAdapter();
         CommonBottomItemDecoration bottomItemDecoration = new CommonBottomItemDecoration(0, 0, SizeUtils.dp2px(12), 0);
         EmptyViewLayout emptyViewLayout = new EmptyViewLayout(this);
-        emptyViewLayout.setContent(com.cooleshow.base.R.drawable.icon_empty_content, "暂无内容");
+        int emptyDrawable = StyleConfig.isStudentStyle ? com.cooleshow.base.R.drawable.icon_empty_content : com.cooleshow.base.R.drawable.jg_icon_empty_content;
+        emptyViewLayout.setContent(emptyDrawable, "暂无内容");
         mAdapter.setEmptyView(emptyViewLayout);
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
         viewBinding.recyclerView.addItemDecoration(bottomItemDecoration);

+ 6 - 4
usercenter/src/main/java/com/cooleshow/usercenter/widget/FeedBackRecordFilterView.java

@@ -13,6 +13,7 @@ import com.bigkoo.pickerview.listener.CustomListener;
 import com.bigkoo.pickerview.view.TimePickerView;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemClickListener;
+import com.cooleshow.base.constanst.StyleConfig;
 import com.cooleshow.base.utils.DateUtil;
 import com.cooleshow.base.utils.ToastUtil;
 import com.cooleshow.base.utils.UiUtils;
@@ -302,12 +303,13 @@ public class FeedBackRecordFilterView extends FrameLayout implements View.OnClic
     }
 
     private void changeTextStyle(boolean isLightMode, boolean isStart) {
+        int mainColor = StyleConfig.getMainColor();
         if (isStart) {
-            mTvStartTime.setTextColor(getContext().getResources().getColor(isLightMode ? com.cooleshow.base.R.color.color_2dc7aa : com.cooleshow.base.R.color.color_aaaaaa));
-            mViewLineStart.setBackgroundColor(getContext().getResources().getColor(isLightMode ? com.cooleshow.base.R.color.color_2dc7aa : com.cooleshow.base.R.color.color_777777));
+            mTvStartTime.setTextColor(getContext().getResources().getColor(isLightMode ? mainColor : com.cooleshow.base.R.color.color_aaaaaa));
+            mViewLineStart.setBackgroundColor(getContext().getResources().getColor(isLightMode ? mainColor : com.cooleshow.base.R.color.color_777777));
         } else {
-            mTvEndTime.setTextColor(getContext().getResources().getColor(isLightMode ? com.cooleshow.base.R.color.color_2dc7aa : com.cooleshow.base.R.color.color_aaaaaa));
-            mViewLineEnd.setBackgroundColor(getContext().getResources().getColor(isLightMode ? com.cooleshow.base.R.color.color_2dc7aa : com.cooleshow.base.R.color.color_777777));
+            mTvEndTime.setTextColor(getContext().getResources().getColor(isLightMode ? mainColor : com.cooleshow.base.R.color.color_aaaaaa));
+            mViewLineEnd.setBackgroundColor(getContext().getResources().getColor(isLightMode ? mainColor : com.cooleshow.base.R.color.color_777777));
         }
     }
 }

+ 1 - 1
usercenter/src/main/res/color/selector_333333_to_2dc7aa.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:color="@color/color_2dc7aa" android:state_selected="true"/>
+    <item android:color="?klx_main_color" android:state_selected="true"/>
     <item android:color="@color/color_333333"/>
 </selector>

BIN
usercenter/src/main/res/drawable-xhdpi/jg_icon_feedback_add_img.png


BIN
usercenter/src/main/res/drawable-xxhdpi/jg_icon_feedback_add_img.png


+ 1 - 1
usercenter/src/main/res/drawable/selector_feedback_record_filter_item.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:drawable="@drawable/shape_f0fffc_16dp_border_2dc7aa_1dp" android:state_selected="true"/>
+    <item android:drawable="@drawable/shape_feedback_record_filter_item_bg" android:state_selected="true"/>
     <item android:drawable="@drawable/shape_f2f2f2_16dp"/>
 
 </selector>

+ 6 - 0
usercenter/src/main/res/drawable/shape_feedback_record_filter_item_bg.xml

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

+ 1 - 1
usercenter/src/main/res/layout/view_feed_back_record_filter_layout.xml

@@ -156,7 +156,7 @@
             android:layout_height="44dp"
             android:layout_marginStart="15dp"
             android:layout_marginEnd="13dp"
-            android:background="@drawable/shape_2dc7aa_22dp"
+            android:background="@drawable/shape_2dc7aa_22dp_dynamic"
             android:gravity="center"
             android:text="确定"
             android:textColor="@color/white"