我的报告页面修改

This commit is contained in:
adam 2022-05-31 10:37:53 +08:00
parent 3f80dfe096
commit c23695be6c
9 changed files with 71 additions and 60 deletions

View File

@ -3,6 +3,8 @@ package com.tenlionsoft.oamodule.activity.workreports;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;
@ -24,8 +26,10 @@ import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
import com.tenlionsoft.baselib.core.widget.AstrictLengthFilter;
import com.tenlionsoft.baselib.core.widget.base.AddFileAdapter;
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
import com.tenlionsoft.baselib.interfaces.TextChange;
import com.tenlionsoft.baselib.utils.ExceptionHandler;
import com.tenlionsoft.baselib.utils.LogUtils;
import com.tenlionsoft.baselib.utils.UIUtil;
@ -75,6 +79,8 @@ public class AddWorkReportsActivity extends BaseActivity {
RecyclerView mRlvFiles;
@BindView(R2.id.btn_confirm)
Button mBtnConfirm;
@BindView(R2.id.tv_content_hint)
TextView mTvContentHint;
private List<AddFileBean> mFileBeans = new ArrayList<>();
private AddFileAdapter mAddFileAdapter;
private String[] fileFilter = new String[]{".doc", ".docx", ".xls", ".xlsx", ".pptx", ".ppt", ".txt", ".pdf"};
@ -84,6 +90,7 @@ public class AddWorkReportsActivity extends BaseActivity {
private OptionsPickerView<DicBean> mTypePicker;
private List<DicBean> mTyps;
private DicBean mSelType;
private final int mReasonMax = 140;
@Override
protected int setLayoutId() {
@ -93,7 +100,8 @@ public class AddWorkReportsActivity extends BaseActivity {
@Override
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("工作报告新增");
mTvBaseTitle.setText("新增我的报告");
mRlTitleBar.setBackgroundColor(getResources().getColor(R.color.gray_f8));
refreshView(STATE_LOAD_SUCCESS);
initViews();
}
@ -140,6 +148,15 @@ public class AddWorkReportsActivity extends BaseActivity {
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
mRlvFiles.setAdapter(mAddFileAdapter);
mBtnConfirm.setOnClickListener(v -> doConfirm());
mEtContent.addTextChangedListener(new TextChange() {
@Override
public void afterTextChanged(Editable s) {
int length = s.toString().length();
mTvContentHint.setText(length + "/" + mReasonMax);
}
});
AstrictLengthFilter filter = new AstrictLengthFilter(mReasonMax);
mEtContent.setFilters(new InputFilter[]{filter});
}
@Override

View File

@ -32,7 +32,6 @@ import com.tenlionsoft.baselib.utils.ExceptionHandler;
import com.tenlionsoft.baselib.utils.FileUtils;
import com.tenlionsoft.baselib.utils.LogUtils;
import com.tenlionsoft.baselib.utils.UIUtil;
import com.tenlionsoft.baselib.utils.UserLgUtils;
import com.tenlionsoft.oamodule.R;
import com.tenlionsoft.oamodule.R2;
import com.tenlionsoft.oamodule.beans.SaveWorkReportBean;
@ -90,6 +89,7 @@ public class EditWorkReportActivity extends BaseActivity {
private List<DicBean> mTyps;
private DicBean mSelType;
private String mId;
private final int mReasonMax = 140;
@Override
protected int setLayoutId() {
@ -100,6 +100,7 @@ public class EditWorkReportActivity extends BaseActivity {
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("工作报告编辑");
mRlTitleBar.setBackgroundColor(getResources().getColor(R.color.gray_f8));
initViews();
mId = getIntent().getStringExtra("id");
if (TextUtils.isEmpty(mId)) {

View File

@ -25,7 +25,6 @@ import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
import com.tenlionsoft.baselib.utils.ExceptionHandler;
import com.tenlionsoft.baselib.utils.FileUtils;
import com.tenlionsoft.baselib.utils.UIUtil;
import com.tenlionsoft.baselib.utils.UserLgUtils;
import com.tenlionsoft.oamodule.R;
import com.tenlionsoft.oamodule.R2;
import com.tenlionsoft.oamodule.beans.WorkReportDetailBean;
@ -67,8 +66,6 @@ public class WorkReportDetailActivity extends BaseActivity {
RecyclerView mRlvFiles;
@BindView(R2.id.btn_del)
Button mBtnDel;
@BindView(R2.id.btn_edit)
Button mBtnEdit;
@BindView(R2.id.tv_file_hint)
TextView mTvFileHint;
private String mId;
@ -81,7 +78,8 @@ public class WorkReportDetailActivity extends BaseActivity {
@Override
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("工作报告");
mTvBaseTitle.setText("我的报告");
mRlTitleBar.setBackgroundColor(getResources().getColor(R.color.gray_f8));
mId = getIntent().getStringExtra("id");
if (TextUtils.isEmpty(mId)) {
ToastUtils.show("数据有误");
@ -90,7 +88,9 @@ public class WorkReportDetailActivity extends BaseActivity {
getDetailById();
}
mBtnDel.setOnClickListener(v -> showDelConfirm());
mBtnEdit.setOnClickListener(v -> ARouter.getInstance()
mTvPublish.setVisibility(View.VISIBLE);
mTvPublish.setText("编辑");
mTvPublish.setOnClickListener(v -> ARouter.getInstance()
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_WORK_REPORT_EDIT)
.withString("id", mId)
.navigation(mActivity, 12));

View File

@ -21,7 +21,6 @@ import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
import com.tenlionsoft.baselib.utils.ExceptionHandler;
import com.tenlionsoft.baselib.utils.LogUtils;
import com.tenlionsoft.baselib.utils.UserLgUtils;
import com.tenlionsoft.oamodule.R;
import com.tenlionsoft.oamodule.R2;
import com.tenlionsoft.oamodule.adapter.WorkReportAdapter;
@ -83,6 +82,7 @@ public class WorkReportsActivity extends BaseActivity {
public void initData() {
ButterKnife.bind(this);
mTvBaseTitle.setText("我的报告");
mRlTitleBar.setBackgroundColor(getResources().getColor(R.color.gray_f8));
mTvPublish.setVisibility(View.VISIBLE);
mTvPublish.setText("新增报告");
mTvPublish.setOnClickListener(v -> ARouter.getInstance()

View File

@ -3,26 +3,27 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_f2"
android:orientation="vertical"
tools:context=".activity.car.ByCarAddActivity">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="50dp"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_f0"
android:background="@color/gray_f8"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
@ -34,8 +35,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="上报标题"
android:textColor="@color/black"
android:textSize="14sp" />
android:textColor="@color/black_10"
android:textSize="@dimen/text_14" />
<EditText
android:id="@+id/et_name"
@ -43,7 +44,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
android:gravity="right"
android:gravity="right|center_vertical"
android:hint="请输入上报标题"
android:textSize="14sp" />
</LinearLayout>
@ -64,7 +65,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:clickable="true"
android:drawableRight="@drawable/ic_arrow_right"
android:drawableRight="@drawable/ic_arrow_right_24"
android:drawablePadding="5dp"
android:focusable="true"
android:gravity="right"
android:hint="请选择上报类型"
@ -78,8 +80,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingBottom="10dp">
@ -98,7 +98,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<EditText
@ -120,8 +120,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingBottom="10dp">
@ -140,7 +138,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<EditText
@ -155,6 +153,14 @@
android:padding="5dp"
android:textColor="@color/black"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_content_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right|center_vertical"
android:paddingRight="10dp"
android:text="0/140" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
@ -162,8 +168,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingBottom="10dp">
@ -182,7 +186,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
@ -203,5 +207,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="保存" />
android:layout_margin="10dp"
android:background="@drawable/sel_btn_submit_no_size"
android:text="新增报告"
android:textColor="@color/col_white_gray_press" />
</RelativeLayout>

View File

@ -3,26 +3,27 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_f2"
android:orientation="vertical"
tools:context=".activity.car.ByCarAddActivity">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="50dp"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_f0"
android:background="@color/gray_f8"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp">
@ -78,8 +79,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingBottom="10dp">
@ -98,7 +97,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<EditText
@ -120,8 +119,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingBottom="10dp">
@ -140,7 +137,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<EditText
@ -162,8 +159,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/white"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingBottom="10dp">
@ -182,7 +177,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
@ -203,5 +198,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="保存" />
android:layout_margin="10dp"
android:background="@drawable/sel_btn_submit_no_size"
android:text="保存"
android:textColor="@color/col_white_gray_press" />
</RelativeLayout>

View File

@ -3,12 +3,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_f0"
android:background="@color/gray_f2"
android:orientation="vertical">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="50dp"
android:scrollbars="none">
@ -78,7 +79,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/gray_f8"
android:orientation="vertical"
android:paddingTop="5dp"
@ -98,7 +98,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<TextView
@ -120,7 +120,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/gray_f8"
android:orientation="vertical"
android:paddingTop="5dp"
@ -140,7 +139,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<TextView
@ -162,7 +161,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@color/gray_f8"
android:orientation="vertical"
android:paddingTop="5dp"
@ -182,7 +180,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="@drawable/shp_rectangle_gray"
android:background="@drawable/shp_rectangle_gray_df"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
@ -210,7 +208,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
android:orientation="horizontal"
android:padding="10dp">
<Button
android:id="@+id/btn_del"
@ -221,14 +220,5 @@
android:text="删除"
android:textColor="@color/col_white_gray_press" />
<Button
android:id="@+id/btn_edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/sel_btn_submit_no_size"
android:text="编辑"
android:textColor="@color/col_white_gray_press" />
</LinearLayout>
</RelativeLayout>

View File

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_bg"
android:background="@color/gray_f8"
android:orientation="vertical">
<include layout="@layout/layout_base_search_cancel" />

View File

@ -5,10 +5,7 @@
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingBottom="10dp">
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
@ -24,6 +21,7 @@
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="@dimen/text_16"
tools:text="上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题" />
<TextView
@ -42,9 +40,9 @@
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:maxLines="1"
android:textSize="@dimen/text_12"
android:textSize="@dimen/text_14"
tools:text="工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容" />
</LinearLayout>