A 有一个爸爸,一个爷爷,
爸爸和爷爷都有
imgViewGroup1 ,imgViewGroup2 这连个共同属性
而在爸爸中,这两个属性的等级是protected,在爷爷中是public
那么当引用文件的方法,引用的地方到了爷爷的java文件中,
this.imgViewGroup1
this.imgViewGroup2
会出现优先级别访问,爷爷是public 会优先访问爷爷级别的方法
从下面这张变量图中,可以看出,对象引用的优先级别和对象存储策略
解决方法:
在爷爷类的java文件中先初始化下对象引用
文件引用说明:
爷爷:
package com.pggmall.origin.activity.correcting3.upload_img.base;
import java.util.ArrayList;
import java.util.List;
import org.androidannotations.annotations.ViewById;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.provider.MediaStore;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.AnimationUtils;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.pggmall.chatuidemo.R;
import com.pggmall.frame.utils.DeviceUtil;
import com.pggmall.frame.utils.TranslatingUtil;
import com.pggmall.origin.activity.correcting.base.C_BaseActivity;
import com.pggmall.origin.activity.correcting3.upload_img.activity.AlbumActivity_;
import com.pggmall.origin.activity.correcting3.upload_img.activity.GalleryActivity;
import com.pggmall.origin.activity.correcting3.upload_img.util.Bimp;
import com.pggmall.origin.activity.correcting3.upload_img.util.FileUtils;
import com.pggmall.origin.activity.correcting3.upload_img.util.ImageItem;
import com.pggmall.origin.activity.correcting3.upload_img.util.PublicWay;
import com.pggmall.origin.activity.correcting3.upload_img.util.Res;
import com.pggmall.origin.utils.LogUtils;
import com.pggmall.origin.utils.Utils;
import com.pggmall.origin.view.MyToast;
import com.pggmall.origin.view.upload_progress_image.ProcessImageView;
public class UpLoadActivity extends C_BaseActivity {
public Context context;
public LinearLayout imgViewGroup1;
public LinearLayout imgViewGroup2;
public LinearLayout leatherPr;
public LinearLayout metalPr;
public ImageView leatherIV;
public TextView leatherTV;
public ImageView metalIV;
public TextView metalTV;
public static Bitmap bimap ;
public static final int TAKE_PICTURE = 0x000001;
public View parentView;
public PopupWindow pop = null;
public LinearLayout ll_popup;
public List<FrameLayout> imgItemsViewGroups = new ArrayList<>();
public List<ProcessImageView> imgItems = new ArrayList<>();
public List<ImageView> delBts = new ArrayList<>();
//位置的布局
public FrameLayout.LayoutParams flPos;
//浏览图片
public boolean isScanImgs = false;
//在需求发布:1代表皮料,2代表五金
//在我要接单:1代表现货,2代表订货
public static int DEMAND_FLAG = 1;
public void initAllInject(){
Res.init(this);
bimap = BitmapFactory.decodeResource(
getResources(),
R.drawable.icon_addpic_unfocused);
PublicWay.activityList.add(this);
//初始化图片布局
init3PositionLinLyot();
}
//初始化子类的所有对象
public void initAllView(Context context,View... views){
this.context = context;
this.imgViewGroup1 = (LinearLayout) views[0];
this.imgViewGroup2 = (LinearLayout) views[1];
this.leatherPr = (LinearLayout) views[2];
this.metalPr = (LinearLayout) views[3];
this.leatherIV = (ImageView) views[4];
this.leatherTV = (TextView) views[5];
this.metalIV = (ImageView) views[6];
this.metalTV = (TextView) views[7];
this.parentView = views[8];
}
@SuppressWarnings("deprecation")
public void init3PositionLinLyot(){
int windowW = DeviceUtil.getScreenPixels(this).getWidth();
int marginLen = TranslatingUtil.Dp2Px(this, 11);
int avgWidth = (windowW - marginLen * 4 ) / 3;
flPos = new FrameLayout.LayoutParams(avgWidth,avgWidth);
flPos.setMargins(marginLen/2, marginLen/2, marginLen/2, marginLen/2);
}
/**
* @Title: initGridViewData
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param 设定文件
* @return void 返回类型
* @throws
*/
public void initData() {
ArrayList<ImageItem> menu_list = new ArrayList<>();
String paths[] = new String[Bimp.tempSelectBitmap.size()];
//移除现有views
imgViewGroup1.removeAllViews();
imgViewGroup2.removeAllViews();
for (int i = 0 ; i<6; i++) {
imgItems.get(i).setImageBitmap(null);
imgItems.get(i).setProgress(0);
imgItems.get(i).setOnClickListener(null);
delBts.get(i).setOnClickListener(null);
}
//去除堆栈中旧数据
for (int i = 0 ; i<Bimp.tempSelectBitmap.size();i++) {
paths[i] = Bimp.tempSelectBitmap.get(i).getImagePath();
}
checkImageSetOrDelete(paths);
//添加新views
for (int i = 0 ; i<Bimp.tempSelectBitmap.size();i++) {
menu_list.add(Bimp.tempSelectBitmap.get(i));
imgItems.get(i).setImageBitmap(menu_list.get(i).getBitmap());
imgItems.get(i).setOnClickListener(new ScanImgClickListener(i));
delBts.get(i).setOnClickListener(new DelImgClickListener(menu_list.get(i).getImagePath()));
//重新加载,有就跳过
processingImgBatch(menu_list.get(i).getImagePath(),String.valueOf(i),imgItems.get(i));
if (i < 3) imgViewGroup1.addView(imgItemsViewGroups.get(i));
else if (i > 2) imgViewGroup2.addView(imgItemsViewGroups.get(i));
}
//未满6个追加 上传按钮
if (imgViewGroup1.getChildCount() < 3) imgViewGroup1.addView(imgItemsViewGroups.get(6));
else if (imgViewGroup2.getChildCount() < 3 ) imgViewGroup2.addView(imgItemsViewGroups.get(6));
}
public void restart(){
if (isScanImgs) {
isScanImgs = false;
return;
}
initData();
}
class DelImgClickListener implements OnClickListener{
String imgPath;
public DelImgClickListener(String imgPath) {
super();
this.imgPath = imgPath;
}
@Override
public void onClick(View v) {
del(imgPath, Bimp.tempSelectBitmap);
Bimp.max--;
initData();
}
private void del(String imgPath,ArrayList<ImageItem> tempSelectBitmap) {
if (!isAllSuccess()) {
MyToast.show(context,"请再给我一些时间,全部上传完毕再操作!",Toast.LENGTH_SHORT);
return;
}
if (imgPath == null || tempSelectBitmap.isEmpty()) return;
for (int i = 0 ; i < tempSelectBitmap.size(); i++) {
if (tempSelectBitmap.get(i).getImagePath().equals(imgPath)) {
Bimp.tempSelectBitmap.remove(i);
}
}
}
}
public void leatherPr(){
if (DEMAND_FLAG == 1) {
//皮料失去焦点
getUnFoucus(leatherTV,leatherIV);
getFoucus(metalTV,metalIV);
DEMAND_FLAG = 2;
} else {
//皮料得到焦点
getFoucus(leatherTV,leatherIV);
getUnFoucus(metalTV,metalIV);
DEMAND_FLAG = 1;
}
}
public void metalPr(){
if (DEMAND_FLAG == 2) {
//五金失去焦点
getFoucus(leatherTV,leatherIV);
getUnFoucus(metalTV,metalIV);
DEMAND_FLAG = 1;
} else {
//五金得到焦点
getUnFoucus(leatherTV,leatherIV);
getFoucus(metalTV,metalIV);
DEMAND_FLAG = 2;
}
}
public void getFoucus(TextView tv , ImageView iv ){
//得到焦点
iv.setImageResource(R.drawable.icon_check);
tv.setTextColor(getResources().getColor(R.color.common_style_color));
}
public void getUnFoucus(TextView tv , ImageView iv){
//失去焦点
iv.setImageResource(R.drawable.icon_uncheck);
tv.setTextColor(getResources().getColor(R.color.title_text_desc_color));
}
//单位选择适配器
class MyUnitGridAdapter extends BaseAdapter {
String[] units;
public MyUnitGridAdapter(String[] units) {
super();
this.units = units;
}
@Override
public int getCount() {
return units.length;
}
/**
* 获取当前数据
*/
@Override
public Object getItem(int position) {
return units[position];
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LinearLayout llPr = null;
llPr = (LinearLayout) getLayoutInflater().inflate(R.layout.correcting3_pggmall_publish_demand_unit_item, null);
TextView tv = (TextView) llPr.findViewById(R.id.leather);
tv.setText(units[position]);
return llPr;
}
}
public Handler handlerRefreshImg = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
if (msg.what == 44) {
cancleTask(msg.obj.toString());
}
return false;
}
});
/**拍照**/
public void photo() {
/*Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(openCameraIntent, TAKE_PICTURE);*/
// 执行拍照前,应该先判断SD卡是否存在
String SDState = Environment.getExternalStorageState();
if (SDState.equals(Environment.MEDIA_MOUNTED)) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);// "android.media.action.IMAGE_CAPTURE"
/***
* 需要说明一下,以下操作使用照相机拍照,拍照后的图片会存放在相册中的 这里使用的这种方式有一个好处就是获取的图片是拍照后的原图
* 如果不实用ContentValues存放照片路径的话,拍照后获取的图片为缩略图不清晰
*/
ContentValues values = new ContentValues();
photoUri = this.getContentResolver().insert(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, photoUri);
startActivityForResult(intent, TAKE_PICTURE);
} else {
MyToast.show(getApplicationContext(), "内存卡不存在",
Toast.LENGTH_SHORT);
}
}
public void init() {
isScanImgs = false;
pop = new PopupWindow(this);
View view = getLayoutInflater().inflate(R.layout.item_popupwindows, null);
ll_popup = (LinearLayout) view.findViewById(R.id.ll_popup);
pop.setWidth(LayoutParams.MATCH_PARENT);
pop.setHeight(LayoutParams.WRAP_CONTENT);
pop.setBackgroundDrawable(new BitmapDrawable());
pop.setFocusable(true);
pop.setOutsideTouchable(true);
pop.setContentView(view);
RelativeLayout parent = (RelativeLayout) view.findViewById(R.id.parent);
Button bt1 = (Button) view
.findViewById(R.id.item_popupwindows_camera);
Button bt2 = (Button) view
.findViewById(R.id.item_popupwindows_Photo);
Button bt3 = (Button) view
.findViewById(R.id.item_popupwindows_cancel);
parent.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
pop.dismiss();
ll_popup.clearAnimation();
}
});
bt1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
photo();
pop.dismiss();
ll_popup.clearAnimation();
}
});
bt2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(context,AlbumActivity_.class);
startActivity(intent);
overridePendingTransition(R.anim.activity_translate_in, R.anim.activity_translate_out);
pop.dismiss();
ll_popup.clearAnimation();
}
});
bt3.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
pop.dismiss();
ll_popup.clearAnimation();
}
});
}
class SelectPhotoClickListener implements OnClickListener{
int position;
public SelectPhotoClickListener(int position) {
super();
this.position = position;
}
@Override
public void onClick(View v) {
Utils.closeInputMethodWindows((Activity) context);
ll_popup.startAnimation(AnimationUtils.loadAnimation(context,R.anim.activity_translate_in));
pop.showAtLocation(parentView, Gravity.BOTTOM, 0, 0);
}
}
//浏览图片
class ScanImgClickListener implements OnClickListener{
int position;
public ScanImgClickListener(int position) {
super();
this.position = position;
}
@Override
public void onClick(View v) {
isScanImgs = true;
Intent intent = new Intent(context, GalleryActivity.class);
intent.putExtra("position", "1");
intent.putExtra("ID", position);
startActivityForResult(intent, GalleryActivity.REQUEST_CODE);
}
}
public void initUploadImgs() {
for (int i=0 ; i<7; i++) {
FrameLayout viewGroup = (FrameLayout) LayoutInflater.from(this).inflate(R.layout.item_published_grida, null);
ProcessImageView pImgView = (ProcessImageView) viewGroup.findViewById(R.id.item_grida_image);
if (flPos == null) init3PositionLinLyot();
pImgView.setLayoutParams(flPos);
pImgView.setPadding(0, 0, 0, 0);
ImageView delBt = (ImageView) viewGroup.findViewById(R.id.delBt);
imgItemsViewGroups.add(viewGroup);
imgItems.add(pImgView);
delBts.add(delBt);
if (i == 6) {
imgItems.get(i).setImageBitmap(BitmapFactory.decodeResource(
getResources(), R.drawable.icon_addpic_unfocused));
imgItems.get(i).setProgress(100);
imgItems.get(i).setOnClickListener(new SelectPhotoClickListener(i));
delBts.get(i).setVisibility(View.GONE);
imgViewGroup1.addView(imgItemsViewGroups.get(i));
}
}
}
@Override
public void onRestart() {
super.onRestart();
restart();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case TAKE_PICTURE:
if (Bimp.tempSelectBitmap.size() < 9 && resultCode == RESULT_OK) {
//这样仅能获取到缩略图
/*String fileName = String.valueOf(System.currentTimeMillis());
Bitmap bm = (Bitmap) data.getExtras().get("data");
String imgPath = FileUtils.saveBitmap(bm, fileName);
ImageItem takePhoto = new ImageItem();
takePhoto.setBitmap(bm);
takePhoto.setImagePath(imgPath);
Bimp.tempSelectBitmap.add(takePhoto);
initData();*/
/* 拍照获取图片 进行处理 * */
String[] pojo = {MediaStore.Images.Media.DATA};
Cursor cursor = managedQuery(photoUri, pojo, null, null, null);
if (cursor != null) {
int columnIndex = cursor.getColumnIndexOrThrow(pojo[0]);
cursor.moveToFirst();
picPath = cursor.getString(columnIndex);
//cursor.close();
}
if (picPath != null
&& (picPath.toLowerCase().endsWith(".png") || picPath.toLowerCase().endsWith(".png")
|| picPath.toLowerCase().endsWith(".jpg") || picPath.toLowerCase().endsWith(".jpg"))) {
try {
Bitmap bitmap = getAllBitmapFromImgPath(picPath);
if (bitmap == null) return;
String fileName = String.valueOf(System.currentTimeMillis());
String imgPath = FileUtils.saveBitmap(bitmap, fileName);
ImageItem takePhoto = new ImageItem();
takePhoto.setBitmap(bitmap);
takePhoto.setImagePath(imgPath);
Bimp.tempSelectBitmap.add(takePhoto);
initData();
}catch (Exception e){
LogUtils.e("[Android]", e.getMessage());
LogUtils.e("[Android]", "目录为:" + photoUri);
}
} else {
MyToast.show(getApplicationContext(), "选择图片文件不正确",
Toast.LENGTH_SHORT);
}
}
break;
case GalleryActivity.REQUEST_CODE :
restart();
break;
}
}
}
父类:
package com.pggmall.origin.activity.correcting3;
import java.util.Iterator;
import java.util.Map.Entry;
import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.pggmall.chatuidemo.R;
import com.pggmall.frame.httpUtils.HttpManage;
import com.pggmall.frame.utils.StringUtil;
import com.pggmall.origin.activity.correcting3.upload_img.base.UpLoadActivity;
import com.pggmall.origin.utils.Properties;
import com.pggmall.origin.view.MyToast;
/**
*
* @ClassName: C_PublishPurchaseInquiryActivity
* @Description:发布采购需求
* @author William
* @date 2016年2月17日 下午4:04:55
*
*/
@EActivity
public class C3_WantPickUpListActivity extends UpLoadActivity {
String fdDemaId;
@ViewById
LinearLayout imgViewGroup1;
@ViewById
LinearLayout imgViewGroup2;
@ViewById
LinearLayout leatherPr;
@ViewById
LinearLayout metalPr;
@ViewById
ImageView leatherIV;
@ViewById
TextView leatherTV;
@ViewById
ImageView metalIV;
@ViewById
TextView metalTV;
@ViewById
EditText purchaseDesc;
@ViewById
Button submit;
@ViewById
TextView coName;
@ViewById
TextView phoneNum;
@AfterInject
public void initAllInject() {
super.initAllInject();
}
@AfterViews
void initAll() {
parentView = getLayoutInflater().inflate(R.layout.correcting3_want_pick_up_list,null);
//必须在这个方法在调用其他方法的 最前面初始化
initAllView(this,imgViewGroup1,imgViewGroup2,leatherPr,metalPr,leatherIV,leatherTV,metalIV,metalTV,parentView);
fdDemaId = getIntent().getExtras().getString("fdDemaId");
init();
initUploadImgs();
// 初始化当前我要接单商户信息
initCurrentLoginInfo();
}
void initCurrentLoginInfo() {
String o2OSetSession = getSharedPreferences(Properties.LOGIN_INFO, 0)
.getString("o2OSetSession", null);
if (StringUtil.isEmpty(o2OSetSession))
return;
String uType = this.getSharedPreferences(Properties.LOGIN_INFO, 0)
.getString(Properties.LoginInfo.USER_TYPE, null);
if (uType != null && uType.equalsIgnoreCase("Supplier")) {
try {
JSONObject sessionObj = new JSONObject(o2OSetSession);
String CoName = sessionObj.getJSONObject("huanxin").getString(
"CoName");
String fdShopPhone = sessionObj.getJSONObject("detail")
.getString("fdShopPhone");
coName.setText(CoName);
phoneNum.setText(fdShopPhone);
} catch (JSONException e) {
}
}
}
@Click
public void leatherPr() {
super.leatherPr();
}
@Click
public void metalPr() {
super.metalPr();
}
@Click
void submit() {
if (StringUtil.isEmpty(purchaseDesc.getText().toString())) {
MyToast.show(this, "请输入采购需求描述!", Toast.LENGTH_SHORT);
return;
}
if (hasStarMapTask == null || !isAllSuccess()) {
MyToast.show(context, "请再给我一些时间,全部上传完毕再操作!", Toast.LENGTH_SHORT);
return;
}
new SubmitDataAsyncTask().execute(fdDemaId);
}
private class SubmitDataAsyncTask extends AsyncTask<String, Void, String> {
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
if (context == null)
return;
/*
* { "error": { "err_msg": "操作成功!", "err_code": 1, "request_args":
* "fdInquProduct=112,userUUID=af40ea21-3af9-4abe-a31c-fbab2baf6073,fdInquSKU=深棕色:3,金色:1,银色:4,可定制:2,fdInquContent=来看看,fdInquPhone=15521392526"
* } }
*/
if (result != null) {
try {
JSONObject err = new JSONObject(
new JSONObject(result).getString("error"));
int errCode = err.getInt("err_code");
if (errCode == 1 || errCode == 0) {
MyToast.show(getApplicationContext(), "发布成功!",
Toast.LENGTH_SHORT);
// submit.setClickable(true);
finish();
} else {
MyToast.show(context, err.getString("err_msg"),
Toast.LENGTH_SHORT);
}
} catch (Exception e) {
MyToast.show(context, "服务器繁忙,请稍后再试!", Toast.LENGTH_SHORT);
}
} else {
MyToast.show(context, "服务器繁忙,请稍后再试!", Toast.LENGTH_SHORT);
}
}
@Override
protected String doInBackground(String... params) {
String isRet = null;
// fdDemaRemark=哦&method=Demand.Save&userUUID=0a6df78f-7717-40f2-856e-e26a7259d034&
// Images=/plugin/upload/web/store/demand/635913876290884735.png&fdDemaTitle=哦
String uri = Properties.SERVER_URL + "/api.ashx";
StringBuilder uriParams = new StringBuilder();
uriParams.append("fdDereContent=" + purchaseDesc.getText());
String userUUID = getSharedPreferences(Properties.LOGIN_INFO, 0)
.getString(Properties.LoginInfo.USERUUID, "");
uriParams.append("&method=Demand.Reply");
uriParams.append("&fdDereDemand=" + params[0]);
uriParams.append("&userUUID=" + userUUID);
uriParams.append("&Images=");
if (saveImgPathMap != null) {
Iterator<Entry<String, String>> it = saveImgPathMap.entrySet()
.iterator();
while (it.hasNext()) {
Entry<String, String> entry = it.next();
uriParams.append(entry.getValue() + ",");
}
}
if (uriParams.lastIndexOf(",") != -1)
uriParams = new StringBuilder(uriParams.subSequence(0,
uriParams.lastIndexOf(",")));
// 现货,订货状态
uriParams.append("&fdDereStatus=" + DEMAND_FLAG);
try {
isRet = HttpManage.httpPost(context, uri, uriParams.toString(),
null);
Log.e("-上传图片-", "路径 :" + uri + uriParams.toString());
isRet = js.reLogin(null, uri, "post", uriParams.toString(),
new JSONObject(isRet));
} catch (Exception e) {
}
return isRet;
}
}
}
子类(本类) :
//
// DO NOT EDIT THIS FILE, IT HAS BEEN GENERATED USING AndroidAnnotations 3.0.1.
//
package com.pggmall.origin.activity.correcting3;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.pggmall.chatuidemo.R.id;
import org.androidannotations.api.SdkVersionHelper;
import org.androidannotations.api.view.HasViews;
import org.androidannotations.api.view.OnViewChangedListener;
import org.androidannotations.api.view.OnViewChangedNotifier;
public final class C3_WantPickUpListActivity_
extends C3_WantPickUpListActivity
implements HasViews, OnViewChangedListener
{
private final OnViewChangedNotifier onViewChangedNotifier_ = new OnViewChangedNotifier();
@Override
public void onCreate(Bundle savedInstanceState) {
OnViewChangedNotifier previousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_);
init_(savedInstanceState);
super.onCreate(savedInstanceState);
OnViewChangedNotifier.replaceNotifier(previousNotifier);
}
private void init_(Bundle savedInstanceState) {
OnViewChangedNotifier.registerOnViewChangedListener(this);
initAllInject();
}
@Override
public void setContentView(int layoutResID) {
super.setContentView(layoutResID);
onViewChangedNotifier_.notifyViewChanged(this);
}
@Override
public void setContentView(View view, LayoutParams params) {
super.setContentView(view, params);
onViewChangedNotifier_.notifyViewChanged(this);
}
@Override
public void setContentView(View view) {
super.setContentView(view);
onViewChangedNotifier_.notifyViewChanged(this);
}
public static C3_WantPickUpListActivity_.IntentBuilder_ intent(Context context) {
return new C3_WantPickUpListActivity_.IntentBuilder_(context);
}
public static C3_WantPickUpListActivity_.IntentBuilder_ intent(Fragment supportFragment) {
return new C3_WantPickUpListActivity_.IntentBuilder_(supportFragment);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (((SdkVersionHelper.getSdkInt()< 5)&&(keyCode == KeyEvent.KEYCODE_BACK))&&(event.getRepeatCount() == 0)) {
onBackPressed();
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onViewChanged(HasViews hasViews) {
imgViewGroup2 = ((LinearLayout) hasViews.findViewById(id.imgViewGroup2));
metalPr = ((LinearLayout) hasViews.findViewById(id.metalPr));
imgViewGroup1 = ((LinearLayout) hasViews.findViewById(id.imgViewGroup1));
submit = ((Button) hasViews.findViewById(id.submit));
phoneNum = ((TextView) hasViews.findViewById(id.phoneNum));
metalIV = ((ImageView) hasViews.findViewById(id.metalIV));
purchaseDesc = ((EditText) hasViews.findViewById(id.purchaseDesc));
leatherPr = ((LinearLayout) hasViews.findViewById(id.leatherPr));
metalTV = ((TextView) hasViews.findViewById(id.metalTV));
leatherTV = ((TextView) hasViews.findViewById(id.leatherTV));
leatherIV = ((ImageView) hasViews.findViewById(id.leatherIV));
coName = ((TextView) hasViews.findViewById(id.coName));
{
View view = hasViews.findViewById(id.leatherPr);
if (view!= null) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
C3_WantPickUpListActivity_.this.leatherPr();
}
}
);
}
}
{
View view = hasViews.findViewById(id.metalPr);
if (view!= null) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
C3_WantPickUpListActivity_.this.metalPr();
}
}
);
}
}
{
View view = hasViews.findViewById(id.submit);
if (view!= null) {
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
C3_WantPickUpListActivity_.this.submit();
}
}
);
}
}
initAll();
}
public static class IntentBuilder_ {
private Context context_;
private final Intent intent_;
private Fragment fragmentSupport_;
public IntentBuilder_(Context context) {
context_ = context;
intent_ = new Intent(context, C3_WantPickUpListActivity_.class);
}
public IntentBuilder_(Fragment fragment) {
fragmentSupport_ = fragment;
context_ = fragment.getActivity();
intent_ = new Intent(context_, C3_WantPickUpListActivity_.class);
}
public Intent get() {
return intent_;
}
public C3_WantPickUpListActivity_.IntentBuilder_ flags(int flags) {
intent_.setFlags(flags);
return this;
}
public void start() {
context_.startActivity(intent_);
}
public void startForResult(int requestCode) {
if (fragmentSupport_!= null) {
fragmentSupport_.startActivityForResult(intent_, requestCode);
} else {
if (context_ instanceof Activity) {
((Activity) context_).startActivityForResult(intent_, requestCode);
} else {
context_.startActivity(intent_);
}
}
}
}
}