Ver código fonte

1.修改资料。

石慧云 4 anos atrás
pai
commit
0b4985cab2
24 arquivos alterados com 1121 adições e 170 exclusões
  1. 2 0
      app/build.gradle
  2. 63 6
      app/src/main/java/com/quansu/heifengwuliu/activity/PasswordActivity.kt
  3. 0 2
      app/src/main/java/com/quansu/heifengwuliu/activity/SettingsActivity.kt
  4. 2 2
      app/src/main/java/com/quansu/heifengwuliu/config/ConfigRx.kt
  5. 112 3
      app/src/main/java/com/quansu/heifengwuliu/fragment/AccountAnalysisFragment.kt
  6. 12 2
      app/src/main/java/com/quansu/heifengwuliu/fragment/MineFragment.kt
  7. 11 0
      app/src/main/java/com/quansu/heifengwuliu/model/IconData.kt
  8. 163 0
      app/src/main/java/com/quansu/heifengwuliu/mp/LineChartManager.java
  9. 18 0
      app/src/main/java/com/quansu/heifengwuliu/mp/MyFofChartBean.java
  10. 160 0
      app/src/main/java/com/quansu/heifengwuliu/mp/MyMarkerView.java
  11. 10 0
      app/src/main/java/com/quansu/heifengwuliu/utils/net/ApiService.kt
  12. 12 0
      app/src/main/java/com/quansu/heifengwuliu/vmodel/AccountAnalysisVModel.kt
  13. 85 26
      app/src/main/java/com/quansu/heifengwuliu/vmodel/PasswordVModel.kt
  14. 1 5
      app/src/main/java/com/quansu/heifengwuliu/vmodel/SettingsVModel.kt
  15. BIN
      app/src/main/res/drawable-xxhdpi/ic_account_time.webp
  16. BIN
      app/src/main/res/drawable-xxhdpi/ic_down.png
  17. BIN
      app/src/main/res/drawable-xxhdpi/icon_chart_dot.png
  18. BIN
      app/src/main/res/drawable-xxhdpi/icon_mark_arrow_down.png
  19. BIN
      app/src/main/res/drawable-xxhdpi/icon_mark_arrow_up.webp
  20. 216 112
      app/src/main/res/layout/activity_password.xml
  21. 1 1
      app/src/main/res/layout/activity_settings.xml
  22. 1 1
      app/src/main/res/layout/activity_vehicle_info.xml
  23. 78 0
      app/src/main/res/layout/chart_marker_view.xml
  24. 174 10
      app/src/main/res/layout/fragment_account_analysis.xml

+ 2 - 0
app/build.gradle

@@ -133,5 +133,7 @@ dependencies {
 
     //高仿微信朋友圈图片展示效果 ImageWatcher
     implementation 'com.github.iielse:ImageWatcher:1.1.5'
+    //各种图标折线图
+    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
 
 }

+ 63 - 6
app/src/main/java/com/quansu/heifengwuliu/activity/PasswordActivity.kt

@@ -1,20 +1,26 @@
 package com.quansu.heifengwuliu.activity
 
+import android.app.Activity
+import android.content.Intent
 import android.os.Bundle
 import android.os.Handler
 import android.util.Log
+import com.luck.picture.lib.PictureSelector
 import com.quansu.heifengwuliu.R
 import com.quansu.heifengwuliu.base.MBActivity
+import com.quansu.heifengwuliu.config.MIntentAction
 import com.quansu.heifengwuliu.databinding.ActivityPasswordBinding
+import com.quansu.heifengwuliu.inte.OnUploadCallback
+import com.quansu.heifengwuliu.utils.OssUtils
 import com.quansu.heifengwuliu.view.PasswordView
 import com.quansu.heifengwuliu.view.PasswordView.PasswordListener
 import com.quansu.heifengwuliu.vmodel.PasswordVModel
 import java.util.*
 
