Browse Source

cypf

茶饮配方
lyw 9 months ago
parent
commit
77f6671e03
17 changed files with 705 additions and 56 deletions
  1. +17
    -0
      .idea/deploymentTargetDropDown.xml
  2. +1
    -1
      .idea/gradle.xml
  3. +1
    -1
      .idea/misc.xml
  4. +3
    -2
      app/build.gradle
  5. +4
    -4
      app/src/main/AndroidManifest.xml
  6. +16
    -0
      app/src/main/java/com/bonait/bnframework/ShaomaActivity.java
  7. +1
    -1
      app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java
  8. +9
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java
  9. +2
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/image_sp_adapter.java
  10. +63
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  11. +16
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/SerialInter.java
  12. +106
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/SerialManage.java
  13. +218
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/ShaoMaSave.java
  14. +9
    -2
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java
  15. +97
    -0
      app/src/main/res/layout/activity_shaoma.xml
  16. +92
    -0
      app/src/main/res/layout/fragment_make_good.xml
  17. +50
    -41
      app/src/main/res/layout/item/layout/dialog_edit.xml

+ 17
- 0
.idea/deploymentTargetDropDown.xml View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="P5J1XA341F" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2024-03-23T08:35:23.875508600Z" />
</component>
</project>

+ 1
- 1
.idea/gradle.xml View File

@@ -7,7 +7,7 @@
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="Android Studio default JDK" />
<option name="gradleJvm" value="corretto-11" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />


+ 1
- 1
.idea/misc.xml View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="corretto-11" project-jdk-type="JavaSDK" />
</project>

+ 3
- 2
app/build.gradle View File

@@ -111,8 +111,9 @@ dependencies {
// log日志框架
implementation 'com.orhanobut:logger:2.2.0'

// leak 内存泄漏检测
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3'

//leak 内存泄漏检测
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3'

//Modbus
implementation 'com.github.licheedev:Modbus4Android:2.0.2'


+ 4
- 4
app/src/main/AndroidManifest.xml View File

@@ -33,6 +33,9 @@
tools:ignore="GoogleAppIndexingWarning"
tools:node="merge"
tools:replace="android:icon">
<activity
android:name=".ShaomaActivity"
android:exported="false" />
<activity
android:name=".modules.home.fragment.mode.Silos_item_fragment"
android:exported="false"
@@ -43,7 +46,6 @@
<activity
android:name=".modules.mine.fragment.from.UserActivity"
android:exported="false" />

<activity
android:name=".modules.home.fragment.from.fragment.JiaoYan_sdkz_fragment"
android:exported="false"
@@ -56,7 +58,6 @@
android:name=".modules.home.fragment.from.WdszActivity"
android:exported="false"
tools:ignore="Instantiatable" />

<activity
android:name=".modules.home.fragment.from.DzcjyActivity"
android:exported="false"
@@ -174,8 +175,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".modules.welcome.activity.LoginActivity">
</activity>
<activity android:name=".modules.welcome.activity.LoginActivity"></activity>

<receiver
android:name=".common.base.BootReceiver"


+ 16
- 0
app/src/main/java/com/bonait/bnframework/ShaomaActivity.java View File

@@ -0,0 +1,16 @@
package com.bonait.bnframework;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Button;

import com.bonait.bnframework.common.base.BaseActivity;

public class ShaomaActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shaoma);
}
}

+ 1
- 1
app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java View File

@@ -52,7 +52,7 @@ public class BaseActivity extends QMUIActivity implements EasyPermissions.Permis
@Override
protected void onDestroy() {
super.onDestroy();
LocalCacheUtils.Get().releaseMemory();
/*LocalCacheUtils.Get().ClearBitmapFile();*/
}

