@@ -325,8 +325,8 @@ public class QueryDB { | |||||
* | * | ||||
* @param data | * @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); | |||||
} | } | ||||
/** | /** | ||||
@@ -160,8 +160,8 @@ public class lcsz_activity extends AppCompatActivity implements View.OnClickList | |||||
BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | ||||
item.silosID = currentSilo.id; | item.silosID = currentSilo.id; | ||||
item.materialID = ((selectitem_adapter)viewHolder).getItem(position).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); | currentSilo.materialName.setText(((selectitem_adapter)viewHolder).getItem(position).name); | ||||
} | } | ||||
} | } | ||||
@@ -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> |
@@ -9,24 +9,31 @@ | |||||
<TableLayout | <TableLayout | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_height="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> | </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> | </LinearLayout> |