예제 #1
0
  @Override
  public void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
    String check = shared.getString("check_status", "0");
    if (check.equals("0")) {
      profile_check.setImageResource(R.drawable.profile_check);
    } else {
      profile_check.setImageResource(R.drawable.profile_checked);
    }
    if (isLogin()) {
      HttpUtils.refreshUserInfo(res_refresh);
      name.setVisibility(View.VISIBLE);
      security.setVisibility(View.VISIBLE);
      security_img.setVisibility(View.VISIBLE);
      welcome_word.setVisibility(View.VISIBLE);
      vip_icon.setVisibility(View.VISIBLE);
      login_or_regist.setVisibility(View.GONE);
      number_info.setVisibility(View.VISIBLE);

      String avatar_head = shared.getString("member_avatar", "");
      String url = LandousAppConst.avatar_url_head + avatar_head;
      ImageLoader.getInstance().displayImage(url, avatar_head_image);
      name.setText(shared.getString("member_name", ""));
      coin_num.setText("积分:" + shared.getString("member_points", "0"));
      pre_deposit.setText("预存款:¥" + shared.getString("available_predeposit", "0.00"));
    } else {
      String avatar_head = shared.getString("member_avatar", "");
      String url = LandousAppConst.avatar_url_head + avatar_head;
      ImageLoader.getInstance()
          .displayImage(url, avatar_head_image, LandousApplication.options_circle);
      name.setVisibility(View.GONE);
      security.setVisibility(View.GONE);
      security_img.setVisibility(View.GONE);
      welcome_word.setVisibility(View.GONE);
      vip_icon.setVisibility(View.GONE);
      login_or_regist.setVisibility(View.VISIBLE);
      number_info.setVisibility(View.GONE);
      coin_num.setText("积分:" + shared.getString("member_points", "0"));
      pre_deposit.setText("预存款:¥" + shared.getString("available_predeposit", "0.00"));
    }
    if (badge_new.isShown()) {
      badge_new.toggle();
    }
    if (badge_pay.isShown()) badge_pay.toggle();
    if (badge_send.isShown()) badge_send.toggle();
    if (badge_success.isShown()) badge_success.toggle();
  }
예제 #2
0
 // 将剪切后的图片保存到本地图片上!
 public void savaBitmap(Bitmap bitmap) {
   Date date = new Date(System.currentTimeMillis());
   SimpleDateFormat dateFormat = new SimpleDateFormat("'IMG'_yyyyMMddHHmmss");
   cutnameString = dateFormat.format(date);
   filename = Environment.getExternalStorageDirectory().getPath() + "/" + cutnameString + ".jpg";
   File f = new File(filename);
   FileOutputStream fOut = null;
   try {
     f.createNewFile();
     fOut = new FileOutputStream(f);
   } catch (Exception e) {
     e.printStackTrace();
   }
   bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fOut); // 把Bitmap对象解析成流
   try {
     fOut.flush();
     fOut.close();
   } catch (IOException e) {
     e.printStackTrace();
   }
   HttpUtils.update(res_update, filename);
 }
예제 #3
0
  @Override
  public void onClick(View v) {
    Intent intent;
    switch (v.getId()) {
      case R.id.profile_address_page:
        intent = new Intent(getActivity(), E2_AddressManageActivity.class);
        startActivity(intent);
        getActivity().overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);

        break;
      case R.id.profile_star_thing:
        //                intent = new Intent(getActivity(), CollectActivity.class);
        //                startActivity(intent);
        //                getActivity().overridePendingTransition(R.anim.push_right_in,
        //                        R.anim.push_right_out);
        break;
      case R.id.profile_coin_store:
        //                intent = new Intent(getActivity(), E5_CoinStoreActivity.class);
        //                startActivity(intent);
        //                getActivity().overridePendingTransition(R.anim.push_right_in,
        //                        R.anim.push_right_out);
        break;
      case R.id.profile_avatar_login_area:
        if (!isLogin()) {
          intent = new Intent(getActivity(), E6_SigninActivity.class);
          startActivityForResult(intent, REQUEST_SIGN_IN);
          getActivity().overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
        }
        break;
      case R.id.profile_head_nopayment:
        //                intent = new Intent(getActivity(), E1_NO_PaymentAvtivity.class);
        //                intent.putExtra("order_state", "10");
        //                startActivity(intent);
        //                getActivity().overridePendingTransition(R.anim.push_right_in,
        //                        R.anim.push_right_out);
        break;
      case R.id.profile_head_payment:
        //                intent = new Intent(getActivity(), E1_PaymentAvtivity.class);
        //                startActivity(intent);
        //                getActivity().overridePendingTransition(R.anim.push_right_in,
        //                        R.anim.push_right_out);
        break;
      case R.id.profile_head_ship:
        //                intent = new Intent(getActivity(), E1_ShipActivity.class);
        //                startActivity(intent);
        //                getActivity().overridePendingTransition(R.anim.push_right_in,
        //                        R.anim.push_right_out);
        break;
      case R.id.profile_head_receipt:
        //                intent = new Intent(getActivity(), E1_EceiptActivity.class);
        //                startActivity(intent);
        //                getActivity().overridePendingTransition(R.anim.push_right_in,
        //                        R.anim.push_right_out);
        break;
      case R.id.profile_head_address_manage:
        //                intent = new Intent(getActivity(), E1_Activity_getPointsLog.class);
        //                startActivity(intent);
        //                getActivity().overridePendingTransition(R.anim.push_right_in,
        //                        R.anim.push_right_out);
        break;
      case R.id.profile_check:
        if (isLogin()) {
          HttpUtils.addCheckPoints(res);
          loadingPDialog.show();
        } else {
          intent = new Intent(getActivity(), E6_SigninActivity.class);
          startActivityForResult(intent, REQUEST_SIGN_IN);
          getActivity().overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out);
        }
        break;
      case R.id.avatar_head_image:
        if (isLogin()) {
          if (android.os.Environment.getExternalStorageState()
              .equals(android.os.Environment.MEDIA_MOUNTED)) {
            ShowPickDialog();
          }

        } else {

        }
        break;
      default:
        break;
    }
  }