Pārlūkot izejas kodu

异步加载布局的一些自定义View封装

liukai 2 gadi atpakaļ
vecāks
revīzija
a24d2ae3b9

+ 77 - 10
cpt_parttime/src/main/java/com/hongyegroup/cpt_parttime/ui/main/PartTimeProfileFragment.kt

@@ -2,22 +2,31 @@ package com.hongyegroup.cpt_parttime.ui.main
 
 import android.os.Bundle
 import android.view.View
+import androidx.databinding.DataBindingUtil
+import androidx.lifecycle.lifecycleScope
 import com.guadou.cs_cptservices.base.fragment.YYBaseVDBLoadingFragment
 import com.guadou.cs_cptservices.interfaces.IFragmentRefresh
 import com.guadou.lib_baselib.bean.DataBindingConfig
 import com.guadou.lib_baselib.utils.CommUtils
+import com.guadou.lib_baselib.utils.log.YYLogUtils
 import com.guadou.lib_baselib.view.gloading.GLoadingTitleStatus
 import com.guadou.lib_baselib.view.gloading.Gloading
 import com.guadou.lib_baselib.view.gloading.GloadingGlobalAdapter
 import com.hongyegroup.cpt_parttime.BR
 import com.hongyegroup.cpt_parttime.R
 import com.hongyegroup.cpt_parttime.databinding.FragmentParttimeJobProfileBinding
