ソースを参照

Merge remote-tracking branch 'origin/master'

740085783@qq.com 6 年 前
コミット
eb7d713d79

+ 29 - 16
app/src/main/java/com/silence/commonframe/activity/mine/activity/setup/FireMessageActivity.java

@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import butterknife.BindView;
+import butterknife.OnClick;
 
 /**
  * 推送管理
@@ -32,6 +33,8 @@ public class FireMessageActivity extends BaseActivity implements FireMessageList
     SmartRefreshLayout srlRefresh;
     @BindView(R.id.tv_no_message)
     TextView tvNoMsg;
+    @BindView(R.id.tv_submit)
+    TextView tvSubmit;
 
     List<SiteModel.DataBean.DataListBean> listDataBean = new ArrayList<>();
 
@@ -62,22 +65,6 @@ public class FireMessageActivity extends BaseActivity implements FireMessageList
         //设置分割线
         myRecyclerView.addItemDecoration(new LinearItemDecoration(FireMessageActivity.this,LinearLayoutManager.HORIZONTAL,8,getResources().getColor(R.color.thingray)));
 
-        myAdapter.setButtonClickListener((view, position) -> {
-            BaseDialog.DialogCallBack dialogCallBack=new BaseDialog.DialogCallBack() {
-                @Override
-                public void leftBtn() {
-                }
-
-                @Override
-                public void rightBtn() {
-                    startLoading();
-                    presenter.updatePhonePush();
-                }
-            };
-            new BaseDialog().BaseDialog(this,"提示","你确定要提交推送管理吗?","取消","确定",dialogCallBack);
-        });
-
-
         srlRefresh.setOnRefreshListener(refreshLayout -> {
             page = 1;
             presenter.getData();
@@ -88,6 +75,32 @@ public class FireMessageActivity extends BaseActivity implements FireMessageList
         });
     }
 
+    @OnClick(R.id.tv_submit)
+    public void onClick(View view){
+        switch (view.getId()){
+            case R.id.tv_submit:
+                BaseDialog.DialogCallBack dialogCallBack=new BaseDialog.DialogCallBack() {
+                    @Override
+                    public void leftBtn() {
+                    }
+
+                    @Override
+                    public void rightBtn() {
+                        startLoading();
+                        presenter.updatePhonePush();
+                    }
+                };
+                new BaseDialog().BaseDialog(FireMessageActivity.this,getResources().getString(R.string.tips),
+                        "你确定要提交推送管理吗?",
+                        getResources().getString(R.string.cancel),
+                        getResources().getString(R.string.sure),
+                        dialogCallBack);
+                break;
+            default:
+                break;
+        }
+    }
+
     @Override
     public int getPage() {
         return page;

+ 2 - 18
app/src/main/java/com/silence/commonframe/adapter/mine/FireMessageAdapter.java

@@ -30,9 +30,9 @@ public class FireMessageAdapter extends BaseQuickAdapter<SiteModel.DataBean.Data
         LinearLayout llMessage = helper.itemView.findViewById(R.id.cb_message_L);
         CheckBox cbPhoto = helper.itemView.findViewById(R.id.cb_photo);
         CheckBox cbMessage = helper.itemView.findViewById(R.id.cb_message);
-        TextView tvSubmit = helper.itemView.findViewById(R.id.submit);
 
-        tvDeployment.setText(data.getDeployment());
+        String deployment = "场所名称:" + data.getDeployment();
+        tvDeployment.setText(deployment);
 
         if ("1".equals(data.getIsTel())){
             cbPhoto.setChecked(true);
@@ -46,12 +46,6 @@ public class FireMessageAdapter extends BaseQuickAdapter<SiteModel.DataBean.Data
             cbMessage.setChecked(false);
         }
 
-        tvSubmit.setOnClickListener(v -> {
-            if (mListener != null){
-                mListener.buttonClick(v,helper.getAdapterPosition());
-            }
-        });
-
         llPhoto.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -100,14 +94,4 @@ public class FireMessageAdapter extends BaseQuickAdapter<SiteModel.DataBean.Data
     public List<SiteModel.DataBean.DataListBean> getListData() {
         return listData;
     }
-
-    public interface buttonClickListener{
-        void buttonClick(View view, int position);
-    }
-
-    buttonClickListener mListener;
-
-    public void setButtonClickListener(buttonClickListener mListener){
-        this.mListener = mListener;
-    }
 }

+ 3 - 3
app/src/main/res/drawable-hdpi/checkbox_style.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:drawable="@drawable/choose" android:state_checked="true"></item>
-    <item android:drawable="@drawable/unchoose" android:state_checked="false"></item>
-    <item android:drawable="@drawable/choose"></item>
+    <item android:drawable="@drawable/choose" android:state_checked="true"/>
+    <item android:drawable="@drawable/unchoose" android:state_checked="false"/>
+    <item android:drawable="@drawable/choose"/>
 </selector>

BIN
app/src/main/res/drawable-hdpi/choose.png


BIN
app/src/main/res/drawable-hdpi/unchoose.png


BIN
app/src/main/res/drawable/choose.png


BIN
app/src/main/res/drawable/unchoose.png


+ 16 - 6
app/src/main/res/layout/activity_fire_message.xml

@@ -4,8 +4,8 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical"
-   >
+    android:background="@color/white"
+    android:orientation="vertical">
 
     <com.silence.commonframe.base.basemvp.TitleBar
         android:id="@+id/base_title_bar"
@@ -15,7 +15,8 @@
     <com.scwang.smartrefresh.layout.SmartRefreshLayout
         android:id="@+id/srl_refresh"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="0dp"
+        android:layout_weight="1">
 
         <LinearLayout
             android:layout_width="match_parent"
@@ -42,10 +43,19 @@
 
         </LinearLayout>
 
-
-
     </com.scwang.smartrefresh.layout.SmartRefreshLayout>
 
-
+    <TextView
+        android:id="@+id/tv_submit"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:background="@color/myblue"
+        android:paddingTop="10dp"
+        android:paddingBottom="10dp"
+        android:text="@string/submit"
+        android:textColor="@color/white"
+        android:textSize="20sp"
+        android:layout_gravity="bottom" />
 
 </LinearLayout>

+ 24 - 36
app/src/main/res/layout/activity_search_message.xml

@@ -5,6 +5,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
+    android:background="@color/white"
     tools:context=".activity.message.activity.SearchMessageActivity">
 
     <com.silence.commonframe.base.basemvp.TitleBar
@@ -14,9 +15,10 @@
 
     <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="30dp"
+        android:layout_height="wrap_content"
+        android:padding="10dp"
         android:gravity="center_vertical"
-        android:background="#ccc"
+        android:background="@color/gray_line"
         android:id="@+id/checkBox_type_L">
 
         <CheckBox
@@ -24,7 +26,7 @@
             android:layout_width="20dp"
             android:layout_height="20dp"
             android:layout_gravity="center"
-            android:layout_marginLeft="10dp"
+            android:layout_marginLeft="5dp"
             android:checked="true"
             style="@style/CheckBoxStyle" />
 
@@ -49,7 +51,6 @@
             android:textColor="#444"
             android:layout_marginLeft="15dp"
             android:layout_gravity="center"
-            android:theme="@style/cb_style"
             android:checked="true"
             android:text="显示火警" />
 
@@ -59,7 +60,6 @@
             android:layout_weight="1"
             android:layout_height="wrap_content"
             android:layout_gravity="center"
-            android:theme="@style/cb_style"
             android:textColor="#444"
             android:checked="true"
             android:text="显示故障" />
@@ -70,23 +70,23 @@
             android:layout_weight="1"
             android:layout_height="wrap_content"
             android:layout_gravity="center"
-            android:theme="@style/cb_style"
             android:textColor="#444"
             android:checked="true"
             android:text="显示其他" />
     </LinearLayout>
     <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="30dp"
+        android:layout_height="wrap_content"
+        android:padding="10dp"
         android:gravity="center_vertical"
-        android:background="#ccc"
+        android:background="@color/gray_line"
         android:id="@+id/checkBox_type4_L">
 
         <CheckBox
             android:id="@+id/checkBox_type4"
             android:layout_width="20dp"
             android:layout_height="20dp"
-            android:layout_marginLeft="10dp"
+            android:layout_marginLeft="5dp"
             android:layout_gravity="center"
             android:checked="true"
             android:textColor="#444"
@@ -176,34 +176,22 @@
         </LinearLayout>
 
     </LinearLayout>
-
-    <LinearLayout
+    <View
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_weight="1"/>
+    <Button
         android:layout_width="match_parent"
-        android:layout_height="55dp"
-        android:gravity="center_vertical"
-        android:orientation="horizontal"
-        android:layout_marginTop="45dp">
-
-        <View
-            android:layout_width="10dp"
-            android:layout_height="match_parent"></View>
-
-        <Button
-            android:layout_width="0dp"
-            android:layout_weight="1"
-            android:layout_height="45dp"
-            android:onClick="searchMessage"
-            android:id="@+id/search"
-            android:background="@mipmap/login"
-            android:textColor="#fff"
-            android:textSize="20sp"
-            android:text="提交"/>
-
-        <View
-            android:layout_width="10dp"
-            android:layout_height="match_parent"></View>
-
-    </LinearLayout>
+        android:layout_height="45dp"
+        android:layout_marginLeft="@dimen/normal_side"
+        android:layout_marginRight="@dimen/normal_side"
+        android:layout_marginBottom="40dp"
+        android:onClick="searchMessage"
+        android:id="@+id/search"
+        android:background="@mipmap/login"
+        android:textColor="#fff"
+        android:textSize="20sp"
+        android:text="提交"/>
 
 </LinearLayout>
 

+ 57 - 95
app/src/main/res/layout/recyclerview_itemtest1.xml

@@ -2,116 +2,78 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:background="@color/white"
+    android:paddingTop="10dp"
+    android:paddingBottom="10dp"
+    android:paddingLeft="@dimen/normal_side"
+    android:paddingRight="@dimen/normal_side">
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="2dp"
-        android:layout_marginBottom="2dp"
+        android:gravity="center_vertical"
         android:orientation="horizontal">
 
-        <LinearLayout
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-            android:gravity="center_vertical"
-            android:layout_marginTop="3dp"
-            android:layout_marginBottom="3dp"
-            android:orientation="vertical">
+        <TextView
+            android:id="@+id/re_item"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:textSize="18sp"
+            android:text="测试四海带花掉"
+            android:textColor="@color/myblack" />
 
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:gravity="center_vertical"
-                android:orientation="horizontal">
-                <TextView
-                    android:id="@+id/re_item"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:gravity="center"
-                    android:textSize="18sp"
-                    android:text="测试四海带花掉"
-                    android:layout_marginLeft="20dp"
-                    android:textColor="@color/myblack"
-                    />
+    </LinearLayout>
 
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-                    <View
-                        android:layout_width="0dp"
-                        android:layout_height="match_parent"
-                        android:layout_weight="1"></View>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginTop="10dp"
+        android:orientation="horizontal">
 
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:background="@drawable/bg_corner_blue_thin"
-                        android:gravity="center"
-                        android:paddingTop="3dp"
-                        android:paddingBottom="3dp"
-                        android:paddingLeft="9dp"
-                        android:paddingRight="9dp"
-                        android:id="@+id/submit"
-                        android:textColor="@color/white"
-                        android:textSize="14sp"
-                        android:layout_marginRight="20dp"
-                        android:text="提交"/>
-                </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center_vertical"
+            android:id="@+id/cb_photo_L">
 
-            </LinearLayout>
+            <CheckBox
+                android:id="@+id/cb_photo"
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                style="@style/CheckBoxStyle" />
 
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_marginTop="4dp"
-                android:gravity="center_vertical">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="接收火警电话"
+                android:textColor="@color/myblack"
+                android:textSize="16sp"
+                android:layout_marginLeft="10dp"/>
 
-                <LinearLayout
-                    android:layout_width="wrap_content"
-                    android:layout_height="match_parent"
-                    android:gravity="center_vertical"
-                    android:id="@+id/cb_photo_L">
-                    <CheckBox
-                        android:id="@+id/cb_photo"
-                        android:layout_width="20dp"
-                        android:layout_height="20dp"
-                        android:layout_marginLeft="20dp"
-                        style="@style/CheckBoxStyle" />
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="接收火警电话"
-                        android:textColor="@color/myblack"
-                        android:textSize="15sp"
-                        android:layout_marginLeft="10dp"/>
-                </LinearLayout>
+        </LinearLayout>
 
-                <LinearLayout
-                    android:layout_width="wrap_content"
-                    android:layout_height="match_parent"
-                    android:gravity="center_vertical"
-                    android:id="@+id/cb_message_L">
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center_vertical"
+            android:id="@+id/cb_message_L">
 
-                    <CheckBox
-                        android:id="@+id/cb_message"
-                        android:layout_width="20dp"
-                        android:layout_height="20dp"
-                        android:layout_marginLeft="19dp"
-                        style="@style/CheckBoxStyle"
-                        />
-                    <TextView
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="接收短信通知"
-                        android:textColor="@color/myblack"
-                        android:textSize="15sp"
-                        android:layout_marginLeft="10dp"/>
+            <CheckBox
+                android:id="@+id/cb_message"
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                android:layout_marginLeft="20dp"
+                style="@style/CheckBoxStyle" />
 
-                </LinearLayout>
-            </LinearLayout>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="接收短信通知"
+                android:textColor="@color/myblack"
+                android:textSize="16sp"
+                android:layout_marginLeft="10dp"/>
 
         </LinearLayout>
 

+ 2 - 0
app/src/main/res/values/dimens.xml

@@ -9,6 +9,8 @@
 
     <dimen name="margin_side">15dp</dimen>
 
+    <dimen name="normal_side">15dp</dimen>
+
     <dimen name="bottom_Line">0.5dp</dimen>