parent
c7131b3992
commit
63b61f7942
29 changed files with 570 additions and 108 deletions
@ -0,0 +1,7 @@ |
||||
package com.project.survey.logic.bean |
||||
|
||||
data class HahaReq( |
||||
val type: String, |
||||
val userName: String? = null, |
||||
val page: Int = 1 |
||||
) |
@ -1,4 +1,5 @@ |
||||
package com.project.survey.model |
||||
|
||||
class ApprovalBean { |
||||
} |
||||
data class ApprovalBean( |
||||
val type: String |
||||
) |
@ -1,4 +1,4 @@ |
||||
package com.project.survey.logic.bean |
||||
package com.project.survey.model |
||||
|
||||
data class LoginBean( |
||||
val token: String, |
@ -0,0 +1,75 @@ |
||||
package com.project.survey.ui.approval.adapter |
||||
|
||||
import android.content.Context |
||||
import android.view.LayoutInflater |
||||
import android.view.ViewGroup |
||||
import androidx.recyclerview.widget.RecyclerView |
||||
import com.chad.library.adapter4.BaseMultiItemAdapter |
||||
import com.project.survey.databinding.ItemApprovalApprovedBinding |
||||
import com.project.survey.databinding.ItemApprovalOwnerBinding |
||||
import com.project.survey.extend.isVisibleOrGone |
||||
import com.project.survey.model.ApprovalBean |
||||
|
||||
class ApprovalAdapter : BaseMultiItemAdapter<ApprovalBean>() { |
||||
|
||||
init { |
||||
addItemType(TYPE_0, object : OnMultiItemAdapterListener<ApprovalBean, ItemPreapprovVH> { |
||||
override fun onCreate( |
||||
context: Context, |
||||
parent: ViewGroup, |
||||
viewType: Int |
||||
): ItemPreapprovVH { |
||||
val viewBinding = |
||||
ItemApprovalApprovedBinding.inflate(LayoutInflater.from(context), parent, false) |
||||
return ItemPreapprovVH(viewBinding) |
||||
} |
||||
|
||||
override fun onBind(holder: ItemPreapprovVH, position: Int, item: ApprovalBean?) { |
||||
holder.binding.ivAgree.isVisibleOrGone(false) |
||||
} |
||||
}).addItemType(TYPE_1, object : OnMultiItemAdapterListener<ApprovalBean, ItemApprovedVH> { |
||||
override fun onCreate( |
||||
context: Context, |
||||
parent: ViewGroup, |
||||
viewType: Int |
||||
): ItemApprovedVH { |
||||
val viewBinding = |
||||
ItemApprovalApprovedBinding.inflate(LayoutInflater.from(context), parent, false) |
||||
return ItemApprovedVH(viewBinding) |
||||
} |
||||
|
||||
override fun onBind(holder: ItemApprovedVH, position: Int, item: ApprovalBean?) { |
||||
holder.binding.ivAgree.isVisibleOrGone(true) |
||||
} |
||||
}).addItemType(TYPE_2, object : OnMultiItemAdapterListener<ApprovalBean, ItemOwnerVH> { |
||||
override fun onCreate( |
||||
context: Context, |
||||
parent: ViewGroup, |
||||
viewType: Int |
||||
): ItemOwnerVH { |
||||
val viewBinding = |
||||
ItemApprovalOwnerBinding.inflate(LayoutInflater.from(context), parent, false) |
||||
return ItemOwnerVH(viewBinding) |
||||
} |
||||
|
||||
override fun onBind(holder: ItemOwnerVH, position: Int, item: ApprovalBean?) { |
||||
} |
||||
}) |
||||
} |
||||
|
||||
class ItemPreapprovVH(val binding: ItemApprovalApprovedBinding) : |
||||
RecyclerView.ViewHolder(binding.root) |
||||
|
||||
class ItemApprovedVH(val binding: ItemApprovalApprovedBinding) : |
||||
RecyclerView.ViewHolder(binding.root) |
||||
|
||||
class ItemOwnerVH(val binding: ItemApprovalOwnerBinding) : |
||||
RecyclerView.ViewHolder(binding.root) |
||||
|
||||
companion object { |
||||
private const val TYPE_0 = 0 |
||||
private const val TYPE_1 = 1 |
||||
private const val TYPE_2 = 2 |
||||
} |
||||
|
||||
} |
@ -0,0 +1,50 @@ |
||||
package com.project.survey.widget |
||||
|
||||
import android.app.Dialog |
||||
import android.content.Context |
||||
import android.view.LayoutInflater |
||||
import android.widget.TextView |
||||
import com.project.survey.R |
||||
import com.project.survey.extend.isVisibleOrGone |
||||
|
||||
class LoadingDialog @JvmOverloads constructor(context: Context) : |
||||
Dialog(context, R.style.loading_dialog) { |
||||
|
||||
inner class Builder(val context: Context) { |
||||
private var message = "" |
||||
private var isCancelable = false |
||||
private var isCancelOutside = false |
||||
|
||||
|
||||
fun setMessage(message: String): Builder = apply { |
||||
this.message = message |
||||
} |
||||
|
||||
/** |
||||
* 设置是否可以按返回键取消 |
||||
*/ |
||||
fun setCancelable(isCancelable: Boolean): Builder = apply { |
||||
this.isCancelable = isCancelable |
||||
} |
||||
|
||||
/** |
||||
* 设置是否可以取消 |
||||
*/ |
||||
fun setCancelOutside(isCancelOutside: Boolean): Builder = apply { |
||||
this.isCancelOutside = isCancelOutside |
||||
} |
||||
|
||||
fun create(): LoadingDialog { |
||||
val view = LayoutInflater.from(context).inflate(R.layout.dialog_loading, null, false) |
||||
view.findViewById<TextView>(R.id.tvLoadingTips).run { |
||||
isVisibleOrGone(message.isNotBlank()) |
||||
text = message |
||||
} |
||||
return LoadingDialog(context).apply { |
||||
setContentView(view) |
||||
setCancelable(isCancelable) |
||||
setCanceledOnTouchOutside(isCancelOutside) |
||||
} |
||||
} |
||||
} |
||||
} |
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,8 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<!-- 背景颜色 --> |
||||
<solid android:color="#80000000" /> |
||||
|
||||
<!-- 圆角 --> |
||||
<corners android:radius="8dp" /> |
||||
</shape> |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:drawable="@drawable/icon_dialog_loading" |
||||
android:pivotX="50%" |
||||
android:pivotY="50%" /> |
@ -1,16 +1,27 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:orientation="vertical"> |
||||
|
||||
<include layout="@layout/sh_toolbar" /> |
||||
<include |
||||
android:id="@+id/ilToolBar" |
||||
layout="@layout/sh_toolbar" /> |
||||
|
||||
<include layout="@layout/item_search" /> |
||||
|
||||
<androidx.fragment.app.FragmentContainerView |
||||
android:id="@+id/container" |
||||
<!-- <androidx.fragment.app.FragmentContainerView--> |
||||
<!-- android:id="@+id/container"--> |
||||
<!-- android:layout_width="match_parent"--> |
||||
<!-- android:layout_height="match_parent" />--> |
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/recyclerView" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" /> |
||||
android:layout_height="match_parent" |
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" |
||||
tools:itemCount="2" |
||||
tools:listitem="@layout/item_approval_approved" /> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,39 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:id="@+id/dialog_loading_view" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:gravity="center" |
||||
android:orientation="vertical"> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="120dp" |
||||
android:layout_height="100dp" |
||||
android:background="@drawable/bg_dialog_loading" |
||||
android:gravity="center" |
||||
android:orientation="vertical" |
||||
android:paddingLeft="21dp" |
||||
android:paddingTop="10dp" |
||||
android:paddingRight="21dp" |
||||
android:paddingBottom="10dp"> |
||||
|
||||
<ProgressBar |
||||
android:id="@+id/progressBar" |
||||
android:layout_width="35dp" |
||||
android:layout_height="35dp" |
||||
android:layout_gravity="center_horizontal" |
||||
android:indeterminateBehavior="repeat" |
||||
android:indeterminateDrawable="@drawable/loading_dialog_progress_bar" |
||||
android:indeterminateOnly="true" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvLoadingTips" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="15dp" |
||||
android:text="@string/loading" |
||||
android:textColor="@android:color/white" |
||||
android:textSize="15sp" /> |
||||
</LinearLayout> |
||||
|
||||
</LinearLayout> |
@ -0,0 +1,99 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginHorizontal="12dp" |
||||
android:background="@drawable/bg_white_round_4" |
||||
android:padding="12dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvName" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_20" |
||||
android:textSize="13sp" |
||||
android:textStyle="bold" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
tools:text="单位测量资质报验单" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvNo" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_727778" |
||||
android:textSize="12sp" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/tvName" |
||||
tools:text="XMBH2021-00001" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvStatus" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="5dp" |
||||
android:background="@drawable/bg_approval_blue_stroke" |
||||
android:paddingHorizontal="4dp" |
||||
android:paddingVertical="1dp" |
||||
android:textColor="@color/text_color_396bd0" |
||||
android:textSize="10sp" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/tvNo" |
||||
tools:text="监理审核" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvReceiverKey" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="12dp" |
||||
android:text="接 收 人:" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/tvStatus" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvReceiver" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintBaseline_toBaselineOf="@id/tvReceiverKey" |
||||
app:layout_constraintStart_toEndOf="@id/tvReceiverKey" |
||||
tools:text="Tom" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvStartTimeKey" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="4dp" |
||||
android:text="办理时间:" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/tvReceiverKey" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvTime" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintBaseline_toBaselineOf="@id/tvStartTimeKey" |
||||
app:layout_constraintStart_toEndOf="@id/tvStartTimeKey" |
||||
tools:text="2022-06-10 09:27:49" /> |
||||
|
||||
<ImageView |
||||
android:id="@+id/ivAgree" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_alignParentEnd="true" |
||||
android:background="@mipmap/ic_approval_agree" |
||||
android:visibility="gone" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
app:layout_constraintEnd_toEndOf="parent" |
||||
tools:visibility="visible" /> |
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
@ -0,0 +1,74 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginHorizontal="12dp" |
||||
android:background="@drawable/bg_white_round_4" |
||||
android:padding="12dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvName" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_20" |
||||
android:textSize="13sp" |
||||
android:textStyle="bold" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
tools:text="单位测量资质报验单" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvNo" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_727778" |
||||
android:textSize="12sp" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/tvName" |
||||
tools:text="XMBH2021-00001" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvStartTimeKey" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="12dp" |
||||
android:text="发起时间:" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/tvNo" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvStartTime" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintBaseline_toBaselineOf="@id/tvStartTimeKey" |
||||
app:layout_constraintStart_toEndOf="@id/tvStartTimeKey" |
||||
tools:text="2022-06-10 09:27:49" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvEndTimeKey" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="4dp" |
||||
android:text="结束时间:" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintStart_toStartOf="parent" |
||||
app:layout_constraintTop_toBottomOf="@id/tvStartTimeKey" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tvEndTime" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textColor="@color/text_color_404145" |
||||
android:textSize="12sp" |
||||
app:layout_constraintBaseline_toBaselineOf="@id/tvEndTimeKey" |
||||
app:layout_constraintStart_toEndOf="@id/tvEndTimeKey" |
||||
tools:text="2022-06-10 09:27:49" /> |
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
Loading…
Reference in new issue