List of usage examples for android.view View INVISIBLE
int INVISIBLE
To view the source code for android.view View INVISIBLE.
Click Source Link
From source file:com.pandoroid.PandoroidPlayer.java
private void dismissSongHaltedProgress() { m_song_halted_reason = MediaPlaybackController.HALT_STATE_CLEAR; View progress = findViewById(R.id.progressUpdate); progress.setVisibility(View.INVISIBLE); }
From source file:com.purplefrog.glitchclocka.LearningReadout.java
public void updateReadoutFull() { nameW.setText(learningState.name);// www. j av a 2 s . c om if (false && learningState.skillIconURL != null && learningState.skillIconURL.length() > 0) { skillIconW.setImageURI(Uri.parse(learningState.skillIconURL)); } descriptionW.setText(learningState.description); Log.d(LOG_TAG, "configuring progress bar"); if (learningState.totalTime > 0) { progressBar.setMax(learningState.totalTime); ensureTimerRunning(); updateProgressTimeBar(); progressBar.setVisibility(View.VISIBLE); } else { progressBar.setVisibility(View.INVISIBLE); } }
From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_trainer.AbstractSignTrainerFragment.java
protected void setVisibility(View[] views, int visibility) { Validate.notNull(views, "View array is null!"); if (View.VISIBLE != visibility && View.INVISIBLE != visibility && View.GONE != visibility) { throw new IllegalArgumentException( "Visibility can either be View.VISIBLE, VIEW.INVISIBLE or View.GONE, but was: " + visibility); }/*from w w w. j av a 2s . c om*/ for (View view : views) { view.setVisibility(visibility); } }
From source file:com.netpace.expressit.fragment.MainGridFragment.java
private void fetchMediaFromRemote(final boolean refresh) { if (loading != null && !loading.isDone() && !loading.isCancelled()) return;/*w w w . j a va 2 s . c o m*/ if ((mediaArray.size() % AppConstants.MEDIA_CHUNK_SIZE) > 0 && refresh == false) return; if (!Util.isNetworkAvailable()) { Toast.makeText(getActivity(), R.string.no_internet_available, Toast.LENGTH_SHORT).show(); return; } int page = mediaArray.size() / AppConstants.MEDIA_CHUNK_SIZE; if (refresh) page = 0; loading = ADMediaSharingUtil.getRestClient(getActivity()) .load(AppConstants.DOMAIN_URL + AppConstants.GET_MEDIA_URL).setHeader("page", page + "") .setHeader("size", AppConstants.MEDIA_CHUNK_SIZE + "").asJsonArray().withResponse() .setCallback(new FutureCallback<Response<JsonArray>>() { @Override public void onCompleted(Exception arg0, Response<JsonArray> arg1) { if (arg0 == null && arg1.getHeaders().getResponseCode() == HttpStatus.SC_OK) { if (arg1.getResult().size() > 0) { if (refresh) mediaArray.clear(); Iterator<JsonElement> element = arg1.getResult().iterator(); Gson gson = new Gson(); while (element.hasNext()) { JsonElement jsonElement = (JsonElement) element.next(); Media media = gson.fromJson(jsonElement, Media.class); mediaArray.add(media); } updateGridViewData(mediaArray); } else { if (progressBar.isShown()) progressBar.setVisibility(View.INVISIBLE); Log.i(TAG, "Data not found...!!!"); mPullRefreshGridView.onRefreshComplete(); } } } }); }
From source file:com.pixplicity.castdemo.MainActivity.java
private void updateMessages() { if (mMessageListMessages.size() > 0) { mVgLogo.setVisibility(View.INVISIBLE); }/* www .ja v a 2 s . c o m*/ if (mMessageAdapter == null) { mMessageAdapter = new BaseAdapter() { @SuppressLint("InflateParams") @Override public View getView(int position, View convertView, ViewGroup parent) { View row; if (convertView == null) { LayoutInflater inflater = (LayoutInflater) getApplicationContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); row = inflater.inflate(R.layout.list_messages, null); } else { row = convertView; } /* TODO Message msg = getItem(position); row.getText1().setText(msg.username); row.getText2().setText(msg.message); */ ((TextView) row.findViewById(R.id.tv_username)).setText(mMessageListUsernames.get(position)); ((TextView) row.findViewById(R.id.tv_message)).setText(mMessageListMessages.get(position)); return row; } @Override public int getCount() { return mMessageListMessages.size(); } @Override public Message getItem(int position) { // TODO return mMessageList.get(position); return null; } @Override public long getItemId(int position) { return 0; } }; mLvMessages.setAdapter(mMessageAdapter); } }
From source file:com.example.vedantn.algaeestimator.MainActivity.java
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { //Listens to calcMethodSpinner if (parent == (AdapterView) findViewById(R.id.calcMethodSpinner)) { TextView selection = (TextView) view; Toast.makeText(this, selection.getText(), Toast.LENGTH_SHORT).show(); //For making unused components invisible from the main page when calculation mode is selected switch (position) { case 0: { resetView();//from w ww . ja va 2 s . com ((TextView) findViewById(R.id.lblSD)).setVisibility(View.INVISIBLE); ((EditText) findViewById(R.id.tbSD)).setVisibility(View.INVISIBLE); ((Spinner) findViewById(R.id.spinnerSD)).setVisibility(View.INVISIBLE); ((TextView) findViewById(R.id.lblDO)).setVisibility(View.INVISIBLE); ((EditText) findViewById(R.id.tbDO)).setVisibility(View.INVISIBLE); break; } case 1: { resetView(); ((TextView) findViewById(R.id.lblValueOfAlgal)).setVisibility(View.INVISIBLE); ((EditText) findViewById(R.id.tbValueOfAlgal)).setVisibility(View.INVISIBLE); break; } default: { resetView(); } } } //Sets the units for depth (m/f) if (parent == (AdapterView) findViewById(R.id.spinnerDepth)) { if (position == 1) flagDepth = 1; else flagDepth = 0; } //Sets the units for surface temperature (C/F) if (parent == (AdapterView) findViewById(R.id.spinnerStemp)) { if (position == 1) flagStemp = 1; else flagStemp = 0; } //Sets the units for bottom temperature (C/F) if (parent == (AdapterView) findViewById(R.id.spinnerBotTemp)) { if (position == 1) flagBottemp = 1; else flagBottemp = 0; } //Sets the units for Secchi Depth (m/f) if (parent == (AdapterView) findViewById(R.id.spinnerSD)) { if (position == 1) flagSD = 1; else flagSD = 0; } }
From source file:net.oschina.app.ui.MainActivity.java
private void initTabs() { MainTab[] tabs = MainTab.values();/*from w ww .j a v a2s.co m*/ final int size = tabs.length; for (int i = 0; i < size; i++) { MainTab mainTab = tabs[i]; TabSpec tab = mTabHost.newTabSpec(getString(mainTab.getResName())); View indicator = LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_indicator, null); TextView title = (TextView) indicator.findViewById(R.id.tab_title); Drawable drawable = this.getResources().getDrawable(mainTab.getResIcon()); title.setCompoundDrawablesWithIntrinsicBounds(null, drawable, null, null); if (i == 2) { indicator.setVisibility(View.INVISIBLE); mTabHost.setNoTabChangedTag(getString(mainTab.getResName())); } title.setText(getString(mainTab.getResName())); tab.setIndicator(indicator); tab.setContent(new TabContentFactory() { @Override public View createTabContent(String tag) { return new View(MainActivity.this); } }); mTabHost.addTab(tab, mainTab.getClz(), null); if (mainTab.equals(MainTab.ME)) { View cn = indicator.findViewById(R.id.tab_mes); mBvNotice = new BadgeView(MainActivity.this, cn); mBvNotice.setBadgePosition(BadgeView.POSITION_TOP_RIGHT); mBvNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10); mBvNotice.setBackgroundResource(R.drawable.notification_bg); mBvNotice.setGravity(Gravity.CENTER); } mTabHost.getTabWidget().getChildAt(i).setOnTouchListener(this); } }
From source file:net.openid.appauthdemo.TokenActivity.java
@MainThread private void displayAuthorized() { findViewById(R.id.authorized).setVisibility(View.VISIBLE); findViewById(R.id.not_authorized).setVisibility(View.GONE); findViewById(R.id.loading_container).setVisibility(View.GONE); AuthState state = mStateManager.getCurrent(); TextView refreshTokenInfoView = (TextView) findViewById(R.id.refresh_token_info); refreshTokenInfoView.setText((state.getRefreshToken() == null) ? R.string.no_refresh_token_returned : R.string.refresh_token_returned); TextView idTokenInfoView = (TextView) findViewById(R.id.id_token_info); idTokenInfoView//from w w w .ja v a 2 s. co m .setText((state.getIdToken()) == null ? R.string.no_id_token_returned : R.string.id_token_returned); TextView accessTokenInfoView = (TextView) findViewById(R.id.access_token_info); if (state.getAccessToken() == null) { accessTokenInfoView.setText(R.string.no_access_token_returned); } else { Long expiresAt = state.getAccessTokenExpirationTime(); if (expiresAt == null) { accessTokenInfoView.setText(R.string.no_access_token_expiry); } else if (expiresAt < System.currentTimeMillis()) { accessTokenInfoView.setText(R.string.access_token_expired); } else { String template = getResources().getString(R.string.access_token_expires_at); accessTokenInfoView.setText(String.format(template, DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss ZZ").print(expiresAt))); } } Button refreshTokenButton = (Button) findViewById(R.id.refresh_token); refreshTokenButton.setVisibility(state.getRefreshToken() != null ? View.VISIBLE : View.GONE); refreshTokenButton.setOnClickListener((View view) -> refreshAccessToken()); Button viewProfileButton = (Button) findViewById(R.id.view_profile); AuthorizationServiceDiscovery discoveryDoc = state.getAuthorizationServiceConfiguration().discoveryDoc; if (discoveryDoc == null || discoveryDoc.getUserinfoEndpoint() == null) { viewProfileButton.setVisibility(View.GONE); } else { viewProfileButton.setVisibility(View.VISIBLE); viewProfileButton.setOnClickListener((View view) -> fetchUserInfo()); } ((Button) findViewById(R.id.sign_out)).setOnClickListener((View view) -> signOut()); View userInfoCard = findViewById(R.id.userinfo_card); JSONObject userInfo = mUserInfoJson.get(); if (userInfo == null) { userInfoCard.setVisibility(View.INVISIBLE); } else { try { String name = "???"; if (userInfo.has("name")) { name = userInfo.getString("name"); } ((TextView) findViewById(R.id.userinfo_name)).setText(name); if (userInfo.has("picture")) { Glide.with(TokenActivity.this).load(Uri.parse(userInfo.getString("picture"))).fitCenter() .into((ImageView) findViewById(R.id.userinfo_profile)); } ((TextView) findViewById(R.id.userinfo_json)).setText(mUserInfoJson.toString()); userInfoCard.setVisibility(View.VISIBLE); } catch (JSONException ex) { Log.e(TAG, "Failed to read userinfo JSON", ex); } } }
From source file:com.example.caique.educam.Activities.TimelineActivity.java
private void retrievePosts(String user, String type) { mAsyncTask = new AsyncTask<String, Void, Request>() { private JSONObject rawJson = new JSONObject(); private Request checkReq = new Request(); @Override// w w w. j a v a 2s . c om protected void onPreExecute() { super.onPreExecute(); mProgressBar.setVisibility(View.VISIBLE); mProgressBar.setEnabled(true); } @Override protected Request doInBackground(String... strings) { try { if (!strings[0].isEmpty()) { rawJson.put("user", strings[0]); } if (!strings[1].isEmpty()) { rawJson.put("type", strings[1]); checkReq.setType(strings[1]); } checkReq.setResponse(POST(rawJson)); return checkReq; } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); Toast.makeText(getApplicationContext(), "Falha na conexo", Toast.LENGTH_SHORT).show(); } return null; } @Override protected void onPostExecute(Request request) { try { mProgressBar.setVisibility(View.INVISIBLE); mProgressBar.setEnabled(false); handleConnection(request); } catch (JSONException e) { e.printStackTrace(); } } }; mAsyncTask.execute(user, type); }
From source file:com.CloudRecognition.CloudReco.java
@Override protected void onPause() { Log.d(LOGTAG, "onPause"); super.onPause(); // Turn off the flash if (mFlashOptionView != null && mFlash) { // OnCheckedChangeListener is called upon changing the checked state if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { ((Switch) mFlashOptionView).setChecked(false); } else {/*from w w w . j a v a 2s. c o m*/ ((CheckBox) mFlashOptionView).setChecked(false); } } try { vuforiaAppSession.pauseAR(); } catch (SampleApplicationException e) { Log.e(LOGTAG, e.getString()); } // Pauses the OpenGLView if (mGlView != null) { mGlView.setVisibility(View.INVISIBLE); mGlView.onPause(); } }