Browse Source

weewewe

plate
fyf 1 year ago
parent
commit
a3c548521e
2 changed files with 3 additions and 5 deletions
  1. +2
    -2
      app/src/main/java/com/bpa/scalage/control/ConsumedAdapter.java
  2. +1
    -3
      app/src/main/res/layout/controlview/layout/consumed_item.xml

+ 2
- 2
app/src/main/java/com/bpa/scalage/control/ConsumedAdapter.java View File

@@ -53,11 +53,11 @@ public class ConsumedAdapter extends ArrayAdapter<BPA_SubOrder> {
{ {
bz=Double.parseDouble(order.remark); bz=Double.parseDouble(order.remark);
} }
dj.setText(String.format("%.2f", bz));
dj.setText(String.format("%.2f", bz)+" ¥/50g");
price.setText("¥"+String.format("%.2f", order.goodsRealPrice)); price.setText("¥"+String.format("%.2f", order.goodsRealPrice));
}catch(Exception e){ }catch(Exception e){
//异常捕获,例如输出异常信息 //异常捕获,例如输出异常信息
dj.setText(String.format("%.2f", 0));
dj.setText(String.format("%.2f", 0)+" ¥/50g");
price.setText("¥"+String.format("%.2f", 0)); price.setText("¥"+String.format("%.2f", 0));
}finally{ }finally{
//善后处理,无论是否异常,都会执行的部分 //善后处理,无论是否异常,都会执行的部分


+ 1
- 3
app/src/main/res/layout/controlview/layout/consumed_item.xml View File

@@ -30,10 +30,9 @@
android:textColor="@color/dc_wz" android:textColor="@color/dc_wz"
android:textSize="30dp" android:textSize="30dp"
/> />

<TextView <TextView
android:id="@+id/tv_consumed_dj" android:id="@+id/tv_consumed_dj"
android:layout_width="121dp"
android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="100dp" android:layout_marginLeft="100dp"
android:text="00.00¥/g" android:text="00.00¥/g"
@@ -50,6 +49,5 @@
android:textSize="30dp" android:textSize="30dp"
/> />
</TableRow> </TableRow>

</TableLayout> </TableLayout>
</RelativeLayout> </RelativeLayout>

Loading…
Cancel
Save