/**


+ 9
- 2
app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationMainActivity.java View File

@@ -31,7 +31,10 @@ import com.bonait.bnframework.modules.home.fragment.GuanLifragment;
import com.bonait.bnframework.modules.home.fragment.JiaoYanFragment;
import com.bonait.bnframework.modules.home.fragment.MakeGoodFragment;
import com.bonait.bnframework.modules.home.fragment.SheZhifragment;
import com.bonait.bnframework.modules.home.fragment.mode.SerialInter;
import com.bonait.bnframework.modules.home.fragment.mode.SerialManage;
import com.bonait.bnframework.modules.mine.fragment.MyFragment;
import com.bumptech.glide.Glide;
import com.qmuiteam.qmui.widget.QMUIViewPager;

import java.util.ArrayList;
@@ -40,7 +43,7 @@ import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;

public class BottomNavigationMainActivity extends BaseActivity {
public class BottomNavigationMainActivity extends BaseActivity{

@BindView(R.id.mainTabBar)
MainNavigateTabBar mNavigateTabBar;
@@ -76,6 +79,8 @@ public class BottomNavigationMainActivity extends BaseActivity {
MediaPlayerHelper.getInstance().Release();
MQTT.get().ConnMqttBroken(false);//释放mqtt
super.onDestroy();

Glide.get(this).clearMemory();
}

private List<Fragment> fragmentList = new ArrayList<Fragment>();
@@ -84,10 +89,11 @@ public class BottomNavigationMainActivity extends BaseActivity {
* viewPager里添加fragment
*/
private void initFragment() {

fragmentList = new ArrayList<>();
fragmentList.add(new GongnengFragment());
fragmentList.add(new DingDanfragment());
fragmentList.add(new MakeGoodFragment());
fragmentList.add(new MakeGoodFragment(viewPager));
fragmentList.add(new SheZhifragment());
fragmentList.add(new MyFragment());
ConfigName.getInstance().fragmentAdapter = new FragmentAdapter(getSupportFragmentManager(), fragmentList);
@@ -115,6 +121,7 @@ public class BottomNavigationMainActivity extends BaseActivity {
ReconnectModbus();
//MQTT数据监听
OrderServer.Get().MqttInit();

}

/**


+ 2
- 0
app/src/main/java/com/bonait/bnframework/modules/home/adapter/image_sp_adapter.java View File

@@ -30,6 +30,7 @@ public class image_sp_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold

private final LayoutInflater mLayoutInflater;


private Context context;

List<image_sp> goods = new ArrayList<>();
@@ -68,6 +69,7 @@ public class image_sp_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold
try {
if (holder instanceof MyLCViewHolder1) {
MyLCViewHolder1 myViewHolder = (MyLCViewHolder1) holder;
//设置图片
new MyBitmapUtils().disPlay(myViewHolder.img,goods.get(position).url);
myViewHolder.img.setOnClickListener(new View.OnClickListener() {
@Override


+ 63
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java View File

@@ -71,6 +71,8 @@ import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.modules.home.adapter.loadinggood_adapter;
import com.bonait.bnframework.modules.home.adapter.wl_adapter;
import com.bonait.bnframework.modules.home.fragment.mode.SerialInter;
import com.bonait.bnframework.modules.home.fragment.mode.SerialManage;
import com.bonait.bnframework.modules.home.fragment.mode.add_makegood_control;
import com.bonait.bnframework.modules.home.fragment.mode.add_manguan_control;
import com.bonait.bnframework.modules.home.fragment.mode.add_pf_control;
@@ -78,9 +80,11 @@ import com.bumptech.glide.Glide;
import com.litao.slider.NiftySlider;
import com.orhanobut.logger.Logger;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;
import com.qmuiteam.qmui.widget.QMUIViewPager;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;

import java.security.PublicKey;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
@@ -90,8 +94,18 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
*
*/
public class MakeGoodFragment extends BaseFragment {

private String TAG="主页面";

public void InfoView(String shaoma){
shaoma_view.setVisibility(3);
shaoma_Text.setText(shaoma);
}
private QMUIViewPager viewPager;
@BindView(R.id.topbar)
QMUITopBarLayout mTopBar;//顶部标题

@@ -141,9 +155,23 @@ public class MakeGoodFragment extends BaseFragment {
@BindView(R.id.loadgoodliebiao)
RelativeLayout loadgoodliebiao;


/**
* 获取扫码内容
*/
@BindView(R.id.res_text)
TextView shaoma_Text;

/**
* 扫码界面展示
*/
@BindView(R.id.shaoma_view)
RelativeLayout shaoma_view;

private Context context;

public MakeGoodFragment() {
public MakeGoodFragment(QMUIViewPager viewPager) {
this.viewPager = viewPager;
}

@Override
@@ -163,6 +191,35 @@ public class MakeGoodFragment extends BaseFragment {
initTopBar();
Initdata();
Run();
SerialManage.GetInstance().init(new SerialInter() {
@Override
public void connectMsg(String path, boolean isSucc) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (isSucc){
CookieHelper.Show(activity, TAG, "扫码串口连接成功");
}else {
CookieHelper.Show(activity, TAG, "扫码串口连接失败");
}

}
});

}

@Override
public void readData(String path, byte[] bytes, int size) {
shaoma_Text.setText(new String(bytes));
Log.e(TAG,"串口号:"+path+"-输出字节长度:"+size);
shaoma_view.setVisibility(View.VISIBLE);
if (viewPager.getCurrentItem()>2){
viewPager.setCurrentItem(2);
}
}
});
//扫码串口连接
SerialManage.GetInstance().Open("/dev/ttyS4",9600,true);
}

