コード例 #1
0
 private void startRequest() {
   if (httpRequestHandle != null) {
     return;
   }
   if (!UserCenterModuleEngine.getInstance().checkUserIsLogin()) {
     return;
   }
   if (!srl_refresh.isRefreshing()) {
     srl_refresh.post(
         new Runnable() {
           @Override
           public void run() {
             srl_refresh.setRefreshing(true);
           }
         });
   }
   RequestParams requestParams = new RequestParams();
   requestParams.put(
       NetConfig.UserCenterModule_MyLevel.RequestKey.sessionId,
       UserCenterModuleEngine.getInstance().getSessionIdFromCache());
   httpRequestHandle =
       NetUtil.funHttpRequest(
           NetConfig.UserCenterModule_MyLevel.requestModel,
           baseActivity,
           null,
           NetConfig.UserCenterModule_MyLevel.ACTION,
           requestParams,
           new CusHttpResponseHandler());
 }
コード例 #2
0
 private void showData() {
   userCenter_userInfo = UserCenterModuleEngine.getInstance().getUserInfoFromCache();
   if (userCenter_userInfo == null) {
     userCenter_userInfo = new UserCenter_UserInfo();
   }
   if (userCenter_myLevel == null) {
     userCenter_myLevel = new UserCenter_MyLevel();
   }
   if (userCenter_myLevel.zuanshi == null) {
     userCenter_myLevel.zuanshi = new UserCenter_MyLevel.Info();
   }
   if (userCenter_myLevel.star1 == null) {
     userCenter_myLevel.star1 = new UserCenter_MyLevel.Info();
   }
   if (userCenter_myLevel.star2 == null) {
     userCenter_myLevel.star2 = new UserCenter_MyLevel.Info();
   }
   if (userCenter_myLevel.star3 == null) {
     userCenter_myLevel.star3 = new UserCenter_MyLevel.Info();
   }
   if (userCenter_myLevel.star4 == null) {
     userCenter_myLevel.star4 = new UserCenter_MyLevel.Info();
   }
   if (userCenter_myLevel.star5 == null) {
     userCenter_myLevel.star5 = new UserCenter_MyLevel.Info();
   }
   // 钻石
   if (NetConfig.UserCenterModule_MyInformation.ResponseValue.diamond_1.equals(
       userCenter_userInfo.diamond)) {
     iv_diamonds_icon.setImageResource(R.drawable.tvdog_user_center_fragment_level_diamond_0);
   } else {
     iv_diamonds_icon.setImageResource(R.drawable.tvdog_user_center_fragment_level_diamond);
   }
   tv_diamonds_description.setText(userCenter_myLevel.zuanshi.message);
   // 星级
   iv_item_icon_0.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_1_0);
   iv_item_icon_1.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_2_0);
   iv_item_icon_2.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_3_0);
   iv_item_icon_3.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_4_0);
   iv_item_icon_4.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_5_0);
   tv_item_description_0.setText(userCenter_myLevel.star1.message);
   tv_item_description_1.setText(userCenter_myLevel.star2.message);
   tv_item_description_2.setText(userCenter_myLevel.star3.message);
   tv_item_description_3.setText(userCenter_myLevel.star4.message);
   tv_item_description_4.setText(userCenter_myLevel.star5.message);
   do {
     iv_item_icon_0.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_1_1);
     if ("1".equals(userCenter_userInfo.level)) {
       break;
     }
     iv_item_icon_1.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_2_1);
     if ("2".equals(userCenter_userInfo.level)) {
       break;
     }
     iv_item_icon_2.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_3_1);
     if ("3".equals(userCenter_userInfo.level)) {
       break;
     }
     iv_item_icon_3.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_4_1);
     if ("4".equals(userCenter_userInfo.level)) {
       break;
     }
     iv_item_icon_4.setImageResource(R.drawable.tvdog_user_center_fragment_level_start_5_1);
     if ("5".equals(userCenter_userInfo.level)) {
       break;
     }
   } while (false);
 }