+import com.hongyegroup.cpt_parttime.databinding.IncludePensonalTurnUpRateBinding
 import com.hongyegroup.cpt_parttime.mvvm.PartJobProfileViewModel
 import com.hongyegroup.cpt_parttime.ui.PartJobEditProfileInfoActivity
 import com.hongyegroup.cpt_parttime.widget.UserUrgentAlertPopup
 import com.lxj.xpopup.XPopup
 import com.scwang.smart.refresh.layout.api.RefreshLayout
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.async
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.launch
+
 
 /**
  * 兼职个人信息页面
@@ -25,9 +34,13 @@ import com.scwang.smart.refresh.layout.listener.OnRefreshListener
 class PartTimeProfileFragment : YYBaseVDBLoadingFragment<PartJobProfileViewModel, FragmentParttimeJobProfileBinding>(), IFragmentRefresh,
     OnRefreshListener {
 
+    val clickProxy by lazy { ClickProxy() }
+    var mUserProfile: String? = null
+    var mRootBinding: IncludePensonalTurnUpRateBinding? = null
+
     override fun getDataBindingConfig(): DataBindingConfig {
         return DataBindingConfig(R.layout.fragment_parttime_job_profile, BR.viewModel, mViewModel)
-            .addBindingParams(BR.click, ClickProxy())
+            .addBindingParams(BR.click, clickProxy)
     }
 
     //重新生成GLoading对象-跳动动画
@@ -42,26 +55,80 @@ class PartTimeProfileFragment : YYBaseVDBLoadingFragment<PartJobProfileViewModel
 
     override fun init(savedInstanceState: Bundle?) {
         initData()
+//        inflateRootAndData()
         initListener()
     }
 
+    //异步加载真正的布局
+    private fun inflateRootAndData() {
+
+        showStateLoading()
+
+        lifecycleScope.launch {
+
+            val start = System.currentTimeMillis()
+
+            val rootView = async(Dispatchers.IO) {
+                YYLogUtils.w("开始异步加载真正的跟视图")
+                val view = layoutInflater.inflate(R.layout.include_pensonal_turn_up_rate, null)
+
+                val end = System.currentTimeMillis()
+
+                YYLogUtils.w("加载真正布局耗时:" + (end - start))
+
+                view
+            }
+
+            val request = async {
+                YYLogUtils.w("开始请求用户详情数据")
+                delay(1500)
+                true
+            }
+
+            if (request.await() && rootView.await() != null) {
+                val start1 = System.currentTimeMillis()
+                mBinding.llRootContainer.addView(rootView.await(), 0)
+                val end1 = System.currentTimeMillis()
+                YYLogUtils.w("添加布局耗时:" + (end1 - start1))
+                showStateSuccess()
+
+                //展示数据
+            }
+
+        }
+    }
+
 
     private fun initData() {
         showStateLoading()
+
+        YYLogUtils.w("开始异步加载真正的跟视图")
+        if (!mBinding.viewStubRoot.isInflate()) {
+            mBinding.viewStubRoot.inflateAsync { view ->
+                mRootBinding = DataBindingUtil.bind<IncludePensonalTurnUpRateBinding>(view)?.apply {
+                    click = clickProxy
+                }
+
+                popupData2View()
+            }
+        }
+
+
+        YYLogUtils.w("开始请求用户详情数据")
         CommUtils.getHandler().postDelayed({
+            mUserProfile = "xxx"
             showStateSuccess()
+            popupData2View()
+        }, 1200)
+    }
 
-//            popupPartTimeProfile()
-        }, 1500)
+    private fun popupData2View() {
+        if (mUserProfile != null && mRootBinding != null) {
+            mRootBinding!!.turnUpProgress.setValue("60", 100F)
+        }
     }
 
-//    private fun popupPartTimeProfile() {
-//        val mRatingView = mBinding.viewStubRating.viewStub?.inflate()
-//
-//        val mRateBinding = DataBindingUtil.bind<IncludePensonalTurnUpRateBinding>(mRatingView!!)
-//
-//        mRateBinding?.turnUpProgress?.setValue("60", 100f)
-//    }
+
 
     override fun onGoadingRetry() {
 

+ 11 - 575
cpt_parttime/src/main/res/layout/fragment_parttime_job_profile.xml

@@ -65,592 +65,28 @@
                 android:overScrollMode="never">
 
                 <LinearLayout
+                    android:id="@+id/ll_root_container"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:background="#FAFDFF"
                     android:orientation="vertical">
 
-                    <!--    头部     -->
-                    <FrameLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content">
-
-                        <!--     弧形的渐变    -->
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="@dimen/d_120dp"
-                            android:background="@drawable/shape_gradient_proifle_title_bottom" />
-
-                        <!--   顶部的信息框展示   -->
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_5dp"
-                            android:layout_marginRight="@dimen/d_5dp"
-                            android:background="@drawable/profile_white_shadow_comm_bg"
-                            android:orientation="horizontal">
-
-                            <com.guadou.lib_baselib.view.CircleImageView
-                                android:id="@+id/image_view_profile_photo"
-                                android:layout_width="@dimen/d_70dp"
-                                android:layout_height="@dimen/d_70dp"
-                                android:layout_marginLeft="@dimen/d_20dp"
-                                android:layout_marginTop="@dimen/d_30dp"
-                                android:scaleType="centerCrop"
-                                android:src="@drawable/im_default_head"
-                                app:civ_border_color="@color/white"
-                                app:civ_border_overlay="true"
-                                app:civ_border_width="@dimen/d_1dp" />
-
-
-                            <LinearLayout
-                                android:layout_width="0dp"
-                                android:layout_height="wrap_content"
-                                android:layout_marginLeft="@dimen/d_18dp"
-                                android:layout_marginTop="@dimen/d_25dp"
-                                android:layout_marginRight="@dimen/d_15dp"
-                                android:layout_marginBottom="@dimen/d_26dp"
-                                android:layout_weight="1"
-                                android:orientation="vertical">
-
-                                <com.guadou.lib_baselib.font_text_view.TextViewBold
-                                    android:id="@+id/text_view_full_name"
-                                    android:layout_width="wrap_content"
-                                    android:layout_height="wrap_content"
-                                    android:textColor="@color/profile_black_28394a"
-                                    android:textSize="24sp"
-                                    tools:text="Lisa Yang" />
-
-
-                                <com.guadou.lib_baselib.font_text_view.TextViewRegular
-                                    android:id="@+id/text_view_email_address"
-                                    android:layout_width="match_parent"
-                                    android:layout_height="wrap_content"
-                                    android:layout_gravity="center_horizontal"
-                                    android:layout_marginTop="@dimen/d_2dp"
-                                    android:textColor="#8098B2"
-                                    android:textSize="13.8dp"
-                                    tools:text="Fangyuan@hongyegroup.com" />
-
-                                <com.guadou.lib_baselib.font_text_view.TextViewRegular
-                                    android:id="@+id/text_view_joined_date"
-                                    android:layout_width="match_parent"
-                                    android:layout_height="wrap_content"
-                                    android:layout_gravity="center_horizontal"
-                                    android:layout_marginTop="@dimen/d_2dp"
-                                    android:textColor="#8098B2"
-                                    android:textSize="13.8dp"
-                                    tools:text="10,May 2020" />
-
-                                <LinearLayout
-                                    android:id="@+id/ll_profile_me_detail_point"
-                                    android:layout_width="wrap_content"
-                                    android:layout_height="wrap_content"
-                                    android:layout_marginTop="@dimen/d_6dp"
-                                    android:orientation="horizontal">
-
-
-                                    <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                        android:id="@+id/text_view_profile_points"
-                                        android:layout_width="105dp"
-                                        android:layout_height="25dp"
-                                        android:background="@drawable/shape_5round_main_blue"
-                                        android:gravity="center"
-                                        android:text="- Credits"
-                                        android:textColor="@color/white"
-                                        android:textSize="13.5dp" />
-
-                                    <ImageView
-                                        android:id="@+id/button_help_points"
-                                        android:layout_width="wrap_content"
-                                        android:layout_height="wrap_content"
-                                        android:layout_gravity="center_vertical"
-                                        android:layout_marginLeft="@dimen/d_9dp"
-                                        android:contentDescription="-"
-                                        android:src="@drawable/help_blue" />
-
-                                </LinearLayout>
-
-
-                            </LinearLayout>
-
-                        </LinearLayout>
-
-                    </FrameLayout>
-
-                    <!--Status-->
-                    <LinearLayout
-                        android:id="@+id/ll_profile_me_detail_status"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="@dimen/d_5dp"
-                        android:layout_marginRight="@dimen/d_5dp"
-                        android:background="@drawable/profile_white_shadow_comm_bg"
-                        android:orientation="vertical"
-                        android:paddingTop="@dimen/d_20dp"
-                        android:paddingBottom="@dimen/d_20dp"
-                        binding:clicks="@{click.editProfileInfo}">
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:gravity="center_vertical"
-                            android:orientation="horizontal">
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginLeft="@dimen/d_25dp"
-                                android:layout_marginRight="@dimen/d_10dp"
-                                android:drawableLeft="@drawable/iv_profile_status_icon"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:text="您的账户状态:"
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp"
-                                tools:text="You account status: " />
-
-                            <TextView
-                                android:id="@+id/tv_profile_me_detail_user_status"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:text="-"
-                                android:textColor="@color/green"
-                                android:textSize="@dimen/d_14sp" />
-
-                        </LinearLayout>
-
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/text_view_additional_info_reject"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_10dp"
-                            android:layout_marginRight="@dimen/d_23dp"
-                            android:background="@drawable/shape_gray_3round"
-                            android:paddingLeft="33dp"
-                            android:paddingTop="@dimen/d_10dp"
-                            android:paddingRight="33dp"
-                            android:paddingBottom="@dimen/d_10dp"
-                            android:text="原因"
-                            android:textColor="#8098B2"
-                            android:textSize="@dimen/d_14sp"
-                            android:visibility="visible" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/text_view_additional_info"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_25dp"
-                            android:layout_marginTop="@dimen/d_10dp"
-                            android:layout_marginRight="@dimen/d_10dp"
-                            android:drawableLeft="@drawable/iv_profile_additional_info_icon"
-                            android:drawablePadding="@dimen/d_12dp"
-                            android:text="- >"
-                            android:textColor="#FFC000"
-                            android:textSize="@dimen/d_14sp" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/btn_urgent"
-                            android:layout_width="match_parent"
-                            android:layout_height="@dimen/d_35dp"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_15dp"
-                            android:layout_marginRight="@dimen/d_23dp"
-                            android:layout_marginBottom="@dimen/d_10dp"
-                            android:background="@drawable/selector_app_blue_button_round5_bg"
-                            android:gravity="center"
-                            android:text="加急"
-                            android:textColor="@color/white"
-                            android:textSize="@dimen/d_15sp"
-                            android:visibility="visible"
-                            binding:clicks="@{click.userUrgent}" />
-
-                    </LinearLayout>
-
-                    <!--    基本信息     -->
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="@dimen/d_5dp"
-                        android:layout_marginRight="@dimen/d_5dp"
-                        android:background="@drawable/profile_white_shadow_comm_bg"
-                        android:orientation="vertical"
-                        android:paddingTop="@dimen/d_25dp"
-                        android:paddingBottom="@dimen/d_38dp">
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewBold
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:text="个人信息"
-                            android:textColor="@color/profile_black_28394a"
-                            android:textSize="17dp" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/text_view_name"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_20dp"
-                            android:layout_marginRight="@dimen/d_10dp"
-                            android:drawableLeft="@drawable/profile_detail_name_icon"
-                            android:drawablePadding="@dimen/d_12dp"
-                            android:text="@string/null_data"
-                            android:textColor="@color/profile_black_8098b2"
-                            android:textSize="@dimen/d_14sp"
-                            tools:text="Lisa Yang" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/text_view_email_address_below"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_20dp"
-                            android:layout_marginRight="@dimen/d_10dp"
-                            android:drawableLeft="@drawable/profile_detail_email_icon"
-                            android:drawablePadding="@dimen/d_12dp"
-                            android:text="@string/null_data"
-                            android:textColor="@color/profile_black_8098b2"
-                            android:textSize="@dimen/d_14sp" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/text_view_mobile_number"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_20dp"
-                            android:layout_marginRight="@dimen/d_10dp"
-                            android:drawableLeft="@drawable/profile_detail_phone_icon"
-                            android:drawablePadding="@dimen/d_12dp"
-                            android:text="@string/null_data"
-                            android:textColor="@color/profile_black_8098b2"
-                            android:textSize="@dimen/d_14sp" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/text_view_nric_no"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_20dp"
-                            android:layout_marginRight="@dimen/d_10dp"
-                            android:drawableLeft="@drawable/profile_detail_nric_icon"
-                            android:drawablePadding="@dimen/d_12dp"
-                            android:text="@string/null_data"
-                            android:textColor="@color/profile_black_8098b2"
-                            android:textSize="@dimen/d_14sp" />
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/text_view_nationality"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_20dp"
-                            android:layout_marginRight="@dimen/d_10dp"
-                            android:drawableLeft="@drawable/profile_detail_lang_icon"
-                            android:drawablePadding="@dimen/d_12dp"
-                            android:text="@string/null_data"
-                            android:textColor="@color/profile_black_8098b2"
-                            android:textSize="@dimen/d_14sp" />
 
-                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                            android:id="@+id/tv_rate"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_20dp"
-                            android:layout_marginRight="@dimen/d_10dp"
-                            android:drawableLeft="@drawable/profile_detail_rate_icon"
-                            android:drawablePadding="@dimen/d_12dp"
-                            android:text="@string/null_data"
-                            android:textColor="@color/profile_black_8098b2"
-                            android:textSize="@dimen/d_14sp" />
 
 
-                        <LinearLayout
-                            android:id="@+id/rl_request_view_profile_total_hours"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/d_20dp"
-                            android:gravity="center_vertical"
-                            android:orientation="horizontal"
-                            android:visibility="visible">
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginLeft="@dimen/d_23dp"
-                                android:drawableLeft="@drawable/profile_detail_hours_icon"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:text="Total Hours: "
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_request_view_profile_total_hours"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:text="1024"
-                                android:textColor="@color/app_blue"
-                                android:textSize="@dimen/d_14sp" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_marginLeft="@dimen/d_3dp"
-                                android:text="Hrs"
-                                android:textColor="@color/gray_text"
-                                android:textSize="@dimen/d_15sp" />
-
-
-                            <View
-                                android:layout_width="0dp"
-                                android:layout_height="1dp"
-                                android:layout_weight="1" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_profile_rules"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_centerVertical="true"
-                                android:layout_marginRight="@dimen/d_10dp"
-                                android:layout_toLeftOf="@id/iv_total_hours_arrow"
-                                android:text="Rules"
-                                android:textColor="@color/app_blue"
-                                android:textSize="14.5sp" />
-
-                            <ImageView
-                                android:id="@+id/iv_total_hours_arrow"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_alignParentRight="true"
-                                android:layout_centerVertical="true"
-                                android:layout_marginRight="@dimen/d_15dp"
-                                android:src="@drawable/back_more_black" />
-
-                        </LinearLayout>
-
-                    </LinearLayout>
-
-                    <!-- 技能的选择 -->
-                    <LinearLayout
-                        android:id="@+id/ll_edit_profile_work_type"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="@dimen/d_5dp"
-                        android:layout_marginRight="@dimen/d_5dp"
-                        android:background="@drawable/profile_white_shadow_comm_bg"
-                        android:orientation="vertical"
-                        android:paddingTop="@dimen/d_25dp"
-                        android:paddingBottom="@dimen/d_38dp">
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:gravity="center_vertical"
-                            android:orientation="horizontal">
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewBold
-                                android:layout_width="0dp"
-                                android:layout_height="wrap_content"
-                                android:layout_marginLeft="@dimen/d_23dp"
-                                android:layout_weight="1"
-                                android:text="技能"
-                                android:textColor="@color/profile_black_28394a"
-                                android:textSize="17dp" />
-
-                            <ImageView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_alignParentRight="true"
-                                android:layout_centerVertical="true"
-                                android:layout_marginRight="@dimen/d_15dp"
-                                android:src="@drawable/back_more_black"
-                                app:tint="@color/gray_8098B2"
-                                tools:tint="@color/gray_8098B2" />
-
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:id="@+id/ll_edit_profile_work_type1"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/d_15dp"
-                            android:orientation="vertical"
-                            android:paddingLeft="@dimen/d_23dp"
-                            android:visibility="visible">
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_edit_profile_work_type1"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_weight="1"
-                                android:drawableLeft="@drawable/profile_detail_skill_icon1"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:paddingBottom="@dimen/d_10dp"
-                                android:text="Clean Service"
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp"
-                                android:visibility="gone" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_edit_profile_work_type2"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_marginTop="@dimen/d_10dp"
-                                android:layout_weight="1"
-                                android:drawableLeft="@drawable/profile_detail_skill_icon2"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:paddingBottom="@dimen/d_10dp"
-                                android:text="Business"
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp"
-                                android:visibility="gone" />
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:id="@+id/ll_edit_profile_work_type2"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/d_10dp"
-                            android:orientation="vertical"
-                            android:paddingLeft="@dimen/d_23dp"
-                            android:visibility="visible">
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_edit_profile_work_type3"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_weight="1"
-                                android:drawableLeft="@drawable/profile_detail_skill_icon3"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:paddingBottom="@dimen/d_10dp"
-                                android:text="Finance"
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp"
-                                android:visibility="gone" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_edit_profile_work_type4"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_marginTop="@dimen/d_10dp"
-                                android:layout_weight="1"
-                                android:drawableLeft="@drawable/profile_detail_skill_icon4"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:paddingBottom="@dimen/d_10dp"
-                                android:text="Food &#38; Banquet"
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp"
-                                android:visibility="gone" />
-                        </LinearLayout>
-
-                        <LinearLayout
-                            android:id="@+id/ll_edit_profile_work_type3"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginTop="@dimen/d_10dp"
-                            android:orientation="vertical"
-                            android:paddingLeft="@dimen/d_23dp"
-                            android:visibility="visible"
-                            android:weightSum="2">
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_edit_profile_work_type5"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_weight="1"
-                                android:drawableLeft="@drawable/profile_detail_skill_icon5"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:paddingBottom="@dimen/d_15dp"
-                                android:text="Recruitment"
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp"
-                                android:visibility="gone" />
-
-                            <com.guadou.lib_baselib.font_text_view.TextViewMedium
-                                android:id="@+id/tv_edit_profile_work_type6"
-                                android:layout_width="match_parent"
-                                android:layout_height="wrap_content"
-                                android:layout_weight="1"
-                                android:drawableLeft="@drawable/profile_detail_skill_icon6"
-                                android:drawablePadding="@dimen/d_12dp"
-                                android:text="Recruitment"
-                                android:textColor="@color/profile_black_8098b2"
-                                android:textSize="@dimen/d_14sp"
-                                android:visibility="gone" />
-
-                        </LinearLayout>
+                    <!--  个人信息的到达率等懒加载信息   -->
+<!--                    <ViewStub-->
+<!--                        android:id="@+id/view_stub_rating"-->
+<!--                        android:layout_width="match_parent"-->
+<!--                        android:layout_height="match_parent"-->
+<!--                        android:layout="@layout/include_pensonal_turn_up_rate" />-->
 
-                    </LinearLayout>
 
-                    <!--  证书  -->
-                    <LinearLayout
+                    <com.guadou.cs_cptservices.widget.AsyncViewStub
+                        android:id="@+id/view_stub_root"
                         android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginLeft="@dimen/d_5dp"
-                        android:layout_marginRight="@dimen/d_5dp"
-                        android:background="@drawable/profile_white_shadow_comm_bg"
-                        android:orientation="vertical"
-                        android:paddingTop="@dimen/d_25dp"
-                        android:paddingBottom="@dimen/d_38dp">
-
-                        <com.guadou.lib_baselib.font_text_view.TextViewBold
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:text="食品证书"
-                            android:textColor="@color/profile_black_28394a"
-                            android:textSize="17dp" />
-
-
-                        <FrameLayout
-                            android:id="@+id/fl_certificate_box"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="@dimen/d_23dp"
-                            android:layout_marginTop="@dimen/d_17dp">
-
-                            <ImageView
-                                android:id="@+id/iv_certificate_img"
-                                android:layout_width="98dp"
-                                android:layout_height="98dp"
-                                android:layout_gravity="center"
-                                android:background="#F0F2F9" />
-
-                            <ImageView
-                                android:id="@+id/iv_upload_empty"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_gravity="center"
-                                android:src="@drawable/profile_edit_cert_empty_img"
-                                android:visibility="visible" />
-
-                            <ImageView
-                                android:id="@+id/iv_certificate_img_delete"
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_gravity="right|top"
-                                android:layout_marginLeft="95dp"
-                                android:paddingLeft="@dimen/d_5dp"
-                                android:paddingTop="-10dp"
-                                android:paddingRight="@dimen/d_5dp"
-                                android:paddingBottom="@dimen/d_5dp"
-                                android:src="@drawable/profile_edit_cert_delete"
-                                android:visibility="visible" />
-
-                        </FrameLayout>
-
-
-                    </LinearLayout>
-
-                    <!--  个人信息的到达率等懒加载信息   -->
-                    <!--                    <ViewStub-->
-                    <!--                        android:id="@+id/view_stub_rating"-->
-                    <!--                        android:layout_width="match_parent"-->
-                    <!--                        android:layout_height="match_parent"-->
-                    <!--                        android:layout="@layout/include_pensonal_turn_up_rate"-->
-                    <!--                        />-->
+                        app:layout="@layout/include_pensonal_turn_up_rate"
+                        android:layout_height="wrap_content"/>
 
                     <View
                         android:layout_width="1dp"

+ 580 - 4
cpt_parttime/src/main/res/layout/include_pensonal_turn_up_rate.xml

@@ -6,14 +6,590 @@
 
     <data>
 
+        <variable
+            name="click"
+            type="com.hongyegroup.cpt_parttime.ui.main.PartTimeProfileFragment.ClickProxy" />
+
     </data>
 
-    <RelativeLayout
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+
+        <!--    头部     -->
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <!--     弧形的渐变    -->
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/d_120dp"
+                android:background="@drawable/shape_gradient_proifle_title_bottom" />
+
+            <!--   顶部的信息框展示   -->
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_5dp"
+                android:layout_marginRight="@dimen/d_5dp"
+                android:background="@drawable/profile_white_shadow_comm_bg"
+                android:orientation="horizontal">
+
+                <com.guadou.lib_baselib.view.CircleImageView
+                    android:id="@+id/image_view_profile_photo"
+                    android:layout_width="@dimen/d_70dp"
+                    android:layout_height="@dimen/d_70dp"
+                    android:layout_marginLeft="@dimen/d_20dp"
+                    android:layout_marginTop="@dimen/d_30dp"
+                    android:scaleType="centerCrop"
+                    android:src="@drawable/im_default_head"
+                    app:civ_border_color="@color/white"
+                    app:civ_border_overlay="true"
+                    app:civ_border_width="@dimen/d_1dp" />
+
+
+                <LinearLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/d_18dp"
+                    android:layout_marginTop="@dimen/d_25dp"
+                    android:layout_marginRight="@dimen/d_15dp"
+                    android:layout_marginBottom="@dimen/d_26dp"
+                    android:layout_weight="1"
+                    android:orientation="vertical">
+
+                    <com.guadou.lib_baselib.font_text_view.TextViewBold
+                        android:id="@+id/text_view_full_name"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textColor="@color/profile_black_28394a"
+                        android:textSize="24sp"
+                        tools:text="Lisa Yang" />
+
+
+                    <com.guadou.lib_baselib.font_text_view.TextViewRegular
+                        android:id="@+id/text_view_email_address"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:layout_marginTop="@dimen/d_2dp"
+                        android:textColor="#8098B2"
+                        android:textSize="13.8dp"
+                        tools:text="Fangyuan@hongyegroup.com" />
+
+                    <com.guadou.lib_baselib.font_text_view.TextViewRegular
+                        android:id="@+id/text_view_joined_date"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_horizontal"
+                        android:layout_marginTop="@dimen/d_2dp"
+                        android:textColor="#8098B2"
+                        android:textSize="13.8dp"
+                        tools:text="10,May 2020" />
+
+                    <LinearLayout
+                        android:id="@+id/ll_profile_me_detail_point"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="@dimen/d_6dp"
+                        android:orientation="horizontal">
+
+
+                        <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                            android:id="@+id/text_view_profile_points"
+                            android:layout_width="105dp"
+                            android:layout_height="25dp"
+                            android:background="@drawable/shape_5round_main_blue"
+                            android:gravity="center"
+                            android:text="- Credits"
+                            android:textColor="@color/white"
+                            android:textSize="13.5dp" />
+
+                        <ImageView
+                            android:id="@+id/button_help_points"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginLeft="@dimen/d_9dp"
+                            android:contentDescription="-"
+                            android:src="@drawable/help_blue" />
+
+                    </LinearLayout>
+
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </FrameLayout>
+
+        <!--Status-->
+        <LinearLayout
+            android:id="@+id/ll_profile_me_detail_status"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/d_5dp"
+            android:layout_marginRight="@dimen/d_5dp"
+            android:background="@drawable/profile_white_shadow_comm_bg"
+            android:orientation="vertical"
+            android:paddingTop="@dimen/d_20dp"
+            android:paddingBottom="@dimen/d_20dp"
+            binding:clicks="@{click.editProfileInfo}">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/d_25dp"
+                    android:layout_marginRight="@dimen/d_10dp"
+                    android:drawableLeft="@drawable/iv_profile_status_icon"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:text="您的账户状态:"
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp"
+                    tools:text="You account status: " />
+
+                <TextView
+                    android:id="@+id/tv_profile_me_detail_user_status"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="-"
+                    android:textColor="@color/green"
+                    android:textSize="@dimen/d_14sp" />
+
+            </LinearLayout>
+
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/text_view_additional_info_reject"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_10dp"
+                android:layout_marginRight="@dimen/d_23dp"
+                android:background="@drawable/shape_gray_3round"
+                android:paddingLeft="33dp"
+                android:paddingTop="@dimen/d_10dp"
+                android:paddingRight="33dp"
+                android:paddingBottom="@dimen/d_10dp"
+                android:text="原因"
+                android:textColor="#8098B2"
+                android:textSize="@dimen/d_14sp"
+                android:visibility="visible" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/text_view_additional_info"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_25dp"
+                android:layout_marginTop="@dimen/d_10dp"
+                android:layout_marginRight="@dimen/d_10dp"
+                android:drawableLeft="@drawable/iv_profile_additional_info_icon"
+                android:drawablePadding="@dimen/d_12dp"
+                android:text="- >"
+                android:textColor="#FFC000"
+                android:textSize="@dimen/d_14sp" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/btn_urgent"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/d_35dp"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_15dp"
+                android:layout_marginRight="@dimen/d_23dp"
+                android:layout_marginBottom="@dimen/d_10dp"
+                android:background="@drawable/selector_app_blue_button_round5_bg"
+                android:gravity="center"
+                android:text="加急"
+                android:textColor="@color/white"
+                android:textSize="@dimen/d_15sp"
+                android:visibility="visible"
+                binding:clicks="@{click.userUrgent}" />
+
+        </LinearLayout>
+
+        <!--    基本信息     -->
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/d_5dp"
+            android:layout_marginRight="@dimen/d_5dp"
+            android:background="@drawable/profile_white_shadow_comm_bg"
+            android:orientation="vertical"
+            android:paddingTop="@dimen/d_25dp"
+            android:paddingBottom="@dimen/d_38dp">
+
+            <com.guadou.lib_baselib.font_text_view.TextViewBold
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:text="个人信息"
+                android:textColor="@color/profile_black_28394a"
+                android:textSize="17dp" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/text_view_name"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_20dp"
+                android:layout_marginRight="@dimen/d_10dp"
+                android:drawableLeft="@drawable/profile_detail_name_icon"
+                android:drawablePadding="@dimen/d_12dp"
+                android:text="@string/null_data"
+                android:textColor="@color/profile_black_8098b2"
+                android:textSize="@dimen/d_14sp"
+                tools:text="Lisa Yang" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/text_view_email_address_below"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_20dp"
+                android:layout_marginRight="@dimen/d_10dp"
+                android:drawableLeft="@drawable/profile_detail_email_icon"
+                android:drawablePadding="@dimen/d_12dp"
+                android:text="@string/null_data"
+                android:textColor="@color/profile_black_8098b2"
+                android:textSize="@dimen/d_14sp" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/text_view_mobile_number"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_20dp"
+                android:layout_marginRight="@dimen/d_10dp"
+                android:drawableLeft="@drawable/profile_detail_phone_icon"
+                android:drawablePadding="@dimen/d_12dp"
+                android:text="@string/null_data"
+                android:textColor="@color/profile_black_8098b2"
+                android:textSize="@dimen/d_14sp" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/text_view_nric_no"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_20dp"
+                android:layout_marginRight="@dimen/d_10dp"
+                android:drawableLeft="@drawable/profile_detail_nric_icon"
+                android:drawablePadding="@dimen/d_12dp"
+                android:text="@string/null_data"
+                android:textColor="@color/profile_black_8098b2"
+                android:textSize="@dimen/d_14sp" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/text_view_nationality"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_20dp"
+                android:layout_marginRight="@dimen/d_10dp"
+                android:drawableLeft="@drawable/profile_detail_lang_icon"
+                android:drawablePadding="@dimen/d_12dp"
+                android:text="@string/null_data"
+                android:textColor="@color/profile_black_8098b2"
+                android:textSize="@dimen/d_14sp" />
+
+            <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                android:id="@+id/tv_rate"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_20dp"
+                android:layout_marginRight="@dimen/d_10dp"
+                android:drawableLeft="@drawable/profile_detail_rate_icon"
+                android:drawablePadding="@dimen/d_12dp"
+                android:text="@string/null_data"
+                android:textColor="@color/profile_black_8098b2"
+                android:textSize="@dimen/d_14sp" />
+
+
+            <LinearLayout
+                android:id="@+id/rl_request_view_profile_total_hours"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/d_20dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:visibility="visible">
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/d_23dp"
+                    android:drawableLeft="@drawable/profile_detail_hours_icon"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:text="Total Hours: "
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp" />
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_request_view_profile_total_hours"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="1024"
+                    android:textColor="@color/app_blue"
+                    android:textSize="@dimen/d_14sp" />
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/d_3dp"
+                    android:text="Hrs"
+                    android:textColor="@color/gray_text"
+                    android:textSize="@dimen/d_15sp" />
+
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="1" />
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_profile_rules"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerVertical="true"
+                    android:layout_marginRight="@dimen/d_10dp"
+                    android:layout_toLeftOf="@id/iv_total_hours_arrow"
+                    android:text="Rules"
+                    android:textColor="@color/app_blue"
+                    android:textSize="14.5sp" />
+
+                <ImageView
+                    android:id="@+id/iv_total_hours_arrow"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentRight="true"
+                    android:layout_centerVertical="true"
+                    android:layout_marginRight="@dimen/d_15dp"
+                    android:src="@drawable/back_more_black" />
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <!-- 技能的选择 -->
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/d_5dp"
+            android:layout_marginRight="@dimen/d_5dp"
+            android:background="@drawable/profile_white_shadow_comm_bg"
+            android:orientation="vertical"
+            android:paddingTop="@dimen/d_25dp"
+            android:paddingBottom="@dimen/d_38dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:orientation="horizontal">
+
+                <com.guadou.lib_baselib.font_text_view.TextViewBold
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/d_23dp"
+                    android:layout_weight="1"
+                    android:text="技能"
+                    android:textColor="@color/profile_black_28394a"
+                    android:textSize="17dp" />
+
+                <ImageView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentRight="true"
+                    android:layout_centerVertical="true"
+                    android:layout_marginRight="@dimen/d_15dp"
+                    android:src="@drawable/back_more_black"
+                    app:tint="@color/gray_8098B2"
+                    tools:tint="@color/gray_8098B2" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/d_15dp"
+                android:orientation="vertical"
+                android:paddingLeft="@dimen/d_23dp"
+                android:visibility="visible">
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_edit_profile_work_type1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:drawableLeft="@drawable/profile_detail_skill_icon1"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:paddingBottom="@dimen/d_10dp"
+                    android:text="Clean Service"
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp"
+                    android:visibility="gone" />
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_edit_profile_work_type2"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/d_10dp"
+                    android:layout_weight="1"
+                    android:drawableLeft="@drawable/profile_detail_skill_icon2"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:paddingBottom="@dimen/d_10dp"
+                    android:text="Business"
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp"
+                    android:visibility="gone" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_edit_profile_work_type2"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/d_10dp"
+                android:orientation="vertical"
+                android:paddingLeft="@dimen/d_23dp"
+                android:visibility="visible">
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_edit_profile_work_type3"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:drawableLeft="@drawable/profile_detail_skill_icon3"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:paddingBottom="@dimen/d_10dp"
+                    android:text="Finance"
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp"
+                    android:visibility="gone" />
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_edit_profile_work_type4"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/d_10dp"
+                    android:layout_weight="1"
+                    android:drawableLeft="@drawable/profile_detail_skill_icon4"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:paddingBottom="@dimen/d_10dp"
+                    android:text="Food &#38; Banquet"
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp"
+                    android:visibility="gone" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_edit_profile_work_type3"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/d_10dp"
+                android:orientation="vertical"
+                android:paddingLeft="@dimen/d_23dp"
+                android:visibility="visible"
+                android:weightSum="2">
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_edit_profile_work_type5"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:drawableLeft="@drawable/profile_detail_skill_icon5"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:paddingBottom="@dimen/d_15dp"
+                    android:text="Recruitment"
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp"
+                    android:visibility="gone" />
+
+                <com.guadou.lib_baselib.font_text_view.TextViewMedium
+                    android:id="@+id/tv_edit_profile_work_type6"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:drawableLeft="@drawable/profile_detail_skill_icon6"
+                    android:drawablePadding="@dimen/d_12dp"
+                    android:text="Recruitment"
+                    android:textColor="@color/profile_black_8098b2"
+                    android:textSize="@dimen/d_14sp"
+                    android:visibility="gone" />
+
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <!--  证书  -->
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/d_5dp"
+            android:layout_marginRight="@dimen/d_5dp"
+            android:background="@drawable/profile_white_shadow_comm_bg"
+            android:orientation="vertical"
+            android:paddingTop="@dimen/d_25dp"
+            android:paddingBottom="@dimen/d_38dp">
+
+            <com.guadou.lib_baselib.font_text_view.TextViewBold
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:text="食品证书"
+                android:textColor="@color/profile_black_28394a"
+                android:textSize="17dp" />
+
+
+            <FrameLayout
+                android:id="@+id/fl_certificate_box"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/d_23dp"
+                android:layout_marginTop="@dimen/d_17dp">
+
+                <ImageView
+                    android:id="@+id/iv_certificate_img"
+                    android:layout_width="98dp"
+                    android:layout_height="98dp"
+                    android:layout_gravity="center"
+                    android:background="#F0F2F9" />
+
+                <ImageView
+                    android:id="@+id/iv_upload_empty"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:src="@drawable/profile_edit_cert_empty_img"
+                    android:visibility="visible" />
+
+                <ImageView
+                    android:id="@+id/iv_certificate_img_delete"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="right|top"
+                    android:layout_marginLeft="95dp"
+                    android:paddingLeft="@dimen/d_5dp"
+                    android:paddingTop="-10dp"
+                    android:paddingRight="@dimen/d_5dp"
+                    android:paddingBottom="@dimen/d_5dp"
+                    android:src="@drawable/profile_edit_cert_delete"
+                    android:visibility="visible" />
+
+            </FrameLayout>
+
+        </LinearLayout>
 
+        <!--    个人信息的到达率    -->
         <LinearLayout
-            android:id="@+id/ll_edit_profile_work_type"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginLeft="@dimen/d_5dp"
@@ -424,6 +1000,6 @@
 
         </LinearLayout>
 
-    </RelativeLayout>
+    </LinearLayout>
 
 </layout>

+ 77 - 0
cs_cptServices/src/main/java/com/guadou/cs_cptservices/widget/AsyncViewStub.kt

@@ -0,0 +1,77 @@
+package com.guadou.cs_cptservices.widget
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.guadou.cs_cptservices.R
+import kotlinx.coroutines.*
+
+
+/**
+ *  异步加载布局的 ViewStub
+ */
+class AsyncViewStub @JvmOverloads constructor(context: Context?, attrs: AttributeSet? = null, defStyleAttr: Int = 0) :
+    View(context, attrs, defStyleAttr), CoroutineScope by MainScope() {
+
+    var layoutId: Int = 0
+    var mView: View? = null
+
+    init {
+        initAttrs(attrs, context)//初始化属性
+    }
+
+    private fun initAttrs(attrs: AttributeSet?, context: Context?) {
+        val typedArray = context!!.obtainStyledAttributes(
+            attrs,
+            R.styleable.AsyncViewStub
+        )
+
+        layoutId = typedArray.getResourceId(
+            R.styleable.AsyncViewStub_layout,
+            0
+        )
+
+        typedArray.recycle()
+    }
+
+
+    fun inflateAsync(block: (View) -> Unit) {
+
+        if (layoutId == 0) throw RuntimeException("没有找到加载的布局,你必须在xml中设置layout属性")
+
+        launch {
+
+            val view = withContext(Dispatchers.IO) {
+                LayoutInflater.from(context).inflate(layoutId, null)
+            }
+
+            mView = view
+
+            //添加到父布局
+            val parent = parent as ViewGroup
+            val index = parent.indexOfChild(this@AsyncViewStub)
+            val vlp: ViewGroup.LayoutParams = layoutParams
+            view.layoutParams = vlp //把 LayoutParams 给到新view
+
+            parent.removeViewAt(index) //删除原来的占位View
+            parent.addView(view, index) //把新有的View替换上去
+
+            block(view)
+        }
+    }
+
+    fun isInflate(): Boolean {
+        return mView != null
+    }
+
+    fun getInflatedView(): View? {
+        return mView
+    }
+
+    override fun onDetachedFromWindow() {
+        cancel()
+        super.onDetachedFromWindow()
+    }
+}

+ 3 - 0
cs_cptServices/src/main/res/values/attrs.xml

@@ -40,5 +40,8 @@
         <attr name="paintMinWidth" format="dimension" />
     </declare-styleable>
 
+    <declare-styleable name="AsyncViewStub">
+        <attr name="layout" format="reference" />
+    </declare-styleable>
 
 </resources>