public List<LinkMode> Fdata = new ArrayList<>();
@@ -402,7 +459,7 @@ public class MakeGoodFragment extends BaseFragment {
};
}

@OnClick({R.id.good_gengxin, R.id.cheng_clear, R.id.loadgood})
@OnClick({R.id.good_gengxin, R.id.cheng_clear, R.id.loadgood,R.id.no,R.id.yes})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.good_gengxin://刷新
@@ -428,6 +485,10 @@ public class MakeGoodFragment extends BaseFragment {
loadgoodliebiao.setVisibility(View.VISIBLE);
}
break;
case R.id.yes:
shaoma_view.setVisibility(View.GONE);
case R.id.no:
shaoma_view.setVisibility(View.GONE);

}
}


+ 16
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/SerialInter.java View File

@@ -0,0 +1,16 @@
package com.bonait.bnframework.modules.home.fragment.mode;

public interface SerialInter {
/**
* @param path 串口地址
* @param isSucc 连接状态
*/
void connectMsg(String path,boolean isSucc);

/**
* @param path 串口地址
* @param bytes 读取到的数据
* @param size 数据长度
*/
void readData(String path,byte[]bytes,int size);
}

+ 106
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/SerialManage.java View File

@@ -0,0 +1,106 @@
package com.bonait.bnframework.modules.home.fragment.mode;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

/**
*
*/
public class SerialManage {
public volatile static SerialManage _instance;
public static SerialManage GetInstance(){
if (_instance == null)
_instance = new SerialManage();
return _instance;
}

private ScheduledExecutorService scheduledExecutor;//线程池 统一管理保证只有一个
private ShaoMaSave shaoMaSave;//串口连接 发送 读取对象
private Queue<String> queueMsg = new ConcurrentLinkedQueue<String>();//线程安全到队列
private ScheduledFuture sendStrTask;//循环发送队列
private boolean isConnect = false;//串口是否连接



private SerialManage(){
scheduledExecutor = Executors.newScheduledThreadPool(8);//初始化8个线程
}

/**
* 获取线程池
* @return
*/
public ScheduledExecutorService getScheduledExecutor(){
return scheduledExecutor;
}

/**
* 串口初始化
* @param serialInter 串口接口
*/
public void init(SerialInter serialInter){
if (shaoMaSave == null){
shaoMaSave = new ShaoMaSave();
/*starSendTask();*///暂时关闭发送任务
}
shaoMaSave.addSerialInter(serialInter);
}

/**
* 打开串口
*/
public void Open(String path,int baudrate,boolean isRead){
isConnect = shaoMaSave.Open(path,baudrate,isRead);
}

public void Open(String path,int baudrate,int dataBits,int stopBits,int parity,boolean isRead){
isConnect = shaoMaSave.Open(path,baudrate,dataBits,stopBits,parity,isRead);
}

/**
* 发送指令
* @param msg
*/
public void send(String msg){
queueMsg.offer(msg);//向队列添加指令
}

/**
* 关闭串口
*/
public void Close(){
shaoMaSave.Close();
}

/**
* 启动发送任务
*/
private void starSendTask(){
CancelTask();
sendStrTask =scheduledExecutor.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
if (!isConnect) return;//串口未连接 退出
if (shaoMaSave == null) return;//串口未初始化
String msg = queueMsg.poll();//取出指令
if (msg == null||"".equals(msg)) return;//无效指令 退出
shaoMaSave.send(msg);//发送指令
}
},0,100, TimeUnit.MILLISECONDS);
}

