@Override public void setOnViewClickListener() { super.setOnViewClickListener(); box1View.setOnClickListener(this); box2View.setOnClickListener(this); box3View.setOnClickListener(this); box4View.setOnClickListener(this); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View ui = inflater.inflate(R.layout.fragment_profile, container, false); // get UI views points = (TextView) ui.findViewById(R.id.rank_card_points); userName = (TextView) ui.findViewById(R.id.profile_card_name); profilePicture = (ImageView) ui.findViewById(R.id.profile_card_picture); contentPicture = (ImageView) ui.findViewById(R.id.content_card_picture); profileCard = (CardView) ui.findViewById(R.id.profile_card); contentCard = (CardView) ui.findViewById(R.id.content_card); profileCard.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { /*Code from: http://bit.ly/1UmSnOi*/ startActivityForResult( new Intent( Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), Constants.SELECT_IMAGE); } }); contentCard.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getContext(), ContentDisplay.class); i.putExtra(Constants.PUT_EXTRA_UID, MainActivity.getUser().getUid()); ArrayList<Course> courses = MainActivity.getCourses(); String[] courseIDs = new String[courses.size()]; for (int p = 0; p < courses.size(); ++p) { courseIDs[p] = Integer.toString(courses.get(p).getId()); } i.putExtra(Constants.PUT_EXTRA_COURSE_IDS, courseIDs); startActivity(i); } }); level = (TextView) ui.findViewById(R.id.rank_card_level); updateUI(); return ui; }
@Override public void setData(RecommendContent data) { super.setData(data); recommendContent = data; simpleDraweeView1.setImageURI(Uri.parse(recommendContent.getImgUrl1())); simpleDraweeView2.setImageURI(Uri.parse(recommendContent.getImgUrl2())); title1.setText(recommendContent.getTitle1()); title2.setText(recommendContent.getTitle2()); content1.setText(recommendContent.getContent1()); content2.setText(recommendContent.getContent2()); cardView1.setOnClickListener(this); cardView2.setOnClickListener(this); }
public ExtraGroupInfoListHolder(View itemView) { super(itemView); g_name_joined = (TextView) itemView.findViewById(R.id.tv_group_joined_name); cv_group_attributes = (CardView) itemView.findViewById(R.id.group_attributes_card); cv_group_attributes.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (getPosition() == 1) { Intent intent_temp = new Intent(v.getContext(), AboutGroupActivity.class); v.getContext().startActivity(intent_temp); } else if (getPosition() == 2) { Intent intent_temp = new Intent(v.getContext(), GroupMembersByGroupActivity.class); v.getContext().startActivity(intent_temp); } else if (getPosition() == 3) { Intent intent_temp = new Intent(v.getContext(), UpcomingEventsActivity.class); v.getContext().startActivity(intent_temp); } else if (getPosition() == 4) { Intent intent_temp = new Intent(v.getContext(), NewsPostsByGroupActivity.class); v.getContext().startActivity(intent_temp); } else if (getPosition() == 5) { Intent intent_temp = new Intent(v.getContext(), PreviousEventsActivity.class); v.getContext().startActivity(intent_temp); } else { } } }); }
public ViewHolder(View view) { super(view); mTextViewDietplanName = (TextView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_dietplanname); mTextViewDescription = (TextView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_description); mTextViewAmountDays = (TextView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_amountdays); mTextViewAmountMeals = (TextView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_amountmeals); mTextViewEnergyKcal = (TextView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_energykcal); mImageViewPinAsCurrent = (ImageView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview_imagebutton_pinascurrent); mImageViewPinAsCurrent.setOnClickListener(this); mImageViewSettings = (ImageView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview_imageview_settings); mImageViewSettings.setOnClickListener(this); mCardView = (CardView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview); mCardView.setOnClickListener(this); context = view.getContext(); }
private void setListeners(final String recipeId) { fab.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (isFavorite) { favRecipesIds.remove(recipeId); fab.setImageDrawable(getResources().getDrawable(R.drawable.ic_favorite_outline)); isFavorite = false; } else { fab.setImageDrawable(getResources().getDrawable(R.drawable.ic_like)); favRecipesIds.add(recipeId); isFavorite = true; } SharedPreferences.Editor editor = settings.edit(); editor.putStringSet(FAVORITE_RECIPE_KEY, favRecipesIds); editor.commit(); Log.d(TAG, "favRecipesIds: " + favRecipesIds.toString()); } }); btnClearIngredients.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { ingredientsAdapter.uncheckAllChildrenCascade(lvIngredients); } }); btnAddIngredients.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Set<String> shoppingList = settings.getStringSet(SHOPPING_LIST_KEY, new HashSet<String>()); shoppingList.addAll(ingredientsAdapter.getAllChecked()); Log.d(TAG, "getAllChecked: " + ingredientsAdapter.getAllChecked()); SharedPreferences.Editor editor = settings.edit(); editor.putStringSet(SHOPPING_LIST_KEY, shoppingList); editor.commit(); Log.d(TAG, "shoppingList: " + shoppingList.toString()); Snackbar.make( findViewById(R.id.main_content), ingredientsAdapter.getAllChecked().size() + " items added to shopping list.", Snackbar.LENGTH_LONG) .show(); } }); cvDirections.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlRecipeDirections)); startActivity(intent); } }); }
SponsorViewHolder(View itemView) { super(itemView); cv = (CardView) itemView.findViewById(R.id.card_view_sponsor); name = (TextView) itemView.findViewById(R.id.sponsorDescription); icon = (ImageView) itemView.findViewById(R.id.sponsorImage); cv.setOnClickListener(this); }
public void bind(@NonNull final Movie movie) { mFavoriteButton.setSelected(movie.isFavorited()); mMovieItemTitle.setText(movie.getTitle()); mMovieItemContainer.setOnClickListener( v -> BusProvider.getInstance().post(new OnMovieClickedEvent(movie, itemView))); mFavoriteButton.setOnClickListener( v -> { BusProvider.getInstance() .post(new FavoriteClickedEvent(movie, MovieViewHolder.this.getAdapterPosition())); mFavoriteButton.setSelected(movie.isFavorited()); }); // stop that blinking ish if (mMovieId != movie.getId()) { resetColors(); mMovieId = movie.getId(); } Glide.with(itemView.getContext()) .load("http://image.tmdb.org/t/p/w185/" + movie.getPosterPath()) .crossFade() .placeholder(R.color.movie_poster_placeholder) .listener( GlidePalette.with(movie.getPosterPath()) .intoCallBack(palette -> applyColors(palette.getVibrantSwatch()))) .into(mMovieItemImage); }
public ViewHolder(View v) { super(v); name = (TextView) v.findViewById(R.id.name); placeimage = (ImageView) v.findViewById(R.id.placeimage); cv = (CardView) v.findViewById(R.id.card_view); cv.setOnClickListener(this); name.setOnClickListener(this); }
@Override public void initView() { imgCard = (CardView) findViewById(R.id.img_card); imgPic = (ImageView) findViewById(R.id.img_pic); tvUpage = (TextView) findViewById(R.id.tv_update); imgUpage = (ImageView) findViewById(R.id.img_update); update = (TextView) findViewById(R.id.creategroup); update.setOnClickListener(updateCardListener); imgCard.setOnClickListener(updateImageListener); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_input_height_weight); android.support.v7.app.ActionBar bar = getSupportActionBar(); bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00463f"))); // Input Height CardView heightb = (CardView) findViewById(R.id.hw1); heightb.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { heightf(); } }); // Input Weight CardView weightb = (CardView) findViewById(R.id.hw2); weightb.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { weightf(); } }); Button submit = (Button) findViewById(R.id.hw_submit); submit.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { sendData(); Intent i = new Intent(InputHeightWeight.this, DashboardActivity.class); startActivity(i); } }); }
@Nullable @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_tool_bottles, container, false); edVolumeTotal = (EditText) view.findViewById(R.id.ed_volume_total); edVolumeRecipiente = (EditText) view.findViewById(R.id.ed_volume_recipiente); txtQtd = (TextView) view.findViewById(R.id.txt_qtd_bottles); cvCalculate = (CardView) view.findViewById(R.id.card_calculate); cvCalculate.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (TextUtils.isEmpty(edVolumeTotal.getText().toString())) { Toast.makeText(getContext(), "Informe o volume total", Toast.LENGTH_SHORT).show(); return; } if (TextUtils.isEmpty(edVolumeRecipiente.getText().toString())) { Toast.makeText(getContext(), "Informe o volume do recipiente", Toast.LENGTH_SHORT) .show(); return; } try { double total = Double.parseDouble(edVolumeTotal.getText().toString()); double recipiente = Double.parseDouble(edVolumeRecipiente.getText().toString()); double qtd = total / recipiente; DecimalFormat numberFormat = new DecimalFormat("#.00"); txtQtd.setText(numberFormat.format(qtd)); } catch (Exception e) { Toast.makeText( getContext(), "Houve um erro no cálculo. Verifique os campos preenchidos e tente novamente", Toast.LENGTH_SHORT) .show(); } } }); return view; }
AllEventsViewHolder(final Activity callingActivity, View itemView) { super(itemView); Log.i(TAG, " constructor called "); this.callingActivity = callingActivity; cv = (CardView) itemView.findViewById(R.id.cv); eventImage = (ImageView) itemView.findViewById(R.id.eventImage); eventImageProgressBar = (ProgressBar) itemView.findViewById(R.id.eventImageProgressBar); eventTitle = (TextView) itemView.findViewById(R.id.eventTitle); eventSmallDec = (TextView) itemView.findViewById(R.id.eventSmallDesc); eventVenue = (TextView) itemView.findViewById(R.id.eventVenue); eventTime = (TextView) itemView.findViewById(R.id.eventETA); cv.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Log.i(TAG, "CV Clicked !!"); Pair<View, String> pair = new Pair<View, String>(eventImage, "eventImageTransition"); if (Build.VERSION.SDK_INT > 21) { ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation( callingActivity, v, "eventImageTransition"); Intent intent = new Intent(callingActivity, EventDetails.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); EventDetails.event = event; callingActivity.startActivity(intent, optionsCompat.toBundle()); } else { Intent intent = new Intent(callingActivity, EventDetails.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); EventDetails.event = event; callingActivity.startActivity(intent); } // Intent intent = new // Intent(cv.getContext().getApplicationContext(),EventDetails.class); // intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // EventDetails.event = event; // // cv.getContext().getApplicationContext().startActivity(intent); } }); Log.i(TAG, " constructor ended "); }
/** * 创建图片回忆的ViewHolder. * * @param view each_picture_view */ public PictureViewHolder(CardView view) { super(view); view.setOnClickListener(new PictureClickListener()); placeTv = (TextView) view.findViewById(R.id.titleTVArticleView); timeTv = (TextView) view.findViewById(R.id.timeTVArticleView); imageView = (ImageView) view.findViewById(R.id.imageView); nine = new ImageView[9]; nine[0] = (ImageView) view.findViewById(R.id.small_1); nine[1] = (ImageView) view.findViewById(R.id.small_2); nine[2] = (ImageView) view.findViewById(R.id.small_3); nine[3] = (ImageView) view.findViewById(R.id.small_4); nine[4] = (ImageView) view.findViewById(R.id.small_5); nine[5] = (ImageView) view.findViewById(R.id.small_6); nine[6] = (ImageView) view.findViewById(R.id.small_7); nine[7] = (ImageView) view.findViewById(R.id.small_8); nine[8] = (ImageView) view.findViewById(R.id.small_9); }
@Override public View getItemView(final Stamp stamp, View v, ViewGroup parent) { if (v == null) { v = View.inflate(getContext(), R.layout.image, null); } super.getItemView(stamp, v, parent); ParseImageView stampImage = (ParseImageView) v.findViewById(R.id.image_view); ParseFile photoFile = stamp.getPhotoFile(); if (photoFile != null) { stampImage.setParseFile(photoFile); stampImage.loadInBackground( new GetDataCallback() { @Override public void done(byte[] data, ParseException e) { // nothing to do } }); } CardView card = (CardView) v.findViewById(R.id.image_card); card.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(cont, PgStampInfoActivity.class); /* event.getObjectId(); stamp.getObjectId(); String stampId = item.getID(); ArrayList<String> stampIdList = getStampObjectIdArrayList(); int pos = stampIdList.indexOf(stampId); intent.putExtra("clicked_stamp_pos", pos); intent.putExtra("stamp_id_list", stampIdList);*/ cont.startActivity(intent); } }); return v; }
public GroupsJoinedListHolder(View itemView) { super(itemView); card_g_joined = (CardView) itemView.findViewById(R.id.cv_groups_joined); card_g_joined.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent_temp = new Intent(v.getContext(), GroupPageActivity.class); posi = getPosition() - 1; Bundle bundle = new Bundle(); bundle.putSerializable("BEAN", GroupsJoinedList.get(posi)); // bundle.putString("G_ID", (String) // ViewProfilePageAdapterActivity.this.GroupsJoinedList.get(posi)); intent_temp.putExtras(bundle); v.getContext().startActivity(intent_temp); } }); }
@Override public void bind(Element element) { image.setImageDrawable(null); String imageURL = parseImageURL(element); Picasso.with(itemView.getContext()) .load(imageURL) .into( image, new Callback() { @Override public void onSuccess() { setRatio(image); } @Override public void onError() { /*ignored*/ } }); String title = parseTitle(element); primaryText.setText(title); image.setContentDescription(title); subtext.setText(parseAuthor(element)); final String articleLink = parseArticleLink(element); cardView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO: 9-7-2015 Check if href is not a re/code web page if (articleLink != null) { ArticleActivity.openArticle(itemView.getContext(), articleLink); } } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_morphing); mCardView = (CardView) findViewById(R.id.card); mOrigSize = getResources().getDimensionPixelSize(R.dimen.morphing_original_size); mOrigRadius = getResources().getDimensionPixelSize(R.dimen.morphing_original_radius); mTargetSize1 = mOrigSize * 2; mTargetSize2 = mOrigSize * 4; mTargetRadius1 = getResources().getDimensionPixelSize(R.dimen.morphing_target_radius_1); mTargetRadius2 = mOrigRadius * 4; mTargetRadius3 = getResources().getDimensionPixelSize(R.dimen.morphing_target_radius_2); mCardView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { doMaterialAnimation(); } }); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View v = inflater.inflate(R.layout.fragment_question, container, false); String rawMessage = getArguments().getString(QuestionListenerService.MESSAGE_KEY); TextView questionText = (TextView) v.findViewById(R.id.question); TextView aAns = (TextView) v.findViewById(R.id.a_ans); TextView bAns = (TextView) v.findViewById(R.id.b_ans); TextView cAns = (TextView) v.findViewById(R.id.c_ans); TextView dAns = (TextView) v.findViewById(R.id.d_ans); TextView progress = (TextView) v.findViewById(R.id.progress); helper = new BrickAppDbHelper(getActivity()); Bundle args = getArguments(); aAns.setText(args.getString(AKEY)); bAns.setText(args.getString(BKEY)); cAns.setText(args.getString(CKEY)); dAns.setText(args.getString(DKEY)); questionText.setText(args.getString(QUESTION_KEY)); progress.setText("Question " + args.getInt(POSKEY) + "/" + args.getInt(TOTKEY)); CardView aCard = (CardView) v.findViewById(R.id.a_button); CardView bCard = (CardView) v.findViewById(R.id.b_button); CardView cCard = (CardView) v.findViewById(R.id.c_button); CardView dCard = (CardView) v.findViewById(R.id.d_button); final CustomViewPager mPager = (CustomViewPager) getActivity().findViewById(R.id.quiz_pager); aCard.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { movePage(mPager, 1); } }); bCard.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { movePage(mPager, 2); } }); cCard.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { movePage(mPager, 3); } }); dCard.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { movePage(mPager, 4); } }); return v; }
private void setup() { cardView = new CardView(context); cardView.setCardElevation(4f); cardView.setRadius(8f); LinearLayout linearLayout = new LinearLayout(context); linearLayout.setOrientation(LinearLayout.VERTICAL); tempTextView = new TextView(context); tempTextView.setText(benchmarkList.getName()); tempTextView.setTextAppearance(context, android.R.style.TextAppearance_Material_Display1); linearLayout.addView(tempTextView); startButton = new Button(context); startButton.setText("Start"); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); params.width = LinearLayout.LayoutParams.MATCH_PARENT; startButton.setLayoutParams(params); startButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { benchmarkList.start(); } }); linearLayout.addView(startButton); stopButton = new Button(context); stopButton.setText("Stop"); LinearLayout.LayoutParams paramsStop = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); paramsStop.width = LinearLayout.LayoutParams.MATCH_PARENT; stopButton.setLayoutParams(paramsStop); stopButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { benchmarkList.stop(); } }); linearLayout.addView(stopButton); LinearLayout resultLinearLayout = new LinearLayout(context); resultLinearLayout.setOrientation(LinearLayout.VERTICAL); lastResultTextView = new TextView(context); lastResultTextView.setTextAppearance(context, android.R.style.TextAppearance_Material_Body1); resultLinearLayout.addView(lastResultTextView); lastTimeTextView = new TextView(context); lastTimeTextView.setTextAppearance(context, android.R.style.TextAppearance_Material_Body1); resultLinearLayout.addView(lastTimeTextView); linearLayout.addView(resultLinearLayout); int margin = Conversions.toPx(context, 16); linearLayout.setPadding(margin, margin, margin, margin); resultLinearLayout.setPadding(0, margin, 0, 0); cardView.addView(linearLayout); dateFormat = android.text.format.DateFormat.getDateFormat(context); timeFormat = android.text.format.DateFormat.getTimeFormat(context); cardView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(context, BenchmarkListResultsActivity.class); intent.putExtra( BenchmarkListResultsActivity.INTENT_BENCH_NAME, benchmarkList.getName()); context.startActivity(intent); } }); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup superContainer, Bundle savedInstanceState) { View root = super.onCreateView(inflater, superContainer, savedInstanceState); View view = inflater.inflate(R.layout.view_key_adv_share_fragment, getContainer()); ProviderHelper providerHelper = new ProviderHelper(ViewKeyAdvShareFragment.this.getActivity()); mNfcHelper = new NfcHelper(getActivity(), providerHelper); mFingerprintView = (TextView) view.findViewById(R.id.view_key_fingerprint); mQrCode = (ImageView) view.findViewById(R.id.view_key_qr_code); mQrCodeLayout = (CardView) view.findViewById(R.id.view_key_qr_code_layout); mQrCodeLayout.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { showQrCodeDialog(); } }); View vFingerprintShareButton = view.findViewById(R.id.view_key_action_fingerprint_share); View vFingerprintClipboardButton = view.findViewById(R.id.view_key_action_fingerprint_clipboard); View vKeyShareButton = view.findViewById(R.id.view_key_action_key_share); View vKeySafeButton = view.findViewById(R.id.view_key_action_key_export); View vKeyNfcButton = view.findViewById(R.id.view_key_action_key_nfc); View vKeyClipboardButton = view.findViewById(R.id.view_key_action_key_clipboard); ImageButton vKeySafeSlingerButton = (ImageButton) view.findViewById(R.id.view_key_action_key_safeslinger); View vKeyUploadButton = view.findViewById(R.id.view_key_action_upload); vKeySafeSlingerButton.setColorFilter( FormattingUtils.getColorFromAttr(getActivity(), R.attr.colorTertiaryText), PorterDuff.Mode.SRC_IN); vFingerprintShareButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { share(true, false); } }); vFingerprintClipboardButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { share(true, true); } }); vKeyShareButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { share(false, false); } }); vKeySafeButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { exportToFile(); } }); vKeyClipboardButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { share(false, true); } }); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { vKeyNfcButton.setVisibility(View.VISIBLE); vKeyNfcButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { mNfcHelper.invokeNfcBeam(); } }); } else { vKeyNfcButton.setVisibility(View.GONE); } vKeySafeSlingerButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startSafeSlinger(mDataUri); } }); vKeyUploadButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { uploadToKeyserver(); } }); return root; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_candidate_detail); ButterKnife.bind(this); // actionbar setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); assert actionBar != null; actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(""); typefaceTitle = FontCache.getTypefaceTitle(this); typefacelight = FontCache.getTypefaceTitle(this); isUnicode = UserPrefUtils.getInstance(this).getTextPref().equals(Config.UNICODE); mListener = new AppBarLayout.OnOffsetChangedListener() { @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { if (collapsingAvatarToolbar.getHeight() + verticalOffset < 2 * ViewCompat.getMinimumHeight(collapsingAvatarToolbar)) { MixUtils.toggleVisibilityWithAnim(cardView, 1000, false); } else { MixUtils.toggleVisibilityWithAnim(cardView, 1000, true); } } }; appbar.addOnOffsetChangedListener(mListener); candidate = (Candidate) getIntent().getSerializableExtra(Config.CANDIDATE); candidateSearchResult = (CandidateSearchResult) getIntent().getSerializableExtra("searchResult"); if (candidate != null) { Glide.with(this) .load(candidate.getParty().getPartyFlag()) .bitmapTransform(new BlurTransformation(getApplicationContext(), 8, 1)) .into(partyImage); Glide.with(this) .load(candidate.getPhotoUrl()) .diskCacheStrategy(DiskCacheStrategy.ALL) .bitmapTransform(new CropCircleTransformation(this)) .placeholder(R.drawable.profile_placeholder) .into(candidateImage); candidateName.setText(candidate.getName()); Glide.with(this) .load(candidate.getParty().getPartyFlag()) .diskCacheStrategy(DiskCacheStrategy.ALL) .into(mCandidatePartyFlag); if (candidate.getConstituency().getAMPCODE() == null) { upperHouseView.setVisibility(View.GONE); } else { upperHouseView.setVisibility(View.VISIBLE); upperHouse.setText( MixUtils.amConstituencyName( candidate.getConstituency().getName(), candidate.getConstituency().getNumber())); } mCandidateConstituency.setText(candidate.getConstituency().getName()); mCandidateDateOfBirth.setText( MixUtils.convertToBurmese(String.valueOf(candidate.getBirthDateString()))); mCandidateEducation.setText(candidate.getEducation()); mCandidateFather.setText(candidate.getFather().getName()); mCandidateMother.setText(candidate.getMother().getName()); mCandidateOccupation.setText(candidate.getOccupation()); mCandidateRace.setText(candidate.getEthnicity()); mCandidateReligion.setText(candidate.getReligion()); mCandidateLegalSlature.setText(candidate.getLegislature()); mCandidateParty.setText(candidate.getParty().getPartyName()); mCandidateAddress.setText(candidate.getWardVillage()); RESTService mRESTService = RESTClient.getService(this); if (candidate.getMpid() == null) { // mCompareCandidate.setCardBackgroundColor(getResources().getColor(R.color.accent_color_error)); // mCandidateCompareResult.setText(getResources().getString(R.string.first_time_candidate)); mQuestionHeaderTv.setVisibility(View.GONE); mMotionHeaderTv.setVisibility(View.GONE); mCandidateQuestionCard.setVisibility(View.GONE); mCandidateMotionCard.setVisibility(View.GONE); } else { Call<JsonObject> questionMotionCall = mRESTService.getQuestionAndMotion(candidate.getMpid()); questionMotionCall.enqueue( new RestCallback<JsonObject>() { @Override public void onResponse(Response<JsonObject> response) { if (response.code() == 200) { int motionCount = response.body().get("motions_count").getAsInt(); JsonArray motions = response.body().get("motions").getAsJsonArray(); int questionCount = response.body().get("questions_count").getAsInt(); JsonArray questions = response.body().get("questions").getAsJsonArray(); makeMotionChart(motionCount, motions); makeQuestionChart(questionCount, questions); } } }); } } else { // TODO fetch Candidate by ID /* RESTService mRESTService = RESTClient.getService(this); Map<String, String> amyotharParams = new HashMap<>(); amyotharParams.put(Config.WITH, "party"); Call<JsonObject> candidateCall = mRESTService.getCandidate("7abd75a22042fe8e3faf931d710949fe", amyotharParams); candidateCall.enqueue(new RestCallback<JsonObject>() { @Override public void onResponse(Response<JsonObject> response) { } });*/ } mCompareCandidate.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(CandidateDetailActivity.this, CandidateListActivity.class); i.putExtra(Config.CANDIDATE, candidate); startActivity(i); } }); setTypeFace(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); cardTakeAttandance = (CardView) findViewById(R.id.card_takeAttandance); cardTakeNote = (CardView) findViewById(R.id.card_takeNote); cardAddStudent = (CardView) findViewById(R.id.card_addStudent); cardViewNote = (CardView) findViewById(R.id.card_viewNote); cardTakeAttandance.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { dialog = new Dialog(HomeActivity.this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_take_attendance); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); TextView ownAttendance = (TextView) dialog.findViewById(R.id.tv_takeOwnAttendance); TextView otherAttendance = (TextView) dialog.findViewById(R.id.tv_takeOtherAttendance); ownAttendance.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intentOwn = new Intent(HomeActivity.this, TakeAttendanceActivity.class); intentOwn.putExtra("view_type", "own"); startActivity(intentOwn); dialog.dismiss(); } }); otherAttendance.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(HomeActivity.this, TakeAttendanceActivity.class); intent.putExtra("view_type", "other"); startActivity(intent); dialog.dismiss(); } }); dialog.show(); } }); cardTakeNote.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { dialog = new Dialog(HomeActivity.this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_take_note); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); TextView myNote = (TextView) dialog.findViewById(R.id.tv_takeMyNote); myNote.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(HomeActivity.this, TakeMyNoteActivity.class)); dialog.dismiss(); } }); dialog.show(); } }); cardAddStudent.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(HomeActivity.this, AddStudentActivity.class)); } }); cardViewNote.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(HomeActivity.this, ViewNoteActivity.class)); } }); }
@Override public void onViewCreated(View view, Bundle savedInstanceState) { listView = (ListView) view.findViewById(R.id.listview); View header = getLayoutInflater(savedInstanceState) .inflate(R.layout.fragment_programoverview_header, listView, false); mProgressBar = (ProgressBar) header.findViewById(R.id.progress_bar); mProgressBar.setVisibility(View.GONE); adapter = new ProgramStageAdapter(getLayoutInflater(savedInstanceState)); listView.addHeaderView(header, CLASS_TAG, false); listView.setAdapter(adapter); listView.setOnItemClickListener(this); enrollmentLayout = (LinearLayout) header.findViewById(R.id.enrollmentLayout); enrollmentDateLabel = (TextView) header.findViewById(R.id.dateOfEnrollmentLabel); enrollmentDateValue = (TextView) header.findViewById(R.id.dateOfEnrollmentValue); incidentDateLabel = (TextView) header.findViewById(R.id.dateOfIncidentLabel); incidentDateValue = (TextView) header.findViewById(R.id.dateOfIncidentValue); profileCardView = (CardView) header.findViewById(R.id.profile_cardview); enrollmentCardview = (CardView) header.findViewById(R.id.enrollment_cardview); completeButton = (Button) header.findViewById(R.id.complete); terminateButton = (Button) header.findViewById(R.id.terminate); followupButton = (ImageButton) header.findViewById(R.id.followupButton); profileButton = (ImageButton) header.findViewById(R.id.profile_button); completeButton.setOnClickListener(null); terminateButton.setOnClickListener(null); followupButton.setOnClickListener(null); profileButton.setOnClickListener(this); profileCardView.setOnClickListener(this); missingEnrollmentLayout = (LinearLayout) header.findViewById(R.id.missingenrollmentlayout); newEnrollmentButton = (FloatingActionButton) header.findViewById(R.id.newenrollmentbutton); newEnrollmentButton.setOnClickListener(this); attribute1Label = (TextView) header.findViewById(R.id.headerItem1label); attribute1Value = (TextView) header.findViewById(R.id.headerItem1value); attribute2Label = (TextView) header.findViewById(R.id.headerItem2label); attribute2Value = (TextView) header.findViewById(R.id.headerItem2value); Bundle fragmentArguments = getArguments(); Log.d(CLASS_TAG, "program: " + fragmentArguments.getString(PROGRAM_ID)); attachSpinner(); mSpinnerAdapter.swapData( MetaDataController.getProgramsForOrganisationUnit( fragmentArguments.getString(ORG_UNIT_ID), Program.SINGLE_EVENT_WITH_REGISTRATION, Program.MULTIPLE_EVENTS_WITH_REGISTRATION)); if (savedInstanceState != null && savedInstanceState.getParcelable(STATE) != null) { mState = savedInstanceState.getParcelable(STATE); } if (mState == null) { mState = new ProgramOverviewFragmentState(); OrganisationUnit ou = MetaDataController.getOrganisationUnit(fragmentArguments.getString(ORG_UNIT_ID)); Program program = MetaDataController.getProgram(fragmentArguments.getString(PROGRAM_ID)); mState.setOrgUnit(ou.getId(), ou.getLabel()); mState.setProgram(program.getId(), program.getName()); mState.setTrackedEntityInstance(fragmentArguments.getLong(TRACKEDENTITYINSTANCE_ID, -1)); } onRestoreState(true); }
private void onClick() { WholeLayout.setOnTouchListener( new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { InputMethodManager in = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); in.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); return false; } }); logolayout.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { InputMethodManager in = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); in.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); startActivity( new Intent(mContext, DashboardActivity.class).putExtra("TO_LAYOUT", "Dashboard")); ((Activity) mContext).finish(); } }); ReviewCancelbutton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { InputMethodManager in = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); in.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); Fragment newFragment = new SummaryFragment(mContext); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.SUMMARY_FRAGMENT); // Commit the transaction transaction.commit(); } }); ReviewNext.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { InputMethodManager in = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); in.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); TaxPageFragment(); } }); errorlist.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, final int position, long id) { for (int i = 0; i < cautionList.getChildCount(); i++) { View v = cautionList.getChildAt(i); v.getTag(); } TextView fix_me = (TextView) view.findViewById(R.id.fix_me); fix_me.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Create")) { Fragment newFragment = new AddExemptOrganization(mContext, true, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.wholevertical, newFragment); transaction.addToBackStack(FragmentNameConfig.ORG_DETAIL_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("IRSPayment")) { Fragment newFragment = new IRSPayment(mContext); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.IRS_PAYMENT_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Step1")) { Fragment newFragment = new NewTaxYearFragment(mContext, 0); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); // transaction.addToBackStack(FragmentNameConfig.FORM_TAX_SELECTION_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Step2")) { Fragment newFragment = new NewTaxYearFragment(mContext, 0); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); // transaction.addToBackStack(FragmentNameConfig.FORM_TAX_SELECTION_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Step3")) { Fragment newFragment = new NewTaxYearFragment(mContext, 0); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); // transaction.addToBackStack(FragmentNameConfig.FORM_TAX_SELECTION_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("BookInCareOf")) { Fragment newFragment = new BooksInCareOf(mContext, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.BOOKS_IN_CARE_OF_FRAGMENT); // Commit the transaction transaction.commit(); // TODO: 11/26/2015 } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("PrimaryExemptPurpose")) { Fragment newFragment = new BooksInCareOf(mContext, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.BOOKS_IN_CARE_OF_FRAGMENT); // Commit the transaction transaction.commit(); // TODO: 11/26/2015 } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("ProgramServiceAccomplishment")) { Fragment newFragment = new BooksInCareOf(mContext, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.BOOKS_IN_CARE_OF_FRAGMENT); // Commit the transaction transaction.commit(); // TODO: 11/26/2015 } else { Fragment newFragment = new AddExemptOrganization(mContext, true, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.wholevertical, newFragment); transaction.addToBackStack(FragmentNameConfig.ORG_DETAIL_FRAGMENT); // Commit the transaction transaction.commit(); } } }); } }); cautionList.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, final int position, long id) { TextView fix_me = (TextView) view.findViewById(R.id.fix_me); fix_me.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Create")) { Fragment newFragment = new AddExemptOrganization(mContext, true, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.wholevertical, newFragment); transaction.addToBackStack(FragmentNameConfig.ORG_DETAIL_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("IRSPayment")) { Fragment newFragment = new IRSPayment(mContext); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.IRS_PAYMENT_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Step1")) { Fragment newFragment = new NewTaxYearFragment(mContext, 0); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); // transaction.addToBackStack(FragmentNameConfig.FORM_TAX_SELECTION_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Step2")) { Fragment newFragment = new NewTaxYearFragment(mContext, 0); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); // transaction.addToBackStack(FragmentNameConfig.FORM_TAX_SELECTION_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("Step3")) { Fragment newFragment = new NewTaxYearFragment(mContext, 0); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); // transaction.addToBackStack(FragmentNameConfig.FORM_TAX_SELECTION_FRAGMENT); // Commit the transaction transaction.commit(); } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("BookInCareOf")) { Fragment newFragment = new BooksInCareOf(mContext, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.BOOKS_IN_CARE_OF_FRAGMENT); // Commit the transaction transaction.commit(); // TODO: 11/26/2015 } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("PrimaryExemptPurpose")) { Fragment newFragment = new BooksInCareOf(mContext, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.BOOKS_IN_CARE_OF_FRAGMENT); // Commit the transaction transaction.commit(); // TODO: 11/26/2015 } else if (getAuditResponse.getErrorList().get(position).getACT() != null && getAuditResponse .getErrorList() .get(position) .getACT() .equalsIgnoreCase("ProgramServiceAccomplishment")) { Fragment newFragment = new BooksInCareOf(mContext, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.rightFragment, newFragment); transaction.addToBackStack(FragmentNameConfig.BOOKS_IN_CARE_OF_FRAGMENT); // Commit the transaction transaction.commit(); // TODO: 11/26/2015 } else { Fragment newFragment = new AddExemptOrganization(mContext, true, true); FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slidein, R.anim.slideout); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack if needed transaction.replace(R.id.wholevertical, newFragment); transaction.addToBackStack(FragmentNameConfig.ORG_DETAIL_FRAGMENT); // Commit the transaction transaction.commit(); } } }); } }); }