Commit e3782ee968e11ed4d4c5ee3c0a6b9379da7fd94b

Authored by 陶汉栋
2 parents f62d7dcc 20641deb
Exists in yxb_dev and in 1 other branch developer

no message

app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/AppContext.java
@@ -5,6 +5,7 @@ import android.content.Context; @@ -5,6 +5,7 @@ import android.content.Context;
5 import android.content.Intent; 5 import android.content.Intent;
6 import android.content.SharedPreferences; 6 import android.content.SharedPreferences;
7 import android.text.TextUtils; 7 import android.text.TextUtils;
  8 +import android.util.Log;
8 9
9 import com.amap.api.location.AMapLocation; 10 import com.amap.api.location.AMapLocation;
10 import com.amap.api.location.AMapLocationClient; 11 import com.amap.api.location.AMapLocationClient;
@@ -209,16 +210,22 @@ public class AppContext extends GlobalApplication { @@ -209,16 +210,22 @@ public class AppContext extends GlobalApplication {
209 @Override 210 @Override
210 public void onLocationChanged(AMapLocation aMapLocation) { 211 public void onLocationChanged(AMapLocation aMapLocation) {
211 if (null != aMapLocation) { 212 if (null != aMapLocation) {
212 -  
213 if (aMapLocation.getErrorCode() == 0) { 213 if (aMapLocation.getErrorCode() == 0) {
214 - cityName = aMapLocation.getCity();  
215 - district = aMapLocation.getDistrict();  
216 - aMapLocation.getCityCode(); 214 + String currName = AppConfig.getAppConfig(getContext()).get(AppConfig.DISTRICT);
  215 + Log.e("11111", currName);
  216 + if (currName != null && !"定位失败".equals(currName) &&! "".equals(currName)) {
  217 + district = AppConfig.getAppConfig(getContext()).get(AppConfig.DISTRICT);
  218 + } else {
  219 + cityName = aMapLocation.getCity();
  220 + district = aMapLocation.getDistrict();
  221 + aMapLocation.getCityCode();
  222 + }
  223 + AppConfig.getAppConfig(getContext()).set(AppConfig.DISTRICT, district);
217 Intent intent = new Intent(); 224 Intent intent = new Intent();
218 intent.setAction(LOCATION_CITYNAME + ""); 225 intent.setAction(LOCATION_CITYNAME + "");
219 sendBroadcast(intent); 226 sendBroadcast(intent);
  227 + Log.e("11111", "222222");
220 stopLocation(); 228 stopLocation();
221 - AppConfig.getAppConfig(getContext()).set(AppConfig.DISTRICT, district);  
222 } else { 229 } else {
223 cityName = "定位失败"; 230 cityName = "定位失败";
224 district = "定位失败"; 231 district = "定位失败";
app/src/main/java/com/shunzhi/parent/ui/activity/PersonInfoActivity.java
@@ -6,6 +6,7 @@ import android.support.annotation.NonNull; @@ -6,6 +6,7 @@ import android.support.annotation.NonNull;
6 import android.text.TextUtils; 6 import android.text.TextUtils;
7 import android.view.View; 7 import android.view.View;
8 import android.widget.EditText; 8 import android.widget.EditText;
  9 +import android.widget.ImageView;
9 import android.widget.RadioButton; 10 import android.widget.RadioButton;
10 import android.widget.TextView; 11 import android.widget.TextView;
11 12
@@ -26,9 +27,10 @@ import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter; @@ -26,9 +27,10 @@ import com.shunzhi.parent.presenter.mine.PersonInfoPrasenter;
26 public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract.PersonInfoPresenter, PersonInfoContract.IPersonInfoModel> 27 public class PersonInfoActivity extends BaseMVPCompatActivity<PersonInfoContract.PersonInfoPresenter, PersonInfoContract.IPersonInfoModel>
27 implements PersonInfoContract.IPersonInfoView, View.OnClickListener { 28 implements PersonInfoContract.IPersonInfoView, View.OnClickListener {
28 RoundedImageView user_image; 29 RoundedImageView user_image;
29 - TextView user_name, user_mobile, change_info; 30 + TextView user_name, user_mobile, change_info, center_title;
30 EditText et_name; 31 EditText et_name;
31 RadioButton man, women; 32 RadioButton man, women;
  33 + ImageView top_back;
32 34
33 35
34 @NonNull 36 @NonNull
@@ -48,6 +50,11 @@ public class PersonInfoActivity extends BaseMVPCompatActivity&lt;PersonInfoContract @@ -48,6 +50,11 @@ public class PersonInfoActivity extends BaseMVPCompatActivity&lt;PersonInfoContract
48 women = findViewById(R.id.women); 50 women = findViewById(R.id.women);
49 change_info = findViewById(R.id.change_info); 51 change_info = findViewById(R.id.change_info);
50 change_info.setOnClickListener(this); 52 change_info.setOnClickListener(this);
  53 + center_title = findViewById(R.id.center_title);
  54 + center_title.setText("个人资料");
  55 + top_back = findViewById(R.id.back_top);
  56 + top_back.setOnClickListener(this);
  57 +
51 initInfo(); 58 initInfo();
52 59
53 60
@@ -100,6 +107,9 @@ public class PersonInfoActivity extends BaseMVPCompatActivity&lt;PersonInfoContract @@ -100,6 +107,9 @@ public class PersonInfoActivity extends BaseMVPCompatActivity&lt;PersonInfoContract
100 107
101 mPresenter.ChangeInfoResult(et_name.getText().toString().trim(), sex, user_mobile.getText().toString().trim()); 108 mPresenter.ChangeInfoResult(et_name.getText().toString().trim(), sex, user_mobile.getText().toString().trim());
102 109
  110 + } else if (v == top_back) {
  111 + finish();
  112 +
103 } 113 }
104 } 114 }
105 115
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
@@ -11,7 +11,6 @@ import android.support.annotation.Nullable; @@ -11,7 +11,6 @@ import android.support.annotation.Nullable;
11 import android.support.annotation.RequiresApi; 11 import android.support.annotation.RequiresApi;
12 import android.support.v4.widget.NestedScrollView; 12 import android.support.v4.widget.NestedScrollView;
13 import android.text.TextUtils; 13 import android.text.TextUtils;
14 -import android.util.Log;  
15 import android.view.View; 14 import android.view.View;
16 import android.widget.EditText; 15 import android.widget.EditText;
17 import android.widget.ImageView; 16 import android.widget.ImageView;
@@ -84,10 +83,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu @@ -84,10 +83,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu
84 83
85 @Override 84 @Override
86 public void initUI(View view, @Nullable Bundle savedInstanceState) { 85 public void initUI(View view, @Nullable Bundle savedInstanceState) {
87 -  
88 recycler_context = view.findViewById(R.id.recycler_content); 86 recycler_context = view.findViewById(R.id.recycler_content);
89 - initRecycler();  
90 -  
91 nesteScrollView = view.findViewById(R.id.nesteScrollView); 87 nesteScrollView = view.findViewById(R.id.nesteScrollView);
92 ivSearch = view.findViewById(R.id.ivSearch); 88 ivSearch = view.findViewById(R.id.ivSearch);
93 xBanner = view.findViewById(R.id.xBanner); 89 xBanner = view.findViewById(R.id.xBanner);
@@ -102,7 +98,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu @@ -102,7 +98,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu
102 videoplayer.backButton.setVisibility(View.GONE); 98 videoplayer.backButton.setVisibility(View.GONE);
103 99
104 initBroadCast(); 100 initBroadCast();
105 - 101 + initRecycler();
106 initListeners(); 102 initListeners();
107 103
108 layout_consult.measure(0, 0); 104 layout_consult.measure(0, 0);
@@ -125,7 +121,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu @@ -125,7 +121,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu
125 //refresh data here 121 //refresh data here
126 pageIndex = 1; 122 pageIndex = 1;
127 contextList.clear(); 123 contextList.clear();
128 - mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); 124 + mPresenter.getContextChannel(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.DISTRICT), 0, 1, pageIndex);
129 recycler_context.refreshComplete(); 125 recycler_context.refreshComplete();
130 } 126 }
131 127
@@ -133,12 +129,12 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu @@ -133,12 +129,12 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu
133 public void onLoadMore() { 129 public void onLoadMore() {
134 // load more data here 130 // load more data here
135 pageIndex = pageIndex + 1; 131 pageIndex = pageIndex + 1;
136 - mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); 132 + mPresenter.getContextChannel(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.DISTRICT), 0, 1, pageIndex);
137 recycler_context.refreshComplete(); 133 recycler_context.refreshComplete();
138 } 134 }
139 }); 135 });
140 pageIndex = 1; 136 pageIndex = 1;
141 - mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, pageIndex); 137 + mPresenter.getContextChannel(AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.DISTRICT), 0, 1, pageIndex);
142 } 138 }
143 139
144 private void initListeners() { 140 private void initListeners() {
@@ -207,7 +203,6 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu @@ -207,7 +203,6 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu
207 } 203 }
208 204
209 private void initBroadCast() { 205 private void initBroadCast() {
210 -  
211 IntentFilter intentFilter = new IntentFilter(); 206 IntentFilter intentFilter = new IntentFilter();
212 intentFilter.addAction(AppContext.LOCATION_CITYNAME + ""); 207 intentFilter.addAction(AppContext.LOCATION_CITYNAME + "");
213 getActivity().registerReceiver(broadcastReceiver, intentFilter); 208 getActivity().registerReceiver(broadcastReceiver, intentFilter);
@@ -301,6 +296,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu @@ -301,6 +296,7 @@ public class ConsultFragment extends BaseMVPCompatFragment&lt;ConsultContract.Consu
301 mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1); 296 mPresenter.getContextChannel(name.split(" ")[2], 0, 1, 1);
302 AppContext.getInstance().cityName = name.split(" ")[1]; 297 AppContext.getInstance().cityName = name.split(" ")[1];
303 AppContext.getInstance().district = name.split(" ")[2]; 298 AppContext.getInstance().district = name.split(" ")[2];
  299 + AppConfig.getAppConfig(getContext()).set(AppConfig.DISTRICT, name.split(" ")[2]);
304 } 300 }
305 301
306 public void refresh() { 302 public void refresh() {
app/src/main/java/com/shunzhi/parent/ui/fragment/ReportFragment.java
@@ -233,7 +233,7 @@ public class ReportFragment extends BaseMVPCompatFragment&lt;MyChildContract.MyChil @@ -233,7 +233,7 @@ public class ReportFragment extends BaseMVPCompatFragment&lt;MyChildContract.MyChil
233 @Override 233 @Override
234 public CharSequence getPageTitle(int position) { 234 public CharSequence getPageTitle(int position) {
235 if (position==0){ 235 if (position==0){
236 - return "成长"; 236 + return "应用";
237 }else { 237 }else {
238 return "报告"; 238 return "报告";
239 } 239 }
app/src/main/res/layout/activity_personinfo.xml
@@ -26,18 +26,9 @@ @@ -26,18 +26,9 @@
26 android:layout_width="match_parent" 26 android:layout_width="match_parent"
27 android:layout_height="200dp" 27 android:layout_height="200dp"
28 android:background="@drawable/backgroud_top" 28 android:background="@drawable/backgroud_top"
29 - android:orientation="vertical"  
30 - > 29 + android:orientation="vertical">
31 30
32 - <TextView  
33 - android:layout_width="match_parent"  
34 - android:layout_height="?android:actionBarSize"  
35 - android:background="@color/back_top"  
36 - android:layout_gravity="center"  
37 - android:gravity="center"  
38 - android:text="个人资料"  
39 - android:textColor="@color/white"  
40 - android:textSize="@dimen/txtsize_headline" /> 31 + <include layout="@layout/top" />
41 32
42 33
43 </LinearLayout> 34 </LinearLayout>
app/src/main/res/layout/fragment_mine.xml
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 android:gravity="center" 27 android:gravity="center"
28 android:text="个人中心" 28 android:text="个人中心"
29 android:textColor="@color/white" 29 android:textColor="@color/white"
30 - android:textSize="@dimen/txtsize_headline" /> 30 + android:textSize="@dimen/sp_18" />
31 31
32 <LinearLayout 32 <LinearLayout
33 android:id="@+id/personinfo" 33 android:id="@+id/personinfo"
app/src/main/res/layout/top.xml
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 android:text="主题" 24 android:text="主题"
25 android:gravity="center" 25 android:gravity="center"
26 android:textColor="@color/white" 26 android:textColor="@color/white"
27 - android:textSize="@dimen/textSize16" /> 27 + android:textSize="@dimen/textSize18" />
28 <TextView 28 <TextView
29 android:layout_width="30dp" 29 android:layout_width="30dp"
30 android:layout_height="30dp" 30 android:layout_height="30dp"