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:com.speedtong.example.ui.account.LoginActivity.java
@Override public void onClick(View v) { switch (v.getId()) { case R.id.switch_regist_view: // HideSoftKeyboard(); LayoutParams lp = registButton.getLayoutParams(); lp.height = LayoutParams.MATCH_PARENT; registButton.setLayoutParams(lp); LayoutParams lp2 = loginButton.getLayoutParams(); lp2.height = DensityUtil.dip2px(54); loginButton.setLayoutParams(lp2); loginView.setVisibility(View.GONE); registView.setVisibility(View.VISIBLE); registButton.setEnabled(false);/* ww w. j a v a 2 s . c o m*/ loginButton.setEnabled(true); break; case R.id.switch_login_view: LayoutParams lp3 = loginButton.getLayoutParams(); lp3.height = LayoutParams.MATCH_PARENT; loginButton.setLayoutParams(lp3); LayoutParams lp4 = registButton.getLayoutParams(); lp4.height = DensityUtil.dip2px(54); registButton.setLayoutParams(lp4); registView.setVisibility(View.GONE); loginView.setVisibility(View.VISIBLE); registButton.setEnabled(true); loginButton.setEnabled(false); break; case R.id.experience_login_submit: hideSoftKeyboard(); if (TextUtils.isEmpty(mAccountEdt.getText()) || TextUtils.isEmpty(mPasswordEdt.getText())) { ToastUtil.showMessage(R.string.tips_login_accountpwd_null); return; } mPostingdialog = new ECProgressDialog(this, R.string.login_posting); mPostingdialog.show(); doLoginReuqest(mAccountEdt.getText().toString(), mPasswordEdt.getText().toString()); break; case R.id.text_right: //doAutoLogin(); break; } }
From source file:com.odoo.addons.customers.CustomerDetails.java
private void setMode(Boolean edit) { if (mMenu != null) { mMenu.findItem(R.id.menu_customer_detail_more).setVisible(!edit); mMenu.findItem(R.id.menu_customer_edit).setVisible(!edit); mMenu.findItem(R.id.menu_customer_save).setVisible(edit); mMenu.findItem(R.id.menu_customer_cancel).setVisible(edit); }/*from ww w . ja va 2s. com*/ int color = Color.DKGRAY; if (record != null) { color = OStringColorUtil.getStringColor(this, record.getString("name")); } if (edit) { if (extras != null) actionBar.setTitle(R.string.label_edit); else actionBar.setTitle(R.string.label_new); actionBar.setBackgroundDrawable(new ColorDrawable(color)); mForm = (OForm) findViewById(R.id.customerFormEdit); captureImage = (ImageView) findViewById(R.id.captureImage); captureImage.setOnClickListener(this); userImage = (ImageView) findViewById(android.R.id.icon1); findViewById(R.id.parallaxScrollView).setVisibility(View.GONE); findViewById(R.id.customerScrollViewEdit).setVisibility(View.VISIBLE); OField is_company = (OField) findViewById(R.id.is_company_edit); is_company.setOnValueChangeListener(this); } else { actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar_shade)); userImage = (ImageView) findViewById(android.R.id.icon); mForm = (OForm) findViewById(R.id.customerForm); findViewById(R.id.customerScrollViewEdit).setVisibility(View.GONE); findViewById(R.id.parallaxScrollView).setVisibility(View.VISIBLE); } setColor(color); }
From source file:com.microsoft.graph.connect.ConnectActivity.java
private void showConnectErrorUI() { mConnectButton.setVisibility(View.VISIBLE); mConnectProgressBar.setVisibility(View.GONE); mTitleTextView.setText(R.string.title_text_error); mTitleTextView.setVisibility(View.VISIBLE); mDescriptionTextView.setText(R.string.connect_text_error); mDescriptionTextView.setVisibility(View.VISIBLE); Toast.makeText(ConnectActivity.this, R.string.connect_toast_text_error, Toast.LENGTH_LONG).show(); }
From source file:com.svo.library.widget.RLWebBrowser.java
private void init(Context context) { this.context = context; View rootView = LayoutInflater.from(context).inflate(R.layout.web_browser, null); this.addView(rootView); layout_loading = (LinearLayout) rootView.findViewById(R.id.layout_loading); layout_loading.setVisibility(View.GONE); iv_refresh = (ImageView) rootView.findViewById(R.id.iv_refresh); iv_refresh.setOnClickListener(myClickListener); iv_stop = (ImageView) rootView.findViewById(R.id.iv_stop); iv_stop.setOnClickListener(myClickListener); iv_goback = (ImageView) rootView.findViewById(R.id.iv_goback); iv_goback.setOnClickListener(myClickListener); iv_more = (ImageView) rootView.findViewById(R.id.iv_more); iv_more.setOnClickListener(myClickListener); iv_goback.setEnabled(false);// w ww.j av a 2 s .c o m iv_goforward = (ImageView) rootView.findViewById(R.id.iv_goforward); iv_goforward.setOnClickListener(myClickListener); iv_goforward.setEnabled(false); webView = (WebView) rootView.findViewById(R.id.webView); webView.getSettings().setSupportZoom(true); webView.getSettings().setSaveFormData(false); webView.getSettings().setSavePassword(false); webView.getSettings().setPluginState(PluginState.ON); webView.getSettings().setUseWideViewPort(true); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setBlockNetworkLoads(false); webView.getSettings().setLoadWithOverviewMode(true); webView.getSettings().setRenderPriority(RenderPriority.HIGH); webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); webView.setWebChromeClient(myWebChromeClient); webView.setWebViewClient(myWebViewClient); webView.setOnTouchListener(myTouchListener); webView.setDownloadListener(myDownLoadListener); webView.removeJavascriptInterface("searchBoxJavaBredge_"); }
From source file:com.cloverstudio.spika.utils.BitmapManager.java
public void loadBitmap(final String url, final ImageView imageView, ProgressBar pbLoading) { imageViews.put(imageView, url);/*from w w w . j a va 2s .c om*/ Bitmap bitmap = getBitmapFromCache(url); // check in UI thread, so no concurrency issues if (bitmap != null) { if (smallImg) { imageView.setScaleType(ImageView.ScaleType.CENTER); } else { imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); } imageView.setImageBitmap(bitmap); if (pbLoading != null) pbLoading.setVisibility(View.GONE); } else { imageView.setImageBitmap(null); imageView.setBackgroundResource(R.color.loading_background); queueJob(url, imageView, pbLoading); } }
From source file:com.clearcenter.mobile_demo.mdAuthenticatorActivity.java
public void onCreate(Bundle bundle) { Log.i(TAG, "onCreate(" + bundle + ")"); super.onCreate(bundle); setContentView(R.layout.login_activity); account_manager = AccountManager.get(this); Log.i(TAG, "loading data from Intent"); final Intent intent = getIntent(); nickname = intent.getStringExtra(PARAM_NICKNAME); username = intent.getStringExtra(PARAM_USERNAME); hostname = intent.getStringExtra(PARAM_HOSTNAME); request_new_account = nickname == null; confirm_credentials = intent.getBooleanExtra(PARAM_CONFIRM_CREDENTIALS, false); Log.i(TAG, "new account? " + request_new_account + ", confirm credentials? " + confirm_credentials); scroll_view = (ScrollView) findViewById(R.id.scroll_view); message = (TextView) findViewById(R.id.message); nickname_label = (TextView) findViewById(R.id.nickname_label); nickname_edit = (EditText) findViewById(R.id.nickname_edit); nickname_label.setVisibility(request_new_account ? View.VISIBLE : View.GONE); nickname_edit.setVisibility(request_new_account ? View.VISIBLE : View.GONE); if (nickname != null) nickname_edit.setText(nickname); hostname_label = (TextView) findViewById(R.id.hostname_label); hostname_edit = (EditText) findViewById(R.id.hostname_edit); hostname_label.setVisibility(request_new_account ? View.VISIBLE : View.GONE); hostname_edit.setVisibility(request_new_account ? View.VISIBLE : View.GONE); if (hostname != null) hostname_edit.setText(hostname); username_label = (TextView) findViewById(R.id.username_label); username_edit = (EditText) findViewById(R.id.username_edit); username_label.setVisibility(request_new_account ? View.VISIBLE : View.GONE); username_edit.setVisibility(request_new_account ? View.VISIBLE : View.GONE); if (username != null) username_edit.setText(username); password_edit = (EditText) findViewById(R.id.password_edit); if (confirm_credentials) { String ns = Context.NOTIFICATION_SERVICE; NotificationManager notification_manager; notification_manager = (NotificationManager) getApplicationContext().getSystemService(ns); notification_manager.cancelAll(); Log.i(TAG, "TODO: Cancel all notifications?"); }/* www . ja v a2 s . c o m*/ if (!TextUtils.isEmpty(nickname)) nickname_edit.setText(nickname); if (request_new_account) message.setText(getText(R.string.login_activity_new_account)); else if (confirm_credentials) { message.setText(getText(R.string.login_activity_confirm_credentials)); } try { mdSSLUtil.DisableSecurity(); } catch (GeneralSecurityException e) { Toast.makeText(getApplicationContext(), e.getMessage(), 4).show(); } }
From source file:net.olejon.spotcommander.PlaylistsActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Allow landscape? if (!mTools.allowLandscape()) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // Intent/*from w w w . j av a2 s .c o m*/ final Intent intent = getIntent(); // Computer final long computerId = mTools.getSharedPreferencesLong( "WIDGET_" + intent.getStringExtra(WidgetLarge.WIDGET_LARGE_INTENT_EXTRA) + "_COMPUTER_ID"); final String[] computer = mTools.getComputer(computerId); // Layout setContentView(R.layout.activity_playlists); // Toolbar final Toolbar toolbar = (Toolbar) findViewById(R.id.playlists_toolbar); toolbar.setNavigationIcon(R.drawable.ic_close_white_24dp); toolbar.setTitle(getString(R.string.playlists_title)); setSupportActionBar(toolbar); // Progress bar mProgressBar = (ProgressBar) findViewById(R.id.playlists_progressbar); mProgressBar.setVisibility(View.VISIBLE); // Listview mListView = (ListView) findViewById(R.id.playlists_list); // Get playlists final Cache cache = new DiskBasedCache(getCacheDir(), 0); final Network network = new BasicNetwork(new HurlStack()); final RequestQueue requestQueue = new RequestQueue(cache, network); requestQueue.start(); final JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, computer[0] + "/playlists.php?get_playlists_as_json", null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { requestQueue.stop(); try { final ArrayList<String> playlistNames = new ArrayList<>(); final Iterator<?> iterator = response.keys(); while (iterator.hasNext()) { String key = (String) iterator.next(); playlistNames.add(key); } Collections.sort(playlistNames, new Comparator<String>() { @Override public int compare(String string1, String string2) { return string1.compareToIgnoreCase(string2); } }); for (String playlistName : playlistNames) { mPlaylistUris.add(response.getString(playlistName)); } final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(mContext, R.layout.activity_playlists_list_item, playlistNames); mProgressBar.setVisibility(View.GONE); mListView.setAdapter(arrayAdapter); mListView.setVisibility(View.VISIBLE); mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mTools.remoteControl(computerId, "shuffle_play_uri", mPlaylistUris.get(position)); finish(); } }); } catch (Exception e) { mProgressBar.setVisibility(View.GONE); final TextView textView = (TextView) findViewById(R.id.playlists_error); textView.setVisibility(View.VISIBLE); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { requestQueue.stop(); mProgressBar.setVisibility(View.GONE); final TextView textView = (TextView) findViewById(R.id.playlists_error); textView.setVisibility(View.VISIBLE); } }) { @Override public HashMap<String, String> getHeaders() { final HashMap<String, String> hashMap = new HashMap<>(); if (!computer[1].equals("") && !computer[2].equals("")) hashMap.put("Authorization", "Basic " + Base64.encodeToString((computer[1] + ":" + computer[2]).getBytes(), Base64.NO_WRAP)); return hashMap; } }; jsonObjectRequest.setRetryPolicy(new DefaultRetryPolicy(2500, 0, 0)); requestQueue.add(jsonObjectRequest); }
From source file:de.geeksfactory.opacclient.frontend.AccountEditActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(getLayoutResource()); setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); getSupportActionBar().setDisplayHomeAsUpEnabled(true); etLabel = (EditText) findViewById(R.id.etLabel); etName = (EditText) findViewById(R.id.etName); etPassword = (EditText) findViewById(R.id.etPassword); AccountDataSource data = new AccountDataSource(this); data.open();/*ww w .j a v a 2s .c om*/ account = data.getAccount(getIntent().getLongExtra(EXTRA_ACCOUNT_ID, -1)); if (account == null) { finish(); return; } data.close(); if (account.getLabel().equals(getString(R.string.default_account_name))) { etLabel.setText(""); } else { etLabel.setText(account.getLabel()); } etName.setText(account.getName()); etPassword.setText(account.getPassword()); try { lib = ((OpacClient) getApplication()).getLibrary(account.getLibrary()); if (findViewById(R.id.tvCity) != null) { TextView tvCity = (TextView) findViewById(R.id.tvCity); tvCity.setText(lib.getDisplayName()); } if (lib.getReplacedBy() != null && findViewById(R.id.rlReplaced) != null) { findViewById(R.id.rlReplaced).setVisibility(View.VISIBLE); findViewById(R.id.ivReplacedStore).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + lib.getReplacedBy())); startActivity(i); } catch (ActivityNotFoundException e) { Log.i("play", "no market installed"); } } }); } else if (findViewById(R.id.rlReplaced) != null) { findViewById(R.id.rlReplaced).setVisibility(View.GONE); } try { if (!lib.getData().getString("baseurl").contains("https") && findViewById(R.id.no_ssl) != null && lib.isAccountSupported()) { findViewById(R.id.no_ssl).setVisibility(View.VISIBLE); } else if (findViewById(R.id.no_ssl) != null) { findViewById(R.id.no_ssl).setVisibility(View.GONE); } } catch (Exception e) { } } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { ErrorReporter.handleException(e); e.printStackTrace(); } }
From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_trainer.SignTrainerActiveFragment.java
@Override protected void handleLoadRandomSignTaskOnPostExecute() { setVisibility(SignTrainerActiveFragment.this.questionViews, View.VISIBLE); setVisibility(SignTrainerActiveFragment.this.answerViews, View.GONE); this.signQuestionTextDetail.setText(this.currentSign.getNameLocaleDe()); }
From source file:kr.co.generic.wifianalyzer.wifi.AccessPointDetailTest.java
@Test public void testMakeViewFullWithVendorShortNotVisible() throws Exception { // setup//from ww w.ja va 2 s . com WiFiDetail wiFiDetail = withWiFiDetail(SSID, new WiFiAdditional(StringUtils.EMPTY, false)); // execute View actual = fixture.makeView(null, null, wiFiDetail, false); // validate assertNull(actual.findViewById(kr.co.generic.wifianalyzer.R.id.vendorLong)); assertEquals(View.GONE, actual.findViewById(kr.co.generic.wifianalyzer.R.id.vendorShort).getVisibility()); }