private void CancelTask(){
if (sendStrTask == null) return;
sendStrTask.cancel(true);
try {
Thread.sleep(100);
}catch (InterruptedException e){
e.printStackTrace();
}
sendStrTask = null;
}
}

+ 218
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/ShaoMaSave.java View File

@@ -0,0 +1,218 @@
package com.bonait.bnframework.modules.home.fragment.mode;

import android.hardware.usb.UsbManager;
import android.serialport.SerialPort;
import android.util.Log;

import com.serotonin.modbus4j.serial.SerialMessage;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

import kotlin.text.UStringsKt;

/**
*
*/
public class ShaoMaSave implements Runnable{

private static final String Tag = "串口处理类";
private String path="";//串口地址
private SerialPort sp;//串口对象
private InputStream inputStream;//串口输入流对象
private BufferedInputStream bufferedInputStream;//监听硬件返回信息
private SerialInter serialInter;//串口回调接口
private OutputStream outputStream;//串口输出流对象 用于发送指令
private ScheduledFuture readTask;//串口读取任务

private boolean isRead = true;//是否循环读取


/**
* 回调接口
* @param serialInter
*/
public void addSerialInter(SerialInter serialInter){
this.serialInter = serialInter;
}

/**
* @param devicePath 串口地址
* @param baudrate 波特率
* @param isRead 是否持续监听返回数据
* @return 是否打开串口成功
*/
public boolean Open(String devicePath,int baudrate,boolean isRead){
return Open(devicePath,baudrate,8,1,0,isRead);
}

/**
* @param devicePath 串口地址
* @param baudrate 波特率
* @param dataBits 数据位
* @param stopBits 停止位
* @param parity 校验位
* @param isRead 是否持续监听
* @return 是否打开成功
*/
public boolean Open(String devicePath,int baudrate,int dataBits,int stopBits,int parity,boolean isRead){
boolean isSucc = false;
try{
if (sp != null) Close();//关闭
File device = new File(devicePath);
sp = SerialPort
.newBuilder(device,baudrate)
.dataBits(dataBits)
.stopBits(stopBits)
.parity(parity)
.build();//打开串口对象并返回
inputStream = sp.getInputStream();
bufferedInputStream = new BufferedInputStream(inputStream);
outputStream = sp.getOutputStream();
isSucc = true;
path = devicePath;
this.isRead = isRead;
if (isRead) readData();
}catch (Throwable tr){
Close();//关闭sp
isSucc = false;
}finally {
serialInter.connectMsg(path,isSucc);
return isSucc;
}
}

private void readData(){
new Thread(this).start();
}

@Override
public void run(){
while (this.isRead){
if (Thread.currentThread().isInterrupted()) continue;
try{
/*int available = inputStream.available();
if (available == 0) continue;*/
if (inputStream == null) continue;
byte[] received = new byte[1024];
int size = inputStream.read(received);
if (size>0&&serialInter!=null)
serialInter.readData(path,received,size);
Thread.sleep(20);
}catch (InterruptedException e){
Log.e(Tag,"线程异常"+e.toString());
}catch(IOException e){
Log.e(Tag,"串口读取异常:"+e.toString());
}
}

}

/**
* 关闭串口
*/
public void Close(){
try {
if (inputStream!=null) inputStream.close();
}catch (Exception e){
Log.e(Tag,"串口输入流对象关闭异常"+e.toString());
}
try{
if (outputStream!=null) outputStream.close();
}catch (Exception e){
Log.e(Tag,"串口输出流对象关闭异常"+e.toString());
}
try{
if (sp!=null) sp.close();
}catch (Exception e){
Log.e(Tag,"串口对象关闭异常"+e.toString());
}
}

/**
* 发送指令
* @param msg
*/
public void send(String msg){
byte[] bytes = hexStr2bytes(msg);
try {
outputStream.write(bytes);
}catch (Exception e){
e.printStackTrace();
}
}

/**
* 把十六进制表示的字节数组字符串,转换成十六进制字节数组
*
* @param
* @return byte[]
*/
private byte[] hexStr2bytes(String hex) {
int len = (hex.length() / 2);
byte[] result = new byte[len];
char[] achar = hex.toUpperCase().toCharArray();
for (int i = 0; i < len; i++) {
int pos = i * 2;
result[i] = (byte) (hexChar2byte(achar[pos]) << 4 | hexChar2byte(achar[pos + 1]));
}
return result;
}

/**
* 把16进制字符[0123456789abcde](含大小写)转成字节
* @param c
* @return
*/
private static int hexChar2byte(char c) {
switch (c) {
case '0':
return 0;
case '1':
return 1;
case '2':
return 2;
case '3':
return 3;
case '4':
return 4;
case '5':
return 5;
case '6':
return 6;
case '7':
return 7;
case '8':
return 8;
case '9':
return 9;
case 'a':
case 'A':
return 10;
case 'b':
case 'B':
return 11;
case 'c':
case 'C':
return 12;
case 'd':
case 'D':
return 13;
case 'e':
case 'E':
return 14;
case 'f':
case 'F':
return 15;
default:
return -1;
}
}


}

