Browse Source

no message

master
lh 8 years ago
parent
commit
87896a28b7
4 changed files with 79 additions and 53 deletions
  1. +2
    -1
      app/src/main/java/com/qhclh/ytzh/index/shangpin/ShangpinFragment.java
  2. +2
    -1
      app/src/main/res/layout/fragment_index_shangpin.xml
  3. +74
    -51
      app/src/main/res/layout/item_shangpinpianqu.xml
  4. +1
    -0
      app/src/main/res/values/dimens.xml

+ 2
- 1
app/src/main/java/com/qhclh/ytzh/index/shangpin/ShangpinFragment.java View File

@ -24,6 +24,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -150,7 +151,7 @@ public class ShangpinFragment extends BaseFragment {
shangpin_zonglan.setText("总栏:"+rpc.getInt("ZongLan")); shangpin_zonglan.setText("总栏:"+rpc.getInt("ZongLan"));
shangpin_zongcunlan.setText("存栏:"+rpc.getInt("CunLan")); shangpin_zongcunlan.setText("存栏:"+rpc.getInt("CunLan"));
shangpin_zongkonglan.setText("空栏:"+rpc.getInt("KongLan")); shangpin_zongkonglan.setText("空栏:"+rpc.getInt("KongLan"));
shangpin_zongzhishu.setText("总只数:"+rpc.getDecimal("BreedNumber"));
shangpin_zongzhishu.setText("总只数:"+rpc.getDecimal("BreedNumber").setScale(0, BigDecimal.ROUND_DOWN));
} }
@Override @Override


+ 2
- 1
app/src/main/res/layout/fragment_index_shangpin.xml View File

@ -58,12 +58,13 @@
android:textSize="@dimen/text_size_14" /> android:textSize="@dimen/text_size_14" />
</LinearLayout> </LinearLayout>
<include layout="@layout/include_line"/>
<include layout="@layout/include_line"/>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rv_shangpinpianqu" android:id="@+id/rv_shangpinpianqu"
android:visibility="gone" android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"
android:scrollbars="none"> android:scrollbars="none">
</android.support.v7.widget.RecyclerView> </android.support.v7.widget.RecyclerView>


+ 74
- 51
app/src/main/res/layout/item_shangpinpianqu.xml View File

@ -1,73 +1,96 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_kuang"
android:orientation="vertical"
android:padding="@dimen/dp_10">
android:orientation="vertical">
<TextView
android:id="@+id/shangpinpianqu_name"
<android.support.v7.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/dp_5" />
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="@dimen/dp_4"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true"
tools:targetApi="lollipop">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/shangpinpianqu_zonglan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:padding="@dimen/dp_5" />
<TextView
android:id="@+id/shangpinpianqu_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="@color/colorAccent"
android:textSize="@dimen/text_size_16" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/shangpinpianqu_zonglan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:padding="@dimen/dp_5"
android:textSize="@dimen/text_size_14" />
<TextView
android:id="@+id/shangpinpianqu_cunlan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:padding="@dimen/dp_5" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/shangpinpianqu_konglan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:padding="@dimen/dp_5" />
<TextView
android:id="@+id/shangpinpianqu_cunlan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:padding="@dimen/dp_5"
android:textSize="@dimen/text_size_14" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
</LinearLayout>
<TextView
android:id="@+id/shangpinpianqu_konglan"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:padding="@dimen/dp_5"
android:textSize="@dimen/text_size_14" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout> </LinearLayout>

+ 1
- 0
app/src/main/res/values/dimens.xml View File

@ -28,6 +28,7 @@
<dimen name="dp_1">1dp</dimen> <dimen name="dp_1">1dp</dimen>
<dimen name="dp_2">2dp</dimen> <dimen name="dp_2">2dp</dimen>
<dimen name="dp_3">3dp</dimen> <dimen name="dp_3">3dp</dimen>
<dimen name="dp_4">4dp</dimen>
<dimen name="dp_5">5dp</dimen> <dimen name="dp_5">5dp</dimen>
<dimen name="dp_6">6dp</dimen> <dimen name="dp_6">6dp</dimen>
<dimen name="dp_7">7dp</dimen> <dimen name="dp_7">7dp</dimen>


Loading…
Cancel
Save