xiugai 读取

idata
wangh 7 months ago
parent 71d1194158
commit bdea369f5b

@ -52,4 +52,5 @@ dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
// https://mvnrepository.com/artifact/com.contrarywind/Android-PickerView
// implementation 'com.contrarywind:Android-PickerView:4.1.9'
implementation 'org.litepal.android:java:3.0.0'
}

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:name=".base.MyApplication"
@ -13,6 +16,15 @@
android:supportsRtl="true"
android:theme="@style/Theme.Beijingdaxing"
tools:targetApi="31">
<receiver
android:name=".broadcast.MyNetWorkReceiver"
android:enabled="true"
android:exported="true">
</receiver>
<activity
android:name=".OffLineCheckActivity"
android:exported="false" />
<activity
android:name=".FpOutActivity"
android:exported="false" />
@ -39,19 +51,21 @@
<activity
android:name=".HomePageActivity"
android:exported="true">
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
</activity>
<activity
android:name=".MainActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true">
<!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> -->
</activity>
</application>
</manifest>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<litepal>
<dbname value="rfidcon" />
<version value="1" />
<list>
<mapping class="com.example.beijing_daxing.been.RFIDLocation"></mapping>
</list>
</litepal>

@ -1,9 +1,13 @@
package com.example.beijing_daxing;
import androidx.annotation.NonNull;
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.AdapterView;
import android.widget.Toast;
@ -31,6 +35,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
private List<Stock> list;
private List<String> selectList;
private ObservableBoolean state;
private ObservableBoolean checkState;
private InPutDialog inputDialog;
@Override
@ -39,8 +44,10 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
binding = DataBindingUtil.setContentView(this, R.layout.activity_check);
adapter = new CheckAdapter(this, this);
state = new ObservableBoolean();
checkState = new ObservableBoolean();
binding.setAdapter(adapter);
binding.setState(state);
binding.setCheckState(checkState);
selectList = Arrays.asList(getResources().getStringArray(R.array.check_item));
binding.checkItemSelect.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
@ -55,14 +62,12 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
}
});
initRequest();
inputDialog = new InPutDialog(this);
inputDialog.setInPutDialogCall(this);
}
// 初始化数据
private void initRequest() {
OkGo.<MyResult>post(url + "/xj/select").params("user", SharedPreferencesUtils.getstring("user", "")).execute(new MyRecultCall(dialog, this) {
@Override
@ -86,7 +91,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
}
private int subIndex = -1;
// 扫描一个验证
@Override
protected void sanRfid(List<String> epcs) {
var text = epcs.get(0);
@ -101,7 +106,7 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
subIndex = index;
}
//提交数据
public void check_submit(View view) {
var type = list.stream().anyMatch(t -> t.getState().equals("未检"));
@ -109,20 +114,16 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
Toast.makeText(this, "未检完全部轮挡,不允许提交", Toast.LENGTH_SHORT).show();
return;
}
OkGo.<MyResult>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<MyResult> response) {
super.onSuccess(response);
Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
finish();
}
});
OkGo.<MyResult>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<MyResult> response) {
super.onSuccess(response);
Toast.makeText(CheckActivity.this, "提交成功", Toast.LENGTH_SHORT).show();
finish();
}
});
}
// 一条数据保存
public void check_stock(View view) {
if (subIndex == -1) return;
var stock = list.get(subIndex);
@ -150,4 +151,29 @@ public class CheckActivity extends BaseActivity implements AdapterClickCall, InP
inputDialog.dismiss();
adapter.notifyDataSetChanged();
}
// 持续扫描按钮
public void offCheckRead(View view) {
var b = checkState.get();
if (b) {
handler.removeCallbacks(runnable);
} else {
handler.postDelayed(runnable, 0);
}
checkState.set(!b);
}
@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);
}
};
}