+ 9
- 2
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/add_good_control.java View File

@@ -164,7 +164,11 @@ public class add_good_control extends LinearLayout {
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
/*24-2-2 lyw 更改*/
if (editsp_fl.getSelectedItem()!=null){
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
}

Data.materialids=ids;
QueryDB.AddGoods(Data);
if (mListener != null) {
@@ -179,7 +183,10 @@ public class add_good_control extends LinearLayout {
Data.issc = 1;
Data.url = url;
Data.foreignKeyRe=edittext1.getText().toString();
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
/*24-2-2 lyw 更改*/
if (editsp_fl.getSelectedItem()!=null){
Data.goodtype=map_fl.get(editsp_fl.getSelectedItem().toString());
}
Data.materialids=ids;
QueryDB.UpdateGoods(Data);
if (mListener != null) {


+ 97
- 0
app/src/main/res/layout/activity_shaoma.xml View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ShaomaActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#A5000000">

<LinearLayout
android:layout_width="260dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/common_bg_with_radius_and_border"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="扫码结果"
android:layout_marginTop="20dp"
android:textColor="@color/blue"
android:textSize="20dp"
/>


<LinearLayout
android:layout_width="260dp"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="扫码编号:"
android:gravity="right"/>
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="left"
android:textSize="18dp"
android:textColor="@color/black"
android:text="1298731289"/>

</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="15dp"
android:background="#E4E4E4" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:orientation="horizontal">

<Button
android:id="@+id/no"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:singleLine="true"
android:text="取消"
android:textColor="@color/colorPrimary" />

<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="#E4E4E4" />

<Button
android:id="@+id/yes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:singleLine="true"
android:text="确 定"
android:textColor="@color/red_primary" />

</LinearLayout>
</LinearLayout>

</RelativeLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 92
- 0
app/src/main/res/layout/fragment_make_good.xml View File

@@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_color_blue">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -189,4 +190,95 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/app_color_blue" />
<RelativeLayout
android:id="@+id/shaoma_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:background="#A5000000">

<LinearLayout
android:layout_width="260dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/common_bg_with_radius_and_border"
android:orientation="vertical"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="扫码结果"
android:layout_marginTop="20dp"
android:textColor="@color/blue"
android:textSize="20dp"
/>


<LinearLayout
android:layout_width="260dp"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="扫码编号:"
android:gravity="right"/>
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="left"
android:textSize="18dp"
android:textColor="@color/black"
android:id="@+id/res_text"/>

</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="15dp"
android:background="#E4E4E4" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:orientation="horizontal">

<Button
android:id="@+id/no"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:singleLine="true"
android:text="取消"
android:textColor="@color/colorPrimary" />

<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="#E4E4E4" />

<Button
android:id="@+id/yes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center"
android:singleLine="true"
android:text="确 定"
android:textColor="@color/red_primary" />

</LinearLayout>
</LinearLayout>

</RelativeLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

+ 50
- 41
app/src/main/res/layout/item/layout/dialog_edit.xml View File

@@ -20,112 +20,123 @@
android:gravity="center"
android:text="标题"
android:textColor="@color/black"
android:textSize="@dimen/TitleSize"/>
android:textSize="@dimen/TitleSize" />

<LinearLayout
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="@dimen/dp_10"
android:text="选择菜谱"
android:textColor="@color/black"
android:layout_marginRight="@dimen/dp_10"/>
android:textColor="@color/black" />
<Spinner
android:id="@+id/editsp_cp"
style="@style/commonSpinnerStyle"
android:layout_width="140dp"
android:layout_height="24dp"
android:paddingLeft="@dimen/dp_10"
android:layout_centerVertical="true"/>
android:layout_centerVertical="true"
android:paddingLeft="@dimen/dp_10" />
</LinearLayout>

<LinearLayout
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="@dimen/dp_10"
android:text="商品大类"
android:textColor="@color/black"
android:layout_marginRight="@dimen/dp_10"/>
android:textColor="@color/black" />
<Spinner
android:id="@+id/editsp_dl"
style="@style/commonSpinnerStyle"
android:layout_width="140dp"
android:paddingLeft="@dimen/dp_10"

android:layout_height="24dp"
android:layout_centerVertical="true"/>

android:layout_centerVertical="true"
android:paddingLeft="@dimen/dp_10" />
</LinearLayout>

<LinearLayout
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="@dimen/dp_10"
android:text="商品小类"
android:textColor="@color/black"
android:layout_marginRight="@dimen/dp_10"/>
android:textColor="@color/black" />
<Spinner
android:id="@+id/editsp_xl"
style="@style/commonSpinnerStyle"
android:layout_width="140dp"
android:layout_height="24dp"
android:paddingLeft="@dimen/dp_10"
android:layout_centerVertical="true"

android:layout_centerVertical="true"/>
android:paddingLeft="@dimen/dp_10" />
</LinearLayout>

<LinearLayout
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="@dimen/dp_10"
android:text="商品单位"
android:textColor="@color/black"
android:layout_marginRight="@dimen/dp_10"/>
android:textColor="@color/black" />
<Spinner
android:id="@+id/editsp_dw"
style="@style/commonSpinnerStyle"
android:layout_width="140dp"
android:layout_height="24dp"
android:paddingLeft="@dimen/dp_10"
android:layout_centerVertical="true"/>
android:layout_centerVertical="true"
android:paddingLeft="@dimen/dp_10" />
</LinearLayout>

<LinearLayout
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/dp_10">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="@dimen/dp_10"
android:text="配方分类"
android:textColor="@color/black"
android:layout_marginRight="@dimen/dp_10"/>
android:textColor="@color/black" />
<Spinner
android:id="@+id/editsp_fl"
style="@style/commonSpinnerStyle"
android:layout_width="140dp"
android:layout_height="24dp"
android:paddingLeft="@dimen/dp_10"
android:layout_centerVertical="true"/>
android:layout_centerVertical="true"
android:paddingLeft="@dimen/dp_10" />
</LinearLayout>

<View
@@ -148,8 +159,7 @@
android:gravity="center"
android:singleLine="true"
android:text="取消"
android:textColor="@color/colorPrimary"
/>
android:textColor="@color/colorPrimary" />

<View
android:layout_width="1px"
@@ -165,8 +175,7 @@
android:gravity="center"
android:singleLine="true"
android:text="确 定"
android:textColor="@color/red_primary"
/>
android:textColor="@color/red_primary" />

</LinearLayout>
</LinearLayout>


Loading…
Cancel
Save