-class PasswordActivity : MBActivity<PasswordVModel, ActivityPasswordBinding>() {
+class PasswordActivity : MBActivity<PasswordVModel, ActivityPasswordBinding>(), OnUploadCallback<String> {
 
 
-    var type=1//1:登录密码 2支付密码
+    var type=1//1:登录密码 2支付密码 3编辑资料
     var oldPassword=""
     var newPassword=""
 
@@ -23,6 +29,7 @@ class PasswordActivity : MBActivity<PasswordVModel, ActivityPasswordBinding>() {
 
         type= intent?.extras?.getInt("type", 1)!!
 
+
     }
 
     override fun init(savedInstanceState: Bundle?) {
@@ -32,6 +39,9 @@ class PasswordActivity : MBActivity<PasswordVModel, ActivityPasswordBinding>() {
             //初始化密码输入框
             initPassword()
         }
+        if(type==3){
+            vm.setInitData()
+        }
     }
 
 
@@ -82,11 +92,14 @@ class PasswordActivity : MBActivity<PasswordVModel, ActivityPasswordBinding>() {
 
 
     override fun title(): String? {
-        return if(type==1) {
-            "设置登录密码"
-        }else{
-            "设置支付密码"
+
+        return when(type){
+            1-> "设置登录密码"
+            2-> "设置支付密码"
+            3-> "编辑资料"
+            else-> ""
         }
+
     }
     override fun binding(): ActivityPasswordBinding {
         return ActivityPasswordBinding.inflate(layoutInflater)
@@ -96,6 +109,50 @@ class PasswordActivity : MBActivity<PasswordVModel, ActivityPasswordBinding>() {
         return PasswordVModel::class.java
     }
 
+    override fun onUploadSuccess(t: String) {
+        val ss: Array<String> = t.split(",".toRegex()).toTypedArray()
+        vm.avatar.value = ss[1]
+    }
+
+    override fun onUploadError(error: String?) {
+        TODO("Not yet implemented")
+    }
+
+    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+        super.onActivityResult(requestCode, resultCode, data)
+        if (resultCode != Activity.RESULT_OK) {
+            return
+        }
+        if (requestCode == MIntentAction.REQUEST_CODE_THREE) {//图片
+
+            val selectList = PictureSelector.obtainMultipleResult(data)
+            val list = ArrayList<String>()
+            if (null != selectList) {
+                for (path in selectList) {
+                    list.add(path.path)
+                }
+
+                OssUtils(this, vm)
+                        .setUpLoad("avatar", list, this)
+
+            }
+
+            return
+
+        }
+        if (requestCode == MIntentAction.REQUEST_CODE_CAMERA) {//拍照
+            //拍照
+            val selectList = PictureSelector.obtainMultipleResult(data) ?: return
+            val list = ArrayList<String>()
+            list.add(selectList[0].path)
+            OssUtils(this, vm)
+                    .setUpLoad("avatar", list, this)
+
+            return
+        }
+
+    }
+
 
 
 }

+ 0 - 2
app/src/main/java/com/quansu/heifengwuliu/activity/SettingsActivity.kt

@@ -9,9 +9,7 @@ import com.quansu.heifengwuliu.R
 import com.quansu.heifengwuliu.base.MBActivity
 import com.quansu.heifengwuliu.config.ConfigRx
 import com.quansu.heifengwuliu.databinding.ActivitySettingsBinding
-import com.quansu.heifengwuliu.repository.UserInfoRepository
 import com.quansu.heifengwuliu.vmodel.SettingsVModel
-import com.ysnows.base.base.BRepository
 import com.ysnows.base.ccretrofit.CCRetrofit
 import com.ysnows.base.ext.message
 import com.ysnows.base.route.IUpdate

+ 2 - 2
app/src/main/java/com/quansu/heifengwuliu/config/ConfigRx.kt

@@ -17,11 +17,11 @@ object ConfigRx {
 
     const val CHOSE_CAR = "CHOSE_CAR" //选择车辆
 
-    const val ADD_ADAIN = "ADD_ADAIN" //再来一
+    const val ADD_ADAIN = "ADD_ADAIN" //再来一
 
     const val CLOSE_LOGIN = "CLOSE_LOGIN" //关闭一键登录界面
 
-
+    const val REFRESH_USER = "REFRESH_USER" //刷新用户信息
 
 
 }

+ 112 - 3
app/src/main/java/com/quansu/heifengwuliu/fragment/AccountAnalysisFragment.kt

@@ -1,15 +1,124 @@
 package com.quansu.heifengwuliu.fragment
 
+import android.os.Bundle
+import android.util.Log
 import android.view.LayoutInflater
 import android.view.ViewGroup
+import com.github.mikephil.charting.components.XAxis
+import com.github.mikephil.charting.data.Entry
+import com.github.mikephil.charting.formatter.IndexAxisValueFormatter
+import com.github.mikephil.charting.highlight.Highlight
+import com.github.mikephil.charting.listener.OnChartValueSelectedListener
+import com.quansu.heifengwuliu.R
 import com.quansu.heifengwuliu.base.MBFragment
 import com.quansu.heifengwuliu.databinding.FragmentAccountAnalysisBinding
-import com.ysnows.base.base.BRepository
-import com.ysnows.base.base.BViewModel
+import com.quansu.heifengwuliu.model.IconData
+import com.quansu.heifengwuliu.mp.LineChartManager
+import com.quansu.heifengwuliu.mp.MyFofChartBean
+import com.quansu.heifengwuliu.mp.MyMarkerView
+import com.quansu.heifengwuliu.vmodel.AccountAnalysisVModel
+import java.util.*
 
-class AccountAnalysisFragment : MBFragment<BViewModel<BRepository>, FragmentAccountAnalysisBinding>() {
+class AccountAnalysisFragment : MBFragment<AccountAnalysisVModel, FragmentAccountAnalysisBinding>() {
 
 
+    private val mXData = ArrayList<String>()
+    private var mMarkerView: MyMarkerView? = null
+
+    private var mChartManager: LineChartManager? = null
+
+
+    override fun init(savedInstanceState: Bundle?) {
+        super.init(savedInstanceState)
+
+        // 初始化表格manager
+        mChartManager = LineChartManager(binding.chart)
+        mMarkerView = MyMarkerView(context, R.layout.chart_marker_view)
+        mChartManager!!.setMarkView(mMarkerView)
+
+
+
+    }
+
+
+   private fun  initData(bean: IconData){//给折线图数据
+       val list: ArrayList<MyFofChartBean> = ArrayList<MyFofChartBean>()
+
+       for((index,item)in bean!!.x.withIndex()){
+           val item = MyFofChartBean(item, bean.y[index].toFloat())
+           list.add(item)
+       }
+       binding.chart.setOnChartValueSelectedListener(object : OnChartValueSelectedListener {
+           private var mHighlight: Highlight? = null
+           override fun onValueSelected(entry: Entry, highlight: Highlight) {
+               mHighlight = highlight
+           }
+
+           override fun onNothingSelected() {
+               if (mHighlight == null) {
+                   mHighlight = Highlight(mMarkerView!!.highlightXValue, mMarkerView!!.highlightYValue, 1)
+               }
+               mMarkerView!!.showMarkView(mHighlight!!.x, mHighlight!!.y)
+           }
+       })
+       setLineChartData(list)
+
+   }
+
+
+    private fun setLineChartData(list: List<MyFofChartBean>?) {
+        if (list != null && !list.isEmpty()) {
+            mXData.clear()
+            val size = list.size
+            val entries: MutableList<Entry> = ArrayList()
+            for (i in 0 until size) {
+                val dataBean = list[i]
+                if (dataBean != null) {
+                    if (!java.lang.Float.isNaN(dataBean.networth)) { //getResources().getDrawable(R.drawable.icon_chart_dot)
+                        val e = Entry(i.toFloat(), dataBean.networth, null)
+                        entries.add(e)
+                    }
+                    mXData.add(dataBean.inputDate)
+                }
+            }
+            val xAxis: XAxis = binding.chart.xAxis
+            //            xAxis.setLabelCount(list.size());
+            xAxis.setLabelCount(3, true)
+            //            xAxis.setAxisMinimum(0f);
+//            xAxis.setAxisMaximum((float) list.size());
+            xAxis.valueFormatter = object : IndexAxisValueFormatter() {
+                override fun getFormattedValue(value: Float): String {
+                    val i = value.toInt()
+                    Log.e("-shy-", "i=$i")
+                    Log.e("-shy-", "mXData.size=" + mXData.size)
+                    return try {
+                        mXData[i]
+                    } catch (e: Exception) {
+                        ""
+                    }
+
+                }
+            }
+            // 设置lineChart的数据
+            mChartManager!!.setData(entries)
+            // 给y轴设置最大值
+            val yMax: Float = binding.chart.yMax
+            binding.chart.axisLeft.axisMaximum = yMax + 0.1f
+
+            // 设置X轴的label的集合
+            mMarkerView!!.setXAxisLabels(mXData)
+            // 指定最后一个点为高亮,让其自定显示MarkView
+            val entry = entries[size - 1]
+            mMarkerView!!.showMarkView(entry.x, entry.y)
+            binding.chart.animateXY(800, 800)
+            binding.chart.invalidate()
+        }
+    }
+
+
+    override fun vmClass(): Class<AccountAnalysisVModel> {
+        return AccountAnalysisVModel::class.java
+    }
     override fun binding(inflater: LayoutInflater, container: ViewGroup?): FragmentAccountAnalysisBinding {
         return FragmentAccountAnalysisBinding.inflate(inflater, container, false)
     }

+ 12 - 2
app/src/main/java/com/quansu/heifengwuliu/fragment/MineFragment.kt

@@ -2,11 +2,13 @@ package com.quansu.heifengwuliu.fragment
 
 import android.view.LayoutInflater
 import android.view.ViewGroup
+import com.hwangjr.rxbus.annotation.Subscribe
+import com.hwangjr.rxbus.annotation.Tag
 import com.quansu.heifengwuliu.base.MBFragment
+import com.quansu.heifengwuliu.config.ConfigRx
 import com.quansu.heifengwuliu.databinding.FragmentMineBinding
-import com.quansu.heifengwuliu.repository.MineRepository
+import com.quansu.heifengwuliu.model.User
 import com.quansu.heifengwuliu.vmodel.MineVModel
-import com.ysnows.base.base.BRepository
 
 /**
  *Created by shihuiyun
@@ -25,4 +27,12 @@ class MineFragment : MBFragment<MineVModel, FragmentMineBinding>() {
     override fun vmClass(): Class<MineVModel> {
         return MineVModel::class.java
     }
+
+    override val isRxbus: Boolean
+        get() = true
+
+    @Subscribe(tags = [Tag(ConfigRx.REFRESH_USER)])
+    fun setRefreshUser(type: String) {
+       vm.user.value= User.get()
+    }
 }

+ 11 - 0
app/src/main/java/com/quansu/heifengwuliu/model/IconData.kt

@@ -0,0 +1,11 @@
+package com.quansu.heifengwuliu.model
+
+import com.ysnows.base.inter.IModel
+import java.util.ArrayList
+
+/**
+ *Created by shihuiyun
+ *on 2020/9/25
+ */
+data class IconData(var x: ArrayList<String>,var y:ArrayList<String>):IModel {
+}

+ 163 - 0
app/src/main/java/com/quansu/heifengwuliu/mp/LineChartManager.java

@@ -0,0 +1,163 @@
+package com.quansu.heifengwuliu.mp;
+
+import android.graphics.Color;
+import android.graphics.drawable.GradientDrawable;
+
+import com.github.mikephil.charting.charts.LineChart;
+import com.github.mikephil.charting.components.XAxis;
+import com.github.mikephil.charting.components.YAxis;
+import com.github.mikephil.charting.data.Entry;
+import com.github.mikephil.charting.data.LineData;
+import com.github.mikephil.charting.data.LineDataSet;
+import com.github.mikephil.charting.formatter.ValueFormatter;
+
+import java.text.DecimalFormat;
+import java.util.List;
+
+/**
+ * Author :li ChuanWu on 2018/1/12
+ * Blog  :http://blog.csdn.net/lsyz0021/
+ */
+public class LineChartManager {
+//    private DecimalFormat mDecimalFormat = new DecimalFormat("##,##0.0#");
+   private DecimalFormat mDecimalFormat = new DecimalFormat("0.0");
+
+    private LineChart mLineChart;
+
+    public LineChartManager(LineChart lineChart) {
+        mLineChart = lineChart;
+        initChart(lineChart);
+    }
+
+    private void initChart(LineChart lineChart) {
+        if (lineChart != null) {
+            lineChart.getLegend().setEnabled(false);// 不显示图例
+            lineChart.getDescription().setEnabled(false);// 不显示描述
+            lineChart.setScaleEnabled(true);   // 取消缩放
+            lineChart.setNoDataText("暂无数据");// 没有数据的时候默认显示的文字
+            lineChart.setNoDataTextColor(Color.GRAY);
+            lineChart.setBorderColor(Color.BLUE);
+            lineChart.setTouchEnabled(true);
+            lineChart.setDragEnabled(true);
+            // 如果x轴label文字比较大,可以设置边距
+            lineChart.setExtraRightOffset(25f);
+            lineChart.setExtraBottomOffset(10f);
+            lineChart.setExtraTopOffset(10f);
+
+            initChartXAxis(lineChart);
+            initChartYAxis(lineChart);
+        }
+    }
+
+
+
+
+    public void setMarkView(MyMarkerView markerView) {
+        if (markerView != null) {
+            markerView.setChartView(mLineChart);
+            mLineChart.setMarker(markerView);
+        }
+    }
+
+    public void setData(List<Entry> entries) {
+        mLineChart.setData(getLineData(entries));
+    }
+
+    /**
+     * 初始化Y轴
+     *
+     * @param lineChart
+     */
+    private void initChartYAxis(LineChart lineChart) {
+        if (lineChart != null) {
+            // 不显示右侧Y轴
+            YAxis yAxisRight = lineChart.getAxisRight();
+            yAxisRight.setEnabled(false);
+
+            YAxis yAxisLeft = lineChart.getAxisLeft();
+            // 强制显示Y轴5个坐标
+            yAxisLeft.setLabelCount(5, true);
+            // 将y轴0点轴的颜色设置为透明
+            yAxisLeft.setZeroLineColor(Color.WHITE);
+            yAxisLeft.setTextColor(Color.parseColor("#8F8E94"));
+            yAxisLeft.setTextSize(10);
+            // 设置y轴网格的颜色
+            yAxisLeft.setGridColor(Color.parseColor("#8F8E94"));
+            // yAxisLeft.setGranularity(0.5f);
+            yAxisLeft.setAxisMinimum(0.0f); // start at zero
+            //Y方向文字的位置,在线外侧.(默认在外侧)
+            yAxisLeft.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
+            // 格式化Y轴数据
+            yAxisLeft.setValueFormatter(new ValueFormatter() {
+                @Override
+                public String getFormattedValue(float value) {
+                    return mDecimalFormat.format(value)+"%";
+
+                }
+            });
+
+
+        }
+    }
+
+    /**
+     * 初始化X轴
+     *
+     * @param lineChart
+     */
+    private void initChartXAxis(LineChart lineChart) {
+        if (lineChart != null) {
+            // 设置x轴的数据
+            XAxis xAxis = lineChart.getXAxis();
+            xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
+            xAxis.setTextColor(Color.parseColor("#8F8E94"));
+            xAxis.setTextSize(10);
+            // 设置x轴网格的颜色
+            xAxis.setGridColor(Color.parseColor("#00000000"));
+
+            //x轴显示三个坐标
+//            xAxis.setLabelCount(3,true);
+
+           // xAxis.setGridColor(Color.parseColor("#8F8E94"));
+            xAxis.setGranularity(1.0f);
+            //如果设置为true,则在绘制时会避免“剪掉”在x轴上的图表或屏幕边缘的第一个和最后一个坐标轴标签项。
+            // xAxis.setAvoidFirstLastClipping(true);
+            // x轴最左多出空n个坐标
+            // xAxis.setSpaceMax(1.0f);
+            // 让左侧x轴不从0点开始
+            // xAxis.setSpaceMin(0.1f);
+
+        }
+    }
+
+    /**
+     * 获取含有数据的LineDataSet对象
+     *
+     * @param entries
+     * @return
+     */
+    private LineData getLineData(List<Entry> entries) {
+        LineDataSet lineDataSet = new LineDataSet(entries, null);
+        if (entries != null) {
+            // 点击圆点不显示高亮
+            lineDataSet.setDrawHighlightIndicators(true);
+            // 设置折线的颜色
+            lineDataSet.setColor(Color.parseColor("#4186F7"));
+            ///设置点的颜色
+            lineDataSet.setCircleColor(Color.parseColor("#4186F7"));
+            lineDataSet.setDrawCircles(true);//设置是否绘制点,默认是true
+            lineDataSet.setDrawValues(false);//是否绘制点上的文字,默认为true
+
+            // 填充颜色(渐变色)
+            lineDataSet.setDrawFilled(true);
+            lineDataSet.setFillDrawable(new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM,
+                    new int[]{Color.parseColor("#99E8F3FE"), Color.parseColor("#40E8F3FE")}));
+            lineDataSet.setLineWidth(1f);
+            //设置曲线展示为圆滑曲线(如果不设置则默认折线)
+            lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
+
+        }
+        return new LineData(lineDataSet);
+    }
+
+}

+ 18 - 0
app/src/main/java/com/quansu/heifengwuliu/mp/MyFofChartBean.java

@@ -0,0 +1,18 @@
+package com.quansu.heifengwuliu.mp;
+
+import java.io.Serializable;
+
+/**
+ * Author :li ChuanWu on 2018/1/8
+ * Blog  :http://blog.csdn.net/lsyz0021/
+ */
+public class MyFofChartBean implements Serializable {
+    private static final long serialVersionUID = 928892883514145198L;
+    public String inputDate; //日期
+    public Float networth;//万份收益
+
+    public MyFofChartBean(String inputDate, Float networth) {
+        this.inputDate = inputDate;
+        this.networth = networth;
+    }
+}

+ 160 - 0
app/src/main/java/com/quansu/heifengwuliu/mp/MyMarkerView.java

@@ -0,0 +1,160 @@
+package com.quansu.heifengwuliu.mp;
+
+import android.content.Context;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.github.mikephil.charting.charts.Chart;
+import com.github.mikephil.charting.components.MarkerView;
+import com.github.mikephil.charting.data.Entry;
+import com.github.mikephil.charting.highlight.Highlight;
+import com.github.mikephil.charting.utils.MPPointF;
+import com.quansu.heifengwuliu.R;
+
+import java.util.List;
+
+/**
+ * Author :li ChuanWu on 2018/1/3
+ * Blog  :http://blog.csdn.net/lsyz0021/
+ */
+public class MyMarkerView extends MarkerView {
+
+    private final TextView mTvDate;
+    private final TextView mTvMoney;
+    private final LinearLayout mLlTopArrow;
+    private final LinearLayout mLlBottomArrow;
+    private final ImageView mIvDot;
+    private List<String> mXAxisLabels;
+    private MPPointF mMPPointF = new MPPointF();
+    private float mHighlightXValue;
+    private float mHighlightYValue;
+
+    public MyMarkerView(Context context, int layoutResource) {
+        super(context, layoutResource);
+        mTvDate = (TextView) findViewById(R.id.tv_date);
+        mTvMoney = (TextView) findViewById(R.id.tv_money);
+        mLlTopArrow = (LinearLayout) findViewById(R.id.ll_move_top);
+        mLlBottomArrow = (LinearLayout) findViewById(R.id.ll_move_bottom);
+        mIvDot = (ImageView) findViewById(R.id.iv_bottom_dot);
+    }
+
+    @Override
+    public void refreshContent(Entry e, Highlight highlight) {
+        super.refreshContent(e, highlight);
+        if (mXAxisLabels == null) {
+            throw new NullPointerException("mXAxisLabels 不能为空,请调用setXAxisLabels()为其设置数据");
+        }
+        if (e != null) {
+            float x = e.getX();
+            float y = e.getY();
+            mTvDate.setText(String.format("%s 收益", mXAxisLabels.get((int) x)));
+//            mTvMoney.setText(String.format("%s %s", String.valueOf((char) 165), y));
+
+           // mTvMoney.setText(String.format("%d%% %n", String.valueOf((char) 165), y));
+
+            mTvMoney.setText(y+"%");
+        }
+    }
+
+    @Override
+    public MPPointF getOffsetForDrawingAtPoint(float posX, float posY) {
+        int widthHalf = getWidth() / 2;
+        mMPPointF.x = 0;
+        // 设置x轴MarkView的移动
+        int right = getChartView().getWidth();
+        if (posX < widthHalf) {
+            // 在最左侧的情况
+            mMPPointF.x = -posX;
+        } else if ((posX >= widthHalf) && (posX + widthHalf) <= right) {
+            mMPPointF.x = -widthHalf;
+        } else if ((posX + widthHalf) > right) {
+            // 在最右侧的情况
+            float dis = getWidth() - (right - posX);
+            mMPPointF.x = -dis;
+        }
+        moveArrow(Math.abs(mMPPointF.x));
+
+        // 设置y轴MarkView的移动 如果上面可以放下mark就在上面显示,否则在下面显示
+        if (posY > (getRootView().getHeight() + mIvDot.getHeight())) {
+            showTop(mMPPointF);
+        } else {
+            showBottom(mMPPointF);
+        }
+        // 这里必须要在重新测量、摆放,不然会使用上次的位置
+        refreshContent(null, null);
+        return mMPPointF;
+    }
+
+    /**
+     * mark在点的下方
+     *
+     * @param mpPointF
+     */
+    private void showBottom(MPPointF mpPointF) {
+        if (mpPointF != null) {
+            mpPointF.y = -mIvDot.getHeight() / 2;
+            mLlBottomArrow.setVisibility(GONE);
+            mLlTopArrow.setVisibility(VISIBLE);
+        }
+    }
+
+    private void showTop(MPPointF mpPointF) {
+        if (mpPointF != null) {
+            mpPointF.y = -(getHeight() - mIvDot.getHeight() / 2);
+            mLlBottomArrow.setVisibility(VISIBLE);
+            mLlTopArrow.setVisibility(GONE);
+        }
+    }
+
+    private void moveArrow(float left) {
+        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
+                LinearLayout.LayoutParams.WRAP_CONTENT);
+        params.leftMargin = (int) (left - mLlTopArrow.getWidth() / 2);
+        mLlBottomArrow.setLayoutParams(params);
+        mLlTopArrow.setLayoutParams(params);
+    }
+
+    public float getHighlightXValue() {
+        return mHighlightXValue;
+    }
+
+    public float getHighlightYValue() {
+        return mHighlightYValue;
+    }
+
+    /**
+     * 显示MarkView,设置坐标点为高亮即可显示MarkView.如果LineData的构造参数传入的对象为
+     *
+     * @param xValue 点X坐标坐标对应的值
+     * @param yValue 点Y坐标坐标对应的值
+     */
+    public void showMarkView(float xValue, float yValue) {
+        showMarkView(xValue, yValue, 0);
+    }
+
+    /**
+     * 显示MarkView,设置坐标点为高亮即可显示MarkView
+     *
+     * @param xValue       点X坐标坐标对应的值
+     * @param yValue       点Y坐标坐标对应的值
+     * @param dataSetIndex 设置集合的索引值,根据LineData构造中传入的对象来确定值:1、如果LineData()构造中传入的是LineDataSet对象,设置dataSetIndex为0,
+     *                     2、如果传入的是List集合对象,则dataSetIndex的值为该元素对应集合的索引值
+     */
+    public void showMarkView(float xValue, float yValue, int dataSetIndex) {
+        mHighlightXValue = xValue;
+        mHighlightYValue = yValue;
+        Chart chartView = getChartView();
+        if (chartView != null && chartView.getData() != null) {
+            chartView.highlightValue(xValue, yValue, 0);
+        }
+    }
+
+    /**
+     * 设置 X 轴label的集合
+     */
+    public void setXAxisLabels(List<String> xAxisLabels) {
+        mXAxisLabels = xAxisLabels;
+    }
+
+}

+ 10 - 0
app/src/main/java/com/quansu/heifengwuliu/utils/net/ApiService.kt

@@ -618,6 +618,16 @@ interface ApiService {
 
 
 
+    /**
+     * 修改资料
+     * @return
+     */
+    @POST("api/user/setProfile")
+    @FormUrlEncoded
+    suspend fun setProfile(@Field("avatar") avatar: String?, @Field("name") name: String?): Resp<Any>
+
+
+
 
 
 

+ 12 - 0
app/src/main/java/com/quansu/heifengwuliu/vmodel/AccountAnalysisVModel.kt

@@ -0,0 +1,12 @@
+package com.quansu.heifengwuliu.vmodel
+
+import android.app.Application
+import com.ysnows.base.base.BRepository
+import com.ysnows.base.base.BViewModel
+
+/**
+ *Created by shihuiyun
+ *on 2020/9/25
+ */
+class AccountAnalysisVModel(application: Application) : BViewModel<BRepository>(application) {
+}

+ 85 - 26
app/src/main/java/com/quansu/heifengwuliu/vmodel/PasswordVModel.kt

@@ -3,26 +3,37 @@ package com.quansu.heifengwuliu.vmodel
 import android.app.Activity
 import android.app.Application
 import android.text.TextUtils
-import android.util.Log
 import androidx.databinding.Bindable
 import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.viewModelScope
+import com.hwangjr.rxbus.RxBus
 import com.quansu.heifengwuliu.BR
-import com.quansu.heifengwuliu.config.ConfigMMKV
+import com.quansu.heifengwuliu.config.ConfigRx
 import com.quansu.heifengwuliu.model.User
+import com.quansu.heifengwuliu.utils.ChosePhotoUtils
 import com.quansu.heifengwuliu.utils.net.NetEngine
 import com.ysnows.base.base.BRepository
 import com.ysnows.base.base.BViewModel
-import com.ysnows.base.utils.MMKVManager
+import kotlinx.coroutines.launch
 
 open class PasswordVModel(application: Application) : BViewModel<BRepository>(application) {
 
 
-    var isShow: MutableLiveData<Boolean> = MutableLiveData( User.get()!!.isPwd)
+    var isShow: MutableLiveData<Boolean> = MutableLiveData(User.get()!!.isPwd)
 
     var type: MutableLiveData<Int> = MutableLiveData(1)
 
-    var isPayShow: MutableLiveData<Boolean> = MutableLiveData( User.get()!!.isPayPwd)
+    var isPayShow: MutableLiveData<Boolean> = MutableLiveData(User.get()!!.isPayPwd)
 
+    var avatar: MutableLiveData<String> = MutableLiveData()
+
+
+    @Bindable
+    open var name: String? = null
+        set(value) {
+            field = value
+            notifyPropertyChanged(BR.name)
+        }
 
 
     @Bindable
@@ -47,40 +58,53 @@ open class PasswordVModel(application: Application) : BViewModel<BRepository>(ap
             notifyPropertyChanged(BR.passWordTo)
         }
 
+    fun choseImg() {
+
+        //选择照片
+        ChosePhotoUtils.getChosePhoto(view()!!.context(), 1)
+
+    }
+
+    fun setInitData() {
+        var user = User.get()
+        avatar.value = user!!.avatar
+        name = user!!.name
+    }
 
-    fun toSubmit(){
-        if(type.value==1){//设置登录密码
 
-            var oldpwd=""
-            if(isShow.value!!) {
+    fun toSubmit() {
+        if (type.value == 1) {//设置登录密码
+
+            var oldpwd = ""
+            if (isShow.value!!) {
                 if (TextUtils.isEmpty(oldpassWord)) {
                     toast("请输入旧密码")
                     return
                 }
-                oldpwd= oldpassWord.toString()
+                oldpwd = oldpassWord.toString()
             }
-            if(TextUtils.isEmpty(passWord)){
+            if (TextUtils.isEmpty(passWord)) {
                 toast("请输入新密码")
                 return
             }
 
-            if(TextUtils.isEmpty(passWordTo)){
+            if (TextUtils.isEmpty(passWordTo)) {
                 toast("请再次输入新密码")
                 return
             }
-            if(passWord!=passWordTo){
+            if (passWord != passWordTo) {
                 toast("两次新密码不一致!")
                 return
             }
 
-            repository().rxLreq(NetEngine.service.setPwd(oldpwd, passWord,"0"))
+            repository().rxLreq(NetEngine.service.setPwd(oldpwd, passWord, "0"))
                     .doOnNext {
                         if (it.ok(true)) {
                             toast(it.msg())
-                            if(!isShow.value!!) {
+                            if (!isShow.value!!) {
                                 //没有设置密码
-                                var user=User.get()
-                                user!!.is_pwd=1
+                                var user = User.get()
+                                user!!.is_pwd = 1
                                 user.save()
                             }
                             (repository().context as Activity).finish()
@@ -95,31 +119,31 @@ open class PasswordVModel(application: Application) : BViewModel<BRepository>(ap
     }
 
 
-    fun toPaySubmit(oldpword:String,newPassword:String){
+    fun toPaySubmit(oldpword: String, newPassword: String) {
 
-        var oldpwd=""
-        if(isPayShow.value!!) {
+        var oldpwd = ""
+        if (isPayShow.value!!) {
             if (TextUtils.isEmpty(oldpword)) {
                 toast("请输入旧支付密码")
                 return
             }
 
-            oldpwd= oldpword
+            oldpwd = oldpword
         }
 
-        if(TextUtils.isEmpty(newPassword)){
+        if (TextUtils.isEmpty(newPassword)) {
             toast("请输入新支付密码")
             return
         }
-        repository().rxLreq(NetEngine.service.setPwd(oldpwd, newPassword,"1"))
+        repository().rxLreq(NetEngine.service.setPwd(oldpwd, newPassword, "1"))
                 .doOnNext {
                     if (it.ok(true)) {
                         toast(it.msg())
 
-                        if(!isPayShow.value!!) {
+                        if (!isPayShow.value!!) {
                             //没有设置密码
-                            var user=User.get()
-                            user!!.is_pay_pwd=1
+                            var user = User.get()
+                            user!!.is_pay_pwd = 1
                             user.save()
                         }
 
@@ -130,4 +154,39 @@ open class PasswordVModel(application: Application) : BViewModel<BRepository>(ap
 
     }
 
+
+    fun toSaveInfo() {//保存个人信息
+        if (TextUtils.isEmpty(name) && TextUtils.isEmpty(avatar.value)) {
+            toast("姓名或者头像必须要修改一项才能保存")
+            return
+        }
+        var avatarUrl = ""
+        if (!TextUtils.isEmpty(avatar.value)) {
+            avatarUrl = avatar.value!!
+        }
+        var name = ""
+        if (!TextUtils.isEmpty(this.name)) {
+            name = this.name!!
+        }
+
+        viewModelScope.launch {
+
+            val resp = repository().lreq { NetEngine.service.setProfile(avatarUrl, name) }
+            if (resp.ok(true)) {
+                var user = User.get()
+                user!!.avatar = avatarUrl
+                user!!.name = name
+                user.save()
+
+                RxBus.get().post(ConfigRx.REFRESH_USER, "")
+
+                var con = repository().context as Activity
+                con.finish()
+            }
+
+        }
+
+
+    }
+
 }

+ 1 - 5
app/src/main/java/com/quansu/heifengwuliu/vmodel/SettingsVModel.kt

@@ -29,7 +29,7 @@ class SettingsVModel(application: Application) : BViewModel<UserInfoRepository>(
     }
 
 
-    //设置登录密码和支付密码 1:登录密码 2支付密码
+    //设置登录密码和支付密码 1:登录密码 2支付密码 3:编辑资料
     fun goPassword(type: Int) {
         UiSwitch.bundle(repository().context, PasswordActivity::class.java, Bundle().apply {
             putInt("type", type)
@@ -43,10 +43,6 @@ class SettingsVModel(application: Application) : BViewModel<UserInfoRepository>(
 
     }
 
-    fun goEditProfile() {//编辑资料
-
-
-    }
 
     fun  goOpinion(){//意见反馈
 

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


BIN
app/src/main/res/drawable-xxhdpi/ic_down.png


BIN
app/src/main/res/drawable-xxhdpi/icon_chart_dot.png


BIN
app/src/main/res/drawable-xxhdpi/icon_mark_arrow_down.png


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


+ 216 - 112
app/src/main/res/layout/activity_password.xml

@@ -28,8 +28,9 @@
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:orientation="vertical"
             android:visibility="@{vm.type==1?View.VISIBLE:View.GONE}"
-            android:orientation="vertical">
+            tools:visibility="gone">
 
             <LinearLayout
                 android:layout_width="match_parent"
@@ -37,38 +38,37 @@
                 android:layout_marginTop="12dp"
                 android:background="@color/white"
                 android:gravity="center_vertical"
+                android:orientation="horizontal"
                 android:paddingStart="35dp"
                 android:paddingEnd="@dimen/dp_14"
-                android:visibility="@{vm.isShow?View.VISIBLE :View.GONE}"
-                android:orientation="horizontal"
-                >
+                android:visibility="@{vm.isShow?View.VISIBLE :View.GONE}">
 
                 <TextView
                     android:layout_width="wrap_content"
-                    android:textColor="@color/text_title"
-                    android:textSize="14sp"
-                    android:text="原密码"
+                    android:layout_height="wrap_content"
                     android:layout_marginEnd="18dp"
-                    android:layout_height="wrap_content"/>
+                    android:text="原密码"
+                    android:textColor="@color/text_title"
+                    android:textSize="14sp" />
 
                 <com.ysnows.base.widget.DelEditText
                     android:id="@+id/edt_old_pwd"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
                     android:background="@null"
-                    android:textColor="@color/text_title"
-                    android:textColorHint="#979899"
                     android:hint="@string/please_input_old_pwd"
                     android:inputType="textPassword"
                     android:text="@={vm.oldpassWord}"
+                    android:textColor="@color/text_title"
+                    android:textColorHint="#979899"
                     android:textSize="@dimen/sp_14" />
             </LinearLayout>
 
             <View
                 android:layout_width="match_parent"
+                android:layout_height="1dp"
                 android:background="#F3F4F5"
-                android:visibility="@{vm.isShow?View.VISIBLE :View.GONE}"
-                android:layout_height="1dp"/>
+                android:visibility="@{vm.isShow?View.VISIBLE :View.GONE}" />
 
 
             <LinearLayout
@@ -76,18 +76,17 @@
                 android:layout_height="43dp"
                 android:background="@color/white"
                 android:gravity="center_vertical"
-                android:paddingStart="35dp"
-                android:paddingEnd="@dimen/dp_14"
                 android:orientation="horizontal"
-                >
+                android:paddingStart="35dp"
+                android:paddingEnd="@dimen/dp_14">
 
                 <TextView
                     android:layout_width="wrap_content"
-                    android:textColor="@color/text_title"
-                    android:textSize="14sp"
-                    android:text="原密码"
+                    android:layout_height="wrap_content"
                     android:layout_marginEnd="18dp"
-                    android:layout_height="wrap_content"/>
+                    android:text="原密码"
+                    android:textColor="@color/text_title"
+                    android:textSize="14sp" />
 
 
                 <com.ysnows.base.widget.DelEditText
@@ -97,34 +96,34 @@
                     android:background="@null"
                     android:hint="@string/please_input_new_pwd"
                     android:inputType="textPassword"
+                    android:text="@={vm.passWord}"
                     android:textColor="@color/text_title"
                     android:textColorHint="#979899"
-                    android:text="@={vm.passWord}"
                     android:textSize="@dimen/sp_14" />
 
             </LinearLayout>
 
             <View
                 android:layout_width="match_parent"
-                android:background="#F3F4F5"
-                android:layout_height="1dp"/>
+                android:layout_height="1dp"
+                android:background="#F3F4F5" />
 
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="43dp"
-                android:paddingStart="35dp"
                 android:background="@color/white"
-                android:paddingEnd="@dimen/dp_14"
                 android:gravity="center_vertical"
                 android:orientation="horizontal"
-                >
+                android:paddingStart="35dp"
+                android:paddingEnd="@dimen/dp_14">
+
                 <TextView
                     android:layout_width="wrap_content"
-                    android:textColor="@color/text_title"
-                    android:textSize="14sp"
-                    android:text="原密码"
+                    android:layout_height="wrap_content"
                     android:layout_marginEnd="18dp"
-                    android:layout_height="wrap_content"/>
+                    android:text="原密码"
+                    android:textColor="@color/text_title"
+                    android:textSize="14sp" />
 
 
                 <com.ysnows.base.widget.DelEditText
@@ -175,122 +174,227 @@
             </FrameLayout>
 
 
-
         </LinearLayout>
 
-      <!--    支付密码-->
-         <LinearLayout
-             android:layout_width="match_parent"
-             android:orientation="vertical"
-             android:visibility="@{vm.type==2?View.VISIBLE:View.GONE}"
-             android:layout_height="wrap_content">
+        <!--    支付密码-->
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:visibility="@{vm.type==2?View.VISIBLE:View.GONE}"
+            tools:visibility="gone">
 
 
-             <LinearLayout
-                 android:layout_width="match_parent"
-                 android:orientation="horizontal"
-                 android:layout_marginTop="25dp"
-                 android:visibility="@{vm.isPayShow?View.VISIBLE :View.GONE}"
-                 android:gravity="center_vertical"
-                 android:layout_marginStart="35dp"
-                 android:layout_marginEnd="35dp"
-                 android:layout_height="wrap_content">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="35dp"
+                android:layout_marginTop="25dp"
+                android:layout_marginEnd="35dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:visibility="@{vm.isPayShow?View.VISIBLE :View.GONE}">
 
-                 <TextView
-                     android:layout_width="wrap_content"
-                     android:textSize="@dimen/sp_14"
-                     android:textColor="@color/text_title"
-                     android:text="原支付密码:"
-                     android:layout_height="wrap_content">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="原支付密码:"
+                    android:textColor="@color/text_title"
+                    android:textSize="@dimen/sp_14">
 
-                 </TextView>
+                </TextView>
 
 
-                 <com.quansu.heifengwuliu.view.PasswordView
-                     android:id="@+id/ppet_old_password"
-                     android:layout_width="match_parent"
-                     app:cipherEnable="true"
-                     app:passwordLength="6"
-                     app:smode="rect"
-                     android:layout_height="45dp">
+                <com.quansu.heifengwuliu.view.PasswordView
+                    android:id="@+id/ppet_old_password"
+                    android:layout_width="match_parent"
+                    android:layout_height="45dp"
+                    app:cipherEnable="true"
+                    app:passwordLength="6"
+                    app:smode="rect">
 
-                 </com.quansu.heifengwuliu.view.PasswordView>
+                </com.quansu.heifengwuliu.view.PasswordView>
 
 
-             </LinearLayout>
+            </LinearLayout>
 
 
-             <LinearLayout
-                 android:layout_width="match_parent"
-                 android:orientation="horizontal"
-                 android:layout_marginTop="25dp"
-                 android:gravity="center_vertical"
-                 android:layout_marginStart="35dp"
-                 android:layout_marginEnd="35dp"
-                 android:layout_height="wrap_content">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="35dp"
+                android:layout_marginTop="25dp"
+                android:layout_marginEnd="35dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
 
-                 <TextView
-                     android:layout_width="wrap_content"
-                     android:textSize="@dimen/sp_14"
-                     android:textColor="@color/text_title"
-                     android:text="新支付密码:"
-                     android:layout_height="wrap_content">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="新支付密码:"
+                    android:textColor="@color/text_title"
+                    android:textSize="@dimen/sp_14">
 
-                 </TextView>
+                </TextView>
 
-                 <com.quansu.heifengwuliu.view.PasswordView
-                     android:id="@+id/ppet_new_password"
-                     android:layout_width="match_parent"
-                     app:cipherEnable="true"
-                     app:passwordLength="6"
-                     app:smode="rect"
-                     android:layout_height="45dp">
+                <com.quansu.heifengwuliu.view.PasswordView
+                    android:id="@+id/ppet_new_password"
+                    android:layout_width="match_parent"
+                    android:layout_height="45dp"
+                    app:cipherEnable="true"
+                    app:passwordLength="6"
+                    app:smode="rect">
 
-                 </com.quansu.heifengwuliu.view.PasswordView>
+                </com.quansu.heifengwuliu.view.PasswordView>
 
 
-             </LinearLayout>
+            </LinearLayout>
 
 
-             <View
-                 android:layout_width="match_parent"
-                 android:layout_height="0dp"
-                 android:layout_weight="1">
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1">
 
-             </View>
+            </View>
 
 
-             <FrameLayout
-                 android:id="@+id/fl_pay_submit"
-                 android:layout_width="match_parent"
-                 android:layout_height="wrap_content"
-                 android:layout_marginStart="16dp"
-                 android:layout_marginTop="13dp"
-                 android:layout_marginEnd="@dimen/dp_16"
-                 >
+            <FrameLayout
+                android:id="@+id/fl_pay_submit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="16dp"
+                android:layout_marginTop="13dp"
+                android:layout_marginEnd="@dimen/dp_16">
 
-                 <ImageView
-                     android:layout_width="match_parent"
-                     android:layout_height="106dp"
-                     android:src="@drawable/ic_details_grab" />
+                <ImageView
+                    android:layout_width="match_parent"
+                    android:layout_height="106dp"
+                    android:src="@drawable/ic_details_grab" />
 
-                 <TextView
-                     android:layout_width="wrap_content"
-                     android:layout_height="wrap_content"
-                     android:layout_gravity="center"
-                     android:text="@string/submit"
-                     android:textColor="@color/white"
-                     android:textSize="16sp">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:text="@string/submit"
+                    android:textColor="@color/white"
+                    android:textSize="16sp">
+
+                </TextView>
+
+            </FrameLayout>
+
+
+        </LinearLayout>
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@color/color_bg"
+            android:orientation="vertical"
+            android:visibility="@{vm.type==3?View.VISIBLE:View.GONE}">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="44dp"
+                android:layout_marginTop="12dp"
+                android:background="@color/white"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:paddingStart="22dp"
+                android:paddingEnd="17dp">
 
-                 </TextView>
+                <TextView
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="个人头像"
+                    android:textColor="@color/text_title"
+                    android:textSize="14sp" />
+
+                <com.qmuiteam.qmui.widget.QMUIRadiusImageView
+                    android:id="@+id/img_user_avater"
+                    android:layout_width="34dp"
+                    android:layout_height="34dp"
+                    android:src="@drawable/ic_default_avatar"
+                    app:qmui_border_color="@color/white"
+                    app:url="@{vm.avatar}"
+                    android:onClick="@{v->vm.choseImg()}"
+                    app:qmui_is_circle="true" />
 
-             </FrameLayout>
+                <ImageView
+                    style="@style/mine_arrow_right"
+                    android:layout_marginStart="8dp"
+                    android:src="@drawable/mine_right" />
 
 
+            </LinearLayout>
 
-         </LinearLayout>
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="#EEEFF0" />
 
 
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="44dp"
+                android:background="@color/white"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:paddingStart="23dp"
+                android:paddingEnd="33dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginEnd="18dp"
+                    android:text="姓名"
+                    android:textColor="@color/text_title"
+                    android:textSize="14sp" />
+
+                <com.ysnows.base.widget.DelEditText
+                    android:id="@+id/edt_name"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:background="@null"
+                    android:gravity="right|center_vertical"
+                    android:hint="请输入姓名"
+                    android:text="@={vm.name}"
+                    android:textColor="@color/text_title"
+                    android:textColorHint="#979899"
+                    android:textSize="@dimen/sp_14" />
+            </LinearLayout>
+
+
+            <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="16dp"
+                android:layout_marginTop="25dp"
+                android:layout_marginEnd="@dimen/dp_16"
+                android:onClick="@{v->vm.toSaveInfo()}">
+
+                <ImageView
+                    android:layout_width="match_parent"
+                    android:layout_height="106dp"
+                    android:src="@drawable/ic_details_grab" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:text="完成"
+                    android:textColor="@color/white"
+                    android:textSize="16sp">
+
+                </TextView>
+
+            </FrameLayout>
+
+        </LinearLayout>
+
 
     </LinearLayout>
 </layout>

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

@@ -56,7 +56,7 @@
                             android:layout_width="match_parent"
                             android:layout_height="44dp"
                             android:background="@color/white"
-                            android:onClick="@{v->vm.goEditProfile()}"
+                            android:onClick="@{v->vm.goPassword(3)}"
                             android:paddingStart="19dp" >
 
                             <ImageView

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

@@ -1011,7 +1011,7 @@
                     android:layout_marginStart="16dp"
                     android:layout_marginTop="33dp"
                     android:layout_marginEnd="@dimen/dp_16"
-                    android:visibility=""
+                    android:visibility="@{vm.isShow?View.VISIBLE :View.GONE}"
                     android:onClick="@{v->vm.toSubmit()}">
 
                     <ImageView

+ 78 - 0
app/src/main/res/layout/chart_marker_view.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:background="@android:color/transparent"
+              android:orientation="vertical">
+
+    <LinearLayout
+        android:id="@+id/ll_move_top"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:orientation="vertical">
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/icon_chart_dot"/>
+
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="3dp"
+            android:src="@drawable/icon_mark_arrow_up"/>
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/ll_mark"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:background="#FC863E"
+        android:orientation="vertical"
+        android:padding="3dp"
+        android:visibility="visible">
+
+        <TextView
+            android:id="@+id/tv_date"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="2019/01 收益"
+            android:textColor="@android:color/white"
+            android:textSize="11sp"
+            android:visibility="visible"/>
+
+        <TextView
+            android:id="@+id/tv_money"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="¥1.555"
+            android:textColor="@android:color/white"
+            android:textSize="14sp"
+            android:visibility="visible"/>
+
+    </LinearLayout>
+
+
+    <LinearLayout
+        android:id="@+id/ll_move_bottom"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:orientation="vertical">
+
+        <ImageView
+            android:id="@+id/iv_bottom_arrow"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/icon_mark_arrow_down"/>
+
+        <ImageView
+            android:id="@+id/iv_bottom_dot"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="3dp"
+            android:src="@drawable/icon_chart_dot"/>
+    </LinearLayout>
+</LinearLayout>

+ 174 - 10
app/src/main/res/layout/fragment_account_analysis.xml

@@ -4,27 +4,191 @@
     xmlns:tools="http://schemas.android.com/tools" >
 
     <data >
+        
+        <variable
+            name="vm"
+            type="com.quansu.heifengwuliu.vmodel.AccountAnalysisVModel" />
 
     </data >
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:background="@color/color_bg"
         android:orientation="vertical" >
 
-        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
-            android:id="@+id/refresh_layout"
+
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent" >
+            android:orientation="horizontal"
+            android:paddingTop="10dp"
+            android:paddingBottom="8dp"
+            android:paddingStart="13dp"
+            android:paddingEnd="15dp"
+            android:layout_height="54dp">
+            
+            <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:orientation="horizontal"
+                android:gravity="center"
+                app:qmui_backgroundColor="@color/white"
+                app:qmui_borderColor="@color/white"
+                app:qmui_radius="11dp"
+                android:paddingStart="6dp"
+                android:paddingEnd="12dp"
+                android:layout_height="36dp">
+
+                <TextView
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:textColorHint="#95959A"
+                    android:textColor="@color/text_title"
+                    android:textSize="12sp"
+                    android:gravity="center"
+                    android:hint="选择时间"
+                    android:layout_height="wrap_content"/>
+                
+                
+                 <ImageView
+                     android:layout_width="18dp"
+                     android:layout_marginStart="8dp"
+                     android:src="@drawable/ic_account_time"
+                     android:layout_height="17dp"/>
+
+
+
+            </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
+
+
+
+
+            <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
+                android:layout_width="94dp"
+                android:orientation="horizontal"
+                android:gravity="center"
+                app:qmui_backgroundColor="@color/white"
+                app:qmui_borderColor="@color/white"
+                app:qmui_radius="11dp"
+                android:paddingStart="12dp"
+                android:layout_marginStart="13dp"
+                android:paddingEnd="6dp"
+                android:layout_height="36dp">
+
+
+                <ImageView
+                    android:layout_width="20dp"
+                    android:src="@drawable/stock_serch"
+                    android:layout_height="19dp"/>
+                
+                   <com.ysnows.base.widget.DelEditText
+                       android:layout_width="match_parent"
+                       android:background="@null"
+                       android:textSize="13sp"
+                       android:textColor="@color/text_title"
+                       android:textColorHint="#95959A"
+                       android:layout_marginStart="4dp"
+                       android:layout_height="wrap_content"/>
+
 
-            <androidx.recyclerview.widget.RecyclerView
-                android:id="@+id/recycler_view"
+            </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
+
+
+
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:textColor="#333333"
+                android:textSize="12sp"
+                android:gravity="center_vertical"
+                android:text="搜索"
+                android:layout_marginStart="10dp"
+                android:layout_height="match_parent"/>
+
+
+        </LinearLayout>
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:orientation="vertical"
+            android:background="@color/white"
+            android:paddingEnd="1dp"
+            android:paddingStart="2dp"
+            android:paddingBottom="20dp"
+            android:layout_height="wrap_content">
+
+            <LinearLayout
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
-                tools:listitem="@layout/item_msg" />
+                android:orientation="horizontal"
+                android:layout_marginTop="20dp"
+                android:layout_height="wrap_content">
+
+                <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout
+                    android:layout_width="120dp"
+                    app:qmui_radius="4dp"
+                    app:qmui_borderColor="#95959A"
+                    app:qmui_borderWidth="1dp"
+                    android:orientation="horizontal"
+                    android:gravity="center"
+                    android:layout_height="40dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        tools:text="最近30天"
+                        android:textSize="14sp"
+                        android:textColor="@color/text_title"
+                        android:layout_height="wrap_content"/>
+
+                      <ImageView
+                          android:layout_width="8dp"
+                          android:src="@drawable/ic_down"
+                          android:layout_marginStart="@dimen/dp_10"
+                          android:layout_height="5dp"/>
+
+
+                </com.qmuiteam.qmui.widget.roundwidget.QMUIRoundLinearLayout>
+
+
+            </LinearLayout>
+
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="手指移至下方曲线图上,可查看每天详细统计"
+                android:textColor="#95959A"
+                android:textSize="14sp"
+                ></TextView>
+
+
+            <com.github.mikephil.charting.charts.LineChart
+                android:id="@+id/chart"
+                android:layout_width="match_parent"
+                android:layout_height="150dp"
+                android:layout_marginStart="19dp"
+                android:layout_marginTop="17dp"
+                android:layout_marginEnd="16dp"
+                android:background="#fafafc"/>
+
+
+
+        </LinearLayout>
+
+
+
+
+
+
+
+        
+        
+        
+        
+        
 
-        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout >
+       
     </LinearLayout >
 
-</layout >
+</layout >