@ -4,6 +4,8 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
@ -11,35 +13,70 @@ 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.broadcast.MyNetWorkReceiver;
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 {
private MyNetWorkReceiver myNetWorkReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityHomePageBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_home_page);
List<HomeIcon> list = new ArrayList<>();
initUi(binding);
/* myNetWorkReceiver=new MyNetWorkReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
registerReceiver(myNetWorkReceiver, intentFilter);*/
}
private long exitTime = 0;
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == 4) {
if ((System.currentTimeMillis() - exitTime) > 2000) {
Toast.makeText(getApplicationContext(), "再按一次退出程序", Toast.LENGTH_SHORT).show();
exitTime = System.currentTimeMillis();
return true;
} else {
finish();
}
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onDestroy() {
super.onDestroy();
var uhfLongerManager = MyApplication.getUhfLongerManager();
uhfLongerManager.close();
MyApplication.uhfLongerManager = null;
// unregisterReceiver(myNetWorkReceiver);
}
private void initUi(ActivityHomePageBinding binding) {
List<HomeIcon> 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_check, "轮挡检查", CheckActivity.class));
list.add(new HomeIcon(R.mipmap.home_check, "轮挡巡检", OffLineCheckActivity.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, "废品出库", FpOutActivity.class));
var intent = getIntent();
try {
if (!intent.getStringExtra("user").equals("admin")) {
ArrayList<String> strings = new Gson().fromJson(intent.getStringExtra("json"), new TypeToken<ArrayList<String>>() {
@ -69,31 +106,4 @@ public class HomePageActivity extends AppCompatActivity {
}
});
}
private long exitTime = 0;
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == 4) {
if ((System.currentTimeMillis() - exitTime) > 2000) {
Toast.makeText(getApplicationContext(), "再按一次退出程序", Toast.LENGTH_SHORT).show();
exitTime = System.currentTimeMillis();
return true;
} else {
finish();
}
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onDestroy() {
super.onDestroy();
var uhfLongerManager = MyApplication.getUhfLongerManager();
uhfLongerManager.close();
MyApplication.uhfLongerManager = null;
}
}

@ -0,0 +1,86 @@
package com.example.beijing_daxing;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableBoolean;
import androidx.databinding.ViewDataBinding;
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.StoreCheckAdapter;
import com.example.beijing_daxing.base.BaseActivity;
import com.example.beijing_daxing.been.RFIDLocation;
import com.example.beijing_daxing.been.Stock;
import com.example.beijing_daxing.databinding.ActivityOffLineCheckBinding;
import org.litepal.LitePal;
import java.util.ArrayList;
import java.util.List;
public class OffLineCheckActivity extends BaseActivity {
private StoreCheckAdapter checkAdapter;
private ObservableBoolean checkState;
private List<Stock> list;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityOffLineCheckBinding binding;
binding = DataBindingUtil.setContentView(this, R.layout.activity_off_line_check);
checkState = new ObservableBoolean();
binding.setCheckState(checkState);
/* var all = LitePal.findAll(RFIDLocation.class);
if (all == null || all.isEmpty()) {
Toast.makeText(this, "", Toast.LENGTH_SHORT).show();
return;
}*/
list = new ArrayList<>();
// all.forEach(t -> {
// Stock stock = new Stock();
// stock.setLocationCode(t.getLocationCode());
// stock.setEpcCode(t.getEpcCode());
// list.add(stock);
// });
checkAdapter=new StoreCheckAdapter(this);
checkAdapter.setList(list);
checkAdapter = new StoreCheckAdapter(this);
binding.setAdapter(checkAdapter);
}
@Override
protected void sanRfid(List<String> epcs) {
}
public void offCheckRead(View view) {
var b = checkState.get();
if (b) {
handler.removeCallbacks(runnable);
} else {
handler.postDelayed(runnable, 0);
}
checkState.set(!b);
}
@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);
}
};
}

@ -25,8 +25,8 @@ 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:8090/api";
// public static String url = "http://175.27.215.92:8090/api";
public ProgressDialog dialog;
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");

