Commit 73ba0df5f612ffcb3b9801a47d085c3db93bd0bf
1 parent
a5bcfdbccf
Exists in
master
测试个人中心
Showing
32 changed files
with
833 additions
and
185 deletions
Show diff stats
PersonalCenter/.idea/misc.xml
... | ... | @@ -37,7 +37,7 @@ |
37 | 37 | <ConfirmationsSetting value="0" id="Add" /> |
38 | 38 | <ConfirmationsSetting value="0" id="Remove" /> |
39 | 39 | </component> |
40 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
40 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
41 | 41 | <output url="file://$PROJECT_DIR$/build/classes" /> |
42 | 42 | </component> |
43 | 43 | <component name="ProjectType"> | ... | ... |
PersonalCenter/app/src/main/AndroidManifest.xml
... | ... | @@ -146,5 +146,6 @@ |
146 | 146 | <uses-permission android:name="android.permission.INTERNET" /> |
147 | 147 | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
148 | 148 | <uses-permission android:name="android.permission.READ_LOGS" /> |
149 | + <uses-permission android:name="android.permission.RESTART_PACKAGES\"/> | |
149 | 150 | |
150 | 151 | </manifest> |
151 | 152 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/AccountManagementActivity.java
... | ... | @@ -69,6 +69,7 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
69 | 69 | String school = null; |
70 | 70 | String addr = null; |
71 | 71 | String phote = null; |
72 | + String subAccountId = null; | |
72 | 73 | List<ChildsInfo.DataBean> childList = new ArrayList<>(); |
73 | 74 | List<ChildsInfo.DataBean> list = (List<ChildsInfo.DataBean>) msg.obj; |
74 | 75 | for (int i = 0; i < list.size(); i++) { |
... | ... | @@ -79,6 +80,7 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
79 | 80 | school = list.get(i).getSchool(); |
80 | 81 | addr = list.get(i).getRegion(); |
81 | 82 | phote = list.get(i).getImage(); |
83 | + subAccountId = list.get(i).getSubAccountId(); | |
82 | 84 | } else if (type == 2) { |
83 | 85 | childList.add(list.get(i)); |
84 | 86 | } |
... | ... | @@ -187,6 +189,7 @@ public class AccountManagementActivity extends AppCompatActivity implements View |
187 | 189 | overridePendingTransition(R.anim.rightin, R.anim.rightout); |
188 | 190 | break; |
189 | 191 | case R.id.add_account: |
192 | + Content.accountflag =2; | |
190 | 193 | Intent account = new Intent(); |
191 | 194 | account.setClass(AccountManagementActivity.this, RegisterInfoActivity.class); |
192 | 195 | startActivity(account); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ChoiseTextBookActivity.java
... | ... | @@ -5,13 +5,15 @@ import android.os.Bundle; |
5 | 5 | import android.os.Handler; |
6 | 6 | import android.os.Message; |
7 | 7 | import android.support.v7.app.AppCompatActivity; |
8 | -import android.util.Log; | |
9 | 8 | import android.view.View; |
10 | 9 | import android.widget.AdapterView; |
11 | 10 | import android.widget.Button; |
12 | 11 | import android.widget.GridView; |
13 | 12 | import android.widget.ImageView; |
13 | +import android.widget.TextView; | |
14 | +import android.widget.Toast; | |
14 | 15 | |
16 | +import com.facebook.drawee.view.SimpleDraweeView; | |
15 | 17 | import com.hjx.personalcenter.R; |
16 | 18 | import com.hjx.personalcenter.adapter.GridAdapter; |
17 | 19 | import com.hjx.personalcenter.customdialog.ElectronicCardDialog; |
... | ... | @@ -19,9 +21,7 @@ import com.hjx.personalcenter.customdialog.VerSionDialog; |
19 | 21 | import com.hjx.personalcenter.db.SaveParam; |
20 | 22 | import com.hjx.personalcenter.http.HttpCode; |
21 | 23 | import com.hjx.personalcenter.http.HttpManager; |
22 | -import com.hjx.personalcenter.interfaces.DialogCallBack; | |
23 | 24 | import com.hjx.personalcenter.model.DefautPublishInfo; |
24 | -import com.hjx.personalcenter.model.VersionInfo; | |
25 | 25 | import com.hjx.personalcenter.util.AlertUtils; |
26 | 26 | |
27 | 27 | import org.json.JSONException; |
... | ... | @@ -35,7 +35,7 @@ import java.util.List; |
35 | 35 | * Created by h on 2017/8/10. |
36 | 36 | */ |
37 | 37 | |
38 | -public class ChoiseTextBookActivity extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemClickListener, DialogCallBack.VersionCallBack { | |
38 | +public class ChoiseTextBookActivity extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemClickListener{ | |
39 | 39 | private GridView gridView; |
40 | 40 | private Button btn_ok; |
41 | 41 | private ImageView cancel; |
... | ... | @@ -75,6 +75,36 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On |
75 | 75 | defautPublishInfos.addAll( (List<DefautPublishInfo.DataBean>)msg.obj); |
76 | 76 | sim_adapter.notifyDataSetChanged(); |
77 | 77 | break; |
78 | + case HttpCode.REGISTERINFO_SUCESS: | |
79 | + try { | |
80 | + jsonObject = new JSONObject((String) msg.obj); | |
81 | + String statusregister = jsonObject.optString("status"); | |
82 | + if (statusregister.equals("1")) { | |
83 | + Toast.makeText(ChoiseTextBookActivity.this, "注册信息上传成功", Toast.LENGTH_LONG).show(); | |
84 | + String userID = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, "userId"); | |
85 | + try { | |
86 | + if (userID == null) { | |
87 | + AlertUtils.showToast(ChoiseTextBookActivity.this, "连接超时请重新登录!"); | |
88 | + | |
89 | + } else { | |
90 | + long auserID = Long.parseLong(userID); | |
91 | + //验证保卡信息 | |
92 | + HttpManager.getInstance().cardinfocheck(ChoiseTextBookActivity.this, auserID, handler); | |
93 | + } | |
94 | + | |
95 | + } catch (NumberFormatException e) { | |
96 | + e.printStackTrace(); | |
97 | + } | |
98 | + | |
99 | + } else { | |
100 | + AlertUtils.showToast(ChoiseTextBookActivity.this, "您好,服务器异常,请稍后重试"); | |
101 | + } | |
102 | + } catch (JSONException e) { | |
103 | + e.printStackTrace(); | |
104 | + } | |
105 | + | |
106 | + | |
107 | + break; | |
78 | 108 | |
79 | 109 | } |
80 | 110 | |
... | ... | @@ -85,11 +115,11 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On |
85 | 115 | protected void onCreate(Bundle savedInstanceState) { |
86 | 116 | super.onCreate(savedInstanceState); |
87 | 117 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); |
88 | - String graderid = SaveParam.getInstance().getLoginParam(this,SaveParam.GRADENS); | |
118 | + String graderid = SaveParam.getInstance().getCustomizeParam(this,SaveParam.GRADENS); | |
89 | 119 | try { |
90 | 120 | long auserID = Long.parseLong(userID); |
91 | 121 | int graderID = Integer.parseInt(graderid); |
92 | - //获取个人信息 | |
122 | + //获取版本信息 | |
93 | 123 | HttpManager.getInstance().getpublishinfo(this,auserID,graderID,handler); |
94 | 124 | |
95 | 125 | } catch (NumberFormatException e) { |
... | ... | @@ -126,16 +156,36 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On |
126 | 156 | switch (v.getId()) { |
127 | 157 | case R.id.btn_ok: |
128 | 158 | String userID = SaveParam.getInstance().getLoginParam(this, "userId"); |
159 | + String regionId = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.COUNTRY); | |
160 | + String regionId1 = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.CITYS); | |
161 | + if (regionId == null) { | |
162 | + regionId = regionId1; | |
163 | + } | |
164 | + String grade = SaveParam.getInstance().getCustomizeParam(ChoiseTextBookActivity.this, SaveParam.GRADENS); | |
165 | + String schoolid = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.SCHOOOlID); | |
166 | + String name = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.USERNAME); | |
167 | + String regeionname = SaveParam.getInstance().getLoginParam(ChoiseTextBookActivity.this, SaveParam.ADRESS); | |
168 | + String togoth ="人民教育出版社"; | |
169 | + | |
129 | 170 | try { |
130 | 171 | if (userID == null) { |
131 | 172 | AlertUtils.showToast(ChoiseTextBookActivity.this, "连接超时请重新登录!"); |
132 | 173 | |
133 | 174 | } else { |
175 | + Object schoolID; | |
134 | 176 | long auserID = Long.parseLong(userID); |
135 | - //验证保卡信息 | |
136 | - HttpManager.getInstance().cardinfocheck(this, auserID, handler); | |
177 | + int gradeID = Integer.parseInt(grade); | |
178 | + long regionID = Long.parseLong(regionId); | |
179 | + if (schoolid==null){ | |
180 | + schoolID =null; | |
181 | + }else { | |
182 | + schoolID = Long.parseLong(schoolid); | |
183 | + } | |
184 | + | |
137 | 185 | //提交注册信息 |
138 | - HttpManager.getInstance().cardinfocheck(this, auserID, handler); | |
186 | + HttpManager.getInstance().subregisterinfo(ChoiseTextBookActivity.this, auserID, | |
187 | + name ,gradeID,regionID,regeionname,schoolID,togoth,togoth,togoth,togoth | |
188 | + ,togoth,togoth,togoth,togoth,togoth,togoth,handler); | |
139 | 189 | } |
140 | 190 | |
141 | 191 | } catch (NumberFormatException e) { |
... | ... | @@ -152,17 +202,15 @@ public class ChoiseTextBookActivity extends AppCompatActivity implements View.On |
152 | 202 | |
153 | 203 | @Override |
154 | 204 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) { |
155 | - SaveParam.getInstance().saveLoginParam(this,SaveParam.VERSION,defautPublishInfos.get(position).getSubject()); | |
156 | - VerSionDialog.getInstance(this).show(getSupportFragmentManager(), "VerSionDialog"); | |
157 | - | |
158 | - | |
205 | + SaveParam.getInstance().saveLoginParam(this,SaveParam.SUBJECT,defautPublishInfos.get(position).getSubject()); | |
206 | + VerSionDialog.getInstance().show(getSupportFragmentManager(), "VerSionDialog"); | |
207 | + | |
208 | + String imgurl = SaveParam.getInstance().getLoginParam(this, SaveParam.IMGURL); | |
209 | + String version = SaveParam.getInstance().getLoginParam(this, SaveParam.VERSION); | |
210 | + SimpleDraweeView simpleDraweeView = (SimpleDraweeView) parent.findViewById(R.id.image_publish); | |
211 | + TextView publish = (TextView) parent.findViewById(R.id.tv_publish); | |
212 | + simpleDraweeView.setImageURI(imgurl); | |
213 | + publish.setText(version); | |
159 | 214 | } |
160 | 215 | |
161 | - @Override | |
162 | - public void versionOnItemClick(ArrayList<VersionInfo.DataBean> data, int position, int type) { | |
163 | - | |
164 | - Log.e("...........",""+data); | |
165 | - | |
166 | - | |
167 | - } | |
168 | 216 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/ElectronicCardEditInfoActivity.java
... | ... | @@ -39,7 +39,7 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements |
39 | 39 | private EditText username,store,detalAdress,telphone; |
40 | 40 | private TimePickerView pvTime; |
41 | 41 | private Button btn_change_info; |
42 | - private ImageView iv_card_back; | |
42 | + private ImageView iv_card_back,shop_adress,custom_adress; | |
43 | 43 | |
44 | 44 | @Override |
45 | 45 | protected void onCreate(Bundle savedInstanceState) { |
... | ... | @@ -61,6 +61,8 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements |
61 | 61 | telphone = (EditText) findViewById(R.id.et_edit_telphone); |
62 | 62 | btn_change_info = (Button) findViewById(R.id.btn_change_info); |
63 | 63 | iv_card_back = (ImageView) findViewById(R.id.iv_card_back); |
64 | + shop_adress = (ImageView) findViewById(R.id.shopdizhi); | |
65 | + custom_adress = (ImageView) findViewById(R.id.cunstomdizhi); | |
64 | 66 | } |
65 | 67 | |
66 | 68 | private void initData() { |
... | ... | @@ -73,6 +75,9 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements |
73 | 75 | adress_shop.setOnClickListener(this); |
74 | 76 | adress_custem.setOnClickListener(this); |
75 | 77 | btn_change_info.setOnClickListener(this); |
78 | + iv_card_back.setOnClickListener(this); | |
79 | + shop_adress.setOnClickListener(this); | |
80 | + custom_adress.setOnClickListener(this); | |
76 | 81 | |
77 | 82 | } |
78 | 83 | |
... | ... | @@ -103,11 +108,13 @@ public class ElectronicCardEditInfoActivity extends AppCompatActivity implements |
103 | 108 | |
104 | 109 | break; |
105 | 110 | case R.id.tv_edit_adress_shop: |
111 | + case R.id.shopdizhi: | |
106 | 112 | Content.adressflag =1; |
107 | 113 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) this).show(getSupportFragmentManager(), "ProvinceListDialog"); |
108 | 114 | |
109 | 115 | break; |
110 | 116 | case R.id.tv_edit_adress_custem: |
117 | + case R.id.cunstomdizhi: | |
111 | 118 | Content.adressflag =2; |
112 | 119 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) this).show(getSupportFragmentManager(), "ProvinceListDialog"); |
113 | 120 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MainActivity.java
... | ... | @@ -29,13 +29,17 @@ import com.facebook.drawee.interfaces.DraweeController; |
29 | 29 | import com.facebook.drawee.view.SimpleDraweeView; |
30 | 30 | import com.hjx.personalcenter.R; |
31 | 31 | import com.hjx.personalcenter.adapter.GalleryAdapter; |
32 | +import com.hjx.personalcenter.adapter.VideoAdapter; | |
32 | 33 | import com.hjx.personalcenter.customdialog.HeadDialog; |
34 | +import com.hjx.personalcenter.customdialog.RecyclerViewSpaceItem; | |
33 | 35 | import com.hjx.personalcenter.db.SaveParam; |
34 | 36 | import com.hjx.personalcenter.http.HttpCode; |
35 | 37 | import com.hjx.personalcenter.http.HttpManager; |
36 | 38 | import com.hjx.personalcenter.interfaces.DialogCallBack; |
39 | +import com.hjx.personalcenter.model.DefautPublishInfo; | |
37 | 40 | import com.hjx.personalcenter.model.PesonalInfo; |
38 | 41 | import com.hjx.personalcenter.model.SignInfo; |
42 | +import com.hjx.personalcenter.model.VideoInfo; | |
39 | 43 | import com.hjx.personalcenter.update.UpdateChecker; |
40 | 44 | import com.hjx.personalcenter.util.AlertUtils; |
41 | 45 | import com.hjx.personalcenter.util.CropUtils; |
... | ... | @@ -53,7 +57,6 @@ import com.zaaach.toprightmenu.TopRightMenu; |
53 | 57 | import java.io.File; |
54 | 58 | import java.io.UnsupportedEncodingException; |
55 | 59 | import java.util.ArrayList; |
56 | -import java.util.Arrays; | |
57 | 60 | import java.util.List; |
58 | 61 | |
59 | 62 | public class MainActivity extends AppCompatActivity implements View.OnClickListener, DialogCallBack.CallBackView { |
... | ... | @@ -65,9 +68,12 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
65 | 68 | private TopRightMenu mTopRightMenu; |
66 | 69 | //水平滑动 |
67 | 70 | private RecyclerView mRecyclerView; |
68 | - private GalleryAdapter RecyclerViewadapter; | |
69 | - private List<Integer> mDatas = new ArrayList<Integer>(Arrays.asList(R.mipmap.default_avatar2, | |
70 | - R.mipmap.default_avatar2, R.mipmap.default_avatar2, R.mipmap.default_avatar2)); | |
71 | + private RecyclerView mRecyclerViewpublish; | |
72 | + private VideoAdapter RecyclerViewadapter; | |
73 | + private GalleryAdapter RecyclerViewadapterpublish; | |
74 | + private ArrayList<DefautPublishInfo.DataBean> defautPublishInfos = new ArrayList<>(); | |
75 | + | |
76 | + private ArrayList<VideoInfo.DataBean> videoinfo = new ArrayList<>(); | |
71 | 77 | private boolean showIcon = true; |
72 | 78 | private boolean dimBg = true; |
73 | 79 | private boolean needAnim = true; |
... | ... | @@ -110,6 +116,16 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
110 | 116 | } |
111 | 117 | |
112 | 118 | break; |
119 | + case HttpCode.PUBLISH_SUCESS: | |
120 | + defautPublishInfos.clear(); | |
121 | + defautPublishInfos.addAll( (List<DefautPublishInfo.DataBean>)msg.obj); | |
122 | + RecyclerViewadapterpublish.notifyDataSetChanged(); | |
123 | + break; | |
124 | + case HttpCode.GETVIDIO_SUCESS: | |
125 | + videoinfo.clear(); | |
126 | + videoinfo.addAll( (List<VideoInfo.DataBean>)msg.obj); | |
127 | + RecyclerViewadapter.notifyDataSetChanged(); | |
128 | + break; | |
113 | 129 | } |
114 | 130 | } |
115 | 131 | }; |
... | ... | @@ -161,21 +177,32 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
161 | 177 | linel_myclass = (LinearLayout) findViewById(R.id.linel_myclass); |
162 | 178 | // |
163 | 179 | mRecyclerView = (RecyclerView) findViewById(R.id.id_recyclerview_horizontal); |
180 | + mRecyclerViewpublish =(RecyclerView) findViewById(R.id.id_recyclerview_pubish); | |
164 | 181 | |
165 | 182 | } |
166 | 183 | |
167 | 184 | |
168 | 185 | private void initData() { |
169 | - //加载最近学习视频 | |
170 | - | |
171 | - | |
172 | 186 | //设置布局管理器 |
173 | 187 | LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); |
174 | 188 | linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); |
189 | + | |
190 | + LinearLayoutManager linearLayoutManagerpublish = new LinearLayoutManager(this); | |
191 | + linearLayoutManagerpublish.setOrientation(LinearLayoutManager.HORIZONTAL); | |
192 | + | |
175 | 193 | mRecyclerView.setLayoutManager(linearLayoutManager); |
176 | - //设置适配器 | |
177 | - RecyclerViewadapter = new GalleryAdapter(this, mDatas); | |
194 | + mRecyclerView.addItemDecoration(new RecyclerViewSpaceItem(10)); | |
195 | + | |
196 | + mRecyclerViewpublish.setLayoutManager(linearLayoutManagerpublish); | |
197 | + mRecyclerViewpublish.addItemDecoration(new RecyclerViewSpaceItem(10)); | |
198 | + | |
199 | + //设置视频适配器 | |
200 | + RecyclerViewadapter = new VideoAdapter(this,videoinfo); | |
201 | + RecyclerViewadapterpublish= new GalleryAdapter(this,defautPublishInfos); | |
202 | + | |
203 | + //版本信息适配器 | |
178 | 204 | mRecyclerView.setAdapter(RecyclerViewadapter); |
205 | + mRecyclerViewpublish.setAdapter(RecyclerViewadapterpublish); | |
179 | 206 | |
180 | 207 | //加载个人信息 |
181 | 208 | String xiongzuo = SaveParam.getInstance().getLoginParam(this,SaveParam.CONSTELLATION); |
... | ... | @@ -184,11 +211,9 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
184 | 211 | }else { |
185 | 212 | tv_mygad.setText(xiongzuo); |
186 | 213 | } |
187 | - //加载版本信息 | |
188 | - | |
214 | + String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | |
189 | 215 | |
190 | 216 | //获取个性签名 |
191 | - String userID = SaveParam.getInstance().getLoginParam(this,"userId"); | |
192 | 217 | String typeaccount = SaveParam.getInstance().getCustomizeParam(this,SaveParam.ACCOUNT); |
193 | 218 | try { |
194 | 219 | long auserID = Long.parseLong(userID); |
... | ... | @@ -344,12 +369,26 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
344 | 369 | protected void onResume() { |
345 | 370 | super.onResume(); |
346 | 371 | String userID = SaveParam.getInstance().getLoginParam(this,"userId"); |
347 | - String typeaccount = SaveParam.getInstance().getCustomizeParam(this,SaveParam.ACCOUNT); | |
372 | + String graderid = SaveParam.getInstance().getCustomizeParam(this,SaveParam.GRADENS); | |
373 | + //子账户年级id | |
374 | + String graderidchilds = SaveParam.getInstance().getCustomizeParam(this,SaveParam.CHILDSGRADENS); | |
375 | + //账户类型 | |
376 | + String accounts = SaveParam.getInstance().getCustomizeParam(this,SaveParam.ACCOUNT); | |
348 | 377 | try { |
378 | + int graderID; | |
349 | 379 | long auserID = Long.parseLong(userID); |
350 | - int typeaccount1=Integer.parseInt(typeaccount); | |
380 | + int typeaccount1=Integer.parseInt(accounts); | |
381 | + if ("2".equals(accounts)){ | |
382 | + graderID = Integer.parseInt(graderidchilds); | |
383 | + }else { | |
384 | + graderID = Integer.parseInt(graderid); | |
385 | + } | |
351 | 386 | //获取个人信息 |
352 | 387 | HttpManager.getInstance().getpresonalinfo(MainActivity.this,auserID,typeaccount1,handler); |
388 | + //获取版本信息 | |
389 | + HttpManager.getInstance().getpublishinfo(this,auserID,graderID,handler); | |
390 | + //获取最近播放视频 | |
391 | + HttpManager.getInstance().getstuyvidioinfo(this,auserID,handler); | |
353 | 392 | |
354 | 393 | } catch (NumberFormatException e) { |
355 | 394 | e.printStackTrace(); |
... | ... | @@ -559,8 +598,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe |
559 | 598 | Toast.LENGTH_SHORT).show(); |
560 | 599 | exitTime = System.currentTimeMillis(); |
561 | 600 | } else { |
562 | - finish(); | |
563 | - System.exit(0); | |
601 | + MainActivity.this.finish(); | |
564 | 602 | } |
565 | 603 | return false; |
566 | 604 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/RegisterInfoActivity.java
... | ... | @@ -111,7 +111,7 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
111 | 111 | String register8 = et_school.getText().toString().trim(); |
112 | 112 | if (Content.accountflag == 2) { |
113 | 113 | String userID = SaveParam.getInstance().getLoginParam(this, "userId"); |
114 | - String grade = SaveParam.getInstance().getLoginParam(this, SaveParam.GRADENS); | |
114 | + String grade = SaveParam.getInstance().getCustomizeParam(this, SaveParam.GRADENS); | |
115 | 115 | String School = SaveParam.getInstance().getLoginParam(this, SaveParam.SCHOOOlID); |
116 | 116 | String regionId = SaveParam.getInstance().getLoginParam(this, SaveParam.COUNTRY); |
117 | 117 | String regionId1 = SaveParam.getInstance().getLoginParam(this, SaveParam.CITYS); |
... | ... | @@ -138,6 +138,7 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
138 | 138 | } |
139 | 139 | |
140 | 140 | } else { |
141 | + savedata(); | |
141 | 142 | Intent intent = new Intent(); |
142 | 143 | intent.setClass(RegisterInfoActivity.this, ChoiseTextBookActivity.class); |
143 | 144 | startActivity(intent); |
... | ... | @@ -151,6 +152,18 @@ public class RegisterInfoActivity extends AppCompatActivity implements View.OnCl |
151 | 152 | |
152 | 153 | } |
153 | 154 | |
155 | + private void savedata() { | |
156 | + String register9 = et_username.getText().toString().trim(); | |
157 | + String register10 = et_region.getText().toString().trim(); | |
158 | + String register11 = et_grade.getText().toString().trim(); | |
159 | + String register12 = et_school.getText().toString().trim(); | |
160 | + SaveParam.getInstance().saveLoginParam(this,SaveParam.USERNAME,register9); | |
161 | + SaveParam.getInstance().saveLoginParam(this,SaveParam.ADRESS,register10); | |
162 | + SaveParam.getInstance().saveLoginParam(this,SaveParam.GRADES,register11); | |
163 | + SaveParam.getInstance().saveLoginParam(this,SaveParam.SCHOOL,register12); | |
164 | + | |
165 | + } | |
166 | + | |
154 | 167 | @Override |
155 | 168 | protected void onResume() { |
156 | 169 | super.onResume(); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/AccountChildsAdapter.java
... | ... | @@ -125,6 +125,9 @@ public class AccountChildsAdapter extends RecyclerView.Adapter<AccountChildsAdap |
125 | 125 | public void onClick(View v) { |
126 | 126 | Content.changgeaccountflag =2; |
127 | 127 | SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.ACCOUNT,"2"); |
128 | + SaveParam.getInstance().saveCustomizeParam(mContext,SaveParam.CHILDSID,bean.getSubAccountId()); | |
129 | + //保存子账号年级id | |
130 | + SaveParam.getInstance().saveCustomizeParam(mContext, SaveParam.CHILDSGRADENS,bean.getGradeId() ); | |
128 | 131 | String devicenumber = GetDevicesUtil.getDevicesInfo(mContext).getDeviceNumber(); |
129 | 132 | HttpManager.getInstance().changechildAccountinfo(mContext,bean.getSubAccountId(),bean.getParentId(), |
130 | 133 | devicenumber,2); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/GalleryAdapter.java
... | ... | @@ -9,20 +9,21 @@ import android.widget.TextView; |
9 | 9 | |
10 | 10 | import com.facebook.drawee.view.SimpleDraweeView; |
11 | 11 | import com.hjx.personalcenter.R; |
12 | +import com.hjx.personalcenter.model.DefautPublishInfo; | |
12 | 13 | |
13 | -import java.util.List; | |
14 | +import java.util.ArrayList; | |
14 | 15 | |
15 | 16 | public class GalleryAdapter extends |
16 | 17 | RecyclerView.Adapter<GalleryAdapter.ViewHolder> |
17 | 18 | { |
18 | 19 | |
19 | 20 | private LayoutInflater mInflater; |
20 | - private List<Integer> mDatas; | |
21 | + private ArrayList<DefautPublishInfo.DataBean> defautPublishInfo; | |
21 | 22 | |
22 | - public GalleryAdapter(Context context, List<Integer> datats) | |
23 | + public GalleryAdapter(Context context, ArrayList<DefautPublishInfo.DataBean> mDatas) | |
23 | 24 | { |
24 | 25 | mInflater = LayoutInflater.from(context); |
25 | - mDatas = datats; | |
26 | + defautPublishInfo = mDatas; | |
26 | 27 | } |
27 | 28 | |
28 | 29 | public static class ViewHolder extends RecyclerView.ViewHolder |
... | ... | @@ -32,14 +33,16 @@ public class GalleryAdapter extends |
32 | 33 | super(arg0); |
33 | 34 | } |
34 | 35 | |
35 | - SimpleDraweeView mSimpleDraweeView; | |
36 | - TextView mTxt; | |
36 | + SimpleDraweeView simpleDraweeView; | |
37 | + TextView subject; | |
38 | + TextView publish; | |
39 | + | |
37 | 40 | } |
38 | 41 | |
39 | 42 | @Override |
40 | 43 | public int getItemCount() |
41 | 44 | { |
42 | - return mDatas.size(); | |
45 | + return defautPublishInfo.size(); | |
43 | 46 | } |
44 | 47 | |
45 | 48 | /** |
... | ... | @@ -48,12 +51,13 @@ public class GalleryAdapter extends |
48 | 51 | @Override |
49 | 52 | public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) |
50 | 53 | { |
51 | - View view = mInflater.inflate(R.layout.recycler_study_tem_view, | |
54 | + View view = mInflater.inflate(R.layout.fragment_changge_version_info_itmes2, | |
52 | 55 | viewGroup, false); |
53 | 56 | ViewHolder viewHolder = new ViewHolder(view); |
54 | 57 | |
55 | - viewHolder.mSimpleDraweeView = (SimpleDraweeView) view | |
56 | - .findViewById(R.id.id_index_gallery_item_image); | |
58 | + viewHolder.simpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.image_publish); | |
59 | + viewHolder.subject = (TextView) view.findViewById(R.id.subject); | |
60 | + viewHolder.publish = (TextView) view.findViewById(R.id.tv_publish); | |
57 | 61 | return viewHolder; |
58 | 62 | } |
59 | 63 | |
... | ... | @@ -63,7 +67,9 @@ public class GalleryAdapter extends |
63 | 67 | @Override |
64 | 68 | public void onBindViewHolder(final ViewHolder viewHolder, final int i) |
65 | 69 | { |
66 | - viewHolder.mSimpleDraweeView.setImageResource(mDatas.get(i)); | |
70 | + viewHolder.simpleDraweeView.setImageURI(defautPublishInfo.get(i).getCover()); | |
71 | + viewHolder.subject.setText(defautPublishInfo.get(i).getSubject()); | |
72 | + viewHolder.publish.setText(defautPublishInfo.get(i).getPress()); | |
67 | 73 | } |
68 | 74 | |
69 | 75 | } |
70 | 76 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/GridAdapter.java
... | ... | @@ -44,7 +44,7 @@ public class GridAdapter extends BaseAdapter { |
44 | 44 | public View getView(int position, View convertView, ViewGroup parent) { |
45 | 45 | ViewHolder viewHolder = new ViewHolder(); |
46 | 46 | if (convertView == null) { |
47 | - convertView = View.inflate(context, R.layout.fragment_changge_version_info_itmes, null); | |
47 | + convertView = View.inflate(context, R.layout.fragment_changge_version_info_itmes3, null); | |
48 | 48 | viewHolder.simpleDraweeView = (SimpleDraweeView) convertView.findViewById(R.id.image_publish); |
49 | 49 | viewHolder.subject = (TextView) convertView.findViewById(R.id.subject); |
50 | 50 | viewHolder.publish = (TextView) convertView.findViewById(R.id.tv_publish); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/VideoAdapter.java
... | ... | @@ -0,0 +1,75 @@ |
1 | +package com.hjx.personalcenter.adapter; | |
2 | + | |
3 | +import android.content.Context; | |
4 | +import android.support.v7.widget.RecyclerView; | |
5 | +import android.view.LayoutInflater; | |
6 | +import android.view.View; | |
7 | +import android.view.ViewGroup; | |
8 | +import android.widget.TextView; | |
9 | + | |
10 | +import com.facebook.drawee.view.SimpleDraweeView; | |
11 | +import com.hjx.personalcenter.R; | |
12 | +import com.hjx.personalcenter.model.VideoInfo; | |
13 | + | |
14 | +import java.util.ArrayList; | |
15 | + | |
16 | +public class VideoAdapter extends | |
17 | + RecyclerView.Adapter<VideoAdapter.ViewHolder> | |
18 | +{ | |
19 | + | |
20 | + private LayoutInflater mInflater; | |
21 | + private ArrayList<VideoInfo.DataBean> defautPublishInfo; | |
22 | + | |
23 | + public VideoAdapter(Context context, ArrayList<VideoInfo.DataBean> mDatas) | |
24 | + { | |
25 | + mInflater = LayoutInflater.from(context); | |
26 | + defautPublishInfo = mDatas; | |
27 | + } | |
28 | + | |
29 | + public static class ViewHolder extends RecyclerView.ViewHolder | |
30 | + { | |
31 | + public ViewHolder(View arg0) | |
32 | + { | |
33 | + super(arg0); | |
34 | + } | |
35 | + | |
36 | + SimpleDraweeView simpleDraweeView; | |
37 | + TextView subject; | |
38 | + TextView publish; | |
39 | + | |
40 | + } | |
41 | + | |
42 | + @Override | |
43 | + public int getItemCount() | |
44 | + { | |
45 | + return defautPublishInfo.size(); | |
46 | + } | |
47 | + | |
48 | + /** | |
49 | + * 创建ViewHolder | |
50 | + */ | |
51 | + @Override | |
52 | + public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) | |
53 | + { | |
54 | + View view = mInflater.inflate(R.layout.fragment_changge_version_info_itmes, | |
55 | + viewGroup, false); | |
56 | + ViewHolder viewHolder = new ViewHolder(view); | |
57 | + | |
58 | + viewHolder.simpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.image_publish); | |
59 | + viewHolder.subject = (TextView) view.findViewById(R.id.subject); | |
60 | + viewHolder.publish = (TextView) view.findViewById(R.id.tv_publish); | |
61 | + return viewHolder; | |
62 | + } | |
63 | + | |
64 | + /** | |
65 | + * 设置值 | |
66 | + */ | |
67 | + @Override | |
68 | + public void onBindViewHolder(final ViewHolder viewHolder, final int i) | |
69 | + { | |
70 | + viewHolder.simpleDraweeView.setImageURI(defautPublishInfo.get(i).getVideoCover()); | |
71 | + viewHolder.subject.setText(defautPublishInfo.get(i).getVideoName()); | |
72 | + //viewHolder.publish.setText(defautPublishInfo.get(i).getPress()); | |
73 | + } | |
74 | + | |
75 | +} | |
0 | 76 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/GradeListDialog.java
... | ... | @@ -89,7 +89,7 @@ public class GradeListDialog extends BaseCircleDialog implements AdapterView.OnI |
89 | 89 | @Override |
90 | 90 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) { |
91 | 91 | |
92 | - SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.GRADENS, ""+data.get(position).getId()); | |
92 | + SaveParam.getInstance().saveCustomizeParam(getActivity(), SaveParam.GRADENS, ""+data.get(position).getId()); | |
93 | 93 | mCallBack.province3OnItemClick(data,position,5); |
94 | 94 | dismiss(); |
95 | 95 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/SchoolListDialog.java
... | ... | @@ -94,7 +94,7 @@ public class SchoolListDialog extends BaseCircleDialog implements AdapterView.On |
94 | 94 | school_sech = (EditText) getView().findViewById(R.id.et_school_sech); |
95 | 95 | cance = (ImageView) getView().findViewById(R.id.cancel); |
96 | 96 | String citys = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.CITYS); |
97 | - String grade = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS); | |
97 | + String grade = SaveParam.getInstance().getCustomizeParam(getActivity(), SaveParam.GRADENS); | |
98 | 98 | listadapter = new SchoolAdapter(data, getActivity()); |
99 | 99 | school_list.setAdapter(listadapter); |
100 | 100 | school_list.setOnItemClickListener(this); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/VerSionDialog.java
... | ... | @@ -20,7 +20,6 @@ import com.hjx.personalcenter.adapter.VersionAdapter; |
20 | 20 | import com.hjx.personalcenter.db.SaveParam; |
21 | 21 | import com.hjx.personalcenter.http.HttpCode; |
22 | 22 | import com.hjx.personalcenter.http.HttpManager; |
23 | -import com.hjx.personalcenter.interfaces.DialogCallBack; | |
24 | 23 | import com.hjx.personalcenter.model.VersionInfo; |
25 | 24 | import com.mylhyl.circledialog.BaseCircleDialog; |
26 | 25 | import com.mylhyl.circledialog.res.values.CircleDimen; |
... | ... | @@ -39,8 +38,6 @@ public class VerSionDialog extends BaseCircleDialog implements AdapterView.OnIte |
39 | 38 | private ListView listView; |
40 | 39 | private ArrayList<VersionInfo.DataBean> data = new ArrayList<>(); |
41 | 40 | |
42 | - private DialogCallBack.VersionCallBack mCallBack; | |
43 | - | |
44 | 41 | Handler handler = new Handler(){ |
45 | 42 | @Override |
46 | 43 | public void handleMessage(Message msg) { |
... | ... | @@ -55,12 +52,9 @@ public class VerSionDialog extends BaseCircleDialog implements AdapterView.OnIte |
55 | 52 | } |
56 | 53 | } |
57 | 54 | }; |
58 | - public VerSionDialog(DialogCallBack.VersionCallBack callBack) { | |
59 | - this.mCallBack = callBack; | |
60 | - } | |
61 | 55 | |
62 | - public static VerSionDialog getInstance(DialogCallBack.VersionCallBack callBack) { | |
63 | - VerSionDialog dialogFragment = new VerSionDialog(callBack); | |
56 | + public static VerSionDialog getInstance() { | |
57 | + VerSionDialog dialogFragment = new VerSionDialog(); | |
64 | 58 | dialogFragment.setCanceledBack(true); |
65 | 59 | dialogFragment.setCanceledOnTouchOutside(true); |
66 | 60 | dialogFragment.setRadius(CircleDimen.RADIUS); |
... | ... | @@ -89,7 +83,7 @@ public class VerSionDialog extends BaseCircleDialog implements AdapterView.OnIte |
89 | 83 | dismiss(); |
90 | 84 | } |
91 | 85 | }); |
92 | - String subjectName = SaveParam.getInstance().getLoginParam(getActivity(),SaveParam.VERSION); | |
86 | + String subjectName = SaveParam.getInstance().getLoginParam(getActivity(),SaveParam.SUBJECT); | |
93 | 87 | Log.e("test","选择的科目"+subjectName); |
94 | 88 | HttpManager.getInstance().versioninfo(getActivity(),subjectName,handler); |
95 | 89 | |
... | ... | @@ -97,7 +91,13 @@ public class VerSionDialog extends BaseCircleDialog implements AdapterView.OnIte |
97 | 91 | |
98 | 92 | @Override |
99 | 93 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) { |
100 | - mCallBack.versionOnItemClick(data,position,1100); | |
94 | + String imageurl = data.get(position).getPressCover(); | |
95 | + String publish = data.get(position).getPressName(); | |
96 | + Log.e("test","拿到的数据为"+imageurl+publish); | |
97 | + | |
98 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.IMGURL,imageurl); | |
99 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,publish); | |
100 | + | |
101 | 101 | dismiss(); |
102 | 102 | |
103 | 103 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/db/SaveParam.java
... | ... | @@ -13,9 +13,10 @@ public class SaveParam { |
13 | 13 | } |
14 | 14 | return instance; |
15 | 15 | } |
16 | - | |
16 | + public static String CHILDSID = "childID";//子账号id | |
17 | + public static String CHILDSGRADENS = "childs";//子账号年级id | |
17 | 18 | public static String GRADENS = "gradens";//年级id |
18 | - public static String SCHOOOlID = "schoolid";//年级id | |
19 | + public static String SCHOOOlID = "schoolid";//学校id | |
19 | 20 | //个人信息 |
20 | 21 | public static String USERNAME = "usernames";//昵称 |
21 | 22 | public static String ADRESS = "adress";//地址 |
... | ... | @@ -39,7 +40,11 @@ public class SaveParam { |
39 | 40 | |
40 | 41 | //账户管理 |
41 | 42 | public static String ACCOUNT = "account";//账户类型 |
42 | - //版本信息 | |
43 | + //科目信息 | |
44 | + public static String SUBJECT = "subject"; | |
45 | + //图片URL | |
46 | + public static String IMGURL = "imgurl"; | |
47 | + //版本名称 | |
43 | 48 | public static String VERSION = "version"; |
44 | 49 | |
45 | 50 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/LoginFragment.java
... | ... | @@ -20,6 +20,7 @@ import com.hjx.personalcenter.activity.ForgotPasswordActivity; |
20 | 20 | import com.hjx.personalcenter.activity.MainActivity; |
21 | 21 | import com.hjx.personalcenter.activity.RegisterInfoActivity; |
22 | 22 | import com.hjx.personalcenter.customdialog.ElectronicCardDialog; |
23 | +import com.hjx.personalcenter.db.Content; | |
23 | 24 | import com.hjx.personalcenter.db.SaveParam; |
24 | 25 | import com.hjx.personalcenter.http.HttpCode; |
25 | 26 | import com.hjx.personalcenter.http.HttpManager; |
... | ... | @@ -104,6 +105,7 @@ public class LoginFragment extends Fragment implements View.OnClickListener { |
104 | 105 | boolean isRegisterInfoComplete =isregisterinfo.optBoolean("isRegisterInfoComplete"); |
105 | 106 | if (status.equals("1")){ |
106 | 107 | if (!isRegisterInfoComplete){ |
108 | + Content.accountflag = 1; | |
107 | 109 | Intent intent = new Intent(); |
108 | 110 | intent.setClass(getActivity(), RegisterInfoActivity.class); |
109 | 111 | getActivity().startActivity(intent); | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/PresonInfoFragment.java
... | ... | @@ -5,12 +5,14 @@ import android.graphics.Color; |
5 | 5 | import android.os.Bundle; |
6 | 6 | import android.support.annotation.Nullable; |
7 | 7 | import android.support.v4.app.Fragment; |
8 | +import android.util.Log; | |
8 | 9 | import android.view.Gravity; |
9 | 10 | import android.view.LayoutInflater; |
10 | 11 | import android.view.View; |
11 | 12 | import android.view.ViewGroup; |
12 | 13 | import android.widget.AdapterView; |
13 | 14 | import android.widget.EditText; |
15 | +import android.widget.ImageView; | |
14 | 16 | import android.widget.TextView; |
15 | 17 | |
16 | 18 | import com.bigkoo.pickerview.TimePickerView; |
... | ... | @@ -20,6 +22,7 @@ import com.hjx.personalcenter.customdialog.CountryDialog; |
20 | 22 | import com.hjx.personalcenter.customdialog.GradeListDialog; |
21 | 23 | import com.hjx.personalcenter.customdialog.ProvinceListDialog; |
22 | 24 | import com.hjx.personalcenter.customdialog.SchoolListDialog; |
25 | +import com.hjx.personalcenter.db.Content; | |
23 | 26 | import com.hjx.personalcenter.db.SaveParam; |
24 | 27 | import com.hjx.personalcenter.http.HttpManager; |
25 | 28 | import com.hjx.personalcenter.interfaces.DialogCallBack; |
... | ... | @@ -52,7 +55,8 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
52 | 55 | private TimePickerView pvTime; |
53 | 56 | private EditText tv_username1, tv_useinfo_adress1, tv_useinfo_qq; |
54 | 57 | private TextView tv_sex, tv_useinfo_adress, tv_useinfo_birthday, tv_useinfo_school, tv_useinfo_gender; |
55 | - public static String TABLAYOUT_FRAGMENT = "tab_fragment"; | |
58 | + public static String TABLAYOUT_FRAGMENT = "presonfragment"; | |
59 | + private ImageView my_adress,my_sex,my_bthday,my_grade,my_school; | |
56 | 60 | |
57 | 61 | public static PresonInfoFragment newInstance(int type) { |
58 | 62 | PresonInfoFragment fragment = new PresonInfoFragment(); |
... | ... | @@ -87,6 +91,11 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
87 | 91 | tv_useinfo_birthday = (TextView) mView.findViewById(R.id.tv_useinfo_birthday); |
88 | 92 | tv_useinfo_school = (TextView) mView.findViewById(R.id.tv_useinfo_school); |
89 | 93 | tv_useinfo_gender = (TextView) mView.findViewById(R.id.tv_useinfo_gender); |
94 | + my_adress = (ImageView) mView.findViewById(R.id.my_adress); | |
95 | + my_sex = (ImageView) mView.findViewById(R.id.my_sex); | |
96 | + my_bthday = (ImageView) mView.findViewById(R.id.my_bthday); | |
97 | + my_grade = (ImageView) mView.findViewById(R.id.my_grade); | |
98 | + my_school = (ImageView) mView.findViewById(R.id.my_school); | |
90 | 99 | |
91 | 100 | |
92 | 101 | } |
... | ... | @@ -100,6 +109,11 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
100 | 109 | tv_useinfo_birthday.setOnClickListener(this); |
101 | 110 | tv_useinfo_school.setOnClickListener(this); |
102 | 111 | tv_useinfo_gender.setOnClickListener(this); |
112 | + my_adress.setOnClickListener(this); | |
113 | + my_sex.setOnClickListener(this); | |
114 | + my_bthday.setOnClickListener(this); | |
115 | + my_grade.setOnClickListener(this); | |
116 | + my_school.setOnClickListener(this); | |
103 | 117 | } |
104 | 118 | |
105 | 119 | @Override |
... | ... | @@ -114,6 +128,7 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
114 | 128 | String presonal8 = tv_useinfo_qq.getText().toString().trim(); |
115 | 129 | switch (v.getId()) { |
116 | 130 | case R.id.tv_sex: |
131 | + case R.id.my_sex: | |
117 | 132 | final String[] items = {"男", "女"}; |
118 | 133 | new CircleDialog.Builder(getActivity()) |
119 | 134 | .configDialog(new ConfigDialog() { |
... | ... | @@ -143,12 +158,15 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
143 | 158 | .show(); |
144 | 159 | break; |
145 | 160 | case R.id.tv_useinfo_adress: |
161 | + case R.id.my_adress: | |
146 | 162 | ProvinceListDialog.getInstance((DialogCallBack.ProvincesCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "ProvinceListDialog"); |
147 | 163 | break; |
148 | 164 | case R.id.tv_useinfo_birthday: |
165 | + case R.id.my_bthday: | |
149 | 166 | pvTime.show(tv_useinfo_birthday);//弹出时间选择器,传递参数过去,回调的时候则可以绑定此view |
150 | 167 | break; |
151 | 168 | case R.id.tv_useinfo_school: |
169 | + case R.id.my_school: | |
152 | 170 | if (TextUtils.isEmpty(presonal4) || |
153 | 171 | TextUtils.isEmpty(presonal7)) { |
154 | 172 | AlertUtils.showToast(getActivity(), "请先选择地区和年级!"); |
... | ... | @@ -160,58 +178,62 @@ public class PresonInfoFragment extends Fragment implements View.OnClickListener |
160 | 178 | |
161 | 179 | break; |
162 | 180 | case R.id.tv_useinfo_gender: |
181 | + case R.id.my_grade: | |
163 | 182 | GradeListDialog.getInstance((DialogCallBack.GradeCallBack) PresonInfoFragment.this).show(getChildFragmentManager(), "GradeListDialog"); |
164 | 183 | break; |
165 | 184 | case R.id.presonal_sub: |
166 | - if (TextUtils.isEmpty(presonal1) || | |
167 | - TextUtils.isEmpty(presonal2) || TextUtils.isEmpty(presonal3) || TextUtils.isEmpty(presonal4) || | |
168 | - TextUtils.isEmpty(presonal5) || TextUtils.isEmpty(presonal7) || | |
169 | - TextUtils.isEmpty(presonal8)) { | |
170 | - AlertUtils.showToast(getActivity(), "请将信息填写完整!"); | |
171 | - return; | |
172 | - } else { | |
173 | - | |
174 | - int a = 0, b = 0; | |
175 | - int d = 1; | |
176 | - Object schoolids; | |
177 | - Long f = null; | |
178 | - //保存星座 | |
179 | - BrithdayStar brithdayStar = new BrithdayStar(); | |
180 | - String s = brithdayStar.getConstellations(tv_useinfo_birthday.getText().toString()); | |
181 | - SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.CONSTELLATION, s); | |
182 | - | |
183 | - String regionId = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.COUNTRY); | |
184 | - String regionId1 = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.CITYS); | |
185 | - if (regionId == null) { | |
186 | - regionId = regionId1; | |
187 | - } | |
188 | - String grade = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.GRADENS); | |
189 | - String schoolid = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.SCHOOOlID); | |
190 | - String type = SaveParam.getInstance().getCustomizeParam(getActivity(), SaveParam.ACCOUNT); | |
191 | - String userID = SaveParam.getInstance().getLoginParam(getActivity(), "userId"); | |
192 | - String devicenumber = GetDevicesUtil.getDevicesInfo(getActivity()).getDeviceNumber(); | |
193 | - String changeinfo = null; | |
194 | - if ("男".equals(presonal3)) { | |
195 | - changeinfo = "male"; | |
185 | + if (Content.changeinfoflag == 1) { | |
186 | + Log.e("test","你提交个人信息"); | |
187 | + if (TextUtils.isEmpty(presonal1) || | |
188 | + TextUtils.isEmpty(presonal2) || TextUtils.isEmpty(presonal3) || TextUtils.isEmpty(presonal4) || | |
189 | + TextUtils.isEmpty(presonal5) || TextUtils.isEmpty(presonal7) || | |
190 | + TextUtils.isEmpty(presonal8)) { | |
191 | + AlertUtils.showToast(getActivity(), "请将信息填写完整!"); | |
192 | + return; | |
196 | 193 | } else { |
197 | - changeinfo = "female"; | |
198 | - } | |
199 | - try { | |
200 | - a = Integer.parseInt(regionId); | |
201 | - b = Integer.parseInt(grade); | |
202 | - if (TextUtils.isEmpty(presonal6)) { | |
203 | - schoolids = null; | |
194 | + | |
195 | + int a = 0, b = 0; | |
196 | + int d = 1; | |
197 | + Object schoolids; | |
198 | + Long f = null; | |
199 | + //保存星座 | |
200 | + BrithdayStar brithdayStar = new BrithdayStar(); | |
201 | + String s = brithdayStar.getConstellations(tv_useinfo_birthday.getText().toString()); | |
202 | + SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.CONSTELLATION, s); | |
203 | + | |
204 | + String regionId = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.COUNTRY); | |
205 | + String regionId1 = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.CITYS); | |
206 | + if (regionId == null) { | |
207 | + regionId = regionId1; | |
208 | + } | |
209 | + String grade = SaveParam.getInstance().getCustomizeParam(getActivity(), SaveParam.GRADENS); | |
210 | + String schoolid = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.SCHOOOlID); | |
211 | + String type = SaveParam.getInstance().getCustomizeParam(getActivity(), SaveParam.ACCOUNT); | |
212 | + String userID = SaveParam.getInstance().getLoginParam(getActivity(), "userId"); | |
213 | + String devicenumber = GetDevicesUtil.getDevicesInfo(getActivity()).getDeviceNumber(); | |
214 | + String changeinfo = null; | |
215 | + if ("男".equals(presonal3)) { | |
216 | + changeinfo = "male"; | |
204 | 217 | } else { |
205 | - schoolids = Long.parseLong(schoolid); | |
218 | + changeinfo = "female"; | |
219 | + } | |
220 | + try { | |
221 | + a = Integer.parseInt(regionId); | |
222 | + b = Integer.parseInt(grade); | |
223 | + if (TextUtils.isEmpty(presonal6)) { | |
224 | + schoolids = null; | |
225 | + } else { | |
226 | + schoolids = Long.parseLong(schoolid); | |
227 | + } | |
228 | + d = Integer.parseInt(type); | |
229 | + f = Long.parseLong(userID); | |
230 | + //提交个人信息 | |
231 | + HttpManager.getInstance().changepresonalinfo(getActivity(), | |
232 | + f, d, presonal1, presonal5, b, a, schoolids, presonal8, changeinfo, presonal4 + presonal2, devicenumber); | |
233 | + | |
234 | + } catch (Exception e) { | |
235 | + e.printStackTrace(); | |
206 | 236 | } |
207 | - d = Integer.parseInt(type); | |
208 | - f = Long.parseLong(userID); | |
209 | - //提交个人信息 | |
210 | - HttpManager.getInstance().changepresonalinfo(getActivity(), | |
211 | - f, d, presonal1, presonal5, b, a, schoolids, presonal8, changeinfo, presonal4 + presonal2, devicenumber); | |
212 | - | |
213 | - } catch (Exception e) { | |
214 | - e.printStackTrace(); | |
215 | 237 | } |
216 | 238 | |
217 | 239 | break; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/RegisterFragment.java
... | ... | @@ -19,6 +19,7 @@ import android.widget.ImageView; |
19 | 19 | import com.hjx.personalcenter.R; |
20 | 20 | import com.hjx.personalcenter.activity.RegisterInfoActivity; |
21 | 21 | import com.hjx.personalcenter.db.Content; |
22 | +import com.hjx.personalcenter.db.SaveParam; | |
22 | 23 | import com.hjx.personalcenter.http.HttpCode; |
23 | 24 | import com.hjx.personalcenter.http.HttpManager; |
24 | 25 | import com.hjx.personalcenter.util.AlertUtils; |
... | ... | @@ -75,6 +76,7 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
75 | 76 | String usernameStr = phonenumber.getText().toString().trim(); |
76 | 77 | String passwordStr = password.getText().toString().trim(); |
77 | 78 | HttpManager.getInstance().saveLoginInfo(getActivity(),usernameStr,passwordStr,access_token,userId); |
79 | + SaveParam.getInstance().saveCustomizeParam(getActivity(), SaveParam.ACCOUNT, "1"); | |
78 | 80 | AlertUtils.showToast(getActivity(), "注册成功!"); |
79 | 81 | Content.accountflag =1; |
80 | 82 | Intent intent = new Intent(); |
... | ... | @@ -82,6 +84,8 @@ public class RegisterFragment extends Fragment implements View.OnClickListener { |
82 | 84 | startActivity(intent); |
83 | 85 | getActivity().overridePendingTransition(R.anim.rightin, R.anim.rightout); |
84 | 86 | getActivity().finish(); |
87 | + }else if(status.equals("209")){ | |
88 | + AlertUtils.showToast(getActivity(), "验证码错误!"); | |
85 | 89 | } |
86 | 90 | break; |
87 | 91 | case HttpCode.REGISTERED_FAIL: | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/VersionsInfoFragment.java
1 | 1 | package com.hjx.personalcenter.fragment; |
2 | 2 | |
3 | +import android.app.Activity; | |
3 | 4 | import android.os.Bundle; |
4 | 5 | import android.os.Handler; |
5 | 6 | import android.os.Message; |
6 | 7 | import android.support.annotation.Nullable; |
7 | 8 | import android.support.v4.app.Fragment; |
9 | +import android.util.Log; | |
8 | 10 | import android.view.LayoutInflater; |
9 | 11 | import android.view.View; |
10 | 12 | import android.view.ViewGroup; |
11 | 13 | import android.widget.AdapterView; |
12 | 14 | import android.widget.GridView; |
15 | +import android.widget.TextView; | |
13 | 16 | |
17 | +import com.facebook.drawee.view.SimpleDraweeView; | |
14 | 18 | import com.hjx.personalcenter.R; |
15 | 19 | import com.hjx.personalcenter.adapter.GridAdapter; |
16 | 20 | import com.hjx.personalcenter.customdialog.VerSionDialog; |
21 | +import com.hjx.personalcenter.db.Content; | |
17 | 22 | import com.hjx.personalcenter.db.SaveParam; |
18 | 23 | import com.hjx.personalcenter.http.HttpCode; |
19 | 24 | import com.hjx.personalcenter.http.HttpManager; |
20 | -import com.hjx.personalcenter.interfaces.DialogCallBack; | |
21 | 25 | import com.hjx.personalcenter.model.DefautPublishInfo; |
22 | 26 | |
23 | 27 | import java.util.ArrayList; |
... | ... | @@ -27,13 +31,13 @@ import java.util.List; |
27 | 31 | * Created by h on 2017/8/12. |
28 | 32 | */ |
29 | 33 | |
30 | -public class VersionsInfoFragment extends Fragment implements AdapterView.OnItemClickListener{ | |
34 | +public class VersionsInfoFragment extends Fragment implements AdapterView.OnItemClickListener, View.OnClickListener { | |
31 | 35 | private GridView gridView; |
32 | 36 | private ArrayList<DefautPublishInfo.DataBean> defautPublishInfos = new ArrayList<>(); |
33 | 37 | private GridAdapter sim_adapter; |
34 | 38 | private View mView; |
35 | 39 | private int type; |
36 | - public static String TABLAYOUT_FRAGMENT = "tab_fragment"; | |
40 | + public static String TABLAYOUT_FRAGMENT = "versionfragment"; | |
37 | 41 | |
38 | 42 | public static VersionsInfoFragment newInstance(int type) { |
39 | 43 | VersionsInfoFragment fragment = new VersionsInfoFragment(); |
... | ... | @@ -61,11 +65,20 @@ public class VersionsInfoFragment extends Fragment implements AdapterView.OnItem |
61 | 65 | if (mView == null) { |
62 | 66 | mView = inflater.inflate(R.layout.fragment_changge_version_info, container, false); |
63 | 67 | String userID = SaveParam.getInstance().getLoginParam(getActivity(),"userId"); |
64 | - String graderid = SaveParam.getInstance().getLoginParam(getActivity(),SaveParam.GRADENS); | |
65 | - | |
68 | + String graderid = SaveParam.getInstance().getCustomizeParam(getActivity(),SaveParam.GRADENS); | |
69 | + //子账户年级id | |
70 | + String graderidchilds = SaveParam.getInstance().getLoginParam(getActivity(),SaveParam.CHILDSGRADENS); | |
71 | + //账户类型 | |
72 | + String accounts = SaveParam.getInstance().getCustomizeParam(getActivity(),SaveParam.ACCOUNT); | |
66 | 73 | try { |
74 | + int graderID; | |
67 | 75 | long auserID = Long.parseLong(userID); |
68 | - int graderID = Integer.parseInt(graderid); | |
76 | + if ("2".equals(accounts)){ | |
77 | + graderID = Integer.parseInt(graderidchilds); | |
78 | + }else { | |
79 | + graderID = Integer.parseInt(graderid); | |
80 | + } | |
81 | + | |
69 | 82 | //获取版本信息 |
70 | 83 | HttpManager.getInstance().getpublishinfo(getActivity(),auserID,graderID,handler); |
71 | 84 | |
... | ... | @@ -98,41 +111,27 @@ public class VersionsInfoFragment extends Fragment implements AdapterView.OnItem |
98 | 111 | |
99 | 112 | @Override |
100 | 113 | public void onItemClick(AdapterView<?> parent, View view, int position, long id) { |
101 | - switch (position){ | |
114 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.SUBJECT,defautPublishInfos.get(position).getSubject()); | |
115 | + VerSionDialog.getInstance().show(getChildFragmentManager(), "VerSionDialog"); | |
102 | 116 | |
103 | - case 0: | |
104 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"语文"); | |
105 | - break; | |
106 | - case 1: | |
107 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"数学"); | |
108 | - break; | |
109 | - case 2: | |
110 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"英语"); | |
111 | - break; | |
112 | - case 3: | |
113 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"物理"); | |
114 | - break; | |
115 | - case 4: | |
116 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"化学"); | |
117 | - break; | |
118 | - case 5: | |
119 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"生物"); | |
120 | - break; | |
121 | - case 6: | |
122 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"政治"); | |
123 | - break; | |
124 | - case 7: | |
125 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"历史"); | |
126 | - break; | |
127 | - case 8: | |
128 | - SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"地理"); | |
129 | - break; | |
130 | - } | |
131 | 117 | |
132 | - VerSionDialog.getInstance((DialogCallBack.VersionCallBack)VersionsInfoFragment.this).show(getChildFragmentManager(), "VerSionDialog"); | |
118 | + String imgurl = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.IMGURL); | |
119 | + String version = SaveParam.getInstance().getLoginParam(getActivity(), SaveParam.VERSION); | |
120 | + SimpleDraweeView simpleDraweeView = (SimpleDraweeView) view.findViewById(R.id.image_publish); | |
121 | + TextView publish = (TextView) view.findViewById(R.id.tv_publish); | |
122 | + simpleDraweeView.setImageURI(imgurl); | |
123 | + publish.setText(version); | |
133 | 124 | |
134 | 125 | } |
135 | 126 | |
127 | + @Override | |
128 | + public void onAttach(Activity activity) { | |
129 | + super.onAttach(activity); | |
130 | + View rootView = activity.getWindow().getDecorView(); | |
131 | + TextView sub = (TextView) rootView.findViewById(R.id.presonal_sub); | |
132 | + sub.setOnClickListener(this); | |
133 | + } | |
134 | + | |
136 | 135 | |
137 | 136 | |
138 | 137 | @Override |
... | ... | @@ -140,4 +139,41 @@ public class VersionsInfoFragment extends Fragment implements AdapterView.OnItem |
140 | 139 | super.onResume(); |
141 | 140 | |
142 | 141 | } |
142 | + | |
143 | + @Override | |
144 | + public void onClick(View v) { | |
145 | + switch (v.getId()){ | |
146 | + case R.id.presonal_sub: | |
147 | + if (Content.changeinfoflag ==2){ | |
148 | + Log.e("test","你提交版本信息"); | |
149 | + } | |
150 | + | |
151 | + String userID = SaveParam.getInstance().getLoginParam(getActivity(),"userId"); | |
152 | + //子账户id | |
153 | + String childsidid = SaveParam.getInstance().getCustomizeParam(getActivity(),SaveParam.CHILDSID); | |
154 | + //账户类型 | |
155 | + String accounts = SaveParam.getInstance().getCustomizeParam(getActivity(),SaveParam.ACCOUNT); | |
156 | + try { | |
157 | + String id = null; | |
158 | + String piblish = "清华大学出版社"; | |
159 | + if ("2".equals(accounts)){ | |
160 | + id =childsidid; | |
161 | + }else { | |
162 | + id = userID; | |
163 | + } | |
164 | + | |
165 | + //修改版本信息 | |
166 | + HttpManager.getInstance().changepublishinfo(getActivity(),id,piblish | |
167 | + ,piblish,piblish,piblish,piblish,piblish,piblish,piblish,piblish,piblish); | |
168 | + | |
169 | + } catch (NumberFormatException e) { | |
170 | + e.printStackTrace(); | |
171 | + } | |
172 | + | |
173 | + | |
174 | + | |
175 | + break; | |
176 | + } | |
177 | + | |
178 | + } | |
143 | 179 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpCode.java
... | ... | @@ -49,6 +49,11 @@ public class HttpCode { |
49 | 49 | public static final int REGISTER_SUCESS = 23; |
50 | 50 | //获取默认版本信息 |
51 | 51 | public static final int PUBLISH_SUCESS = 24; |
52 | + //注册信息提交 | |
53 | + public static final int REGISTERINFO_SUCESS = 25; | |
54 | + //获取视频信息 | |
55 | + public static final int GETVIDIO_SUCESS = 26; | |
56 | + | |
52 | 57 | |
53 | 58 | |
54 | 59 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpKey.java
... | ... | @@ -43,6 +43,18 @@ public class HttpKey { |
43 | 43 | public static String BIRDays = "birthday"; |
44 | 44 | public static String QQ = "qq"; |
45 | 45 | public static String GENDER = "gender"; |
46 | + //版本信息 | |
47 | + public static String CHINESE = "chinese"; | |
48 | + public static String MATH = "math"; | |
49 | + public static String ENGLISH = "english"; | |
50 | + public static String PHYSICES = "physics"; | |
51 | + public static String CHEMISTRY = "chemistry"; | |
52 | + public static String HISTIRY = "history"; | |
53 | + public static String GEOGRAPHY = "geography"; | |
54 | + public static String POLITICAL = "political"; | |
55 | + public static String BIOLOGY = "biology"; | |
56 | + public static String SCIENCE = "science"; | |
57 | + | |
46 | 58 | |
47 | 59 | |
48 | 60 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java
... | ... | @@ -7,6 +7,7 @@ import android.content.Intent; |
7 | 7 | import android.os.Handler; |
8 | 8 | import android.os.Message; |
9 | 9 | import android.util.Log; |
10 | +import android.view.KeyEvent; | |
10 | 11 | import android.widget.Toast; |
11 | 12 | |
12 | 13 | import com.google.gson.Gson; |
... | ... | @@ -28,6 +29,7 @@ import com.hjx.personalcenter.model.ProvinceInfo; |
28 | 29 | import com.hjx.personalcenter.model.SchoolInfo; |
29 | 30 | import com.hjx.personalcenter.model.SignInfo; |
30 | 31 | import com.hjx.personalcenter.model.VersionInfo; |
32 | +import com.hjx.personalcenter.model.VideoInfo; | |
31 | 33 | import com.hjx.personalcenter.util.AlertUtils; |
32 | 34 | import com.hjx.personalcenter.util.DialogPermission; |
33 | 35 | import com.loopj.android.http.AsyncHttpResponseHandler; |
... | ... | @@ -555,8 +557,8 @@ public class HttpManager { |
555 | 557 | * @param handler |
556 | 558 | */ |
557 | 559 | public void getpresonalinfo(final Context mContext, long userId, int type, final Handler handler) { |
558 | - mProgress = DialogPermission.showProgress(mContext, null, "正在获取个人信息...", | |
559 | - false, true, null); | |
560 | +// mProgress = DialogPermission.showProgress(mContext, null, "正在获取个人信息...", | |
561 | +// false, true, null); | |
560 | 562 | HttpClient.getInstance().addHeader("Accept", "application/json"); |
561 | 563 | HttpClient.getInstance().setConnectTimeout(5 * 1000); |
562 | 564 | HttpClient.getInstance().get(HttpUrl.getpresonalinfo + "?userId=" + userId + "&type=" + type, new AsyncHttpResponseHandler() { |
... | ... | @@ -642,6 +644,102 @@ public class HttpManager { |
642 | 644 | |
643 | 645 | }); |
644 | 646 | } |
647 | + //提交注册信息 | |
648 | + public void subregisterinfo(final Context mContext, Long userId | |
649 | + , String name, int gradeId, long regionId, String regionName, Object schoolId, | |
650 | + String math, String english, String physics, String chinese, String chemistry, | |
651 | + String history, String geography, String political, String biology, String science, final Handler handler){ | |
652 | + mProgress = DialogPermission.showProgress(mContext, null, "正在保存个人信息...", | |
653 | + false, true, null); | |
654 | + RequestParams params = new RequestParams(); | |
655 | + | |
656 | + params.put(HttpKey.USEID, userId); | |
657 | + params.put(HttpKey.NAME, name); | |
658 | + params.put(HttpKey.GRADE, gradeId); | |
659 | + params.put(HttpKey.REGION, regionId); | |
660 | + params.put(HttpKey.SCHOOL, schoolId); | |
661 | + params.put(HttpKey.REGIONNAME, regionName); | |
662 | + params.put(HttpKey.MATH, math); | |
663 | + params.put(HttpKey.ENGLISH, english); | |
664 | + params.put(HttpKey.PHYSICES, physics); | |
665 | + params.put(HttpKey.CHINESE, chinese); | |
666 | + params.put(HttpKey.CHEMISTRY, chemistry); | |
667 | + params.put(HttpKey.HISTIRY, history); | |
668 | + params.put(HttpKey.GEOGRAPHY, geography); | |
669 | + params.put(HttpKey.POLITICAL, political); | |
670 | + params.put(HttpKey.BIOLOGY, biology); | |
671 | + params.put(HttpKey.SCIENCE, science); | |
672 | + | |
673 | + Log.e("test", "注册信息" + params); | |
674 | + HttpClient.getInstance().addHeader("Accept", "*/*"); | |
675 | + HttpClient.getInstance().post(mContext, HttpUrl.submitregisterURL, params, new JsonHttpResponseHandler() { | |
676 | + @Override | |
677 | + public void onSuccess(int statusCode, Header[] headers, JSONObject response) { | |
678 | + super.onSuccess(statusCode, headers, response); | |
679 | + closeProgress(); | |
680 | + Message message = Message.obtain(); | |
681 | + message.what = HttpCode.REGISTERINFO_SUCESS; | |
682 | + message.obj = new String(String.valueOf(response)); | |
683 | + handler.sendMessage(message); | |
684 | + | |
685 | + } | |
686 | + | |
687 | + @Override | |
688 | + public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { | |
689 | + super.onFailure(statusCode, headers, throwable, errorResponse); | |
690 | + closeProgress(); | |
691 | + Log.e("test", "onFailure" + errorResponse); | |
692 | + AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); | |
693 | + } | |
694 | + | |
695 | + }); | |
696 | + } | |
697 | + //修改版本信息 | |
698 | + public void changepublishinfo(final Context mContext, String userId, | |
699 | + String math, String english, String physics, String chinese, String chemistry, | |
700 | + String history, String geography, String political, String biology, String science){ | |
701 | + mProgress = DialogPermission.showProgress(mContext, null, "正在保存个人信息...", | |
702 | + false, true, null); | |
703 | + RequestParams params = new RequestParams(); | |
704 | + params.put(HttpKey.USEID, userId); | |
705 | + params.put(HttpKey.MATH, math); | |
706 | + params.put(HttpKey.ENGLISH, english); | |
707 | + params.put(HttpKey.PHYSICES, physics); | |
708 | + params.put(HttpKey.CHINESE, chinese); | |
709 | + params.put(HttpKey.CHEMISTRY, chemistry); | |
710 | + params.put(HttpKey.HISTIRY, history); | |
711 | + params.put(HttpKey.GEOGRAPHY, geography); | |
712 | + params.put(HttpKey.POLITICAL, political); | |
713 | + params.put(HttpKey.BIOLOGY, biology); | |
714 | + params.put(HttpKey.SCIENCE, science); | |
715 | + | |
716 | + Log.e("test", "版本信息信息" + params); | |
717 | + HttpClient.getInstance().addHeader("Accept", "*/*"); | |
718 | + HttpClient.getInstance().post(mContext, HttpUrl.chagepublishURL, params, new JsonHttpResponseHandler() { | |
719 | + @Override | |
720 | + public void onSuccess(int statusCode, Header[] headers, JSONObject response) { | |
721 | + super.onSuccess(statusCode, headers, response); | |
722 | + closeProgress(); | |
723 | + String status = response.optString("status"); | |
724 | + if (status.equals("1")) { | |
725 | + Toast.makeText(mContext, "版本信息修改成功", Toast.LENGTH_LONG).show(); | |
726 | + ((Activity) mContext).finish(); | |
727 | + } else { | |
728 | + AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试"); | |
729 | + } | |
730 | + | |
731 | + } | |
732 | + | |
733 | + @Override | |
734 | + public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { | |
735 | + super.onFailure(statusCode, headers, throwable, errorResponse); | |
736 | + closeProgress(); | |
737 | + Log.e("test", "onFailure" + errorResponse); | |
738 | + AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); | |
739 | + } | |
740 | + | |
741 | + }); | |
742 | + } | |
645 | 743 | |
646 | 744 | //修改个性签名 |
647 | 745 | public void changsignature(final Context mContext, long userId, int type, final String signature) { |
... | ... | @@ -700,7 +798,7 @@ public class HttpManager { |
700 | 798 | |
701 | 799 | |
702 | 800 | } else if (status == 1000) { |
703 | - AlertUtils.showToast(mContext, "您还没有签名哦"); | |
801 | + //AlertUtils.showToast(mContext, "您还没有签名哦"); | |
704 | 802 | |
705 | 803 | } else { |
706 | 804 | AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试!"); |
... | ... | @@ -879,7 +977,7 @@ public class HttpManager { |
879 | 977 | * 添加子账户信息 |
880 | 978 | */ |
881 | 979 | public void addchildAccountinfo(final Context mContext, long parentId, String image, |
882 | - String name, Long grade, Object school, Long region | |
980 | + String name, final Long grade, Object school, Long region | |
883 | 981 | , String deviceNumber, String regionName) { |
884 | 982 | mProgress = DialogPermission.showProgress(mContext, null, "正在添加子账户...", |
885 | 983 | false, true, null); |
... | ... | @@ -1150,6 +1248,54 @@ public class HttpManager { |
1150 | 1248 | }); |
1151 | 1249 | |
1152 | 1250 | } |
1251 | + /** | |
1252 | + * 获取最近学习视频 | |
1253 | + * @param mContext | |
1254 | + * @param userId | |
1255 | + */ | |
1256 | + public void getstuyvidioinfo(final Context mContext, long userId, final Handler handler) { | |
1257 | + mProgress = DialogPermission.showProgress(mContext, null, "正在获取最近学习视频...", | |
1258 | + false, true, null); | |
1259 | + HttpClient.getInstance().setTimeout(5 * 1000); | |
1260 | + HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | |
1261 | + HttpClient.getInstance().get(HttpUrl.getvidioURL + "?userId=" + userId , new AsyncHttpResponseHandler() { | |
1262 | + @Override | |
1263 | + public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | |
1264 | + closeProgress(); | |
1265 | + Log.e("test", "近学习视频" + new String(arg2)); | |
1266 | + try { | |
1267 | + JSONObject jsonObject = new JSONObject(new String(arg2)); | |
1268 | + int status = jsonObject.optInt("status"); | |
1269 | + if (status == 1) { | |
1270 | + VideoInfo videoInfo = GsonTool.getPerson(new String(arg2), VideoInfo.class);//解析json数据 | |
1271 | + List<VideoInfo.DataBean> schoolInfoBeanList = videoInfo.getData(); | |
1272 | + Message msg = Message.obtain(); | |
1273 | + msg.what = HttpCode.GETVIDIO_SUCESS; | |
1274 | + msg.obj = schoolInfoBeanList; | |
1275 | + handler.sendMessage(msg); | |
1276 | + | |
1277 | + }else { | |
1278 | + AlertUtils.showToast(mContext, "你好,服务器异常,请稍后再试!"); | |
1279 | + | |
1280 | + } | |
1281 | + } catch (JSONException e) { | |
1282 | + e.printStackTrace(); | |
1283 | + | |
1284 | + } | |
1285 | + | |
1286 | + } | |
1287 | + | |
1288 | + @Override | |
1289 | + public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | |
1290 | + closeProgress(); | |
1291 | + // Log.e("test", "错误信息" + new String(arg2)); | |
1292 | + AlertUtils.showToast(mContext, "无法链接到服务器,请检查您的网络或稍后重试!"); | |
1293 | + | |
1294 | + } | |
1295 | + }); | |
1296 | + | |
1297 | + } | |
1298 | + | |
1153 | 1299 | |
1154 | 1300 | /** |
1155 | 1301 | * 系统升级 |
... | ... | @@ -1386,5 +1532,16 @@ public class HttpManager { |
1386 | 1532 | e.printStackTrace(); |
1387 | 1533 | } |
1388 | 1534 | } |
1535 | + public boolean onKeyDown(int keyCode, KeyEvent event) | |
1536 | + { | |
1537 | + if (keyCode == KeyEvent.KEYCODE_BACK ) | |
1538 | + { | |
1539 | + | |
1540 | + HttpManager.getInstance().closeProgress(); | |
1541 | + } | |
1542 | + | |
1543 | + return false; | |
1544 | + | |
1545 | + } | |
1389 | 1546 | |
1390 | 1547 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpUrl.java
... | ... | @@ -41,6 +41,9 @@ public class HttpUrl { |
41 | 41 | public static String getversionURL=GetDomain()+"/press/list";//获取版本信息 |
42 | 42 | public static String isRegisterInfoCompleteURL=GetDomain()+"/register/extrainfo/check";//注册信息是否完整 |
43 | 43 | public static String getpublishURL=GetDomain()+"/userPress/info";//获取版本信息 |
44 | + public static String getvidioURL=GetDomain()+"/personal/video/recent";//获取最近学习视频 | |
45 | + public static String submitregisterURL=GetDomain()+"/register/extrainfo/submit";//提交注册信息 | |
46 | + public static String chagepublishURL=GetDomain()+"/userPress/update";//修改版本信息 | |
44 | 47 | |
45 | 48 | |
46 | 49 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/ChildsInfo.java
... | ... | @@ -84,6 +84,16 @@ public class ChildsInfo implements Serializable { |
84 | 84 | private String name; |
85 | 85 | private String grade; |
86 | 86 | private String image; |
87 | + | |
88 | + public String getGradeId() { | |
89 | + return gradeId; | |
90 | + } | |
91 | + | |
92 | + public void setGradeId(String gradeId) { | |
93 | + this.gradeId = gradeId; | |
94 | + } | |
95 | + | |
96 | + private String gradeId; | |
87 | 97 | private int type; |
88 | 98 | private String deviceNumber; |
89 | 99 | private String subAccountId; | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/VideoInfo.java
... | ... | @@ -0,0 +1,101 @@ |
1 | +package com.hjx.personalcenter.model; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.List; | |
5 | + | |
6 | +/** | |
7 | + * Created by h on 2017/9/15. | |
8 | + */ | |
9 | + | |
10 | +public class VideoInfo implements Serializable { | |
11 | + | |
12 | + /** | |
13 | + * status : 1 | |
14 | + * pageSize : 0 | |
15 | + * data : [{"videoCover":"http://hjxprodbucket.oss.aliyuncs.com/static/upload/online_api/mobile_portrait/2017-09-06/1e03835a-48fd-425e-8ab4-662968ee5377.png","videoUrl":"rtmp://vplay.xuexiao100.com/oflaDemo/M16-FLV/黄冈视频/小学数学/5年级上 北京版(北京出版社)(2014版)/北京数学5上_05 方程一.flv","videoName":"北京数学5上_05 方程一"},{"videoCover":"http://hjxprodbucket.oss.aliyuncs.com/static/upload/online_api/mobile_portrait/2017-09-06/1e03835a-48fd-425e-8ab4-662968ee5377.png","videoUrl":"rtmp://vplay.xuexiao100.com/oflaDemo/M16-FLV/黄冈视频/小学数学/5年级上 北京版(北京出版社)(2014版)/北京数学5上_05 方程一.flv","videoName":"北京数学5上_05 方程一"},{"videoCover":"http://hjxprodbucket.oss.aliyuncs.com/static/upload/online_api/mobile_portrait/2017-09-06/1e03835a-48fd-425e-8ab4-662968ee5377.png","videoUrl":"rtmp://vplay.xuexiao100.com/oflaDemo/M16-FLV/黄冈视频/小学数学/5年级上 北京版(北京出版社)(2014版)/北京数学5上_05 方程一.flv","videoName":"北京数学5上_05 方程一"},{"videoCover":"http://hjxprodbucket.oss.aliyuncs.com/static/upload/online_api/mobile_portrait/2017-09-06/1e03835a-48fd-425e-8ab4-662968ee5377.png","videoUrl":"rtmp://vplay.xuexiao100.com/oflaDemo/M16-FLV/黄冈视频/小学数学/5年级上 北京版(北京出版社)(2014版)/北京数学5上_05 方程一.flv","videoName":"北京数学5上_05 方程一"},{"videoCover":"http://hjxprodbucket.oss.aliyuncs.com/static/upload/online_api/mobile_portrait/2017-09-06/1e03835a-48fd-425e-8ab4-662968ee5377.png","videoUrl":"rtmp://vplay.xuexiao100.com/oflaDemo/M16-FLV/黄冈视频/小学数学/5年级上 北京版(北京出版社)(2014版)/北京数学5上_05 方程一.flv","videoName":"北京数学5上_05 方程一"},{"videoCover":"http://hjxprodbucket.oss.aliyuncs.com/static/upload/online_api/mobile_portrait/2017-09-06/1e03835a-48fd-425e-8ab4-662968ee5377.png","videoUrl":"rtmp://vplay.xuexiao100.com/oflaDemo/M16-FLV/黄冈视频/小学数学/5年级上 北京版(北京出版社)(2014版)/北京数学5上_05 方程一.flv","videoName":"北京数学5上_05 方程一"}] | |
16 | + * msg : success | |
17 | + * pageNum : 0 | |
18 | + */ | |
19 | + | |
20 | + private int status; | |
21 | + private int pageSize; | |
22 | + private String msg; | |
23 | + private int pageNum; | |
24 | + private List<DataBean> data; | |
25 | + | |
26 | + public void setStatus(int status) { | |
27 | + this.status = status; | |
28 | + } | |
29 | + | |
30 | + public void setPageSize(int pageSize) { | |
31 | + this.pageSize = pageSize; | |
32 | + } | |
33 | + | |
34 | + public void setMsg(String msg) { | |
35 | + this.msg = msg; | |
36 | + } | |
37 | + | |
38 | + public void setPageNum(int pageNum) { | |
39 | + this.pageNum = pageNum; | |
40 | + } | |
41 | + | |
42 | + public void setData(List<DataBean> data) { | |
43 | + this.data = data; | |
44 | + } | |
45 | + | |
46 | + public int getStatus() { | |
47 | + return status; | |
48 | + } | |
49 | + | |
50 | + public int getPageSize() { | |
51 | + return pageSize; | |
52 | + } | |
53 | + | |
54 | + public String getMsg() { | |
55 | + return msg; | |
56 | + } | |
57 | + | |
58 | + public int getPageNum() { | |
59 | + return pageNum; | |
60 | + } | |
61 | + | |
62 | + public List<DataBean> getData() { | |
63 | + return data; | |
64 | + } | |
65 | + | |
66 | + public static class DataBean { | |
67 | + /** | |
68 | + * videoCover : http://hjxprodbucket.oss.aliyuncs.com/static/upload/online_api/mobile_portrait/2017-09-06/1e03835a-48fd-425e-8ab4-662968ee5377.png | |
69 | + * videoUrl : rtmp://vplay.xuexiao100.com/oflaDemo/M16-FLV/黄冈视频/小学数学/5年级上 北京版(北京出版社)(2014版)/北京数学5上_05 方程一.flv | |
70 | + * videoName : 北京数学5上_05 方程一 | |
71 | + */ | |
72 | + | |
73 | + private String videoCover; | |
74 | + private String videoUrl; | |
75 | + private String videoName; | |
76 | + | |
77 | + public void setVideoCover(String videoCover) { | |
78 | + this.videoCover = videoCover; | |
79 | + } | |
80 | + | |
81 | + public void setVideoUrl(String videoUrl) { | |
82 | + this.videoUrl = videoUrl; | |
83 | + } | |
84 | + | |
85 | + public void setVideoName(String videoName) { | |
86 | + this.videoName = videoName; | |
87 | + } | |
88 | + | |
89 | + public String getVideoCover() { | |
90 | + return videoCover; | |
91 | + } | |
92 | + | |
93 | + public String getVideoUrl() { | |
94 | + return videoUrl; | |
95 | + } | |
96 | + | |
97 | + public String getVideoName() { | |
98 | + return videoName; | |
99 | + } | |
100 | + } | |
101 | +} | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_electroniccard_info.xml
... | ... | @@ -116,6 +116,7 @@ |
116 | 116 | android:textSize="22sp" /> |
117 | 117 | |
118 | 118 | <ImageView |
119 | + android:id="@+id/shopdizhi" | |
119 | 120 | android:layout_width="wrap_content" |
120 | 121 | android:layout_height="wrap_content" |
121 | 122 | android:layout_marginLeft="60dp" |
... | ... | @@ -179,6 +180,7 @@ |
179 | 180 | android:textSize="22sp" /> |
180 | 181 | |
181 | 182 | <ImageView |
183 | + android:id="@+id/cunstomdizhi" | |
182 | 184 | android:layout_width="wrap_content" |
183 | 185 | android:layout_height="wrap_content" |
184 | 186 | android:layout_marginLeft="60dp" | ... | ... |
PersonalCenter/app/src/main/res/layout/activity_main.xml
... | ... | @@ -348,13 +348,13 @@ |
348 | 348 | </LinearLayout> |
349 | 349 | |
350 | 350 | <LinearLayout |
351 | - android:layout_width="match_parent" | |
351 | + android:layout_width="wrap_content" | |
352 | 352 | android:layout_height="wrap_content"> |
353 | 353 | |
354 | 354 | <android.support.v7.widget.RecyclerView |
355 | 355 | android:id="@+id/id_recyclerview_horizontal" |
356 | - android:layout_width="match_parent" | |
357 | - android:layout_height="match_parent" | |
356 | + android:layout_width="wrap_content" | |
357 | + android:layout_height="wrap_content" | |
358 | 358 | android:layout_centerVertical="true" |
359 | 359 | android:scrollbars="none" /> |
360 | 360 | </LinearLayout> |
... | ... | @@ -362,6 +362,7 @@ |
362 | 362 | <View |
363 | 363 | android:layout_width="match_parent" |
364 | 364 | android:layout_height="0.7dp" |
365 | + android:layout_marginTop="10dp" | |
365 | 366 | android:background="@color/cutoff_line"> |
366 | 367 | |
367 | 368 | </View> |
... | ... | @@ -369,7 +370,7 @@ |
369 | 370 | <LinearLayout |
370 | 371 | android:layout_width="match_parent" |
371 | 372 | android:layout_height="wrap_content" |
372 | - android:layout_margin="20dp" | |
373 | + android:layout_margin="10dp" | |
373 | 374 | android:gravity="center_vertical" |
374 | 375 | android:orientation="horizontal"> |
375 | 376 | |
... | ... | @@ -402,7 +403,6 @@ |
402 | 403 | android:layout_width="0dp" |
403 | 404 | android:layout_height="wrap_content" |
404 | 405 | android:layout_weight="0.1" |
405 | - | |
406 | 406 | android:src="@mipmap/youjiantou" /> |
407 | 407 | |
408 | 408 | |
... | ... | @@ -412,7 +412,6 @@ |
412 | 412 | android:layout_width="match_parent" |
413 | 413 | android:layout_height="wrap_content" |
414 | 414 | android:layout_marginLeft="50dp" |
415 | - android:layout_marginTop="10dp" | |
416 | 415 | android:orientation="vertical"> |
417 | 416 | |
418 | 417 | <LinearLayout |
... | ... | @@ -455,7 +454,7 @@ |
455 | 454 | <LinearLayout |
456 | 455 | android:layout_width="match_parent" |
457 | 456 | android:layout_height="wrap_content" |
458 | - android:layout_marginTop="20dp" | |
457 | + android:layout_marginTop="15dp" | |
459 | 458 | android:gravity="center_vertical" |
460 | 459 | android:orientation="horizontal"> |
461 | 460 | |
... | ... | @@ -493,7 +492,7 @@ |
493 | 492 | <LinearLayout |
494 | 493 | android:layout_width="match_parent" |
495 | 494 | android:layout_height="wrap_content" |
496 | - android:layout_marginTop="20dp" | |
495 | + android:layout_marginTop="15dp" | |
497 | 496 | android:gravity="center_vertical" |
498 | 497 | android:orientation="horizontal"> |
499 | 498 | |
... | ... | @@ -531,7 +530,7 @@ |
531 | 530 | <LinearLayout |
532 | 531 | android:layout_width="match_parent" |
533 | 532 | android:layout_height="wrap_content" |
534 | - android:layout_marginTop="20dp" | |
533 | + android:layout_marginTop="15dp" | |
535 | 534 | android:gravity="center_vertical" |
536 | 535 | android:orientation="horizontal"> |
537 | 536 | |
... | ... | @@ -578,7 +577,7 @@ |
578 | 577 | <LinearLayout |
579 | 578 | android:layout_width="match_parent" |
580 | 579 | android:layout_height="wrap_content" |
581 | - android:layout_margin="20dp" | |
580 | + android:layout_margin="10dp" | |
582 | 581 | android:gravity="center_vertical" |
583 | 582 | android:orientation="horizontal"> |
584 | 583 | |
... | ... | @@ -601,15 +600,15 @@ |
601 | 600 | <LinearLayout |
602 | 601 | android:layout_width="match_parent" |
603 | 602 | android:layout_height="wrap_content" |
604 | - android:layout_marginTop="20dp"> | |
605 | - | |
606 | - <TextView | |
603 | + android:layout_marginTop="10dp"> | |
604 | + <android.support.v7.widget.RecyclerView | |
605 | + android:id="@+id/id_recyclerview_pubish" | |
607 | 606 | android:layout_width="match_parent" |
608 | - android:layout_height="100dp" | |
609 | - android:layout_marginLeft="20dp" | |
610 | - android:layout_marginTop="10dp" | |
611 | - android:gravity="center" | |
612 | - android:text="这里需要显示水平滑动的" /> | |
607 | + android:layout_height="match_parent" | |
608 | + android:layout_centerVertical="true" | |
609 | + android:scrollbars="none" /> | |
610 | + | |
611 | + | |
613 | 612 | </LinearLayout> |
614 | 613 | |
615 | 614 | ... | ... |
PersonalCenter/app/src/main/res/layout/custom_adilog_electroniccard.xml
PersonalCenter/app/src/main/res/layout/fragment_changge_presonal_info.xml
... | ... | @@ -83,6 +83,8 @@ |
83 | 83 | android:textSize="22sp" /> |
84 | 84 | |
85 | 85 | <ImageView |
86 | + android:id="@+id/my_adress" | |
87 | + android:padding="20dp" | |
86 | 88 | android:layout_width="wrap_content" |
87 | 89 | android:layout_height="wrap_content" |
88 | 90 | android:layout_marginLeft="150dp" |
... | ... | @@ -145,6 +147,8 @@ |
145 | 147 | android:textSize="22sp" /> |
146 | 148 | |
147 | 149 | <ImageView |
150 | + android:id="@+id/my_sex" | |
151 | + android:padding="20dp" | |
148 | 152 | android:layout_width="wrap_content" |
149 | 153 | android:layout_height="wrap_content" |
150 | 154 | android:layout_marginLeft="150dp" |
... | ... | @@ -236,6 +240,8 @@ |
236 | 240 | android:textSize="22sp" /> |
237 | 241 | |
238 | 242 | <ImageView |
243 | + android:id="@+id/my_bthday" | |
244 | + android:padding="20dp" | |
239 | 245 | android:layout_width="wrap_content" |
240 | 246 | android:layout_height="wrap_content" |
241 | 247 | android:layout_marginLeft="150dp" |
... | ... | @@ -262,6 +268,8 @@ |
262 | 268 | android:textSize="22sp" /> |
263 | 269 | |
264 | 270 | <ImageView |
271 | + android:id="@+id/my_grade" | |
272 | + android:padding="20dp" | |
265 | 273 | android:layout_width="wrap_content" |
266 | 274 | android:layout_height="wrap_content" |
267 | 275 | android:layout_marginLeft="150dp" |
... | ... | @@ -349,6 +357,8 @@ |
349 | 357 | android:textSize="22sp" /> |
350 | 358 | |
351 | 359 | <ImageView |
360 | + android:id="@+id/my_school" | |
361 | + android:padding="20dp" | |
352 | 362 | android:layout_width="wrap_content" |
353 | 363 | android:layout_height="wrap_content" |
354 | 364 | android:layout_marginLeft="150dp" | ... | ... |
PersonalCenter/app/src/main/res/layout/fragment_changge_version_info_itmes.xml
... | ... | @@ -2,15 +2,16 @@ |
2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | xmlns:fresco="http://schemas.android.com/apk/res-auto" |
4 | 4 | android:orientation="vertical" |
5 | - android:layout_width="match_parent" | |
6 | - android:layout_height="match_parent" | |
5 | + android:layout_marginLeft="10dp" | |
6 | + android:layout_width="wrap_content" | |
7 | + android:layout_height="wrap_content" | |
7 | 8 | android:gravity="center"> |
8 | 9 | |
9 | 10 | |
10 | 11 | <com.facebook.drawee.view.SimpleDraweeView |
11 | 12 | android:id="@+id/image_publish" |
12 | - android:layout_width="100dp" | |
13 | - android:layout_height="150dp" | |
13 | + android:layout_width="120dp" | |
14 | + android:layout_height="100dp" | |
14 | 15 | android:layout_gravity="center" |
15 | 16 | android:background="@drawable/corcle_black_bg" |
16 | 17 | fresco:placeholderImage="@mipmap/header_default" |
... | ... | @@ -20,18 +21,13 @@ |
20 | 21 | <TextView |
21 | 22 | android:id="@+id/subject" |
22 | 23 | android:layout_marginTop="5dp" |
23 | - android:textSize="22sp" | |
24 | - android:layout_width="wrap_content" | |
25 | - android:layout_height="wrap_content" | |
26 | - android:textColor="@color/login_text_black" | |
27 | - android:text="" | |
28 | - /> | |
29 | - <TextView | |
30 | - android:id="@+id/tv_publish" | |
31 | - android:layout_marginTop="10dp" | |
32 | 24 | android:textSize="18sp" |
33 | - android:layout_width="wrap_content" | |
25 | + android:layout_width="100dp" | |
34 | 26 | android:layout_height="wrap_content" |
27 | + android:width="100dp" | |
28 | + android:singleLine="true" | |
29 | + android:gravity="center" | |
30 | + android:ellipsize="end" | |
35 | 31 | android:textColor="@color/login_text_black" |
36 | 32 | android:text="" |
37 | 33 | /> | ... | ... |
PersonalCenter/app/src/main/res/layout/fragment_changge_version_info_itmes2.xml
... | ... | @@ -0,0 +1,48 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + xmlns:fresco="http://schemas.android.com/apk/res-auto" | |
4 | + android:orientation="vertical" | |
5 | + android:layout_width="wrap_content" | |
6 | + android:layout_height="wrap_content" | |
7 | + android:layout_marginLeft="10dp" | |
8 | + android:gravity="center"> | |
9 | + | |
10 | + | |
11 | + <com.facebook.drawee.view.SimpleDraweeView | |
12 | + android:id="@+id/image_publish" | |
13 | + android:layout_width="80dp" | |
14 | + android:layout_height="100dp" | |
15 | + android:layout_gravity="center" | |
16 | + android:background="@drawable/corcle_black_bg" | |
17 | + fresco:placeholderImage="@mipmap/header_default" | |
18 | + fresco:roundAsCircle="true" | |
19 | + fresco:placeholderImageScaleType="fitCenter" /> | |
20 | + | |
21 | + <TextView | |
22 | + android:id="@+id/subject" | |
23 | + android:layout_marginTop="5dp" | |
24 | + android:textSize="18sp" | |
25 | + android:width="80dp" | |
26 | + android:singleLine="true" | |
27 | + android:ellipsize="end" | |
28 | + android:gravity="center" | |
29 | + android:layout_width="wrap_content" | |
30 | + android:layout_height="wrap_content" | |
31 | + android:textColor="@color/login_text_black" | |
32 | + android:text="" | |
33 | + /> | |
34 | + <TextView | |
35 | + android:id="@+id/tv_publish" | |
36 | + android:layout_marginTop="10dp" | |
37 | + android:textSize="16sp" | |
38 | + android:width="80dp" | |
39 | + android:singleLine="true" | |
40 | + android:ellipsize="end" | |
41 | + android:layout_width="80dp" | |
42 | + android:gravity="center" | |
43 | + android:layout_height="wrap_content" | |
44 | + android:textColor="@color/login_text_black" | |
45 | + android:text="" | |
46 | + /> | |
47 | + | |
48 | +</LinearLayout> | |
0 | 49 | \ No newline at end of file | ... | ... |
PersonalCenter/app/src/main/res/layout/fragment_changge_version_info_itmes3.xml
... | ... | @@ -0,0 +1,41 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + xmlns:fresco="http://schemas.android.com/apk/res-auto" | |
4 | + android:orientation="vertical" | |
5 | + android:layout_width="match_parent" | |
6 | + android:layout_height="match_parent" | |
7 | + android:gravity="center"> | |
8 | + | |
9 | + | |
10 | + <com.facebook.drawee.view.SimpleDraweeView | |
11 | + android:id="@+id/image_publish" | |
12 | + android:layout_width="100dp" | |
13 | + android:layout_height="150dp" | |
14 | + android:layout_gravity="center" | |
15 | + android:background="@drawable/corcle_black_bg" | |
16 | + fresco:placeholderImage="@mipmap/header_default" | |
17 | + fresco:roundAsCircle="true" | |
18 | + fresco:placeholderImageScaleType="fitCenter" /> | |
19 | + | |
20 | + <TextView | |
21 | + android:id="@+id/subject" | |
22 | + android:layout_marginTop="5dp" | |
23 | + android:textSize="22sp" | |
24 | + android:gravity="center" | |
25 | + android:layout_width="match_parent" | |
26 | + android:layout_height="wrap_content" | |
27 | + android:textColor="@color/login_text_black" | |
28 | + android:text="" | |
29 | + /> | |
30 | + <TextView | |
31 | + android:id="@+id/tv_publish" | |
32 | + android:layout_marginTop="10dp" | |
33 | + android:textSize="18sp" | |
34 | + android:layout_width="wrap_content" | |
35 | + android:gravity="center" | |
36 | + android:layout_height="wrap_content" | |
37 | + android:textColor="@color/login_text_black" | |
38 | + android:text="" | |
39 | + /> | |
40 | + | |
41 | +</LinearLayout> | |
0 | 42 | \ No newline at end of file | ... | ... |