实时盘点保存数据成功
parent
00c176a493
commit
4ba76504c7
@ -0,0 +1,82 @@
|
|||||||
|
package com.rehome.zhdcoa.weiget;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import com.rehome.zhdcoa.R;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by gzw on 2016/8/17.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class RealTimePdDialog {
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private final AlertDialog dialog;
|
||||||
|
private final TextView tv_title;
|
||||||
|
private final TextView tv_message;
|
||||||
|
private final Button btn_fg;
|
||||||
|
private final Button btn_qx;
|
||||||
|
private final Window mWindow;
|
||||||
|
|
||||||
|
public RealTimePdDialog(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
|
||||||
|
dialog = new AlertDialog.Builder(context).create();
|
||||||
|
dialog.setCancelable(true);
|
||||||
|
dialog.show();
|
||||||
|
mWindow = dialog.getWindow();
|
||||||
|
mWindow.setContentView(R.layout.dialog_real_time_pd);
|
||||||
|
tv_title = mWindow.findViewById(R.id.tv_title);
|
||||||
|
tv_message = mWindow.findViewById(R.id.tv_message);
|
||||||
|
btn_fg = mWindow.findViewById(R.id.btn_fg);
|
||||||
|
btn_qx = mWindow.findViewById(R.id.btn_qx);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 覆盖点击事件
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void setFgOnClick(View.OnClickListener listener) {
|
||||||
|
btn_fg.setOnClickListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消点击事件
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void setQxOnClick(View.OnClickListener listener) {
|
||||||
|
btn_qx.setOnClickListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置Title
|
||||||
|
*
|
||||||
|
* @param title
|
||||||
|
*/
|
||||||
|
public void setTitle(String title) {
|
||||||
|
tv_title.setText(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置message
|
||||||
|
*
|
||||||
|
* @param message
|
||||||
|
*/
|
||||||
|
public void setMessage(String message) {
|
||||||
|
tv_message.setText(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<com.zhy.autolayout.AutoLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/px_100"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="提示"
|
||||||
|
android:textSize="26px"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2px"
|
||||||
|
android:background="@color/blue"></View>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_message"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/px_150"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginEnd="30dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="你已盘点过该物资了,需要执行下面哪个操作?"
|
||||||
|
android:textSize="26px"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2px"
|
||||||
|
android:background="@color/blue"></View>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/px_100"
|
||||||
|
android:layout_marginTop="@dimen/px_10"
|
||||||
|
android:layout_marginStart="30dp"
|
||||||
|
android:layout_marginEnd="30dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_fg"
|
||||||
|
style="@style/button"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="覆盖"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_qx"
|
||||||
|
style="@style/button"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/cancel"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.zhy.autolayout.AutoLinearLayout>
|
||||||
Loading…
Reference in New Issue