List of usage examples for android.view View GONE
int GONE
To view the source code for android.view View GONE.
Click Source Link
From source file:de.elanev.studip.android.app.frontend.forums.ForumEntryComposeFragment.java
@Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_forum_area_create, container, false); mSubjectEditText = (EditText) v.findViewById(R.id.forum_area_subject); mContentEditText = (EditText) v.findViewById(R.id.forum_area_content); if (sEntryType == EntryType.REPLY_ENTRY) { mSubjectEditText.setVisibility(View.GONE); }/* w w w . ja v a 2s . c o m*/ return v; }
From source file:com.bonsai.wallet32.PairWalletActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { mRes = getApplicationContext().getResources(); mPrefs = PreferenceManager.getDefaultSharedPreferences(this); super.onCreate(savedInstanceState); setContentView(R.layout.activity_pair_wallet); // Set the state of the reduce false positives checkbox. boolean reduceFalsePositives = mPrefs.getBoolean("pref_reduceBloomFalsePositives", false); CheckBox chkbx = (CheckBox) findViewById(R.id.reduce_false_positives); chkbx.setChecked(reduceFalsePositives); chkbx.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override/*from w ww . ja v a2 s . c om*/ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { SharedPreferences.Editor editor = mPrefs.edit(); editor.putBoolean("pref_reduceBloomFalsePositives", isChecked); editor.commit(); } }); // Hide the reduce bloom false positives if experimental off. Boolean isExperimental = mPrefs.getBoolean(SettingsActivity.KEY_EXPERIMENTAL, false); if (!isExperimental) { findViewById(R.id.reduce_false_positives).setVisibility(View.GONE); findViewById(R.id.reduce_space).setVisibility(View.GONE); } if (savedInstanceState == null) { final Intent intent = this.getIntent(); final String action = intent.getAction(); final String mimeType = intent.getType(); if ((NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) && Nfc.MIMETYPE_WALLET32PAIRING.equals(mimeType)) { final NdefMessage ndefMessage = (NdefMessage) intent .getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)[0]; final byte[] ndefMessagePayload = Nfc.extractMimePayload(Nfc.MIMETYPE_WALLET32PAIRING, ndefMessage); JSONObject codeObj; try { String msg = new String(ndefMessagePayload, "UTF-8"); codeObj = new JSONObject(msg); } catch (Exception ex) { String msg = "trouble deserializing pairing code: " + ex.toString() + " : " + ndefMessagePayload.toString(); mLogger.error(msg); Toast.makeText(this, msg, Toast.LENGTH_LONG).show(); return; } // Setup the wallet in a background task. new PairWalletTask().execute(codeObj); } } }
From source file:com.mdlive.myhealth.ProviderDetailsFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); view.findViewById(R.id.detailsGroupAffiliations).setVisibility(View.GONE); view.findViewById(R.id.dateTxt).setVisibility(View.GONE); view.findViewById(R.id.AvailableByLl).setVisibility(View.GONE); view.findViewById(R.id.panelMsgLl).setVisibility(View.GONE); view.findViewById(R.id.tapBtn).setVisibility(View.GONE); view.findViewById(R.id.reqfutureapptBtn).setVisibility(View.GONE); view.findViewById(R.id.providerDetailsFooterLl).setVisibility(View.GONE); view.findViewById(R.id.dash_board__left_container).setVisibility(View.GONE); view.findViewById(R.id.dash_board__right_container).setVisibility(View.GONE); educationLl = (LinearLayout) view.findViewById(R.id.educationLl); providerImageHolder = (LinearLayout) view.findViewById(R.id.providerImageHolder); boardCertificationsLl = (LinearLayout) view.findViewById(R.id.boardCertificationsLl); hosaffiliationsLl = (LinearLayout) view.findViewById(R.id.hosaffiliationsLl); languagesLl = (LinearLayout) view.findViewById(R.id.languagesLl); specialitiesLl = (LinearLayout) view.findViewById(R.id.specialitiesLl); aboutmeLl = (LinearLayout) view.findViewById(R.id.aboutmeLl); aboutme_txt = (TextView) view.findViewById(R.id.aboutMe_txt); education_txt = (TextView) view.findViewById(R.id.education_txt); specialities_txt = (TextView) view.findViewById(R.id.specialities_txt); hospitalAffilations_txt = (TextView) view.findViewById(R.id.license_txt); location_txt = (TextView) view.findViewById(R.id.provider_location_txt); lang_txt = (TextView) view.findViewById(R.id.provider_lang_txt); doctorNameTv = (TextView) view.findViewById(R.id.DoctorName); ProfileImg = (CircularNetworkImageView) view.findViewById(R.id.ProfileImg1); }
From source file:com.vrem.wifianalyzer.wifi.channelgraph.ChannelGraphNavigation.java
void update(@NonNull WiFiData wiFiData) { Collection<Pair<WiFiChannel, WiFiChannel>> visible = CollectionUtils.select(ids.keySet(), new PairPredicate()); updateButtons(wiFiData, visible);/*from ww w . j a v a 2 s.com*/ view.setVisibility(visible.size() > 1 ? View.VISIBLE : View.GONE); }
From source file:com.app.jdy.widget.CustomForwardDialog.java
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.forward_dialog); imageView_wetchar = (ImageView) findViewById(R.id.imageView_wetchar); imageView_wetchar1 = (ImageView) findViewById(R.id.imageView_wetchar1); forward_layout = (LinearLayout) findViewById(R.id.forward_layout); top_layout = (LinearLayout) findViewById(R.id.top_layout); api = WXAPIFactory.createWXAPI(context, Constants.APP_ID); if (isVisibility == false) { forward_layout.setVisibility(View.GONE); top_layout.setBackgroundResource(R.drawable.forward_dialog_bg2); }// w ww . j a v a 2s. c om initView(); imageView_wetchar.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { if (CommonUtils.checkLogin(context)) { isTimeLine = true; new MyAsyncTask().execute(); dismiss(); } else { context.startActivity(new Intent(context, LoginActivity.class)); } } }); imageView_wetchar1.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View arg0) { if (CommonUtils.checkLogin(context)) { isTimeLine = false; new MyAsyncTask().execute(); dismiss(); } else { context.startActivity(new Intent(context, LoginActivity.class)); } } }); }
From source file:com.hybris.mobile.app.commerce.adapter.OrderProductListAdapter.java
@Override public View getView(int position, View convertView, ViewGroup parent) { View rowView;//from w w w . jav a2 s.com if (convertView == null) { LayoutInflater inflater = (LayoutInflater) getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); rowView = inflater.inflate(R.layout.item_order_product, parent, false); rowView.setTag(new OrderViewHolder(rowView, position)); } else { rowView = convertView; } final OrderViewHolder orderViewHolder = (OrderViewHolder) rowView.getTag(); final OrderEntry orderProduct = mProducts.get(position); if (orderProduct != null) { // Name orderViewHolder.productNameTextView.setText(orderProduct.getProduct().getName()); // Price if (orderProduct.getBasePrice() != null) { orderViewHolder.productPrice.setText(orderProduct.getBasePrice().getFormattedValue()); } // Promotion if (orderProduct.getPromotionResult() != null) { if (StringUtils.isNotBlank(orderProduct.getPromotionResult().getDescription())) { orderViewHolder.productPromotion.setText(orderProduct.getPromotionResult().getDescription()); } orderViewHolder.productPromotion.setVisibility(View.VISIBLE); } else { orderViewHolder.productPromotion.setVisibility(View.GONE); } // Variants if (orderProduct.getProduct().getBaseOptions() != null && !orderProduct.getProduct().getBaseOptions().isEmpty()) { orderViewHolder.linearLayoutVariants.setVisibility(View.VISIBLE); orderViewHolder.linearLayoutVariants.removeAllViews(); } // Redirecting to the product detail page when clicking on the image orderViewHolder.orderItemClickableLyout.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { ProductHelper.redirectToProductDetail(getContext(), orderProduct.getProduct().getCode()); } }); // Loading the product image if (StringUtils.isNotBlank(orderProduct.getProduct().getImageThumbnailUrl())) { CommerceApplication.getContentServiceHelper().loadImage( orderProduct.getProduct().getImageThumbnailUrl(), null, orderViewHolder.productImageView, 0, 0, true, null, true); } // Quantity orderViewHolder.quantityTextView .setText(getContext().getString(R.string.order_confirmation_qty, orderProduct.getQuantity())); // Total price if (orderProduct.getTotalPrice() != null) { orderViewHolder.productTotalPrice.setText(orderProduct.getTotalPrice().getFormattedValue()); } } return rowView; }
From source file:com.apptentive.android.sdk.module.engagement.interaction.view.survey.SurveyInteractionView.java
@Override public void doOnCreate(final Activity activity, Bundle savedInstanceState) { if (savedInstanceState != null) { surveySubmitted = savedInstanceState.getBoolean(KEY_SURVEY_SUBMITTED, false); }/*from w ww . jav a2 s .c om*/ if (interaction == null || surveySubmitted) { activity.finish(); return; } activity.setContentView(R.layout.apptentive_survey); // Hide branding if needed. final View branding = activity.findViewById(R.id.apptentive_branding_view); if (branding != null) { if (Configuration.load(activity).isHideBranding(activity)) { branding.setVisibility(View.GONE); } } TextView title = (TextView) activity.findViewById(R.id.title); title.setFocusable(true); title.setFocusableInTouchMode(true); title.setText(interaction.getName()); String descriptionText = interaction.getDescription(); if (descriptionText != null) { TextView description = (TextView) activity.findViewById(R.id.description); description.setText(descriptionText); description.setVisibility(View.VISIBLE); } final Button send = (Button) activity.findViewById(R.id.send); send.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Util.hideSoftKeyboard(activity, view); surveySubmitted = true; if (interaction.isShowSuccessMessage() && interaction.getSuccessMessage() != null) { SurveyThankYouDialog dialog = new SurveyThankYouDialog(activity); dialog.setMessage(interaction.getSuccessMessage()); dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialogInterface) { activity.finish(); } }); dialog.show(); } else { activity.finish(); } EngagementModule.engageInternal(activity, interaction, EVENT_SUBMIT, data.toString()); ApptentiveDatabase.getInstance(activity).addPayload(new SurveyResponse(interaction, surveyState)); Log.d("Survey Submitted."); callListener(true); cleanup(); } }); LinearLayout questions = (LinearLayout) activity.findViewById(R.id.questions); questions.removeAllViews(); // Then render all the questions for (final Question question : interaction.getQuestions()) { if (question.getType() == Question.QUESTION_TYPE_SINGLELINE) { TextSurveyQuestionView textQuestionView = new TextSurveyQuestionView(activity, surveyState, (SinglelineQuestion) question); textQuestionView.setOnSurveyQuestionAnsweredListener(new OnSurveyQuestionAnsweredListener() { public void onAnswered() { sendMetricForQuestion(activity, question); send.setEnabled(isSurveyValid()); } }); questions.addView(textQuestionView); } else if (question.getType() == Question.QUESTION_TYPE_MULTICHOICE) { MultichoiceSurveyQuestionView multichoiceQuestionView = new MultichoiceSurveyQuestionView(activity, surveyState, (MultichoiceQuestion) question); multichoiceQuestionView.setOnSurveyQuestionAnsweredListener(new OnSurveyQuestionAnsweredListener() { public void onAnswered() { sendMetricForQuestion(activity, question); send.setEnabled(isSurveyValid()); } }); questions.addView(multichoiceQuestionView); } else if (question.getType() == Question.QUESTION_TYPE_MULTISELECT) { MultiselectSurveyQuestionView multiselectQuestionView = new MultiselectSurveyQuestionView(activity, surveyState, (MultiselectQuestion) question); multiselectQuestionView.setOnSurveyQuestionAnsweredListener(new OnSurveyQuestionAnsweredListener() { public void onAnswered() { sendMetricForQuestion(activity, question); send.setEnabled(isSurveyValid()); } }); questions.addView(multiselectQuestionView); } } send.setEnabled(isSurveyValid()); // Force the top of the survey to be shown first. title.requestFocus(); }
From source file:at.ac.uniklu.mobile.sportal.WebViewActivity.java
@SuppressLint("SetJavaScriptEnabled") @Override//from ww w . j av a 2 s .co m protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String targetUrl = getIntent().getStringExtra(URL); if (targetUrl == null || targetUrl.length() == 0) { // if there's no URL, close the activity finish(); } setContentView(R.layout.webview); mActionBar = new ActionBarHelper(this).setupHeader().addActionRefresh(); // set header title or hide header if no title is given String title = getIntent().getStringExtra(TITLE); if (title != null) { ((TextView) findViewById(R.id.view_title)).setText(title); } else { findViewById(R.id.actionbar).setVisibility(View.GONE); } // Moodle 2.0 uses SSO/CAS authentication mSSO = getIntent().getBooleanExtra(SSO, false); // the moodle hack is only needed until Android 2.3 (or maybe 3.x? - not tested) // Android 4.0 has the redirect history entry problem solved if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) { mExecuteMoodleHack = getIntent().getBooleanExtra(MOODLE_HACK, false); } mWebView = (WebView) findViewById(R.id.web_view); //mWebView.setBackgroundColor(Color.BLACK); // black color messes up the CAS login page mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); // http://stackoverflow.com/questions/3998916/android-webview-leaves-space-for-scrollbar mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setLightTouchEnabled(true); mWebView.getSettings().setLoadWithOverviewMode(true); mWebView.getSettings().setBuiltInZoomControls(true); mWebView.getSettings().setUseWideViewPort(true); // setup custom webview client that shows a progress dialog while loading mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url.startsWith("https://sso.uni-klu.ac.at") || url.startsWith("https://sso.aau.at") || url.startsWith("https://campus.aau.at") || url.startsWith("https://moodle.aau.at")) { return false; } else if (url.startsWith("http://campus-gis.aau.at/")) { Log.d(TAG, "REDIRECT TO MAP"); String roomParameter = "curRouteTo="; int index = url.indexOf(roomParameter); if (index > -1) { MapUtils.openMapAndShowRoom(WebViewActivity.this, url.substring(index + roomParameter.length())); } return true; } // open external websites in browser Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); return true; } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { progressNotificationOn(); super.onPageStarted(view, url, favicon); } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { super.onReceivedError(view, errorCode, description, failingUrl); progressNotificationOff(); } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); progressNotificationOff(); /* * the first page of moodle opens through a redirect so we need to clear the first history * entry to avoid execution of the redirect when going back through the history with the back button */ if (mExecuteMoodleHack && mWebView.canGoBack()) { mWebView.clearHistory(); mExecuteMoodleHack = false; } else { mIsFirstPage = false; } } }); mWebView.setDownloadListener(new DownloadListener() { public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { Analytics.onEvent(Analytics.EVENT_WEB_COURSEMOODLE_DOWNLOAD); Uri uri = Uri.parse(url); MoodleDownloadHelper.download(WebViewActivity.this, uri, Utils.getContentDispositionOrUrlFilename(contentDisposition, uri)); } }); // set session cookie // http://stackoverflow.com/questions/1652850/android-webview-cookie-problem // http://android.joao.jp/2010/11/cookiemanager-and-removeallcookie.html if (Studentportal.getSportalClient().isSessionCookieAvailable()) { CookieSyncManager.createInstance(this); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true); //cookieManager.removeSessionCookie(); // NOTE when calling this method the cookies get removed after the next setCookie() gets called Cookie sessionCookie = Studentportal.getSportalClient().getSessionCookie(); cookieManager.setCookie(sessionCookie.getDomain(), Utils.cookieHeaderString(sessionCookie)); if (mSSO) { // set SSO/CAS cookie Cookie ssoCookie = Studentportal.getSportalClient().getCookie("CASTGC"); if (ssoCookie != null) { cookieManager.setCookie(ssoCookie.getDomain(), Utils.cookieHeaderString(ssoCookie)); } } CookieSyncManager.getInstance().sync(); } mIsFirstPage = true; mWebView.loadUrl(targetUrl); }
From source file:com.esource42.whyapp.utility.ImageDownloader.java
/** * Download the specified image from the Internet and binds it to the provided ImageView. The * binding is immediate if the image is found in the cache and will be done asynchronously * otherwise. A null bitmap will be associated to the ImageView if an error occurs. * * @param url The URL of the image to download. * @param imageView The ImageView to bind the downloaded image to. *//*from ww w.java2 s. co m*/ public void download(String url, ImageView imageView, ProgressBar progress) { resetPurgeTimer(); Bitmap bitmap = getBitmapFromCache(url); if (bitmap == null) { forceDownload(url, imageView, progress); } else { cancelPotentialDownload(url, imageView); imageView.setImageBitmap(bitmap); progress.setVisibility(View.GONE); } }
From source file:com.tlalexander.imptoggle.ElectricImpToggleActivity.java
/** Called when the activity is first created. */ @Override//from w ww. j ava2 s . c om public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); address = settings.getString("address", null); buttonOn = (Button) findViewById(R.id.buttonOn); buttonOn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { new postDataTask().execute("1"); } }); buttonOff = (Button) findViewById(R.id.buttonOff); buttonOff.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { new postDataTask().execute("0"); } }); buttonScan = (Button) findViewById(R.id.buttonScan); buttonScan.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { IntentIntegrator integrator = new IntentIntegrator(ElectricImpToggleActivity.this); integrator.initiateScan(IntentIntegrator.QR_CODE_TYPES); } }); if (address == null) { buttonOn.setVisibility(View.GONE); buttonOff.setVisibility(View.GONE); } }