Browse Source

料仓

master
NXX 1 year ago
parent
commit
badf35b3c1
4 changed files with 82 additions and 20 deletions
  1. +2
    -2
      app/src/main/java/com/example/bpa/db/QueryDB.java
  2. +2
    -2
      app/src/main/java/com/example/bpa/view/from/lcsz_activity.java
  3. +55
    -0
      app/src/main/res/drawable/settingbutton.xml
  4. +23
    -16
      app/src/main/res/layout/from/layout/fragment_system_set.xml

+ 2
- 2
app/src/main/java/com/example/bpa/db/QueryDB.java View File

@@ -325,8 +325,8 @@ public class QueryDB {
*
* @param data
*/
public static void UpdateSilosAndMaterial(BPA_SILOSANDMATERIAL data) {
Update(BPA_SILOSANDMATERIAL.class, data);
public static boolean UpdateSilosAndMaterial(BPA_SILOSANDMATERIAL data) {
return Update(BPA_SILOSANDMATERIAL.class, data);
}

/**


+ 2
- 2
app/src/main/java/com/example/bpa/view/from/lcsz_activity.java View File

@@ -160,8 +160,8 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList
BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL();
item.silosID = currentSilo.id;
item.materialID = ((selectitem_adapter)viewHolder).getItem(position).id;;
if(QueryDB.UpdateSilosAndMaterial(item)){ //更新
//更新
if(QueryDB.UpdateSilosAndMaterial(item)){
currentSilo.materialName.setText(((selectitem_adapter)viewHolder).getItem(position).name);
}
}


+ 55
- 0
app/src/main/res/drawable/settingbutton.xml View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Button 被按下时的样式 -->
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="10dp" />
<gradient
android:startColor="#FF4081"
android:endColor="#FF6699"
android:type="linear"
android:angle="45" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
<stroke
android:width="2dp"
android:color="#FF4081" />
</shape>
<color android:color="#CCCCCC"/>
</item>

<!-- Button 正常状态下的样式 -->
<item>
<shape android:shape="rectangle">
<corners android:radius="10dp" />
<gradient
android:startColor="#0088ff"
android:endColor="#00bbff"
android:type="linear"
android:angle="45" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
<stroke
android:width="2dp"
android:color="#444444" />
<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp" />
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
<shadow
android:radius="5dp"
android:dx="0"
android:dy="2"
android:color="#800000000" />
</shape>
<color android:color="@color/white"/>
</item>
</selector>

+ 23
- 16
app/src/main/res/layout/from/layout/fragment_system_set.xml View File

@@ -9,24 +9,31 @@
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<Button
android:id="@+id/stparameter"
android:text="系统参数"
android:background="@drawable/settingbutton"
android:layout_margin="10dp"
android:textColor="@color/white"
/>
<Button
android:id="@+id/lcparameter"
android:text="料仓设置"
android:background="@drawable/settingbutton"
android:layout_margin="10dp"
android:textColor="@color/white"
/>
</TableLayout>
<Button
android:id="@+id/ConnectDevice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="连接设备"/>

<Button
android:id="@+id/ReadData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="读取数据"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>

<Button
android:id="@+id/WriteData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="写入数据"/>

</LinearLayout>

Loading…
Cancel
Save