diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f256820..123018e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -7,12 +7,15 @@
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
- android:icon="@mipmap/ic_launcher"
+ android:icon="@drawable/logo"
android:label="@string/app_name"
- android:roundIcon="@mipmap/ic_launcher_round"
+ android:roundIcon="@drawable/logo"
android:supportsRtl="true"
android:theme="@style/Theme.Beijingdaxing"
tools:targetApi="31">
+
@@ -36,15 +39,19 @@
+
+
+
+
+
+
-
-
\ No newline at end of file
diff --git a/app/src/main/java/com/example/beijing_daxing/CheckActivity.java b/app/src/main/java/com/example/beijing_daxing/CheckActivity.java
index 0c1250e..e4c623f 100644
--- a/app/src/main/java/com/example/beijing_daxing/CheckActivity.java
+++ b/app/src/main/java/com/example/beijing_daxing/CheckActivity.java
@@ -1,17 +1,11 @@
package com.example.beijing_daxing;
-import androidx.appcompat.app.AlertDialog;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.databinding.BaseObservable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableBoolean;
-import androidx.databinding.ObservableField;
-import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
-import android.widget.EditText;
import android.widget.Toast;
import com.example.beijing_daxing.adapter.CheckAdapter;
@@ -21,6 +15,7 @@ import com.example.beijing_daxing.base.MyRecultCall;
import com.example.beijing_daxing.base.MyResult;
import com.example.beijing_daxing.been.Stock;
import com.example.beijing_daxing.databinding.ActivityCheckBinding;
+import com.example.beijing_daxing.dialog.InPutDialog;
import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
@@ -28,14 +23,15 @@ import com.lzy.okgo.model.Response;
import java.util.Arrays;
import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
-public class CheckActivity extends BaseActivity implements AdapterClickCall {
+public class CheckActivity extends BaseActivity implements AdapterClickCall, InPutDialog.InPutDialogCall {
private ActivityCheckBinding binding;
private CheckAdapter adapter;
private List list;
private List selectList;
private ObservableBoolean state;
- private AlertDialog.Builder inputDialog;
+ private InPutDialog inputDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -59,23 +55,14 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall {
}
});
initRequest();
- initAlertDialog();
- }
+ inputDialog = new InPutDialog(this);
+ inputDialog.setInPutDialogCall(this);
- private void initAlertDialog() {
- final EditText editText = new EditText(this);
- inputDialog = new AlertDialog.Builder(this);
- inputDialog.setTitle("输入跳过原因").setView(editText);
- inputDialog.setPositiveButton("确定", (dialog, which) -> {
- var stock = list.get(tag);
- stock.setState("跳过");
- stock.setRemark(editText.getText().toString());
- adapter.notifyItemChanged(tag);
- });
}
+
private void initRequest() {
OkGo.post(url + "/xj/select").params("user", SharedPreferencesUtils.getstring("user", "")).execute(new MyRecultCall(dialog, this) {
@Override
@@ -85,6 +72,10 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall {
if (body.getCode() == 0) {
list = gson.fromJson(body.getData().toString(), new TypeToken>() {
}.getType());
+ if (list == null || list.isEmpty()) {
+ Toast.makeText(CheckActivity.this, "没有维护巡检区域", Toast.LENGTH_SHORT).show();
+ return;
+ }
adapter.setList(list);
adapter.notifyDataSetChanged();
return;
@@ -93,41 +84,47 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall {
}
});
}
- private int subIndex=-1;
+
+ private int subIndex = -1;
+
@Override
protected void sanRfid(List epcs) {
var text = epcs.get(0);
binding.checkEpc.setText(text);
- Stock stock=new Stock();
+ Stock stock = new Stock();
stock.setEpcCode(text);
var index = list.indexOf(stock);
- if (index==-1){
+ if (index == -1) {
Toast.makeText(this, "轮挡扫描错误", Toast.LENGTH_SHORT).show();
return;
}
- subIndex=index;
+ subIndex = index;
}
public void check_submit(View view) {
- list.forEach(t->{
- if (t.getState().equals("未检")) return;
- });
- OkGo.post(url+"/xj/submit")
+
+ var type = list.stream().anyMatch(t -> t.getState().equals("未检"));
+ if (type) {
+ Toast.makeText(this, "未检完全部轮挡,不允许提交", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ OkGo.post(url + "/xj/submit")
.tag(this)
- .params("json",gson.toJson(list))
- .params("user", SharedPreferencesUtils.getstring("user","test-user"))
- .execute(new MyRecultCall(dialog,this){
- @Override
- public void onSuccess(Response response) {
- super.onSuccess(response);
- Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
- // finish();
- }
- });
+ .params("json", gson.toJson(list))
+ .params("user", SharedPreferencesUtils.getstring("user", "test-user"))
+ .execute(new MyRecultCall(dialog, this) {
+ @Override
+ public void onSuccess(Response response) {
+ super.onSuccess(response);
+ Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
+ finish();
+ }
+ });
}
+
public void check_stock(View view) {
- if (subIndex==-1) return;
+ if (subIndex == -1) return;
var stock = list.get(subIndex);
stock.setState(binding.checkItemSelect.getSelectedItem().toString());
stock.setRemark(binding.checkRemark.getText().toString());
@@ -145,4 +142,12 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall {
}
+ @Override
+ public void inPutDialogReculi(String name) {
+ var stock = list.get(tag);
+ stock.setState("跳过");
+ stock.setRemark(name);
+ inputDialog.dismiss();
+ adapter.notifyDataSetChanged();
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/beijing_daxing/FpInActivity.java b/app/src/main/java/com/example/beijing_daxing/FpInActivity.java
index 7577ddd..58a6955 100644
--- a/app/src/main/java/com/example/beijing_daxing/FpInActivity.java
+++ b/app/src/main/java/com/example/beijing_daxing/FpInActivity.java
@@ -58,7 +58,7 @@ public class FpInActivity extends BaseActivity {
}
public void fpin_submit(View view){
- Log.e("TAG", "onSuccess:" +vm.toString() );
+ // Log.e("TAG", "onSuccess:" +vm.toString() );
var state = vm.getState();
if (!state.equals("报废")){
Toast.makeText(this, "轮挡状态:"+state+",不能使用废品入库功能", Toast.LENGTH_SHORT).show();
diff --git a/app/src/main/java/com/example/beijing_daxing/FpOutActivity.java b/app/src/main/java/com/example/beijing_daxing/FpOutActivity.java
new file mode 100644
index 0000000..12f359e
--- /dev/null
+++ b/app/src/main/java/com/example/beijing_daxing/FpOutActivity.java
@@ -0,0 +1,137 @@
+package com.example.beijing_daxing;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.databinding.DataBindingUtil;
+import androidx.databinding.ObservableBoolean;
+
+import android.annotation.SuppressLint;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.view.View;
+import android.widget.Toast;
+
+import com.example.beijing_daxing.adapter.OutAdapter;
+import com.example.beijing_daxing.adapter.StoreCheckAdapter;
+import com.example.beijing_daxing.base.BaseActivity;
+import com.example.beijing_daxing.base.MyRecultCall;
+import com.example.beijing_daxing.base.MyResult;
+import com.example.beijing_daxing.been.Stock;
+import com.example.beijing_daxing.databinding.ActivityFpOutBinding;
+import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
+import com.google.gson.reflect.TypeToken;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FpOutActivity extends BaseActivity {
+ private ObservableBoolean checkState;
+ private List list;
+ private OutAdapter adapter;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ ActivityFpOutBinding binding= DataBindingUtil. setContentView(this,R.layout.activity_fp_out);
+ checkState=new ObservableBoolean();
+ binding.setCheckState(checkState);
+ adapter = new OutAdapter(this);
+ binding.setAdapter(adapter);
+ initRequest();
+ }
+
+ private List tagList;
+ @Override
+ protected void sanRfid(List epcs) {
+ epcs.forEach(t -> {
+ if (tagList.contains(t)){
+ tagList.add(t);
+ return;
+ }
+ var stock = new Stock();
+ stock.setEpcCode(t);
+ var index = list.indexOf(stock);
+ if (index != -1) {
+ list.get(index).setState("Y");
+ }
+ });
+ adapter.notifyDataSetChanged();
+ }
+ private void initRequest() {
+ OkGo.post(url + "/fpout/select").tag(this).execute(new MyRecultCall(dialog, this) {
+ @Override
+ public void onSuccess(Response response) {
+ super.onSuccess(response);
+ var body = response.body();
+ if (body.getCode() == 0) {
+ list = gson.fromJson(body.getData().toString(), new TypeToken>() {
+ }.getType());
+ tagList=new ArrayList<>();
+ adapter.setList(list);
+ adapter.notifyDataSetChanged();
+ } else {
+ Toast.makeText(FpOutActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ }
+ public void fp_out_read(View view) {
+ var b = checkState.get();
+ if (b) {
+ handler.removeCallbacks(runnable);
+ } else {
+ handler.postDelayed(runnable, 0);
+ }
+ checkState.set(!b);
+ }
+
+ public void fp_out_submit(View view) {
+ if (list.stream().anyMatch(t -> t.getState().equals("N"))){
+ return;
+ }
+ handler.removeCallbacks(runnable);
+
+ OkGo.post(url+"/fpout/submit")
+ .tag(this)
+ .params("user", SharedPreferencesUtils.getstring("user","test"))
+ .params("json",gson.toJson(list))
+ .execute(new MyRecultCall(dialog,this){
+ @Override
+ public void onSuccess(Response response) {
+ super.onSuccess(response);
+ var body = response.body();
+ if (body.getCode()==0){
+ finish();
+ Toast.makeText(FpOutActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
+ }else {
+ Toast.makeText(FpOutActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ }
+
+ @SuppressLint("HandlerLeak")
+ private Handler handler = new Handler() {
+ @Override
+ public void handleMessage(@NonNull Message msg) {
+ super.handleMessage(msg);
+ }
+ };
+ private Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ sendBroadcast(broadcastIntent);
+ handler.postDelayed(runnable, 1000);
+ }
+ };
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ handler.removeCallbacks(runnable);
+ handler=null;
+ runnable=null;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java b/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java
index 2c3224f..c2f958d 100644
--- a/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java
+++ b/app/src/main/java/com/example/beijing_daxing/HomePageActivity.java
@@ -11,10 +11,16 @@ import android.widget.AdapterView;
import android.widget.Toast;
import com.example.beijing_daxing.adapter.HomePageAdapter;
+import com.example.beijing_daxing.base.BaseActivity;
+import com.example.beijing_daxing.base.MyApplication;
import com.example.beijing_daxing.databinding.ActivityHomePageBinding;
import com.example.beijing_daxing.been.HomeIcon;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import com.handheld.UHFLonger.UHFLongerManager;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
public class HomePageActivity extends AppCompatActivity {
@@ -22,19 +28,22 @@ public class HomePageActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- ActivityHomePageBinding binding= DataBindingUtil. setContentView(this,R.layout.activity_home_page);
+ ActivityHomePageBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_home_page);
List list = new ArrayList<>();
+
list.add(new HomeIcon(R.mipmap.home_in1, "轮挡入库", InActivity.class));
list.add(new HomeIcon(R.mipmap.home_out1, "轮挡领用出库", OutActivity.class));
list.add(new HomeIcon(R.mipmap.home_store_check, "仓库盘点", StoreCheckActivity.class));
list.add(new HomeIcon(R.mipmap.home_check, "轮挡巡检", CheckActivity.class));
list.add(new HomeIcon(R.mipmap.home_bf, "轮挡报废", BFActivity.class));
list.add(new HomeIcon(R.mipmap.home_in, "废品入库", FpInActivity.class));
- list.add(new HomeIcon(R.mipmap.home_out, "废品出库", CheckActivity.class));
+ list.add(new HomeIcon(R.mipmap.home_out, "废品出库", FpOutActivity.class));
+ var intent = getIntent();
- /* try {
- if (!loginUser.equals("admin")) {
- ArrayList strings = getIntent().getStringArrayListExtra("json");
+ try {
+ if (!intent.getStringExtra("user").equals("admin")) {
+ ArrayList strings = new Gson().fromJson(intent.getStringExtra("json"), new TypeToken>() {
+ }.getType());
if (strings != null) {
Iterator iter = list.iterator();
while (iter.hasNext()) {
@@ -49,7 +58,7 @@ public class HomePageActivity extends AppCompatActivity {
}
} catch (Exception e) {
e.printStackTrace();
- }*/
+ }
HomePageAdapter adapter = new HomePageAdapter(list, this);
binding.homeGridview.setAdapter(adapter);
binding.homeGridview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@@ -60,7 +69,10 @@ public class HomePageActivity extends AppCompatActivity {
}
});
}
+
+
private long exitTime = 0;
+
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == 4) {
@@ -75,4 +87,13 @@ public class HomePageActivity extends AppCompatActivity {
return super.onKeyDown(keyCode, event);
}
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ var uhfLongerManager = MyApplication.getUhfLongerManager();
+ uhfLongerManager.close();
+ MyApplication.uhfLongerManager = null;
+
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/beijing_daxing/InActivity.java b/app/src/main/java/com/example/beijing_daxing/InActivity.java
index 1e73cea..2a5fb82 100644
--- a/app/src/main/java/com/example/beijing_daxing/InActivity.java
+++ b/app/src/main/java/com/example/beijing_daxing/InActivity.java
@@ -83,19 +83,19 @@ public class InActivity extends BaseActivity implements AdapterClickCall {
String binchCode = vm.getBinchCode();
if (binchCode == null || epcList.isEmpty()) return;
vm.setEpcList(epcList);
- vm.setSubmitUser(SharedPreferencesUtils.getstring("user","test"));
+ vm.setSubmitUser(SharedPreferencesUtils.getstring("user", "test"));
OkGo.post(url + "/instore/submit")
.upRequestBody(RequestBody.create(JSON, gson.toJson(vm)))
- .execute(new MyRecultCall(dialog,this){
+ .execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response response) {
super.onSuccess(response);
- if (response.body().getCode()==0){
- Toast.makeText(InActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
+ Toast.makeText(InActivity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
+ if (response.body().getCode() == 0) {
finish();
- }else {
- Toast.makeText(InActivity.this, response.body().getMsg(), Toast.LENGTH_SHORT).show();
}
+
+
}
});
}
diff --git a/app/src/main/java/com/example/beijing_daxing/MainActivity.java b/app/src/main/java/com/example/beijing_daxing/MainActivity.java
index 2703e95..2ee1e70 100644
--- a/app/src/main/java/com/example/beijing_daxing/MainActivity.java
+++ b/app/src/main/java/com/example/beijing_daxing/MainActivity.java
@@ -66,7 +66,8 @@ public class MainActivity extends BaseActivity {
SharedPreferencesUtils.putstring("user",name);
SharedPreferencesUtils.putstring("pass",pass);
Intent intent=new Intent(MainActivity.this, HomePageActivity.class);
- intent.putExtra("json",response.body());
+ intent.putExtra("json",body);
+ intent.putExtra("user",name);
startActivity(intent);
finish();
}
@@ -75,11 +76,5 @@ public class MainActivity extends BaseActivity {
});
}
- @Override
- protected void onDestroy() {
- super.onDestroy();
- if (uhfLongerManager!=null){
- uhfLongerManager.close();
- }
- }
+
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java b/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java
index 4e8450e..e5d6ed0 100644
--- a/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java
+++ b/app/src/main/java/com/example/beijing_daxing/StoreCheckActivity.java
@@ -135,6 +135,7 @@ public class StoreCheckActivity extends BaseActivity {
@Override
protected void onDestroy() {
super.onDestroy();
+ handler.removeCallbacks(runnable);
handler=null;
runnable=null;
}
diff --git a/app/src/main/java/com/example/beijing_daxing/adapter/OutAdapter.java b/app/src/main/java/com/example/beijing_daxing/adapter/OutAdapter.java
new file mode 100644
index 0000000..94a9144
--- /dev/null
+++ b/app/src/main/java/com/example/beijing_daxing/adapter/OutAdapter.java
@@ -0,0 +1,65 @@
+package com.example.beijing_daxing.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+
+import androidx.databinding.DataBindingUtil;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.example.beijing_daxing.R;
+import com.example.beijing_daxing.been.Stock;
+import com.example.beijing_daxing.databinding.ItemOutBinding;
+import com.example.beijing_daxing.databinding.ItemStoreCheckBinding;
+
+import java.util.List;
+
+/**
+ * @author wanghao
+ * @date 2024/1/19 14:32
+ */
+public class OutAdapter extends RecyclerView.Adapter {
+ private Context context;
+ private List list;
+ private LayoutInflater inflater;
+
+ public OutAdapter(Context context) {
+ this.context = context;
+ inflater = LayoutInflater.from(context);
+ }
+
+ public void setList(List list) {
+ this.list = list;
+ }
+
+ @Override
+ public MyViewHoder onCreateViewHolder(ViewGroup parent, int viewType) {
+ ItemOutBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_out, parent, false);
+ return new MyViewHoder(binding);
+ }
+
+ @Override
+ public void onBindViewHolder(MyViewHoder holder, int position) {
+ var binding = holder.getBinding();
+ binding.setItem(list.get(position));
+
+ }
+
+ @Override
+ public int getItemCount() {
+ return list==null?0:list.size();
+ }
+
+ public class MyViewHoder extends RecyclerView.ViewHolder {
+ private ItemOutBinding binding;
+
+ public MyViewHoder( ItemOutBinding binding) {
+ super(binding.getRoot());
+ this.binding = binding;
+ }
+
+ public ItemOutBinding getBinding() {
+ return binding;
+ }
+ }
+}
diff --git a/app/src/main/java/com/example/beijing_daxing/base/BaseActivity.java b/app/src/main/java/com/example/beijing_daxing/base/BaseActivity.java
index c6b91a6..a692079 100644
--- a/app/src/main/java/com/example/beijing_daxing/base/BaseActivity.java
+++ b/app/src/main/java/com/example/beijing_daxing/base/BaseActivity.java
@@ -9,6 +9,8 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.media.MediaPlayer;
import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
import android.view.Window;
import android.widget.Toast;
@@ -23,14 +25,14 @@ import java.util.List;
import okhttp3.MediaType;
public abstract class BaseActivity extends AppCompatActivity {
- // public static String url = "http://192.168.0.102:90/api";
- public static String url = "http://172.20.10.2:90/api";
+ public static String url = "http://192.168.0.102:90/api";
+ // public static String url = "http://172.20.10.2:90/api";
public ProgressDialog dialog;
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
public UHFLongerManager uhfLongerManager;
private MediaPlayer mediaPlayer;
- private MyReceiver myReceiver;
+ public MyReceiver myReceiver;
public Intent broadcastIntent;
@@ -45,13 +47,18 @@ public abstract class BaseActivity extends AppCompatActivity {
broadcastIntent = new Intent("android.rfid.FUN_KEY");
broadcastIntent.putExtra("keydown", false);
}
+ // private long readTime = 0;
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
- if (!intent.getBooleanExtra("keydown", false)) {
+
+ var keydown = intent.getBooleanExtra("keydown", false);
+ if (!keydown ) {
+ // readTime = System.currentTimeMillis();
List strings = uhfLongerManager.inventoryRealTime();
+ Log.e("TAG", "驱动"+(uhfLongerManager==null) );
if (strings == null || strings.isEmpty()) {
return;
}
@@ -77,13 +84,13 @@ public abstract class BaseActivity extends AppCompatActivity {
registerReceiver(myReceiver, intentFilter);
mediaPlayer = MediaPlayer.create(this, R.raw.msg);
}
-
-
@Override
protected void onDestroy() {
super.onDestroy();
unregisterReceiver(myReceiver);
}
+
+
protected abstract void sanRfid(List epcs);
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/beijing_daxing/dialog/InPutDialog.java b/app/src/main/java/com/example/beijing_daxing/dialog/InPutDialog.java
new file mode 100644
index 0000000..54d10db
--- /dev/null
+++ b/app/src/main/java/com/example/beijing_daxing/dialog/InPutDialog.java
@@ -0,0 +1,48 @@
+package com.example.beijing_daxing.dialog;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.databinding.DataBindingUtil;
+
+import com.example.beijing_daxing.R;
+import com.example.beijing_daxing.databinding.DialogInputBinding;
+
+/**
+ * @author wanghao
+ * @date 2024/2/21 14:33
+ */
+public class InPutDialog extends Dialog {
+ private InPutDialogCall inPutDialogCall;
+ private DialogInputBinding binding;
+
+ public void setInPutDialogCall(InPutDialogCall inPutDialogCall) {
+ this.inPutDialogCall = inPutDialogCall;
+ }
+
+ public InPutDialog(@NonNull Context context) {
+ super(context, R.style.dialog);
+ binding = DataBindingUtil.inflate(LayoutInflater.from(context),
+ R.layout.dialog_input, null, false);
+ setContentView(binding.getRoot());
+ binding.dialogFalse.setOnClickListener(v -> dismiss());
+ binding.dialogTrue.setOnClickListener(v -> {
+ inPutDialogCall.inPutDialogReculi( binding.inputDialogText.getText().toString().trim());
+ });
+ }
+
+
+ public interface InPutDialogCall {
+ void inPutDialogReculi(String name);
+ }
+
+
+
+ @Override
+ public void show() {
+ super.show(); binding.inputDialogText.setText(null);
+ }
+}
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
index 07d5da9..3a1b6ed 100644
--- a/app/src/main/res/drawable/ic_launcher_background.xml
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -5,7 +5,7 @@
android:viewportWidth="108"
android:viewportHeight="108">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 8c7f7d5..59c4648 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -52,11 +52,14 @@
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
android:hint="用户名">
@@ -73,7 +76,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_out.xml b/app/src/main/res/layout/item_out.xml
new file mode 100644
index 0000000..335f21e
--- /dev/null
+++ b/app/src/main/res/layout/item_out.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index 6f3b755..0000000
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
deleted file mode 100644
index 6f3b755..0000000
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
deleted file mode 100644
index c209e78..0000000
Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
deleted file mode 100644
index b2dfe3d..0000000
Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
deleted file mode 100644
index 4f0f1d6..0000000
Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
deleted file mode 100644
index 62b611d..0000000
Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
deleted file mode 100644
index 948a307..0000000
Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
deleted file mode 100644
index 1b9a695..0000000
Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
deleted file mode 100644
index 28d4b77..0000000
Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
deleted file mode 100644
index 9287f50..0000000
Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
deleted file mode 100644
index aa7d642..0000000
Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
deleted file mode 100644
index 9126ae3..0000000
Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 51aa08a..2ec2511 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -61,4 +61,19 @@
- 8dp
+
+
+
\ No newline at end of file