@Override public void onClick(View v) { switch (v.getId()) { case R.id.emptys: if (!"".equals(id)) { HttpRequest.getInstance().recipeDetailRequest(getSupportActivity(), mHandler, id); mLinearLayoutProgress.setVisibility(View.VISIBLE); mImageViewEmpty.setVisibility(View.GONE); } break; case R.id.frament_recipe_detail_item_userCover: if (mRecipeDetailInfo != null) { Intent intent = new Intent(getSupportActivity(), PersonalActivity.class); intent.putExtra("uid", mRecipeDetailInfo.getUId().trim()); intent.putExtra("name", mTextViewUserName.getText().toString()); if (MeishiApplication.getApplication().getUserInfo() != null && MeishiApplication.getApplication().getUserInfo().getSid() != null && MeishiApplication.getApplication() .getUserInfo() .getuId() .trim() .equals(mRecipeDetailInfo.getUId().trim())) { intent.putExtra("ismyself", true); } else { intent.putExtra("ismyself", false); } startActivity(intent); } break; } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.layout_loading_content, null); mLinearLayoutProgress = (LinearLayout) view.findViewById(R.id.progressContainer); mImageViewEmpty = (ImageView) view.findViewById(R.id.emptys); mViewStub = (ViewStub) view.findViewById(R.id.loader_content); mImageViewEmpty.setOnClickListener(this); Bundle bundle = getArguments(); if (bundle != null) { id = (bundle.getString("recipe_id")).trim(); recipeName = (bundle.getString("recipe_name")).trim(); HttpRequest.getInstance().recipeDetailRequest(getSupportActivity(), mHandler, id); mLinearLayoutProgress.setVisibility(View.VISIBLE); } else { mLinearLayoutProgress.setVisibility(View.GONE); mImageViewEmpty.setVisibility(View.VISIBLE); } return view; }