PageRenderTime 52ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/dateLoveInternational/src/main/java/com/datelove/online/International/fragment/MeFragment.java

https://bitbucket.org/juzhiwiscom/datelove
Java | 1350 lines | 939 code | 119 blank | 292 comment | 142 complexity | a1cd0ffda67fc6ea89e7479143206ef4 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. package com.datelove.online.International.fragment;
  2. import android.content.Context;
  3. import android.content.Intent;
  4. import android.os.Bundle;
  5. import android.os.Environment;
  6. import android.os.Handler;
  7. import android.support.design.widget.CollapsingToolbarLayout;
  8. import android.support.v4.view.ViewCompat;
  9. import android.support.v7.widget.LinearLayoutManager;
  10. import android.support.v7.widget.RecyclerView;
  11. import android.text.TextUtils;
  12. import android.util.Log;
  13. import android.view.LayoutInflater;
  14. import android.view.View;
  15. import android.view.ViewGroup;
  16. import android.view.animation.OvershootInterpolator;
  17. import android.widget.ImageView;
  18. import android.widget.LinearLayout;
  19. import android.widget.RelativeLayout;
  20. import android.widget.TextView;
  21. import com.alibaba.fastjson.JSON;
  22. import com.datelove.online.International.R;
  23. import com.datelove.online.International.activity.BuyServiceActivity;
  24. import com.datelove.online.International.activity.GetPhotoActivity;
  25. import com.datelove.online.International.activity.MatchInfoActivity;
  26. import com.datelove.online.International.activity.MyCareActivity;
  27. import com.datelove.online.International.activity.MyInfoActivity;
  28. import com.datelove.online.International.activity.PictureBrowseActivity;
  29. import com.datelove.online.International.activity.RecentVistorsActivity;
  30. import com.datelove.online.International.activity.SettingActivity;
  31. import com.datelove.online.International.adapter.SeeMeAdapter;
  32. import com.datelove.online.International.base.BaseApplication;
  33. import com.datelove.online.International.base.BaseTitleFragment;
  34. import com.datelove.online.International.bean.Image;
  35. import com.datelove.online.International.bean.SeeMe;
  36. import com.datelove.online.International.bean.SeeMeList;
  37. import com.datelove.online.International.bean.User;
  38. import com.datelove.online.International.bean.UserBase;
  39. import com.datelove.online.International.bean.UserDetail;
  40. import com.datelove.online.International.constant.CommonData;
  41. import com.datelove.online.International.constant.IConfigConstant;
  42. import com.datelove.online.International.constant.IUrlConstant;
  43. import com.datelove.online.International.dialog.AlbumMoreDialog;
  44. import com.datelove.online.International.event.SetAvatarEvent;
  45. import com.datelove.online.International.event.UpdatePayInfoEvent;
  46. import com.datelove.online.International.event.UpdateUserInfoEvent;
  47. import com.datelove.online.International.utils.Cheeses;
  48. import com.datelove.online.International.utils.CommonRequestUtil;
  49. import com.datelove.online.International.utils.FileUtil;
  50. import com.datelove.online.International.utils.MyLinearLayout;
  51. import com.datelove.online.International.utils.ParamsUtils;
  52. import com.datelove.online.International.utils.SlideMenu;
  53. import com.datelove.online.International.utils.Utils;
  54. import com.datelove.online.International.xml.PlatformInfoXml;
  55. import com.datelove.online.International.xml.UserInfoXml;
  56. import com.library.adapter.recyclerview.CommonRecyclerViewAdapter;
  57. import com.library.adapter.recyclerview.RecyclerViewHolder;
  58. import com.library.imageloader.CircleTransformation;
  59. import com.library.imageloader.ImageLoader;
  60. import com.library.imageloader.ImageLoaderUtil;
  61. import com.library.utils.DensityUtil;
  62. import com.library.utils.HeightUtils;
  63. import com.library.utils.SharedPreferenceUtil;
  64. import com.library.utils.Util;
  65. import com.library.widgets.CollapsingTextView;
  66. import com.zhy.http.okhttp.OkHttpUtils;
  67. import com.zhy.http.okhttp.callback.Callback;
  68. import org.greenrobot.eventbus.EventBus;
  69. import org.greenrobot.eventbus.Subscribe;
  70. import java.io.File;
  71. import java.util.ArrayList;
  72. import java.util.List;
  73. import java.util.Map;
  74. import butterknife.BindView;
  75. import butterknife.ButterKnife;
  76. import butterknife.Unbinder;
  77. import okhttp3.Call;
  78. import okhttp3.Response;
  79. import static com.squareup.picasso.Picasso.with;
  80. /**
  81. * 我
  82. */
  83. public class MeFragment extends BaseTitleFragment implements View.OnClickListener {
  84. @BindView(R.id.userDetail_CollapsingToolbarLayout)
  85. CollapsingToolbarLayout mCollapsingToolbarLayout;
  86. // @BindView(R.id.userDetail_toolbar)
  87. // Toolbar mToolbar;
  88. // 用户头像和照片墙
  89. @BindView(R.id.userDetail_avatar)
  90. ImageView mIvUserAvatar;
  91. @BindView(R.id.userDetail_pic_wall)
  92. RecyclerView mPicRecyclerView;
  93. // 展示的基本信息
  94. @BindView(R.id.userDetail_base_info)
  95. TextView mTvBaseInfo;
  96. // 内心独白
  97. @BindView(R.id.userDetail_monologue_ll)
  98. LinearLayout mLlMonologue;
  99. @BindView(R.id.userDetail_monologue)
  100. CollapsingTextView mMonologue;
  101. // 用户个人资料
  102. // 国家
  103. @BindView(R.id.userDetail_country_ll)
  104. LinearLayout mLlCountry;
  105. @BindView(R.id.userDetail_country)
  106. TextView mTvCountry;
  107. @BindView(R.id.userDetail_country_divider)
  108. View mCountryDivider;
  109. // 地区
  110. @BindView(R.id.userDetail_area_ll)
  111. LinearLayout mLlArea;
  112. @BindView(R.id.userDetail_area)
  113. TextView mTvArea;
  114. @BindView(R.id.userDetail_area_divider)
  115. View mAreaDivider;
  116. // 星座
  117. @BindView(R.id.userDetail_sign_ll)
  118. LinearLayout mLlSign;
  119. @BindView(R.id.userDetail_sign)
  120. TextView mTvSign;
  121. @BindView(R.id.userDetail_sign_divider)
  122. View mSignDivider;
  123. // 学历
  124. @BindView(R.id.userDetail_education_ll)
  125. LinearLayout mLlEducation;
  126. @BindView(R.id.userDetail_education)
  127. TextView mTvEducation;
  128. @BindView(R.id.userDetail_education_divider)
  129. View mEducationDivider;
  130. // 收入
  131. @BindView(R.id.userDetail_income_ll)
  132. LinearLayout mLlIncome;
  133. @BindView(R.id.userDetail_income)
  134. TextView mTvIncome;
  135. @BindView(R.id.userDetail_income_divider)
  136. View mIncomeDivider;
  137. // 职业
  138. @BindView(R.id.userDetail_occupation_ll)
  139. LinearLayout mLlOccupation;
  140. @BindView(R.id.userDetail_occupation)
  141. TextView mTvOccupation;
  142. @BindView(R.id.userDetail_occupation_divider)
  143. View mOccupationDivider;
  144. // 是否想要小孩
  145. @BindView(R.id.userDetail_wantBaby_ll)
  146. LinearLayout mLlWantBaby;
  147. @BindView(R.id.userDetail_wantBaby)
  148. TextView mTvWantBaby;
  149. @BindView(R.id.userDetail_want_baby_divider)
  150. View mWantBabyDivider;
  151. // 喜欢的运动
  152. @BindView(R.id.userDetail_sport_ll)
  153. LinearLayout mLlSport;
  154. @BindView(R.id.userDetail_sport)
  155. TextView mTvSport;
  156. @BindView(R.id.userDetail_sport_divider)
  157. View mSportDivider;
  158. // 喜欢的宠物
  159. @BindView(R.id.userDetail_pets_ll)
  160. LinearLayout mLlPets;
  161. @BindView(R.id.userDetail_pets)
  162. TextView mTvPets;
  163. @BindView(R.id.userDetail_pets_divider)
  164. View mPetsDivider;
  165. // 种族
  166. @BindView(R.id.userDetail_ethnicity_ll)
  167. LinearLayout mLlEthnicity;
  168. @BindView(R.id.userDetail_ethnicity)
  169. TextView mTvEthnicity;
  170. @BindView(R.id.userDetail_ethnicity_divider)
  171. View mEthnicityDivider;
  172. // 锻炼习惯
  173. @BindView(R.id.userDetail_exerciseHabits_ll)
  174. LinearLayout mLlExerciseHabits;
  175. @BindView(R.id.userDetail_exerciseHabits)
  176. TextView mTvExerciseHabits;
  177. @BindView(R.id.userDetail_exerciseHabits_divider)
  178. View mExerciseHabitsDivider;
  179. // 兴趣爱好
  180. @BindView(R.id.userDetail_hobby_ll)
  181. LinearLayout mLlHobby;
  182. @BindView(R.id.userDetail_hobby)
  183. TextView mTvHobby;
  184. @BindView(R.id.userDetail_hobby_divider)
  185. View mHobbyDivider;
  186. // @BindView(R.id.head_icon)
  187. // ImageView head_icon;
  188. // @BindView(R.id.nick_name)
  189. // TextView nick_name;
  190. // @BindView(R.id.user_info)
  191. // TextView user_info;
  192. @BindView(R.id.recyclerview_seeme)
  193. RecyclerView mRecyclerView;
  194. @BindView(R.id.buy_bean)
  195. TextView buy_bean;
  196. @BindView(R.id.buy_month)
  197. TextView buy_month;
  198. @BindView(R.id.tv_photo)
  199. TextView tv_photo;
  200. // @BindView(R.id.my_info)
  201. // TextView my_info;
  202. // @BindView(R.id.me_vip)
  203. // TextView me_vip;
  204. // @BindView(R.id.my_photo)
  205. // TextView my_photo;
  206. @BindView(R.id.my_match)
  207. TextView my_match;
  208. @BindView(R.id.my_care)
  209. TextView my_care;
  210. @BindView(R.id.my_set)
  211. TextView my_set;
  212. @BindView(R.id.no_person)
  213. TextView no_person;
  214. @BindView(R.id.my_linearlayout)
  215. MyLinearLayout my_linearlayout;
  216. @BindView(R.id.iv_icon)
  217. ImageView ivIcon;
  218. @BindView(R.id.main_left_menu)
  219. ImageView mainLeftMenu;
  220. @BindView(R.id.main_right_menu)
  221. ImageView mainRightMenu;
  222. @BindView(R.id.slideMenu_slide)
  223. SlideMenu slideMenu;
  224. @BindView(R.id.name)
  225. TextView name;
  226. Unbinder unbinder;
  227. @BindView(R.id.tv_introduce)
  228. TextView tvIntroduce;
  229. @BindView(R.id.rl_introduce)
  230. RelativeLayout rlIntroduce;
  231. private SeeMeAdapter mSeeMeAdapter;
  232. private String uId;
  233. private String nickname;
  234. private ImageWallAdapter mImageWallAdapter;
  235. private List<Image> mImageList = new ArrayList<>();
  236. private boolean slideOpen = false;
  237. private int i;
  238. private boolean first=true;
  239. private boolean isFirst=true;
  240. private int n=0;
  241. @Override
  242. public void onResume() {
  243. super.onResume();
  244. System.out.println("wwwwwwMeFragment");
  245. }
  246. // @Override
  247. // public void onCreate(@Nullable Bundle savedInstanceState) {
  248. // super.onCreate(savedInstanceState);
  249. // slideMenu = (SlideMenu) View.inflate(getActivity(), R.layout.activity_main, null);
  250. // setContentView(slideMenu);
  251. // }
  252. @Override
  253. protected int getLayoutResId() {
  254. return R.layout.fragment_me;
  255. }
  256. @Override
  257. protected void initViewsAndVariables() {
  258. // 女用户更换背景图
  259. String genter = SharedPreferenceUtil.getStringValue(getActivity(), "REGISTER_GENDER", "genter", "0");
  260. if (!genter.equals("0")) {
  261. slideMenu.setBackgroundResource(R.drawable.me_woman_bacground);
  262. // 改变字体颜色
  263. buy_bean.setTextColor(getActivity().getResources().getColor(R.color.mask_color));
  264. buy_month.setTextColor(getActivity().getResources().getColor(R.color.mask_color));
  265. tv_photo.setTextColor(getActivity().getResources().getColor(R.color.mask_color));
  266. no_person.setTextColor(getActivity().getResources().getColor(R.color.mask_color));
  267. my_care.setTextColor(getActivity().getResources().getColor(R.color.mask_color));
  268. my_match.setTextColor(getActivity().getResources().getColor(R.color.mask_color));
  269. my_set.setTextColor(getActivity().getResources().getColor(R.color.mask_color));
  270. }
  271. //设置SlideMenu
  272. my_linearlayout.setSlideMenu(slideMenu);
  273. // 去除最上面的标题栏
  274. deleteBar();
  275. // setTitle(getString(R.string.tab_me));
  276. LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
  277. linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
  278. mRecyclerView.setLayoutManager(linearLayoutManager);
  279. mSeeMeAdapter = new SeeMeAdapter(getActivity(), R.layout.item_seeme);
  280. mRecyclerView.setAdapter(mSeeMeAdapter);
  281. uId = UserInfoXml.getUID();
  282. // 初始化照片墙RecyclerView
  283. LinearLayoutManager linearLayoutManager1 = new LinearLayoutManager(getActivity());
  284. linearLayoutManager1.setOrientation(LinearLayoutManager.HORIZONTAL);
  285. mPicRecyclerView.setLayoutManager(linearLayoutManager1);
  286. mImageWallAdapter = new ImageWallAdapter(getActivity(), R.layout.item_pic_wall);
  287. // 添加HeadView
  288. ImageView headView = new ImageView(getActivity());
  289. ViewGroup.MarginLayoutParams layoutParams = new ViewGroup.MarginLayoutParams(DensityUtil.dip2px(getActivity(), 60), DensityUtil.dip2px(getActivity(), 60));
  290. int margin = DensityUtil.dip2px(getActivity(), 5);
  291. layoutParams.setMargins(margin, margin, margin, margin);
  292. headView.setLayoutParams(layoutParams);
  293. headView.setImageResource(R.drawable.upload_photo_me);
  294. mImageWallAdapter.addHeaderView(headView, false);
  295. mPicRecyclerView.setAdapter(mImageWallAdapter);
  296. setMyInfo();
  297. // 加载用户详情
  298. showLoading();
  299. loadUserDetailInfo(false);
  300. getSeeMe();
  301. getPhotoList();
  302. if (CommonData.getCountryList().contains(PlatformInfoXml.getCountry())) {
  303. getSelfIntroduce();
  304. }
  305. }
  306. private void setMyInfo() {
  307. if (UserInfoXml.isMale()) {
  308. // head_icon.setImageResource(R.drawable.icon_me_male);
  309. ivIcon.setImageResource(R.drawable.icon_me_male);
  310. } else {
  311. // head_icon.setImageResource(R.drawable.icon_me_female);
  312. ivIcon.setImageResource(R.drawable.icon_me_female);
  313. }
  314. File avatarFile = new File(IConfigConstant.LOCAL_AVATAR_PATH);
  315. if (avatarFile != null && avatarFile.exists()) {
  316. ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), ivIcon, avatarFile);
  317. } else {
  318. ImageLoaderUtil.getInstance().loadImage(getActivity(), new ImageLoader.Builder().url(UserInfoXml.getAvatarThumbnailUrl()).
  319. imageView(ivIcon).transform(new CircleTransformation()).build());
  320. // 下载头像,缓存到本地
  321. new Thread(new Runnable() {
  322. @Override
  323. public void run() {
  324. String imageUrl = UserInfoXml.getAvatarUrl();
  325. if (!TextUtils.isEmpty(imageUrl)) {
  326. FileUtil.downloadFile(imageUrl, BaseApplication.getGlobalContext().
  327. getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(), "avatar.jpg");
  328. }
  329. }
  330. }).start();
  331. }
  332. boolean booleanValue = SharedPreferenceUtil.getBooleanValue(getActivity(), "mIvUserAvatar", "get_mIvUserAvatar", false);
  333. if (booleanValue) {
  334. File wallrFile = new File(IConfigConstant.LOCAL_wall_PATH);
  335. if (wallrFile != null && wallrFile.exists()) {
  336. ImageLoaderUtil.getInstance().loadLocalImage(getActivity(), mIvUserAvatar, wallrFile);
  337. } else {
  338. String imgUrl = UserInfoXml.getAvatarUrl();
  339. if (!TextUtils.isEmpty(imgUrl)) {
  340. ImageLoaderUtil.getInstance().loadImage(getActivity(), new ImageLoader.Builder()
  341. .url(imgUrl).imageView(mIvUserAvatar).build());
  342. }
  343. }
  344. new Handler().postDelayed(new Runnable() {
  345. @Override
  346. public void run() {
  347. File avatarFile = new File(IConfigConstant.LOCAL_AVATAR_PATH);
  348. if (avatarFile != null && avatarFile.exists()) {
  349. ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), ivIcon, avatarFile);
  350. }
  351. File wallrFile = new File(IConfigConstant.LOCAL_wall_PATH);
  352. if (wallrFile != null && wallrFile.exists()) {
  353. ImageLoaderUtil.getInstance().loadLocalImage(getActivity(), mIvUserAvatar, wallrFile);
  354. } else {
  355. String imgUrl = UserInfoXml.getAvatarUrl();
  356. if (!TextUtils.isEmpty(imgUrl)) {
  357. ImageLoaderUtil.getInstance().loadImage(getActivity(), new ImageLoader.Builder()
  358. .url(imgUrl).imageView(mIvUserAvatar).build());
  359. }
  360. }
  361. }
  362. },5000);
  363. new Handler().postDelayed(new Runnable() {
  364. @Override
  365. public void run() {
  366. File avatarFile = new File(IConfigConstant.LOCAL_AVATAR_PATH);
  367. if (avatarFile != null && avatarFile.exists()) {
  368. ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), ivIcon, avatarFile);
  369. }
  370. File wallrFile = new File(IConfigConstant.LOCAL_wall_PATH);
  371. if (wallrFile != null && wallrFile.exists()) {
  372. ImageLoaderUtil.getInstance().loadLocalImage(getActivity(), mIvUserAvatar, wallrFile);
  373. } else {
  374. String imgUrl = UserInfoXml.getAvatarUrl();
  375. if (!TextUtils.isEmpty(imgUrl)) {
  376. ImageLoaderUtil.getInstance().loadImage(getActivity(), new ImageLoader.Builder()
  377. .url(imgUrl).imageView(mIvUserAvatar).build());
  378. }
  379. }
  380. }
  381. },10000);
  382. }
  383. // nick_name.setText(UserInfoXml.getNickName());
  384. // user_info.setText(UserInfoXml.getAge() + getString(R.string.years) + "\t\t" + UserInfoXml.getProvinceName());
  385. boolean beanUser = UserInfoXml.isBeanUser();
  386. UserInfoXml.isMonthly();
  387. buy_bean.setSelected(UserInfoXml.isBeanUser());
  388. buy_month.setSelected(UserInfoXml.isMonthly());
  389. }
  390. @Override
  391. protected void addListeners() {
  392. buy_bean.setOnClickListener(this);
  393. buy_month.setOnClickListener(this);
  394. mIvUserAvatar.setOnClickListener(this);
  395. // my_photo.setOnClickListener(this);
  396. my_match.setOnClickListener(this);
  397. my_care.setOnClickListener(this);
  398. my_set.setOnClickListener(this);
  399. // no_person.setOnClickListener(this);
  400. // head_icon.setOnClickListener(this);
  401. ivIcon.setOnClickListener(this);
  402. mainLeftMenu.setOnClickListener(this);
  403. mainRightMenu.setOnClickListener(this);
  404. //设置拖拽的监听器
  405. slideMenu.setDragListener(new SlideMenu.OnDragListener() {
  406. @Override
  407. public void onOpen() {
  408. // Toast.makeText(getActivity(), "open", Toast.LENGTH_SHORT).show();
  409. // int i = new Random().nextInt(4);
  410. // menuListView.smoothScrollToPosition(i);
  411. }
  412. @Override
  413. public void onClose() {
  414. // Toast.makeText(getActivity(), "close", Toast.LENGTH_SHORT).show();
  415. // ViewCompat.animate(iv_head)
  416. // .setInterpolator(new CycleInterpolator(10))
  417. // .translationXBy(25)
  418. // .setDuration(1000)
  419. // .start();
  420. ViewCompat.animate(mainLeftMenu)
  421. .rotationBy(360)
  422. .setInterpolator(new OvershootInterpolator(4))
  423. .setDuration(1000)
  424. .start();
  425. }
  426. @Override
  427. public void onDragging(float fraction) {
  428. // Log.e(TAG, "onDragging: "+fraction);
  429. // iv_head.setAlpha(1-fraction);
  430. mainLeftMenu.setRotation(360 * fraction);
  431. }
  432. });
  433. // 头像和照片的监听
  434. mImageWallAdapter.setOnHeaderViewClickListener(new View.OnClickListener() {
  435. @Override
  436. public void onClick(View v) {
  437. GetPhotoActivity.toGetPhotoActivity(getActivity(), IConfigConstant.LOCAL_PIC_PATH, new GetPhotoActivity.OnGetPhotoListener() {
  438. @Override
  439. public void getSelectedPhoto(File file) {
  440. if (file != null) {
  441. uploadImage(file);
  442. updateUserInfo();
  443. }
  444. }
  445. });
  446. }
  447. });
  448. mImageWallAdapter.setOnItemClickListener(new CommonRecyclerViewAdapter.OnItemClickListener() {
  449. @Override
  450. public void onItemClick(View view, int position, RecyclerViewHolder viewHolder) {
  451. PictureBrowseActivity.toPictureBrowseActivity(getActivity(), position, mImageList, true);
  452. }
  453. });
  454. mImageWallAdapter.setOnItemLongClickListener(new CommonRecyclerViewAdapter.OnItemLongClickListener() {
  455. @Override
  456. public void onItemLongClick(View view, final int position, RecyclerViewHolder viewHolder) {
  457. final Image image = mImageWallAdapter.getItemByPosition(position);
  458. AlbumMoreDialog.newInstance(new AlbumMoreDialog.OnAlbumMoreClickLister() {
  459. @Override
  460. public void setToAvatar() {
  461. CommonRequestUtil.setAvatar(image.getId(), true, new CommonRequestUtil.OnCommonListener() {
  462. @Override
  463. public void onSuccess() {
  464. // 删除本地缓存
  465. FileUtil.deleteFile(IConfigConstant.LOCAL_AVATAR_PATH);
  466. FileUtil.deleteFile(IConfigConstant.LOCAL_wall_PATH);
  467. new Thread(new Runnable() {
  468. @Override
  469. public void run() {
  470. FileUtil.downWallFile(image.imageUrl, BaseApplication.getGlobalContext().
  471. getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(), "wall.jpg",false);
  472. }
  473. }).start();
  474. SharedPreferenceUtil.setBooleanValue(getActivity(),"mIvUserAvatar","get_mIvUserAvatar",true);
  475. updateUserInfo();
  476. }
  477. @Override
  478. public void onFail() {
  479. }
  480. });
  481. }
  482. @Override
  483. public void deleteImage() {
  484. CommonRequestUtil.deleteImage(image.getId(), true, new CommonRequestUtil.OnCommonListener() {
  485. @Override
  486. public void onSuccess() {
  487. if (mImageWallAdapter != null) {
  488. mImageWallAdapter.removeItem(position);
  489. getPhotoList();
  490. }
  491. }
  492. @Override
  493. public void onFail() {
  494. }
  495. });
  496. }
  497. }).show(getActivity().getSupportFragmentManager(), "album");
  498. }
  499. });
  500. }
  501. private void getSeeMe() {
  502. OkHttpUtils.post()
  503. .url(IUrlConstant.URL_GET_GUEST_LIST)
  504. .addHeader("token", PlatformInfoXml.getToken())
  505. .addParams("platformInfo", PlatformInfoXml.getPlatformJsonString())
  506. .addParams("pageNum", "1")
  507. .addParams("pageSize", "15")
  508. .build()
  509. .execute(new Callback<SeeMeList>() {
  510. @Override
  511. public SeeMeList parseNetworkResponse(Response response, int id) throws Exception {
  512. String resultJson = response.body().string();
  513. if (!TextUtils.isEmpty(resultJson)) {
  514. return JSON.parseObject(resultJson, SeeMeList.class);
  515. }
  516. return null;
  517. }
  518. @Override
  519. public void onError(Call call, Exception e, int id) {
  520. }
  521. @Override
  522. public void onResponse(SeeMeList response, int id) {
  523. if (response != null) {
  524. List<SeeMe> seeMeList = response.getSeeMeList();
  525. if (!Util.isListEmpty(seeMeList)) {
  526. if (mRecyclerView != null && no_person != null && mSeeMeAdapter != null) {
  527. mRecyclerView.setVisibility(View.VISIBLE);
  528. no_person.setVisibility(View.GONE);
  529. mSeeMeAdapter.replaceAll(seeMeList);
  530. mSeeMeAdapter.setOnItemClickListener(new CommonRecyclerViewAdapter.OnItemClickListener() {
  531. @Override
  532. public void onItemClick(View view, int position, RecyclerViewHolder viewHolder) {
  533. SeeMe seeMe = mSeeMeAdapter.getItemByPosition(position);
  534. if (seeMe != null) {
  535. // UserInfoDetailActivity.toUserInfoDetailActivity(getActivity(), seeMe.getUserBaseEnglish().getId(), null, UserInfoDetailActivity.SOURCE_FROM_SEEME);
  536. // EventBus.getDefault().post(new RecentVistorsEvent());
  537. Intent intent = new Intent(getActivity(), RecentVistorsActivity.class);
  538. startActivity(intent);
  539. }
  540. }
  541. });
  542. }
  543. }
  544. }
  545. }
  546. });
  547. }
  548. @Override
  549. public void onClick(View view) {
  550. switch (view.getId()) {
  551. // case R.id.head_icon:
  552. // GetPhotoActivity.toGetPhotoActivity(getActivity(), IConfigConstant.LOCAL_AVATAR_PATH, new GetPhotoActivity.OnGetPhotoListener() {
  553. // @Override
  554. // public void getSelectedPhoto(final File file) {
  555. // if (file != null) {
  556. // showLoading();
  557. // CommonRequestUtil.uploadImage(true, file, true, new CommonRequestUtil.OnUploadImageListener() {
  558. // @Override
  559. // public void onSuccess(Image image) {
  560. // if (image != null) {
  561. // // 保存头像信息
  562. // UserInfoXml.setAvatarUrl(image.getImageUrl());
  563. // UserInfoXml.setAvatarThumbnailUrl(image.getThumbnailUrl());
  564. // UserInfoXml.setAvatarStatus(image.getStatus());
  565. // }
  566. // // 设置新头像
  567. //// ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), head_icon, file);
  568. // ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), ivIcon, file);
  569. // dismissLoading();
  570. // }
  571. //
  572. // @Override
  573. // public void onFail() {
  574. // dismissLoading();
  575. // }
  576. // });
  577. // }
  578. // }
  579. // });
  580. // break;
  581. // case R.id.userDetail_avatar:
  582. // PictureBrowseActivity.toPictureBrowseActivity(getActivity(), position, mImageList,true);
  583. // break;
  584. case R.id.iv_icon:
  585. slideMenu.open();
  586. new Handler().postDelayed(new Runnable() {
  587. @Override
  588. public void run() {
  589. // 打开侧滑菜单
  590. slideMenu.open();
  591. }
  592. },4000);
  593. GetPhotoActivity.toGetPhotoActivity(getActivity(), IConfigConstant.LOCAL_AVATAR_PATH, new GetPhotoActivity.OnGetPhotoListener() {
  594. @Override
  595. public void getSelectedPhoto(final File file) {
  596. if (file != null) {
  597. slideMenu.open();
  598. showLoading();
  599. CommonRequestUtil.uploadImage(true, file, true, new CommonRequestUtil.OnUploadImageListener() {
  600. @Override
  601. public void onSuccess(final Image image) {
  602. slideMenu.open();
  603. if (image != null) {
  604. // 保存头像信息
  605. UserInfoXml.setAvatarUrl(image.getImageUrl());
  606. UserInfoXml.setAvatarThumbnailUrl(image.getThumbnailUrl());
  607. UserInfoXml.setAvatarStatus(image.getStatus());
  608. }
  609. // 设置新头像
  610. // ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), head_icon, file);
  611. ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), ivIcon, file);
  612. with(getActivity()).load(file).skipMemoryCache().noPlaceholder().into(mIvUserAvatar);
  613. SharedPreferenceUtil.setBooleanValue(getActivity(),"mIvUserAvatar","get_mIvUserAvatar",true);
  614. dismissLoading();
  615. new Thread(new Runnable() {
  616. @Override
  617. public void run() {
  618. FileUtil.downWallFile(image.getImageUrl(), BaseApplication.getGlobalContext().
  619. getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath(), "wall.jpg",false);
  620. }
  621. }).start();
  622. getPhotoList();
  623. new Handler().postDelayed(new Runnable() {
  624. @Override
  625. public void run() {
  626. slideMenu.open();
  627. }
  628. },1000);
  629. }
  630. @Override
  631. public void onFail() {
  632. dismissLoading();
  633. slideMenu.open();
  634. }
  635. });
  636. }
  637. }
  638. });
  639. break;
  640. case R.id.buy_bean:
  641. BuyServiceActivity.toBuyServiceActivity(getActivity(), BuyServiceActivity.INTENT_FROM_BEAN,
  642. IConfigConstant.PAY_TAG_FROM_DETAIL, IConfigConstant.PAY_WAY_BEAN);
  643. break;
  644. case R.id.buy_month:
  645. BuyServiceActivity.toBuyServiceActivity(getActivity(), BuyServiceActivity.INTENT_FROM_MONTH,
  646. IConfigConstant.PAY_TAG_FROM_DETAIL, IConfigConstant.PAY_WAY_MONTH);
  647. break;
  648. // case R.id.me_vip:
  649. // BuyServiceActivity.toBuyServiceActivity(getActivity(), BuyServiceActivity.INTENT_FROM_INTERCEPT,
  650. // IConfigConstant.PAY_TAG_FROM_DETAIL, IConfigConstant.PAY_WAY_ALL);
  651. // break;
  652. //
  653. // case R.id.my_info:
  654. // Util.gotoActivity(getActivity(), MyInfoActivity.class, false);
  655. // break;
  656. // case R.id.my_photo:
  657. // Util.gotoActivity(getActivity(), MyPhotoActivity.class, false);
  658. // break;
  659. case R.id.my_match:
  660. Util.gotoActivity(getActivity(), MatchInfoActivity.class, false);
  661. break;
  662. case R.id.my_care:
  663. Util.gotoActivity(getActivity(), MyCareActivity.class, false);
  664. break;
  665. case R.id.my_set:
  666. Util.gotoActivity(getActivity(), SettingActivity.class, false);
  667. break;
  668. // case R.id.no_person:
  669. // EventBus.getDefault().post(new NoSeeMeEvent());
  670. // break;
  671. case R.id.main_left_menu:
  672. // 左边按钮
  673. slideMenu.open();
  674. break;
  675. case R.id.main_right_menu:
  676. // 右边按钮
  677. Util.gotoActivity(getActivity(), MyInfoActivity.class, false);
  678. break;
  679. }
  680. }
  681. /**
  682. * 设置用户信息
  683. */
  684. private void setUserInfo(User user,boolean setAvatar) {
  685. if (user != null) {
  686. if(setAvatar){
  687. setUserPicWall(user.getListImage());
  688. slideMenu.open();
  689. }else {
  690. UserBase userBase = user.getUserBaseEnglish();
  691. if (userBase != null) {
  692. // 更新ID
  693. uId = userBase.getId();
  694. // 设置用户名为标题
  695. nickname = userBase.getNickName();
  696. if (!TextUtils.isEmpty(nickname)) {
  697. mCollapsingToolbarLayout.setTitle(nickname);
  698. }
  699. // 设置头像
  700. Image image = userBase.getImage();
  701. // new Handler().postDelayed(new Runnable() {
  702. // @Override
  703. // public void run() {
  704. // first = false;
  705. // }
  706. // }, 8000);
  707. // if(!first) {
  708. // if (image != null) {
  709. // boolean booleanValue = SharedPreferenceUtil.getBooleanValue(getActivity(), "mIvUserAvatar", "get_mIvUserAvatar", false);
  710. // if (booleanValue) {
  711. // File avatarFile = new File(IConfigConstant.LOCAL_wall_PATH);
  712. // if (avatarFile != null && avatarFile.exists()) {
  713. // ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), mIvUserAvatar, avatarFile);
  714. // } else {
  715. // String imgUrl = image.getImageUrl();
  716. // if (!TextUtils.isEmpty(imgUrl)) {
  717. // ImageLoaderUtil.getInstance().loadImage(getActivity(), new ImageLoader.Builder()
  718. // .url(imgUrl).imageView(mIvUserAvatar).build());
  719. // }
  720. // }
  721. //
  722. //
  723. //
  724. // }
  725. // } else {
  726. // mIvUserAvatar.setImageResource(IConfigConstant.COMMON_DEFAULT_AVATAR);
  727. // }
  728. // } else {
  729. // mIvUserAvatar.setImageResource(IConfigConstant.COMMON_DEFAULT_AVATAR);
  730. // }
  731. // }
  732. // 设置年龄,身高,婚姻状况为展示基本信息
  733. StringBuilder stringBuilder = new StringBuilder();
  734. int age = userBase.getAge();
  735. if (age < 18) {
  736. age = 18;
  737. }
  738. stringBuilder.append(age);
  739. // .append(getString(R.string.years));
  740. String heightCm = userBase.getHeightCm();
  741. if (!TextUtils.isEmpty(heightCm)) {
  742. stringBuilder.append(" | ")
  743. .append(HeightUtils.getInchCmByCm(heightCm));
  744. }
  745. if (ParamsUtils.getMarriageMap() != null) {
  746. String marriage = ParamsUtils.getMarriageMap().get(String.valueOf(userBase.getMaritalStatus()));
  747. if (!TextUtils.isEmpty(marriage)) {
  748. if (!TextUtils.isEmpty(heightCm)) {
  749. stringBuilder.append(" | ");
  750. }
  751. stringBuilder.append(marriage);
  752. }
  753. }
  754. mTvBaseInfo.setText(stringBuilder.toString());
  755. name.setText(userBase.getNickName());
  756. // 内心独白
  757. String monologue = userBase.getMonologue();
  758. if (!TextUtils.isEmpty(monologue)) {
  759. mMonologue.setText(monologue);
  760. mLlMonologue.setVisibility(View.VISIBLE);
  761. } else {
  762. mLlMonologue.setVisibility(View.GONE);
  763. }
  764. // 国家
  765. String country = userBase.getCountry();
  766. if ("America".equals(country)) {
  767. country = "United States";
  768. }
  769. if (country.contains(" ")) {
  770. country = country.replaceAll(" ", "");
  771. }
  772. for (int i = 0; i < Cheeses.EN_GOUNTRY.length; i++) {
  773. if (country.equals(Cheeses.EN_GOUNTRY[i])) {
  774. country = Cheeses.EN_GOUNTRY[i];
  775. }
  776. }
  777. setTextInfo(mLlCountry, mTvCountry, mCountryDivider, country);
  778. // 地区
  779. setTextInfo(mLlArea, mTvArea, mAreaDivider, userBase.getArea().getProvinceName());
  780. // 星座
  781. setTextInfo(mLlSign, mTvSign, mSignDivider, ParamsUtils.getConstellationMap().get(String.valueOf(userBase.getSign())));
  782. // 学历
  783. // setTextInfo(mLlEducation, mTvEducation, mEducationDivider, ParamsUtils.getEducationMap().get(String.valueOf(userBase.getEducation())));
  784. // 收入
  785. setTextInfo(mLlIncome, mTvIncome, mIncomeDivider, ParamsUtils.getIncomeMap().get(String.valueOf(userBase.getIncome())));
  786. // 职业
  787. setTextInfo(mLlOccupation, mTvOccupation, mOccupationDivider, ParamsUtils.getWorkMap().get(String.valueOf(userBase.getOccupation())));
  788. }
  789. // 设置照片墙
  790. setUserPicWall(user.getListImage());
  791. // 设置用户详细信息
  792. setUserDetailInfo(user);
  793. }
  794. }
  795. }
  796. /**
  797. * 设置用户照片墙
  798. */
  799. private void setUserPicWall(List<Image> imageList) {
  800. if (!Util.isListEmpty(imageList) && mImageWallAdapter != null) {
  801. mImageWallAdapter.replaceAll(imageList);
  802. }
  803. }
  804. /**
  805. * 设置用户详细资料
  806. */
  807. private void setUserDetailInfo(User user) {
  808. // 是否想要小孩
  809. setTextInfo(mLlWantBaby, mTvWantBaby, mWantBabyDivider, ParamsUtils.getWantBabyMap().get(String.valueOf(user.getWantsKids())));
  810. // 喜欢的运动
  811. setTextInfo(mLlSport, mTvSport, mSportDivider, getValue(user.getSports(), ParamsUtils.getSportMap()));
  812. // 喜欢的宠物
  813. setTextInfo(mLlPets, mTvPets, mPetsDivider, getValue(user.getPets(), ParamsUtils.getPetsMap()));
  814. // 种族
  815. setTextInfo(mLlEthnicity, mTvEthnicity, mEthnicityDivider, ParamsUtils.getEthnicityMap().get(user.getEthnicity()));
  816. // 锻炼习惯
  817. setTextInfo(mLlExerciseHabits, mTvExerciseHabits, mExerciseHabitsDivider, ParamsUtils.getExerciseHabitsMap().get(String.valueOf(user.getExerciseHabits())));
  818. // 兴趣爱好
  819. setTextInfo(mLlHobby, mTvHobby, mHobbyDivider, getValue(user.getListHobby(), ParamsUtils.getInterestMap()));
  820. }
  821. private void setTextInfo(LinearLayout llContainer, TextView tvInfo, View dividerView, String text) {
  822. if (!TextUtils.isEmpty(text) && !"null".equals(text) && !"".equals(text)) {
  823. tvInfo.setText(text);
  824. llContainer.setVisibility(View.VISIBLE);
  825. dividerView.setVisibility(View.VISIBLE);
  826. } else {
  827. llContainer.setVisibility(View.GONE);
  828. dividerView.setVisibility(View.GONE);
  829. }
  830. }
  831. private String getValue(String key, Map<String, String> map) {
  832. if (key != null) {
  833. String[] spit = key.split("\\|");
  834. StringBuffer value = new StringBuffer();
  835. for (int i = 0; i < spit.length; i++) {
  836. if (i < spit.length - 1) {
  837. value.append(map.get(spit[i]) + ",");
  838. } else {
  839. value.append(map.get(spit[i]));
  840. }
  841. }
  842. return value.toString();
  843. }
  844. return null;
  845. }
  846. @Override
  847. public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  848. // TODO: inflate a fragment view
  849. View rootView = super.onCreateView(inflater, container, savedInstanceState);
  850. unbinder = ButterKnife.bind(this, rootView);
  851. return rootView;
  852. }
  853. private class ImageWallAdapter extends CommonRecyclerViewAdapter<Image> {
  854. public ImageWallAdapter(Context context, int layoutResId) {
  855. this(context, layoutResId, null);
  856. }
  857. public ImageWallAdapter(Context context, int layoutResId, List<Image> list) {
  858. super(context, layoutResId, list);
  859. }
  860. @Override
  861. protected void convert(final int position, RecyclerViewHolder viewHolder, Image bean) {
  862. final ImageView ivPic = (ImageView) viewHolder.getView(R.id.item_user_pic);
  863. ImageView ivLock = (ImageView) viewHolder.getView(R.id.iv_small_lock);
  864. ivLock.setVisibility(View.GONE);
  865. if (bean != null) {
  866. final String imgUrl = bean.getImageUrl();
  867. if (!TextUtils.isEmpty(imgUrl)) {
  868. // if(position==0){
  869. // if(isFirst){
  870. // isFirst=false;
  871. // File avatarFile = new File(IConfigConstant.LOCAL_AVATAR_PATH);
  872. // if (avatarFile != null && avatarFile.exists()) {
  873. //// ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), head_icon, avatarFile);
  874. // ImageLoaderUtil.getInstance().loadCircleImage(getActivity(), ivPic, avatarFile);
  875. // }else{
  876. // ivPic.setImageResource(IConfigConstant.COMMON_DEFAULT_AVATAR_CIRCLE);
  877. // }
  878. // }
  879. //
  880. // }else{
  881. showImage(ivPic, imgUrl);
  882. // }
  883. } else {
  884. ivPic.setImageResource(IConfigConstant.COMMON_DEFAULT_AVATAR_CIRCLE);
  885. // if(position!=0 && interceptLock){
  886. // returnBitmap(imgUrl, ivPic);
  887. // }
  888. Log.v("Tian==","url地址为空");
  889. }
  890. } else {
  891. ivPic.setImageResource(IConfigConstant.COMMON_DEFAULT_AVATAR_CIRCLE);
  892. Log.v("Tian==","bean地址为空");
  893. }
  894. }
  895. private void showImage(final ImageView ivPic, final String imgUrl) {
  896. ImageLoaderUtil.getInstance().loadImage(mContext, new ImageLoader.Builder()
  897. .url(imgUrl).placeHolder(IConfigConstant.COMMON_DEFAULT_AVATAR_CIRCLE).transform(new CircleTransformation()).imageView(ivPic).build(), new ImageLoaderUtil.OnImageLoadListener() {
  898. @Override
  899. public void onCompleted() {
  900. Log.v("Tian==","显示成功");
  901. }
  902. @Override
  903. public void onFailed() {
  904. Log.v("Tian==","显示失败");
  905. showImage(ivPic, imgUrl);
  906. }
  907. });
  908. }
  909. }
  910. private void loadUserDetailInfo(final boolean setAvatar) {
  911. OkHttpUtils.post()
  912. .url(IUrlConstant.URL_GET_USER_INFO)
  913. .addHeader("token", PlatformInfoXml.getToken())
  914. .addParams("platformInfo", PlatformInfoXml.getPlatformJsonString())
  915. .addParams("uid", TextUtils.isEmpty(uId) ? "" : uId)
  916. .addParams("isRecord", "0")
  917. .addParams("sourceTag", "1")
  918. .build()
  919. .execute(new Callback<UserDetail>() {
  920. @Override
  921. public UserDetail parseNetworkResponse(Response response, int id) throws Exception {
  922. String resultJson = response.body().string();
  923. if (!TextUtils.isEmpty(resultJson)) {
  924. return JSON.parseObject(resultJson, UserDetail.class);
  925. }
  926. return null;
  927. }
  928. @Override
  929. public void onError(Call call, Exception e, int id) {
  930. stopRefresh(3);
  931. }
  932. @Override
  933. public void onResponse(final UserDetail response, int id) {
  934. if (response != null) {
  935. String isSucceed = response.getIsSucceed();
  936. if (!TextUtils.isEmpty(isSucceed) && "1".equals(isSucceed)) {
  937. setUserInfo(response.getUserEnglish(),setAvatar);
  938. }
  939. }
  940. stopRefresh(1);
  941. }
  942. });
  943. }
  944. private void stopRefresh(int seconds) {
  945. new Handler().postDelayed(new Runnable() {
  946. @Override
  947. public void run() {
  948. dismissLoading();
  949. }
  950. }, seconds * 1000);
  951. }
  952. @Override
  953. protected void doRegister() {
  954. EventBus.getDefault().register(this);
  955. }
  956. @Override
  957. protected void unregister() {
  958. EventBus.getDefault().unregister(this);
  959. }
  960. @Subscribe
  961. public void onEvent(UpdatePayInfoEvent event) {
  962. buy_bean.setSelected(UserInfoXml.isBeanUser());
  963. buy_month.setSelected(UserInfoXml.isMonthly());
  964. /**去除读信拦截**/
  965. SharedPreferenceUtil.setBooleanValue(Utils.getContext(), "INTERCEPT_DIALOG", "DIALOG", false);
  966. }
  967. @Subscribe
  968. public void onEvent(SetAvatarEvent event) {
  969. File wallrFile = new File(IConfigConstant.LOCAL_wall_PATH);
  970. if (wallrFile != null && wallrFile.exists()) {
  971. ImageLoaderUtil.getInstance().loadLocalImage(getActivity(), mIvUserAvatar, wallrFile);
  972. } else {
  973. String imgUrl = UserInfoXml.getAvatarUrl();
  974. if (!TextUtils.isEmpty(imgUrl)) {
  975. ImageLoaderUtil.getInstance().loadImage(getActivity(), new ImageLoader.Builder()
  976. .url(imgUrl).imageView(mIvUserAvatar).build());
  977. }
  978. }
  979. new Handler().postDelayed(new Runnable() {
  980. @Override
  981. public void run() {
  982. File wallrFile = new File(IConfigConstant.LOCAL_wall_PATH);
  983. if (wallrFile != null && wallrFile.exists()) {
  984. ImageLoaderUtil.getInstance().loadLocalImage(getActivity(), mIvUserAvatar, wallrFile);
  985. } else {
  986. String imgUrl = UserInfoXml.getAvatarUrl();
  987. if (!TextUtils.isEmpty(imgUrl)) {
  988. ImageLoaderUtil.getInstance().loadImage(getActivity(), new ImageLoader.Builder()
  989. .url(imgUrl).imageView(mIvUserAvatar).build());
  990. }
  991. }
  992. }
  993. },2000);
  994. }
  995. @Subscribe
  996. public void onEvent(UpdateUserInfoEvent event) {
  997. CommonRequestUtil.loadUserInfo(new CommonRequestUtil.OnLoadUserInfoListener() {
  998. @Override
  999. public void onSuccess(User user) {
  1000. setMyInfo();
  1001. loadUserDetailInfo(false);
  1002. }
  1003. @Override
  1004. public void onFail() {
  1005. }
  1006. });
  1007. }
  1008. // 更新用户信息
  1009. public void updateUserInfo() {
  1010. CommonRequestUtil.loadUserInfo(new CommonRequestUtil.OnLoadUserInfoListener() {
  1011. @Override
  1012. public void onSuccess(User user) {
  1013. setMyInfo();
  1014. loadUserDetailInfo(false);
  1015. }
  1016. @Override
  1017. public void onFail() {
  1018. }
  1019. });
  1020. }
  1021. // 获取由注册引导产生的自我介绍
  1022. private void getSelfIntroduce() {
  1023. int answer_1 = SharedPreferenceUtil.getIntValue(getActivity(), "QUESTION", "answer_1", 0);
  1024. int answer_2 = SharedPreferenceUtil.getIntValue(getActivity(), "QUESTION", "answer_2", 0);
  1025. int answer_3 = SharedPreferenceUtil.getIntValue(getActivity(), "QUESTION", "answer_3", 0);
  1026. int answer_4 = SharedPreferenceUtil.getIntValue(getActivity(), "QUESTION", "answer_4", 0);
  1027. int answer_5 = SharedPreferenceUtil.getIntValue(getActivity(), "QUESTION", "answer_5", 0);
  1028. String answer1;
  1029. String answer2;
  1030. String answer3;
  1031. String answer4;
  1032. String answer5;
  1033. String answer6;
  1034. if (answer_1 == 0) {
  1035. answer1 = getString(R.string.result1_a);
  1036. } else if (answer_1 == 1) {
  1037. answer1 = getString(R.string.result1_b);
  1038. } else {
  1039. answer1 = getString(R.string.result1_c);
  1040. }
  1041. if (answer_2 == 0) {
  1042. answer2 = getString(R.string.result2_a);
  1043. } else if (answer_2 == 1) {
  1044. answer2 = getString(R.string.result2_b);
  1045. } else {
  1046. answer2 = "";
  1047. }
  1048. if (answer_3 == 0) {
  1049. answer3 = getString(R.string.result3_a);
  1050. } else if (answer_3 == 1) {
  1051. answer3 = getString(R.string.result3_b);
  1052. } else {
  1053. answer3 = "";
  1054. }
  1055. if (answer_4 == 0) {
  1056. answer4 = getString(R.string.result4_a);
  1057. } else if (answer_4 == 1) {
  1058. answer4 = getString(R.string.result4_b);
  1059. } else {
  1060. answer4 = getString(R.string.result4_c);
  1061. }
  1062. if (answer_5 == 0) {
  1063. answer5 = getSt

Large files files are truncated, but you can click here to view the full file