FANGLH 8 tahun lalu
induk
melakukan
563fa78600

+ 1 - 1
app_core/message/src/main/java/com/me/message/imp/BaseToastImpl.java

@@ -12,8 +12,8 @@ import android.view.Gravity;
 import android.widget.Toast;
 
 import com.me.message.interfacepack.BaseToast;
+import com.me.message.supertoasts.R;
 import com.me.message.utils.Utils;
-import com.umano.message.supertoasts.R;
 
 /**
  * 暂时做成工具类,后面调整灵活切换,这里不设置颜色

+ 1 - 1
app_core/network/src/main/java/com/me/network/app/http/HttpClient.java

@@ -120,7 +120,7 @@ public class HttpClient {
         public Builder() {
             this.method = Method.GET;
             this.params.put("client","Android Client");
-//            this.headers.put("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
+            this.headers.put("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
         }
 
         public Builder(String url) {

+ 1 - 1
app_modular/appme/src/main/java/com/uas/appme/settings/activity/BSettingActivity.java

@@ -28,7 +28,7 @@ public class BSettingActivity extends BaseActivity implements View.OnClickListen
         }else if (v.getId() == R.id.keshi_setting_rl){
             
         }else if (v.getId() == R.id.people_setting_rl){
-            startActivity(new Intent(this,PersonSettingActivity.class));
+            startActivity(new Intent(this,PersonSettingListActivity.class));
         }
     }
 

+ 15 - 19
app_modular/appme/src/main/java/com/uas/appme/settings/activity/PersonSettingActivity.java

@@ -2,10 +2,7 @@ package com.uas.appme.settings.activity;
 
 import android.app.AlertDialog;
 import android.content.DialogInterface;
-import android.content.Intent;
 import android.os.Bundle;
-import android.view.Menu;
-import android.view.MenuItem;
 import android.view.View;
 import android.widget.Button;
 import android.widget.RelativeLayout;
@@ -24,6 +21,7 @@ import com.me.network.app.http.rx.ResultListener;
 import com.me.network.app.http.rx.ResultSubscriber;
 import com.uas.appme.R;
 import com.uas.appme.settings.Constant.Constant;
+import com.uas.appme.settings.model.PersonSetingBean;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -75,11 +73,23 @@ public class PersonSettingActivity extends BaseActivity implements View.OnClickL
 
 
         //更新时的数据获取
-        Intent intent = getIntent();
-        sm_id = intent.getStringExtra("sm_id");
+        PersonSetingBean.ResultBean model = new PersonSetingBean.ResultBean();
+        model = getIntent().getParcelableExtra("model");
+        if (model != null)
+            showUpdatedata(model);
+    }
+
+    private void showUpdatedata(PersonSetingBean.ResultBean model) {
+        mUserNameTv.setText(model.getSm_username());
+        mUserDepartmentTv.setText(model.getSm_stname());
+        mUserJobTv.setText(model.getSm_level());
+        mUserTelTv.setText(model.getSm_telephone());
+        mUserEmailTv.setText("");
 
+        sm_id = model.getSm_id();
     }
 
+
     @Override
     public void onClick(View v) {
         if (v.getId() == R.id.user_sex_tv){
@@ -160,18 +170,4 @@ public class PersonSettingActivity extends BaseActivity implements View.OnClickL
                     }
                 }).setCancelable(true).create().show();
     }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        getMenuInflater().inflate(R.menu.bperson_setting_list, menu);
-        return super.onCreateOptionsMenu(menu);
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        if (item.getItemId() == R.id.more){
-            startActivity(new Intent(this,PersonSettingListActivity.class));
-        }
-        return super.onOptionsItemSelected(item);
-    }
 }

+ 47 - 5
app_modular/appme/src/main/java/com/uas/appme/settings/activity/PersonSettingListActivity.java

@@ -1,19 +1,26 @@
 package com.uas.appme.settings.activity;
 
+import android.content.Intent;
 import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.AdapterView;
 
 import com.alibaba.fastjson.JSON;
 import com.common.LogUtil;
 import com.common.data.JSONUtil;
 import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
+import com.core.widget.MyListView;
 import com.me.network.app.http.HttpClient;
 import com.me.network.app.http.Method;
 import com.me.network.app.http.rx.ResultListener;
 import com.me.network.app.http.rx.ResultSubscriber;
 import com.uas.appme.R;
-import com.uas.appme.pedometer.bean.PersonalStepBean;
 import com.uas.appme.settings.Constant.Constant;
+import com.uas.appme.settings.adapter.PSettingListAdapter;
+import com.uas.appme.settings.model.PersonSetingBean;
 
 /**
  * Created by FANGlh on 2017/10/11.
@@ -22,7 +29,9 @@ import com.uas.appme.settings.Constant.Constant;
 
 public class PersonSettingListActivity extends BaseActivity {
 
-    private PersonalStepBean mList;
+    private PersonSetingBean mList;
+    private MyListView psetting_list;
+    private PSettingListAdapter myAdapter;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -30,8 +39,17 @@ public class PersonSettingListActivity extends BaseActivity {
         setContentView(R.layout.person_setting_list_activity);
         initView();
         initData();
+        initEvents();
     }
 
+
+    private void initView() {
+        mList = new PersonSetingBean();
+        psetting_list = (MyListView) findViewById(R.id.psetting_list);
+        myAdapter = new PSettingListAdapter(this);
+        psetting_list.setAdapter(myAdapter);
+
+    }
     private void initData() {
         HttpClient httpClient = new HttpClient.Builder(Constant.BASE_BOOKING_SETTING_URL).isDebug(true).build(true);
         httpClient.Api().send(new HttpClient.Builder()
@@ -46,7 +64,9 @@ public class PersonSettingListActivity extends BaseActivity {
                 if (!JSONUtil.validate(o.toString()) || o == null) return;
                 LogUtil.prinlnLongMsg("appStoreman", o.toString()+"");
                 try {
-                    mList = JSON.parseObject(o.toString(),PersonalStepBean.class);
+                    mList = JSON.parseObject(o.toString(),PersonSetingBean.class);
+                    myAdapter.setModel(mList);
+                    myAdapter.notifyDataSetChanged();
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
@@ -55,7 +75,29 @@ public class PersonSettingListActivity extends BaseActivity {
 
     }
 
-    private void initView() {
-        mList = new PersonalStepBean();
+    private void initEvents() {
+        psetting_list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                Intent intent = new Intent(ct,PersonSettingActivity.class);
+                intent.putExtra("mdoel",mList.getResult().get(position));
+                LogUtil.prinlnLongMsg("intentmodel",JSON.toJSONString(mList.getResult().get(position)));
+                startActivity(intent);
+            }
+        });
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.add_new, menu);
+        return super.onCreateOptionsMenu(menu);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == R.id.add){
+            startActivity(new Intent(this,PersonSettingActivity.class));
+        }
+        return super.onOptionsItemSelected(item);
     }
 }

+ 69 - 0
app_modular/appme/src/main/java/com/uas/appme/settings/adapter/PSettingListAdapter.java

@@ -0,0 +1,69 @@
+package com.uas.appme.settings.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.uas.appme.R;
+import com.uas.appme.settings.model.PersonSetingBean;
+
+/**
+ * Created by FANGlh on 2017/10/12.
+ * function:
+ */
+
+public class PSettingListAdapter extends BaseAdapter {
+    private PersonSetingBean model;
+    private Context mContext;
+
+    public PSettingListAdapter(Context mContext){this.mContext = mContext;}
+    public PersonSetingBean getModel() {return model;}
+    public void setModel(PersonSetingBean model) {this.model = model;}
+
+    @Override
+    public int getCount() {
+        return model == null ? 0 : model.getResult().size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return model.getResult().get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        ViewHolder viewHolder = null;
+        if (convertView == null){
+            viewHolder = new ViewHolder();
+            convertView =  View.inflate(mContext, R.layout.psetting_item,null);
+            viewHolder.name_tv = (TextView) convertView.findViewById(R.id.name_tv);
+            viewHolder.company_tv = (TextView) convertView.findViewById(R.id.company_tv);
+            viewHolder.department_tv = (TextView) convertView.findViewById(R.id.department_tv);
+            viewHolder.position_tv = (TextView) convertView.findViewById(R.id.position_tv);
+            viewHolder.phone_tv = (TextView) convertView.findViewById(R.id.phone_tv);
+            convertView.setTag(viewHolder);
+        }else {
+            viewHolder = (ViewHolder) convertView.getTag();
+        }
+
+        viewHolder.name_tv.setText(model.getResult().get(position).getSm_username());
+        viewHolder.company_tv.setText(model.getResult().get(position).getSm_companyname());
+        viewHolder.department_tv.setText(model.getResult().get(position).getSm_stname());
+        viewHolder.position_tv.setText(model.getResult().get(position).getSm_level());
+        viewHolder.phone_tv.setText(model.getResult().get(position).getSm_telephone());
+        return convertView;
+    }
+
+    class ViewHolder{
+        TextView name_tv,company_tv,department_tv,position_tv,phone_tv;
+    }
+
+
+}

