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.codebutler.farebot.activities.AddKeyActivity.java
@Override protected void onNewIntent(Intent intent) { Tag tag = (Tag) intent.getParcelableExtra("android.nfc.extra.TAG"); mTagId = Utils.getHexString(tag.getId(), ""); if (ArrayUtils.contains(tag.getTechList(), "android.nfc.tech.MifareClassic")) { mCardType = "MifareClassic"; ((TextView) findViewById(R.id.card_type)).setText("MIFARE Classic"); ((TextView) findViewById(R.id.card_id)).setText(mTagId); ((TextView) findViewById(R.id.key_data)).setText(Utils.getHexString(mKeyData, "").toUpperCase()); findViewById(R.id.directions).setVisibility(View.GONE); findViewById(R.id.info).setVisibility(View.VISIBLE); findViewById(R.id.add).setVisibility(View.VISIBLE); } else {//from w w w.j ava 2 s . c o m new AlertDialog.Builder(this).setMessage(R.string.card_keys_not_supported) .setPositiveButton(android.R.string.ok, null).show(); } }
From source file:com.ratebeer.android.gui.fragments.OfflineRatingsFragment.java
private void loadRatings() { // Get ratings from database List<OfflineRating> result; try {//from w w w. ja va2 s . co m result = offlineRatingDao.queryForAll(); } catch (SQLException e) { // Not available! publishException(emptyText, getString(R.string.rate_offline_notavailable)); return; } // Show in list view if (ratingsView.getAdapter() == null) { ratingsView.setAdapter(new OfflineRatingsAdapter(getActivity(), result)); } else { ((OfflineRatingsAdapter) ratingsView.getAdapter()).replace(result); } ratingsView.setVisibility(result.size() == 0 ? View.GONE : View.VISIBLE); emptyText.setVisibility(result.size() == 0 ? View.VISIBLE : View.GONE); }
From source file:com.example.hifadhi.utils.CacheImageDownloader.java
/** * Same as download but the image is always downloaded and the cache is not * used. Kept private at the moment as its interest is not clear. *//*from w w w. ja v a2 s.c o m*/ private void forceDownload(final String url, final ImageView imageView, final String cookie) { // State sanity: url is guaranteed to never be null in // DownloadedDrawable and cache keys. if (url == null) { imageView.setImageDrawable(null); imageView.setVisibility(View.GONE); return; } if (CacheImageDownloader.cancelPotentialDownload(url, imageView)) { final BitmapDownloaderTask task = new BitmapDownloaderTask(imageView); final DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task); imageView.setImageDrawable(downloadedDrawable); task.execute(url, cookie); } }
From source file:com.grupohqh.carservices.operator.ManipulateCarActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_manipulate_car); if (getIntent().getExtras().containsKey("userId")) userId = getIntent().getExtras().getInt("userId"); if (getIntent().getExtras().containsKey("carOwnerId")) carOwnerId = getIntent().getExtras().getInt("carOwnerId"); CARBRAND_URL = getString(R.string.base_url) + getString(R.string.carbrands_url); CARLINE_URL = getString(R.string.base_url) + getString(R.string.carmodels_url); SAVECAR_URL = getString(R.string.base_url) + "savecar/"; SAVEPHOTO_URL = getString(R.string.base_url) + "savephoto/"; hasCamera = this.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY); etTagNumber = (EditText) findViewById(R.id.etTagNumber); etUsernameOwner = (EditText) findViewById(R.id.etUsernameOwner); etCarBrand = (EditText) findViewById(R.id.etCarBrand); etCarModel = (EditText) findViewById(R.id.etCarModel); etCarYear = (EditText) findViewById(R.id.etCarYear); etColor = (EditText) findViewById(R.id.etCarColor); etSerialNumber = (EditText) findViewById(R.id.etSerialNumber); etLicensePlate = (EditText) findViewById(R.id.etLicensePlate); etKM = (EditText) findViewById(R.id.etKm); imgCar = (ImageView) findViewById(R.id.imgCar); spCarBrand = (Spinner) findViewById(R.id.spCarBrand); spCarModel = (Spinner) findViewById(R.id.spCarModel); btnSaveCar = (Button) findViewById(R.id.btnSaveCar); btnTakePicture = (Button) findViewById(R.id.btnTakePicture); bar = (ProgressBar) findViewById(R.id.progressBar); viewUsername = findViewById(R.id.viewUsername); if (savedInstanceState != null) { bm = savedInstanceState.getParcelable("bm"); if (bm != null) imgCar.setImageBitmap(bm);// w w w . j av a 2 s . co m } bar.setVisibility(View.GONE); etCarBrand.setVisibility(View.GONE); etCarModel.setVisibility(View.GONE); viewUsername.setVisibility(carOwnerId == 0 ? View.VISIBLE : View.GONE); btnTakePicture.setEnabled(hasCamera); btnTakePicture.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(getTempFile(ManipulateCarActivity.this))); startActivityForResult(intent, CAPTURE_IMAGE); } }); btnSaveCar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (validate()) new SaveCarAsyncTask().execute(SAVECAR_URL); } }); spCarBrand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position == 0) ((TextView) parent.getChildAt(position)).setTextColor(Color.GRAY); if (mapBrands.get(brands.get(position)) == otherId) { etCarBrand.setVisibility(View.VISIBLE); etCarModel.setVisibility(View.VISIBLE); spCarModel.setVisibility(View.GONE); etCarBrand.requestFocus(); } else { etCarBrand.setVisibility(View.GONE); etCarModel.setVisibility(View.GONE); spCarModel.setVisibility(View.VISIBLE); new LoadCarModelsAsyncTask().execute(CARLINE_URL + mapBrands.get(brands.get(position)) + "/"); reload = true; } } @Override public void onNothingSelected(AdapterView<?> parent) { } }); spCarModel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (position == 0) ((TextView) parent.getChildAt(position)).setTextColor(Color.GRAY); if (mapModels.get(models.get(position)) == otherId) { etCarModel.setVisibility(View.VISIBLE); etCarModel.requestFocus(); } else { etCarModel.setVisibility(View.GONE); } } @Override public void onNothingSelected(AdapterView<?> parent) { } }); if (useMiniMe) { manager = (UsbManager) getSystemService(Context.USB_SERVICE); usbCommunication = UsbCommunication.newInstance(); IntentFilter filter = new IntentFilter(); filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); // will intercept by system filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); filter.addAction(ACTION_USB_PERMISSION); registerReceiver(usbReceiver, filter); etEPC = (EditText) findViewById(R.id.etEPC); btnReadTAG = (Button) findViewById(R.id.btnReadTAG); txtStatus = (TextView) findViewById(R.id.txtStatus); btnReadTAG.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { etEPC.setText(""); if (txtStatus.getText().toString().equals("conectado")) { readTag(); } else { Toast.makeText(getBaseContext(), "dispositivo " + txtStatus.getText(), Toast.LENGTH_LONG) .show(); } } }); } etKM.addTextChangedListener(new NumberTextWatcher(etKM)); }
From source file:com.gmail.at.faint545.fragments.QueueFragment.java
private void refreshQueue() { loadingStub.setVisibility(View.VISIBLE); // Make progress bar visible getListView().setVisibility(View.GONE); downloadQueue(null); }
From source file:com.ronnyml.sweetplayer.fragments.SearchFragment.java
@Override public void onUpOrCancelMotionEvent(ScrollState scrollState) { if (scrollState == ScrollState.UP) { if (MainActivity.actionBar.isShowing()) { MainActivity.actionBar.hide(); }//ww w .java 2 s.c o m if (mTopArtistsLayout.isShown()) { mTopArtistsLayout.setVisibility(View.GONE); } if (PlayerFragment.playerRelativeLayout.isShown()) { PlayerFragment.playerRelativeLayout.setVisibility(View.GONE); } } else if (scrollState == ScrollState.DOWN) { if (!MainActivity.actionBar.isShowing()) { MainActivity.actionBar.show(); } if (!mTopArtistsLayout.isShown() && !mArtists.isEmpty()) { mTopArtistsLayout.setVisibility(View.VISIBLE); } if (!PlayerFragment.playerRelativeLayout.isShown() && Globals.isPlayerServiceRunning) { PlayerFragment.playerRelativeLayout.setVisibility(View.VISIBLE); } } }
From source file:com.appolis.move.AcMoveDetails.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); languagePrefs = new LanguagePreferences(getApplicationContext()); setContentView(R.layout.move_details_layout); scanFlag = GlobalParams.BLANK_CHARACTER; activityIsRunning = true;//w w w .jav a 2 s . c o m initLayout(); if (bundle.containsKey(GlobalParams.BARCODE_MOVE)) { barCode = bundle.getString(GlobalParams.BARCODE_MOVE); checkLP = bundle.getString(GlobalParams.CHECK_LP_OR_NOT_LP); if (checkLP.equalsIgnoreCase(GlobalParams.TRUE)) { GetLPDataAsyncTask getLPDataAsyncTask = new GetLPDataAsyncTask(); getLPDataAsyncTask.execute(); et_move_to.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!checkSocket) { if (hasFocus) { imgScan.setVisibility(View.VISIBLE); checkLotFocus = false; checkFromFocus = false; checkToFocus = true; } else { imgScan.setVisibility(View.GONE); } } else { if (hasFocus) { checkLotFocus = false; checkFromFocus = false; checkToFocus = true; } } } }); } else { GetDataAsyncTask getDataAsyncTask = new GetDataAsyncTask(); getDataAsyncTask.execute(); edtLotValue.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!checkSocket) { if (hasFocus) { imgScan.setVisibility(View.VISIBLE); checkLotFocus = true; checkFromFocus = false; checkToFocus = false; } else { imgScan.setVisibility(View.GONE); } } else { if (hasFocus) { checkLotFocus = true; checkFromFocus = false; checkToFocus = false; } } } }); edt_move_from.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!checkSocket) { if (hasFocus) { imgScan.setVisibility(View.VISIBLE); checkLotFocus = false; checkFromFocus = true; checkToFocus = false; } else { imgScan.setVisibility(View.GONE); } } else { if (hasFocus) { checkLotFocus = false; checkFromFocus = true; checkToFocus = false; } } } }); et_move_to.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!checkSocket) { if (hasFocus) { imgScan.setVisibility(View.VISIBLE); checkLotFocus = false; checkFromFocus = false; checkToFocus = true; } else { imgScan.setVisibility(View.GONE); } } else { if (hasFocus) { checkLotFocus = false; checkFromFocus = false; checkToFocus = true; } } } }); } } }
From source file:com.openerp.MainActivity.java
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mDBTables = new ArrayList<String>(); getActionBar().setIcon(R.drawable.ic_launcher); if (savedInstanceState != null) { mDrawerItemSelectedPosition = savedInstanceState.getInt("current_drawer_item"); }/*from w ww . j a v a 2s .c o m*/ mContext = this; mFragment = getSupportFragmentManager(); if (findViewById(R.id.fragment_detail_container) != null) { findViewById(R.id.fragment_detail_container).setVisibility(View.GONE); mTwoPane = true; } init(); }