@ -12,6 +12,8 @@ import com.lzy.okgo.cookie.store.MemoryCookieStore;
import com.lzy.okgo.https.HttpsUtils;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
import org.litepal.LitePal;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
@ -31,6 +33,7 @@ public class MyApplication extends Application {
public void onCreate() {
super.onCreate();
application = this;
LitePal.initialize(this);
SharedPreferencesUtils.init(getApplicationContext(), "myapp");
okGoBase();
getUhfLongerManager();

@ -0,0 +1,38 @@
package com.example.beijing_daxing.been;
import org.litepal.crud.LitePalSupport;
/**
* @author wanghao
* @date 2024/5/13 16:40
*/
public class RFIDLocation extends LitePalSupport {
private int id;
private String epcCode;
private String locationCode;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEpcCode() {
return epcCode;
}
public void setEpcCode(String epcCode) {
this.epcCode = epcCode;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
}

@ -2,13 +2,15 @@ package com.example.beijing_daxing.been;
import androidx.databinding.BaseObservable;
import org.litepal.crud.LitePalSupport;
import java.util.Objects;
/**
* @author wanghao
* @date 2024/1/19 13:45
*/
public class Stock extends BaseObservable {
public class Stock extends BaseObservable {
private int index;
private String epcCode;
private String locationCode;

@ -0,0 +1,82 @@
package com.example.beijing_daxing.broadcast;
import static com.example.beijing_daxing.base.BaseActivity.url;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.util.Log;
import android.widget.Toast;
import com.example.beijing_daxing.base.MyRecultCall;
import com.example.beijing_daxing.base.MyResult;
import com.example.beijing_daxing.been.RFIDLocation;
import com.example.beijing_daxing.been.Stock;
import com.example.beijing_daxing.uitls.SharedPreferencesUtils;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import org.litepal.LitePal;
import java.util.List;
public class MyNetWorkReceiver extends BroadcastReceiver {
private String wifiName = "";
private Gson gson;
public MyNetWorkReceiver() {
gson=new Gson();
}
@Override
public void onReceive(Context context, Intent intent) {
if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(intent.getAction())) {
NetworkInfo networkInfo = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
Log.e("TAG", "正在连接:" + networkInfo.isConnectedOrConnecting());
Log.e("TAG", "已连接:" + networkInfo.isConnected());
if (networkInfo != null && networkInfo.isConnected()) {
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
String ssid = wifiInfo.getSSID();
if (ssid != null) {
var newWifiNameState = ssid.equals("\"wang\"");
if (newWifiNameState && !wifiName.equals(ssid)) {
wifiName = ssid;
// 执行你的业务逻辑
Log.e("TAG", "onReceive:连接成功");
OkGo.<String>post(url + "/xj/selectLite")
.params("user", SharedPreferencesUtils.getstring("user", ""))
.execute(new StringCallback() {
@Override
public void onSuccess(Response<String> response) {
var body = response.body();
if (!body.equals("null")){
List<RFIDLocation> list = gson.fromJson(body, new TypeToken<List<RFIDLocation>>() {}.getType());
if (list!=null &&!list.isEmpty()){
LitePal.deleteAll(RFIDLocation.class);
LitePal.saveAll(list);
}
}
}
});
return;
}
}
}
Log.e("TAG", "onReceive:连接断开");
wifiName = "";
}
}
}

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="adapter"
type="com.example.beijing_daxing.adapter.CheckAdapter" />
@ -12,32 +13,38 @@
name="state"
type="androidx.databinding.ObservableBoolean" />
<import type="android.view.View"/>
<variable
name="checkState"
type="androidx.databinding.ObservableBoolean" />
<import type="android.view.View" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CheckActivity"
android:background="@color/bg1"
android:orientation="vertical">
android:orientation="vertical"
tools:context=".CheckActivity">
<TextView
style="@style/title_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:text="轮挡巡检" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="未巡检轮挡情况"
android:layout_marginTop="10dp"/>
android:layout_marginTop="10dp"
android:text="未巡检轮挡情况" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="450dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:adapter="@{adapter}"
android:padding="10dp" />
android:padding="10dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:layout_width="match_parent"
@ -57,12 +64,13 @@
android:layout_height="match_parent"
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@color/white"
android:layout_marginTop="10dp">
android:background="@color/white">
<TextView
style="@style/info_text"
@ -76,16 +84,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:entries="@array/check_item"
android:textAlignment="center"/>
android:textAlignment="center" />
</LinearLayout>
<LinearLayout
android:id="@+id/check_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:visibility='@{state ? View.GONE :View.VISIBLE }'
android:focusable="true"
android:focusableInTouchMode="true">
android:focusableInTouchMode="true"
android:visibility='@{state ? View.GONE :View.VISIBLE }'>
<TextView
style="@style/info_text"
@ -99,7 +108,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:minHeight="48dp"/>
android:minHeight="48dp" />
</LinearLayout>
<Button
@ -108,15 +117,35 @@
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:onClick="check_stock"
android:text="提交" />
<Button
style="@style/button_style"
android:text="单次提交" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_height="55dp"
android:layout_marginTop="10dp"
android:onClick="check_submit"
android:backgroundTint="#009688"
android:text="完成巡检" />
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:backgroundTint="@{checkState?@color/yellow:@color/black}"
android:onClick="offCheckRead"
android:text='@{checkState?"停止读取":"开始扫描"}'
android:textSize="20sp" />
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:backgroundTint="#009688"
android:onClick="check_submit"
android:text="完成巡检" />
</LinearLayout>
</LinearLayout>
</layout>

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="checkState"
type="androidx.databinding.ObservableBoolean" />
<variable
name="adapter"
type="com.example.beijing_daxing.adapter.StoreCheckAdapter" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".OffLineCheckActivity">
<TextView
style="@style/title_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:text="轮挡巡检" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:adapter="@{adapter}"
android:background="@color/white"
android:padding="10dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:backgroundTint="@{checkState?@color/yellow:@color/black}"
android:onClick="offCheckRead"
android:text='@{checkState?"停止读取":"开始扫描"}'
android:textSize="20sp" />
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:onClick="store_check_submit"
android:text="提交" />
</LinearLayout>
</LinearLayout>
</layout>

@ -22,7 +22,7 @@
style="@style/title_text"
android:layout_width="match_parent"
android:layout_height="45dp"
android:text="仓库盘点" />
android:text="盘点" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"

@ -11,7 +11,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:background='@{item.state.equals("Y")?@color/green:@color/item_bg}'
android:orientation="horizontal">
@ -28,34 +28,21 @@
android:layout_height="match_parent"
android:background="@color/white" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="@style/item_text_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="left"
android:text="@{item.epcCode}" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/white" />
<TextView
style="@style/item_text_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left"
android:layout_weight="1"
android:text="@{item.locationCode}" />
<TextView
android:layout_width="100dp"
android:layout_height="match_parent"
style="@style/item_text_style"
android:text="@{item.locationCode}" />
</LinearLayout>
<TextView
style="@style/item_text_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:minHeight="45dp"
android:gravity="left"
android:text="@{item.epcCode}" />
<View
@ -68,7 +55,7 @@
style="@style/item_text_style"
android:layout_width="63dp"
android:layout_height="match_parent"
android:text='@{item.state.equals("Y")?"已盘点":"未盘点"}'
android:text='@{item.state.equals("Y")?"已扫描":"未扫描"}'
android:textColor='@{item.state.equals("Y")?@color/black:@color/red}' />

@ -29,7 +29,7 @@
<item name="android:textColor">@color/white</item>
<item name="android:textSize">20sp</item>
<item name="android:gravity">center</item>
<item name="android:letterSpacing">0.8</item>
<item name="android:letterSpacing">0.2</item>
<item name="android:layout_marginStart">20dp</item>
<item name="android:layout_marginEnd">20dp</item>
</style>

Loading…
Cancel
Save