List of usage examples for android.widget RelativeLayout setVisibility
@RemotableViewMethod public void setVisibility(@Visibility int visibility)
From source file:fm.krui.kruifm.StationSelectionFragment.java
/** * Controls the display of the welcome message on this page. * @param showWelcomeMessage true to display, false to hide *//* ww w . ja va 2 s . c o m*/ private void setWelcomeMessage(boolean showWelcomeMessage) { RelativeLayout welcomeWindow = (RelativeLayout) rootView .findViewById(R.id.welcome_container_relativelayout); if (showWelcomeMessage) { welcomeWindow.setVisibility(View.VISIBLE); } else { welcomeWindow.setVisibility(View.GONE); } }
From source file:hu.balazsbakai.sq.ui.fragments.PagerFragment.java
protected void showPopulatedListView() { listView.setVisibility(View.VISIBLE); RelativeLayout r = (RelativeLayout) getActivity().findViewById(loadingId); if (r != null) r.setVisibility(View.GONE); }
From source file:hu.balazsbakai.sq.ui.fragments.PagerFragment.java
protected void showLoadingLayout() { listView.setVisibility(View.GONE); RelativeLayout l = (RelativeLayout) getActivity().findViewById(loadingId); if (l != null) l.setVisibility(View.VISIBLE); }
From source file:hu.balazsbakai.sq.ui.fragments.PagerFragment.java
protected void showEmptyListView() { RelativeLayout r = (RelativeLayout) getActivity().findViewById(loadingId); if (r != null) r.setVisibility(View.GONE); LinearLayout ll = (LinearLayout) getActivity().findViewById(emptyListViewId); if (ll != null) ll.setVisibility(View.VISIBLE); }
From source file:com.android.argb.edhlc.Utils.java
public static void createRecordListElement(View parent, Record currentRecord, String highlightedPlayerName) { RelativeLayout selectedRecord = (RelativeLayout) parent.findViewById(R.id.selectedRecord); selectedRecord.setVisibility(currentRecord.isSelected() ? View.VISIBLE : View.GONE); TextView textDateRecordCard = (TextView) parent.findViewById(R.id.textDateRecordCard); LinearLayout linearFirstLineRecordCard = (LinearLayout) parent.findViewById(R.id.linearFirstLineRecordCard); TextView textFirstIndicatorRecordCard = (TextView) parent.findViewById(R.id.textFirstIndicatorRecordCard); TextView textFirstPlayerRecordCard = (TextView) parent.findViewById(R.id.textFirstPlayerRecordCard); TextView textFirstDeckRecordCard = (TextView) parent.findViewById(R.id.textFirstDeckRecordCard); View divider1RecordCard = parent.findViewById(R.id.divider1RecordCard); LinearLayout linearSecondLineRecordCard = (LinearLayout) parent .findViewById(R.id.linearSecondLineRecordCard); TextView textSecondIndicatorRecordCard = (TextView) parent.findViewById(R.id.textSecondIndicatorRecordCard); TextView textSecondPlayerRecordCard = (TextView) parent.findViewById(R.id.textSecondPlayerRecordCard); TextView textSecondDeckRecordCard = (TextView) parent.findViewById(R.id.textSecondDeckRecordCard); View divider2RecordCard = parent.findViewById(R.id.divider2RecordCard); LinearLayout linearThirdLineRecordCard = (LinearLayout) parent.findViewById(R.id.linearThirdLineRecordCard); TextView textThirdIndicatorRecordCard = (TextView) parent.findViewById(R.id.textThirdIndicatorRecordCard); TextView textThirdPlayerRecordCard = (TextView) parent.findViewById(R.id.textThirdPlayerRecordCard); TextView textThirdDeckRecordCard = (TextView) parent.findViewById(R.id.textThirdDeckRecordCard); View divider3RecordCard = parent.findViewById(R.id.divider3RecordCard); LinearLayout linearFourthLineRecordCard = (LinearLayout) parent .findViewById(R.id.linearFourthLineRecordCard); TextView textFourthIndicatorRecordCard = (TextView) parent.findViewById(R.id.textFourthIndicatorRecordCard); TextView textFourthPlayerRecordCard = (TextView) parent.findViewById(R.id.textFourthPlayerRecordCard); TextView textFourthDeckRecordCard = (TextView) parent.findViewById(R.id.textFourthDeckRecordCard); Typeface typefaceMedium = Typeface.create("sans-serif-medium", Typeface.NORMAL); Typeface typefaceNormal = Typeface.create("sans-serif", Typeface.NORMAL); int colorAccent = ContextCompat.getColor(parent.getContext(), R.color.accent_color); int colorSecondary = ContextCompat.getColor(parent.getContext(), R.color.secondary_text); textDateRecordCard.setText(String.format("Played on %s", currentRecord.getDate())); switch (currentRecord.getTotalPlayers()) { case 2://from w w w . j a va2 s .c om linearFirstLineRecordCard.setVisibility(View.VISIBLE); linearSecondLineRecordCard.setVisibility(View.VISIBLE); linearThirdLineRecordCard.setVisibility(View.GONE); linearFourthLineRecordCard.setVisibility(View.GONE); divider1RecordCard.setVisibility(View.VISIBLE); divider2RecordCard.setVisibility(View.GONE); divider3RecordCard.setVisibility(View.GONE); textFirstDeckRecordCard.setText(currentRecord.getFirstPlace().getDeckName()); textFirstPlayerRecordCard.setText(currentRecord.getFirstPlace().getDeckOwnerName()); textSecondDeckRecordCard.setText(currentRecord.getSecondPlace().getDeckName()); textSecondPlayerRecordCard.setText(currentRecord.getSecondPlace().getDeckOwnerName()); if (highlightedPlayerName != null) { textFirstDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFirstPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFirstIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textFirstIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textSecondIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); } break; case 3: linearFirstLineRecordCard.setVisibility(View.VISIBLE); linearSecondLineRecordCard.setVisibility(View.VISIBLE); linearThirdLineRecordCard.setVisibility(View.VISIBLE); linearFourthLineRecordCard.setVisibility(View.GONE); divider1RecordCard.setVisibility(View.VISIBLE); divider2RecordCard.setVisibility(View.VISIBLE); divider3RecordCard.setVisibility(View.GONE); textFirstDeckRecordCard.setText(currentRecord.getFirstPlace().getDeckName()); textFirstPlayerRecordCard.setText(currentRecord.getFirstPlace().getDeckOwnerName()); textSecondDeckRecordCard.setText(currentRecord.getSecondPlace().getDeckName()); textSecondPlayerRecordCard.setText(currentRecord.getSecondPlace().getDeckOwnerName()); textThirdDeckRecordCard.setText(currentRecord.getThirdPlace().getDeckName()); textThirdPlayerRecordCard.setText(currentRecord.getThirdPlace().getDeckOwnerName()); if (highlightedPlayerName != null) { textFirstDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFirstPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFirstIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textFirstIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textSecondIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textThirdDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textThirdPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textThirdIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textThirdIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); } break; case 4: linearFirstLineRecordCard.setVisibility(View.VISIBLE); linearSecondLineRecordCard.setVisibility(View.VISIBLE); linearThirdLineRecordCard.setVisibility(View.VISIBLE); linearFourthLineRecordCard.setVisibility(View.VISIBLE); divider1RecordCard.setVisibility(View.VISIBLE); divider2RecordCard.setVisibility(View.VISIBLE); divider3RecordCard.setVisibility(View.VISIBLE); textFirstDeckRecordCard.setText(currentRecord.getFirstPlace().getDeckName()); textFirstPlayerRecordCard.setText(currentRecord.getFirstPlace().getDeckOwnerName()); textSecondDeckRecordCard.setText(currentRecord.getSecondPlace().getDeckName()); textSecondPlayerRecordCard.setText(currentRecord.getSecondPlace().getDeckOwnerName()); textThirdDeckRecordCard.setText(currentRecord.getThirdPlace().getDeckName()); textThirdPlayerRecordCard.setText(currentRecord.getThirdPlace().getDeckOwnerName()); textFourthDeckRecordCard.setText(currentRecord.getFourthPlace().getDeckName()); textFourthPlayerRecordCard.setText(currentRecord.getFourthPlace().getDeckOwnerName()); if (highlightedPlayerName != null) { textFirstDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFirstPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFirstIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textFirstIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFirstPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textSecondIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textSecondIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getSecondPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textThirdDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textThirdPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textThirdIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textThirdIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getThirdPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFourthDeckRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFourthPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFourthPlayerRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFourthPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); textFourthIndicatorRecordCard.setTextColor( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFourthPlace().getDeckOwnerName()) ? colorAccent : colorSecondary); textFourthIndicatorRecordCard.setTypeface( highlightedPlayerName.equalsIgnoreCase(currentRecord.getFourthPlace().getDeckOwnerName()) ? typefaceMedium : typefaceNormal); } break; } }
From source file:com.ultrafunk.network_info.config.ConfigActivity.java
private void initLockscreenGravityView() { if (!isLockscreenWidget(appAppWidgetManager, appWidgetId)) { widgetConfig.setLockscreenWidget(false); RelativeLayout lockscreenRelativeLayout = (RelativeLayout) findViewById(R.id.lockscreenRelativeLayout); lockscreenRelativeLayout.setVisibility(View.GONE); } else {//w w w. j a v a 2s . c o m widgetConfig.setLockscreenWidget(true); gravityCheckedTextView = (CheckedTextView) findViewById(R.id.gravityCheckedTextView); gravityCheckedTextView.setChecked((widgetConfig.getLockscreenGravity() == Gravity.TOP) ? false : true); gravityCheckedTextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (gravityCheckedTextView.isChecked()) { widgetConfig.setLockscreenGravity(Gravity.TOP); gravityCheckedTextView.setChecked(false); } else { widgetConfig.setLockscreenGravity(Gravity.CENTER_VERTICAL); gravityCheckedTextView.setChecked(true); } } }); } }
From source file:org.ciasaboark.tacere.activity.fragment.TutorialProVersionFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = (ViewGroup) inflater.inflate(layout, container, false); RelativeLayout thankYouPage = (RelativeLayout) rootView.findViewById(R.id.tutorial_pro_page_thanks); RelativeLayout upgradePage = (RelativeLayout) rootView.findViewById(R.id.tutorial_pro_page_upgrade); Authenticator authenticator = new Authenticator(getActivity()); if (authenticator.isAuthenticated()) { thankYouPage.setVisibility(View.VISIBLE); upgradePage.setVisibility(View.GONE); } else {//from w w w . ja va 2s . c o m thankYouPage.setVisibility(View.GONE); upgradePage.setVisibility(View.VISIBLE); } Button upgradeButton = (Button) rootView.findViewById(R.id.tutorial_pro_upgrade_button); upgradeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent buyNowActivityIntent = new Intent(rootView.getContext(), ProUpgradeActivity.class); buyNowActivityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(buyNowActivityIntent); } }); return rootView; }
From source file:com.hybris.mobile.activity.CheckoutActivity.java
private void updateUI() { CartDeliveryAddress address = controller.getCart().getDeliveryAddress(); //delivery address section String strList = ""; TextView addressView = (TextView) findViewById(R.id.lbl_addressView); TextView deliveryView = (TextView) findViewById(R.id.lbl_deliveryMethod); TextView paymentView = (TextView) findViewById(R.id.lbl_paymentDetails); if (address != null) { String firstName = address.getFirstName(); String lastName = address.getLastName(); String title = address.getTitle(); strList = "<b>" + strList + title + " " + firstName + " " + lastName + "</b>"; strList += StringUtils.isNotBlank(address.getLine1()) ? "<br />" + address.getLine1() : ""; strList += StringUtils.isNotBlank(address.getLine2()) ? "<br />" + address.getLine2() : ""; strList += StringUtils.isNotBlank(address.getTown()) ? "<br />" + address.getTown() : ""; strList += StringUtils.isNotBlank(address.getPostalCode()) ? "<br />" + address.getPostalCode() : ""; strList += (address.getCountry() != null && StringUtils.isNotBlank(address.getCountry().getName())) ? "<br />" + address.getCountry().getName() : ""; addressView.setText(Html.fromHtml(strList)); ((TextView) findViewById(R.id.textView1)).setTextColor(colorStepDone); ((TextView) findViewById(R.id.textView3)).setTextColor(colorStepCurrent); deliveryView.setVisibility(View.VISIBLE); ((ImageButton) findViewById(R.id.imageButtonDeliveryAddress)).setImageResource(R.drawable.accept); ((ImageButton) findViewById(R.id.imageButtonDeliveryMethod)).setVisibility(View.VISIBLE); }//w ww. jav a 2s.com //delivery mode section CartDeliveryMode deliveryMode = controller.getCart().getDeliveryMode(); if (deliveryMode != null) { strList = "<b>" + deliveryMode.getName() + "</b><br />" + deliveryMode.getDescription() + "<br />" + deliveryMode.getDeliveryCost().getFormattedValue(); deliveryView.setText(Html.fromHtml(strList)); ((TextView) findViewById(R.id.textView3)).setTextColor(colorStepDone); ((TextView) findViewById(R.id.textView4)).setTextColor(colorStepCurrent); paymentView.setVisibility(View.VISIBLE); ((ImageButton) findViewById(R.id.imageButtonDeliveryMethod)).setImageResource(R.drawable.accept); ((ImageButton) findViewById(R.id.imageButtonPaymentDetails)).setVisibility(View.VISIBLE); } //payment section CartPaymentInfo payment = controller.getCart().getPaymentInfo(); if (payment != null) { String accountHolderName = payment.getAccountHolderName(); String cardType = payment.getCardType().getName(); String cardNumber = payment.getCardNumber(); strList = "<b>" + accountHolderName + "<b> <br />" + cardNumber + "<br />" + cardType; paymentView.setText(Html.fromHtml(strList)); ((TextView) findViewById(R.id.textView4)).setTextColor(colorStepDone); ((ImageButton) findViewById(R.id.imageButtonPaymentDetails)).setImageResource(R.drawable.accept); } TextView items = (TextView) findViewById(R.id.textView5); items.setText(controller.getCart().getTotalItems() + " " + getString(R.string.items_label)); TextView subtotal = (TextView) findViewById(R.id.lbl_subTotal); subtotal.setText(controller.getCart().getSubTotal().getFormattedValue()); TextView discounts = (TextView) findViewById(R.id.lbl_totalDiscounts); discounts.setText( getString(R.string.discount, controller.getCart().getTotalDiscounts().getFormattedValue())); TextView totaltax = (TextView) findViewById(R.id.lbl_totalTax); totaltax.setText(controller.getCart().getTotalTax().getFormattedValue()); TextView totalprice = (TextView) findViewById(R.id.lbl_totalPrice); totalprice.setText(controller.getCart().getTotalPrice().getFormattedValue()); boolean stepsComplete = address != null && deliveryMode != null && payment != null; RelativeLayout containerTerms = (RelativeLayout) findViewById(R.id.containerTerms); containerTerms.setVisibility(stepsComplete ? View.VISIBLE : View.GONE); CheckBox checkBoxTerms = (CheckBox) findViewById(R.id.checkBoxTerms); boolean readyToConfirm = stepsComplete && checkBoxTerms.isChecked(); findViewById(R.id.buttonConfirmOrder).setEnabled(readyToConfirm); }
From source file:fr.cph.chicago.fragment.BikeFragment.java
private final void loadError() { mLoadingLayout.setVisibility(RelativeLayout.INVISIBLE); RelativeLayout errorLayout = (RelativeLayout) mRootView.findViewById(R.id.error_layout); errorLayout.setVisibility(RelativeLayout.VISIBLE); }
From source file:com.jun.elephant.ui.topic.details.TopicDetailsActivity.java
private void initViewDetail(TopicEntity mTopicEntity) { RelativeLayout mUserInfoRl = (RelativeLayout) mToolBar.getChildAt(1); mUserInfoRl.setVisibility(View.VISIBLE); mUserImgIv.setImageUrl(mTopicEntity.getUser().getData().getAvatar()); if (!TextUtils.isEmpty(mTopicEntity.getUser().getData().getIntroduction())) { mUserDescTv.setText(mTopicEntity.getUser().getData().getIntroduction()); mUserDescTv.setVisibility(View.VISIBLE); }/*w w w .ja v a 2s .c om*/ mUserNameTv.setText(mTopicEntity.getUser().getData().getName()); mCommentTv.setText(String.valueOf(mTopicEntity.getReplyCount())); mPointTv.setText(String.valueOf(mTopicEntity.getVoteCount())); mWebView.setWebViewClient(new WebAppClient(this, mMultiStateView, mWebView)); mWebView.loadUrl(mTopicEntity.getLinks().getDetailsWebView(), getAuth()); mWebView.addJavascriptInterface(new WebAppInterface(this), PLATFORM); if (getUserConstant().isLogin()) { if (mTopicEntity.isAttention()) { setDrawableTop(mFollowTv, R.mipmap.ic_follow_selector); } else { setDrawableTop(mFollowTv, R.mipmap.ic_follow_normal); } if (mTopicEntity.isFavorite()) { setDrawableTop(mFavoriteTv, R.mipmap.ic_bookmark_selector); } else { setDrawableTop(mFavoriteTv, R.mipmap.ic_bookmark_normal); } if (mTopicEntity.isVoteDown()) { changeVoteStyle(Constants.TopicOpt.TOPIC_VOTE_DOWN); } if (mTopicEntity.isVoteUp()) { changeVoteStyle(Constants.TopicOpt.TOPIC_VOTE_UP); } } }