+ 54 - 2
app_modular/appme/src/main/java/com/uas/appme/settings/model/PersonSetingBean.java

@@ -1,5 +1,8 @@
 package com.uas.appme.settings.model;
 
+import android.os.Parcel;
+import android.os.Parcelable;
+
 import java.util.List;
 
 /**
@@ -7,7 +10,7 @@ import java.util.List;
  * function:
  */
 
-public class PersonSetingBean  {
+public class PersonSetingBean   {
 
     private List<ResultBean> result;
 
@@ -19,7 +22,7 @@ public class PersonSetingBean  {
         this.result = result;
     }
 
-    public static class ResultBean {
+    public static class ResultBean implements Parcelable {
         /**
          * sm_companyid : 201
          * sm_companyname : 北大医院
@@ -113,5 +116,54 @@ public class PersonSetingBean  {
         public void setSm_username(String sm_username) {
             this.sm_username = sm_username;
         }
+
+
+        @Override
+        public int describeContents() {
+            return 0;
+        }
+
+        @Override
+        public void writeToParcel(Parcel dest, int flags) {
+            dest.writeString(this.sm_companyid);
+            dest.writeString(this.sm_companyname);
+            dest.writeString(this.sm_id);
+            dest.writeString(this.sm_level);
+            dest.writeString(this.sm_stid);
+            dest.writeString(this.sm_stname);
+            dest.writeString(this.sm_telephone);
+            dest.writeString(this.sm_userid);
+            dest.writeString(this.sm_username);
+        }
+
+        public ResultBean() {
+        }
+
+        protected ResultBean(Parcel in) {
+            this.sm_companyid = in.readString();
+            this.sm_companyname = in.readString();
+            this.sm_id = in.readString();
+            this.sm_level = in.readString();
+            this.sm_stid = in.readString();
+            this.sm_stname = in.readString();
+            this.sm_telephone = in.readString();
+            this.sm_userid = in.readString();
+            this.sm_username = in.readString();
+        }
+
+        public static final Parcelable.Creator<ResultBean> CREATOR = new Parcelable.Creator<ResultBean>() {
+            @Override
+            public ResultBean createFromParcel(Parcel source) {
+                return new ResultBean(source);
+            }
+
+            @Override
+            public ResultBean[] newArray(int size) {
+                return new ResultBean[size];
+            }
+        };
     }
+
+
+
 }

+ 10 - 0
app_modular/appme/src/main/res/drawable/rl_circular_bg.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape>
+            <solid android:color="@color/white" />
+            <corners android:radius="8dp" />
+            <padding android:bottom="4dp" android:left="6dp" android:right="6dp" android:top="4dp" />
+        </shape>
+    </item>
+</selector>

+ 10 - 0
app_modular/appme/src/main/res/drawable/text_hint_bg.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape>
+            <solid android:color="#cecece" />
+            <corners android:radius="8dp" />
+            <padding android:bottom="2dp" android:left="10dp" android:right="10dp" android:top="2dp" />
+        </shape>
+    </item>
+</selector>

+ 24 - 0
app_modular/appme/src/main/res/layout/person_setting_list_activity.xml

@@ -3,4 +3,28 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
+    <com.core.widget.CustomerScrollView
+        android:id="@+id/csv_hide"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:fillViewport="true"
+        android:scrollbars="none"
+        android:visibility="visible">
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <com.core.widget.MyListView
+                android:id="@+id/psetting_list"
+                android:layout_marginLeft="25dp"
+                android:layout_marginRight="25dp"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:scrollbars="none"
+                android:paddingBottom="20dp">
+            </com.core.widget.MyListView>
+        </LinearLayout>
+    </com.core.widget.CustomerScrollView>
+
 </LinearLayout>

+ 113 - 0
app_modular/appme/src/main/res/layout/psetting_item.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginLeft="25dp"
+    android:layout_marginRight="25dp"
+    android:orientation="vertical"
+    >
+
+    <TextView
+        android:id="@+id/name_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginBottom="10dp"
+        android:layout_marginTop="15dp"
+        android:background="@drawable/text_hint_bg"
+        android:text="张三"
+        android:textColor="@color/green"
+        android:textSize="16sp"
+        />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:background="@drawable/rl_circular_bg">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <TextView
+                android:id="@+id/company_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingTop="5dp"
+                android:text="北大医院"
+                android:textColor="@color/green"
+                android:layout_alignParentTop="true"
+                android:layout_alignParentLeft="true"
+                android:layout_marginLeft="20dp"
+                />
+
+            <TextView
+                android:id="@+id/department_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingTop="10dp"
+                android:text="骨科"
+                android:textColor="@color/green"
+                android:layout_alignParentRight="true"
+                android:layout_marginRight="20dp"/>
+            <TextView
+                android:id="@+id/position_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingBottom="5dp"
+                android:paddingTop="10dp"
+                android:text="医师"
+                android:textColor="@color/green"
+                android:layout_below="@+id/department_tv"
+                android:layout_marginRight="20dp"
+                android:layout_alignParentRight="true"
+                />
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="2px"
+                android:background="@color/item_line"
+                android:layout_below="@+id/position_tv"
+                android:layout_marginLeft="20dp"
+                android:layout_marginRight="20dp"
+                />
+
+        </RelativeLayout>
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="10dp">
+            <ImageView
+                android:id="@+id/champion_im"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/phone"
+                />
+
+
+            <TextView
+                android:id="@+id/phone_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="18122222222"
+                android:textColor="@color/green"
+                android:layout_toRightOf="@+id/champion_im"
+                android:layout_marginLeft="15dp"
+                android:layout_centerVertical="true"/>
+
+
+            <ImageView
+                android:layout_width="15dp"
+                android:layout_height="15dp"
+                android:src="@drawable/next"
+                android:layout_marginRight="19dp"
+                android:layout_centerVertical="true"
+                android:layout_alignParentRight="true"
+                android:layout_alignParentEnd="true"
+                android:layout_marginEnd="19dp"
+                android:id="@+id/imageView3" />
+
+        </RelativeLayout>
+    </LinearLayout>
+</LinearLayout>

+ 12 - 0
app_modular/appme/src/main/res/menu/add_new.xml

@@ -0,0 +1,12 @@
+<menu 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"
+    tools:context="com.xzjmyk.pm.activity.MainActivity">
+
+    <item
+        android:id="@+id/add"
+        android:title="@string/add"
+        android:icon="@drawable/more"
+        app:showAsAction="ifRoom" />
+
+</menu>