Commit d9aa2ef1 authored by zhaopengxiang's avatar zhaopengxiang

update ui

parent 10046a2f
......@@ -151,6 +151,12 @@ class SearchOrderFragment(val payType: MiYaPayPlantformPayWayEnum.MiyaPayType) :
}
it.onSuccess { list ->
val oldSize = adapter.getDataSource().size
if (oldSize == 0 && list.size == 0)
binding!!.cpEmptyView.visibility = View.VISIBLE
else
binding!!.cpEmptyView.visibility = View.GONE
adapter.getDataSource().addAll(list)
if (oldSize == 0) {
adapter.notifyDataSetChanged()
......@@ -162,9 +168,17 @@ class SearchOrderFragment(val payType: MiYaPayPlantformPayWayEnum.MiyaPayType) :
}
}
}
initEmptyView()
loadMore(0)
}
private fun initEmptyView() {
binding!!.cpEmptyView.visibility = View.GONE
binding!!.cpEmptyView.setPromptText(getString(R.string.search_order_prompt_text))
binding!!.cpEmptyView.setPromptImage(R.mipmap.app_bg_common_empty)
}
private fun loadMore(loadIndex: Int) {
//加载更多
vm.getPayData(payType, loadIndex)
......
......@@ -60,6 +60,7 @@ class DateSelectHelper(val act: Activity, val callback: (Date) -> Unit) {
.setContentTextSize(30)
.setTitleSize(30)
.setSubCalSize(30)
.setLineSpacingMultiplier(1.9f)
.setRangDate(startDate, endDate)
.setOutSideCancelable(false)
.setDecorView(act.findViewById(android.R.id.content))
......
package com.miya.fastcashier.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import com.miya.fastcashier.R;
import com.miya.fastcashier.databinding.LayoutCommonPromptViewBinding;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
public class CommonPromptView extends ConstraintLayout {
private LayoutCommonPromptViewBinding viewBinding;
public CommonPromptView(@NonNull @NotNull Context context) {
this(context, null);
}
public CommonPromptView(@NonNull @NotNull Context context,
@Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public CommonPromptView(@NonNull @NotNull Context context,
@Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
View inflate = LayoutInflater.from(getContext()).inflate(R.layout.layout_common_prompt_view, this);
viewBinding = LayoutCommonPromptViewBinding.bind(inflate);
}
public void setPromptImage(int imageResId) {
viewBinding.ivPrompt.setImageResource(imageResId);
}
public void setPromptText(String text) {
viewBinding.tvPrompt.setText(text);
}
}
......@@ -98,7 +98,7 @@
android:textColor="@color/white"
android:textColorHint="#89889A"
android:textAlignment="textEnd"
android:textSize="47sp"
android:textSize="64sp"
android:paddingTop="5dp"
android:layout_marginEnd="32dp"
app:layout_constraintEnd_toEndOf="parent"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvContent"
android:layout_width="match_parent"
android:background="@color/color_F8F8F8"
android:layout_height="match_parent" />
<com.miya.fastcashier.widget.CommonPromptView
android:id="@+id/cpEmptyView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_E5E5E5"
app:layout_constraintStart_toStartOf="parent"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_prompt"
android:layout_width="426dp"
android:layout_height="320dp"
android:layout_marginTop="123dp"
android:scaleType="centerCrop"
android:src="@mipmap/app_bg_common_empty"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_prompt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="26dp"
android:textColor="@color/color_333333"
android:textSize="32sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_prompt" />
</merge>
......@@ -15,4 +15,5 @@
<color name="color_FF4E33">#FF4E33</color>
<color name="color_ECECEC">#ECECEC</color>
<color name="color_F8F8F8">#F8F8F8</color>
<color name="color_E5E5E5">#E5E5E5</color>
</resources>
\ No newline at end of file
......@@ -15,10 +15,11 @@
<string name="username_not_empty">用户名不能为空</string>
<string name="password_not_empty">密码不能为空</string>
<string name="invalid_password">密码位数必须得是6位以上</string>
<string name="search">查询</string>
<string name="statistic">统计</string>
<string name="balance">结算</string>
<string name="search">查询账单</string>
<string name="statistic">统计打印</string>
<string name="balance">结算打印</string>
<string name="cancel">取消</string>
<string name="sure">确定</string>
<string name="search_order_prompt_text">还没有明细哦~</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment