Browse Source

1. update

咸光金 4 years ago
parent
commit
e36a0190a8

+ 1 - 7
app/build.gradle

@@ -12,7 +12,7 @@ android {
         versionCode rootProject.application_version_code
         versionName rootProject.application_version_name
         manifestPlaceholders = [
-                JPUSH_PKGNAME : 'com.quansu.heifengwuliu',
+                JPUSH_PKGNAME: 'com.quansu.heifengwuliu',
                 JPUSH_APPKEY : "fe6707d0979ba5e2059b8fb9",//值来自开发者平台取得的AppKey
                 JPUSH_CHANNEL: "default_developer",
         ]
@@ -114,17 +114,11 @@ android {
 
 dependencies {
 
-
     implementation project(':base')
     addComponent 'update'
     addComponent 'umeng'
     addComponent 'jpush'
 
-
-    // 底部菜单
-    implementation('com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar') {
-        exclude group: 'com.android.support', module: 'support-v4'
-    }
     //微信sdk
     implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
 }

+ 4 - 0
app/src/main/java/com/quansu/heifengwuliu/vmodel/HomeVModel.kt

@@ -1,9 +1,13 @@
 package com.quansu.heifengwuliu.vmodel
 
+import androidx.lifecycle.LiveData
+import androidx.lifecycle.MutableLiveData
+import com.quansu.heifengwuliu.model.User
 import com.quansu.heifengwuliu.repository.HomeRepository
 import com.ysnows.base.base.BViewModel
 
 open class HomeVModel : BViewModel<HomeRepository>() {
+    val user: LiveData<User> = MutableLiveData<User>()
 
     fun getUserInfo() {
         repository().getuserinfo()

+ 261 - 286
app/src/main/res/layout/fragment_mine.xml

@@ -1,356 +1,331 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    xmlns:app="http://schemas.android.com/apk/res-auto" >
+
+    <data >
 
-    <data>
         <variable
             name="vm"
             type="com.quansu.heifengwuliu.vmodel.MineVModel" />
-    </data>
+    </data >
 
-    <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
+    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
+        android:id="@+id/refresh_layout"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
+        android:layout_height="match_parent" >
 
-        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
-            android:id="@+id/refresh_layout"
+        <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
             android:layout_width="match_parent"
-            android:layout_height="match_parent">
+            android:layout_height="match_parent"
+            android:orientation="vertical" >
 
-            <ScrollView
+            <RelativeLayout
+                android:id="@+id/lay_title"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/title_bar_height"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" >
+
+                <TextView
+                    android:id="@+id/tv_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerInParent="true"
+                    android:layout_marginTop="20dp"
+                    android:text="个人中心"
+                    android:textColor="@color/text_title"
+                    android:textSize="@dimen/sp_16"
+                    android:textStyle="bold" />
+
+                <ImageView
+                    android:layout_width="25dp"
+                    android:layout_height="25dp"
+                    android:layout_alignParentEnd="true"
+                    android:layout_centerVertical="true"
+                    android:layout_marginEnd="@dimen/dp_10"
+                    android:src="@drawable/ic_to_wxchat" />
+
+            </RelativeLayout >
+
+            <androidx.constraintlayout.widget.ConstraintLayout
+                android:layout_width="match_parent"
+                android:layout_height="106dp"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/lay_title" >
+
+                <com.qmuiteam.qmui.widget.QMUIRadiusImageView
+                    android:id="@+id/img_user_avater"
+                    android:layout_width="50dp"
+                    android:layout_height="50dp"
+                    android:layout_marginStart="@dimen/dp_10"
+                    android:layout_marginTop="20dp"
+                    android:src="@drawable/ic_math"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent"
+                    app:qmui_is_circle="true" />
+
+                <TextView
+                    android:id="@+id/tv_user_name"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="@dimen/dp_10"
+                    android:layout_marginTop="10dp"
+                    app:layout_constraintStart_toEndOf="@id/img_user_avater"
+                    app:layout_constraintTop_toTopOf="@id/img_user_avater"
+                    tools:text="郑货主" />
+
+                <TextView
+                    android:id="@+id/tv_user_mobile"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="@dimen/dp_10"
+                    android:layout_marginBottom="10dp"
+                    app:layout_constraintBottom_toBottomOf="@id/img_user_avater"
+                    app:layout_constraintStart_toEndOf="@id/img_user_avater"
+                    tools:text="18353965350" />
+
+                <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
+                    android:layout_width="72dp"
+                    android:layout_height="30dp"
+                    android:layout_marginTop="20dp"
+                    android:layout_marginEnd="@dimen/dp_10"
+                    android:text="未认证"
+                    android:textColor="#459AEA"
+                    app:qmui_backgroundColor="#E8F1FB"
+                    app:qmui_borderColor="#459AEA"
+                    app:qmui_radius="@dimen/dp_4" />
+
+            </androidx.constraintlayout.widget.ConstraintLayout >
+
+            <com.qmuiteam.qmui.layout.QMUILinearLayout
+                android:id="@+id/ll_center"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:scrollbars="none">
+                android:layout_height="wrap_content"
+                android:layout_marginStart="10dp"
+                android:layout_marginTop="@dimen/dp_20"
+                android:layout_marginEnd="10dp"
+                android:background="@color/white"
+                android:orientation="horizontal"
+                android:paddingTop="15dp"
+                android:paddingBottom="20dp"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/iv_user_avater"
+                app:qmui_radius="10dp"
+                app:qmui_shadowAlpha="0.56"
+                app:qmui_shadowElevation="7dp" >
+
+                <LinearLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:orientation="vertical" >
 
-                <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:orientation="vertical">
+                    <ImageView
+                        android:layout_width="60dp"
+                        android:layout_height="60dp"
+                        android:src="@drawable/ic_math" ></ImageView >
 
                     <TextView
-                        android:id="@+id/tv_title"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        android:layout_marginTop="20dp"
-                        android:text="个人中心"
-                        android:textColor="@color/text_title"
-                        android:textSize="@dimen/sp_16"
-                        android:textStyle="bold"
-                        app:layout_constraintLeft_toLeftOf="parent"
-                        app:layout_constraintRight_toRightOf="parent"
-                        app:layout_constraintTop_toTopOf="parent"></TextView>
-
-                    <ImageView
-                        android:layout_width="25dp"
-                        android:layout_height="25dp"
-                        android:layout_marginTop="15dp"
-                        android:layout_marginEnd="@dimen/dp_10"
-                        android:src="@drawable/ic_to_wxchat"
-                        app:layout_constraintRight_toRightOf="parent"
-                        app:layout_constraintTop_toTopOf="parent">
-
-                    </ImageView>
-
-                    <com.qmuiteam.qmui.widget.QMUIRadiusImageView
-                        android:id="@+id/iv_user_avater"
-                        android:layout_width="50dp"
-                        android:layout_height="50dp"
                         android:layout_marginStart="@dimen/dp_10"
-                        android:layout_marginTop="20dp"
-                        android:src="@drawable/ic_math"
-                        app:layout_constraintLeft_toLeftOf="parent"
-                        app:layout_constraintTop_toBottomOf="@id/tv_title"
-                        app:qmui_is_circle="true">
+                        android:layout_marginTop="10dp"
+                        tools:text="郑货主" />
+
+                </LinearLayout >
 
-                    </com.qmuiteam.qmui.widget.QMUIRadiusImageView>
+                <LinearLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:gravity="center"
+
+                    android:orientation="vertical" >
+
+                    <ImageView
+                        android:layout_width="60dp"
+                        android:layout_height="60dp"
+                        android:src="@drawable/ic_math" ></ImageView >
 
                     <TextView
-                        android:id="@+id/tv_user_name"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/dp_10"
-                        android:layout_marginTop="20dp"
-                        app:layout_constraintLeft_toRightOf="@id/iv_user_avater"
-                        app:layout_constraintTop_toBottomOf="@id/tv_title"
-                        tools:text="郑货主">
+                        android:layout_marginTop="10dp"
+                        tools:text="郑货主" />
+
+                </LinearLayout >
+
+                <LinearLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:orientation="vertical" >
 
-                    </TextView>
+                    <ImageView
+                        android:layout_width="60dp"
+                        android:layout_height="60dp"
+                        android:src="@drawable/ic_math" ></ImageView >
 
                     <TextView
-                        android:id="@+id/tv_user_mobile"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_marginStart="@dimen/dp_10"
                         android:layout_marginTop="10dp"
-                        app:layout_constraintLeft_toRightOf="@id/iv_user_avater"
-                        app:layout_constraintTop_toBottomOf="@id/tv_user_name"
-                        tools:text="18353965350">
-
-                    </TextView>
-
-
-                    <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
-                        android:layout_width="80dp"
-                        android:layout_height="40dp"
-                        android:layout_marginTop="20dp"
-                        android:layout_marginEnd="@dimen/dp_10"
-                        android:text="未认证"
-                        android:textColor="#459AEA"
-                        app:layout_constraintRight_toRightOf="parent"
-                        app:layout_constraintTop_toBottomOf="@id/tv_title"
-                        app:qmui_backgroundColor="#E8F1FB"
-                        app:qmui_borderColor="#459AEA"
-                        app:qmui_radius="@dimen/dp_4" />
-
-
-                    <com.qmuiteam.qmui.layout.QMUILinearLayout
-                        android:id="@+id/ll_center"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginStart="10dp"
-                        android:layout_marginTop="@dimen/dp_20"
-                        android:layout_marginEnd="10dp"
-                        android:background="@color/white"
-                        android:orientation="horizontal"
-                        android:paddingTop="15dp"
-                        android:paddingBottom="20dp"
-                        app:layout_constraintLeft_toLeftOf="parent"
-                        app:layout_constraintRight_toRightOf="parent"
-                        app:layout_constraintTop_toBottomOf="@id/iv_user_avater"
-                        app:qmui_radius="10dp"
-                        app:qmui_shadowAlpha="0.56"
-                        app:qmui_shadowElevation="7dp">
-
-                        <LinearLayout
-                            android:layout_width="0dp"
-                            android:layout_height="wrap_content"
-                            android:layout_weight="1"
-                            android:gravity="center"
-                            android:orientation="vertical">
-
-                            <ImageView
-                                android:layout_width="60dp"
-                                android:layout_height="60dp"
-                                android:src="@drawable/ic_math"></ImageView>
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginStart="@dimen/dp_10"
-                                android:layout_marginTop="10dp"
-                                tools:text="郑货主" />
-
-
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:layout_width="0dp"
-                            android:layout_height="wrap_content"
-                            android:layout_weight="1"
-                            android:gravity="center"
-
-                            android:orientation="vertical">
-
-                            <ImageView
-                                android:layout_width="60dp"
-                                android:layout_height="60dp"
-                                android:src="@drawable/ic_math"></ImageView>
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginStart="@dimen/dp_10"
-                                android:layout_marginTop="10dp"
-                                tools:text="郑货主" />
-
-
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:layout_width="0dp"
-                            android:layout_height="wrap_content"
-                            android:layout_weight="1"
-                            android:gravity="center"
-                            android:orientation="vertical">
-
-                            <ImageView
-                                android:layout_width="60dp"
-                                android:layout_height="60dp"
-                                android:src="@drawable/ic_math"></ImageView>
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginStart="@dimen/dp_10"
-                                android:layout_marginTop="10dp"
-                                tools:text="郑货主" />
-
-
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:layout_width="0dp"
-                            android:layout_height="wrap_content"
-                            android:layout_weight="1"
-                            android:gravity="center"
-                            android:orientation="vertical">
-
-                            <ImageView
-                                android:layout_width="60dp"
-                                android:layout_height="60dp"
-                                android:src="@drawable/ic_math"></ImageView>
-
-                            <TextView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginStart="@dimen/dp_10"
-                                android:layout_marginTop="10dp"
-                                tools:text="郑货主" />
-
-
-                        </LinearLayout>
-
-
-                    </com.qmuiteam.qmui.layout.QMUILinearLayout>
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="10dp"
-                        android:orientation="vertical"
-                        app:layout_constraintLeft_toLeftOf="parent"
-                        app:layout_constraintRight_toRightOf="parent"
-                        app:layout_constraintTop_toBottomOf="@id/ll_center">
+                        tools:text="郑货主" />
 
+                </LinearLayout >
 
-                        <LinearLayout
-                            style="@style/mine_list"
-                            android:layout_marginTop="4dp"
-                           >
+                <LinearLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:orientation="vertical" >
 
-                            <ImageView
-                                style="@style/mine_img"
-                                android:layout_width="wrap_content"
-                                android:src="@drawable/mine_update" />
+                    <ImageView
+                        android:layout_width="60dp"
+                        android:layout_height="60dp"
+                        android:src="@drawable/ic_math" ></ImageView >
 
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginStart="@dimen/dp_10"
+                        android:layout_marginTop="10dp"
+                        tools:text="郑货主" />
 
-                            <TextView
-                                style="@style/mine_text"
-                                android:text="我的评价" />
+                </LinearLayout >
 
-                            <ImageView
-                                style="@style/mine_arrow_right"
-                                android:src="@drawable/mine_right" />
+            </com.qmuiteam.qmui.layout.QMUILinearLayout >
 
-                        </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:orientation="vertical"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/ll_center" >
 
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="#DDDDDD"
-                            android:visibility="visible">
+                <LinearLayout
+                    style="@style/mine_list"
+                    android:layout_marginTop="4dp" >
 
-                        </View>
+                    <ImageView
+                        style="@style/mine_img"
+                        android:layout_width="wrap_content"
+                        android:src="@drawable/mine_update" />
 
-                        <LinearLayout
-                            style="@style/mine_list"
-                            >
+                    <TextView
+                        style="@style/mine_text"
+                        android:text="我的评价" />
 
-                            <ImageView
-                                style="@style/mine_img"
-                                android:layout_width="wrap_content"
-                                android:src="@drawable/mine_update" />
+                    <ImageView
+                        style="@style/mine_arrow_right"
+                        android:src="@drawable/mine_right" />
 
+                </LinearLayout >
 
-                            <TextView
-                                style="@style/mine_text"
-                                android:text="地址薄" />
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="#DDDDDD"
+                    android:visibility="visible" >
 
-                            <ImageView
-                                style="@style/mine_arrow_right"
-                                android:src="@drawable/mine_right" />
+                </View >
 
-                        </LinearLayout>
+                <LinearLayout style="@style/mine_list" >
 
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="#DDDDDD"
-                            android:visibility="visible">
+                    <ImageView
+                        style="@style/mine_img"
+                        android:layout_width="wrap_content"
+                        android:src="@drawable/mine_update" />
 
-                        </View>
+                    <TextView
+                        style="@style/mine_text"
+                        android:text="地址薄" />
 
-                        <LinearLayout
-                            style="@style/mine_list"
-                           >
+                    <ImageView
+                        style="@style/mine_arrow_right"
+                        android:src="@drawable/mine_right" />
 
-                            <ImageView
-                                style="@style/mine_img"
-                                android:layout_width="wrap_content"
-                                android:src="@drawable/mine_update" />
+                </LinearLayout >
 
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="#DDDDDD"
+                    android:visibility="visible" >
 
-                            <TextView
-                                style="@style/mine_text"
-                                android:text="设置" />
+                </View >
 
-                            <ImageView
-                                style="@style/mine_arrow_right"
-                                android:src="@drawable/mine_right" />
+                <LinearLayout style="@style/mine_list" >
 
-                        </LinearLayout>
+                    <ImageView
+                        style="@style/mine_img"
+                        android:layout_width="wrap_content"
+                        android:src="@drawable/mine_update" />
 
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="#DDDDDD"
-                            android:visibility="visible">
+                    <TextView
+                        style="@style/mine_text"
+                        android:text="设置" />
 
-                        </View>
+                    <ImageView
+                        style="@style/mine_arrow_right"
+                        android:src="@drawable/mine_right" />
 
-                        <LinearLayout
-                            style="@style/mine_list"
-                            android:onClick="@{v->vm.checkUpdates()}"
+                </LinearLayout >
 
-                            >
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="#DDDDDD"
+                    android:visibility="visible" >
 
-                            <ImageView
-                                style="@style/mine_img"
-                                android:layout_width="wrap_content"
-                                android:src="@drawable/mine_update" />
+                </View >
 
+                <LinearLayout
+                    style="@style/mine_list"
+                    android:onClick="@{v->vm.checkUpdates()}"
 
-                            <TextView
-                                style="@style/mine_text"
-                                android:text="检查更新" />
+                    >
 
-                            <ImageView
-                                style="@style/mine_arrow_right"
-                                android:src="@drawable/mine_right" />
+                    <ImageView
+                        style="@style/mine_img"
+                        android:layout_width="wrap_content"
+                        android:src="@drawable/mine_update" />
 
-                        </LinearLayout>
+                    <TextView
+                        style="@style/mine_text"
+                        android:text="检查更新" />
 
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="#DDDDDD"
-                            android:visibility="visible">
+                    <ImageView
+                        style="@style/mine_arrow_right"
+                        android:src="@drawable/mine_right" />
 
-                        </View>
+                </LinearLayout >
 
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="1dp"
+                    android:background="#DDDDDD"
+                    android:visibility="visible" >
 
-                        <TextView
-                            style="@style/mine_text"
-                            android:layout_gravity="center"
-                            android:layout_marginTop="60dp"
-                            android:text="平台联系方式:1835397689" />
+                </View >
 
-                    </LinearLayout>
+                <TextView
+                    style="@style/mine_text"
+                    android:layout_gravity="center"
+                    android:layout_marginTop="60dp"
+                    android:text="平台联系方式:1835397689" />
 
+            </LinearLayout >
 
-                </androidx.constraintlayout.widget.ConstraintLayout>
-            </ScrollView>
-        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
-    </androidx.constraintlayout.widget.ConstraintLayout>
-</layout>
+        </androidx.constraintlayout.widget.ConstraintLayout >
+    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout >
+</layout >