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:jahirfiquitiva.iconshowcase.fragments.WallpapersFragment.java
@Override public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) { setHasOptionsMenu(true);//from ww w . java 2s. c om context = getActivity(); if (layout != null) { ViewGroup parent = (ViewGroup) layout.getParent(); if (parent != null) { parent.removeView(layout); } } try { layout = (ViewGroup) inflater.inflate(R.layout.wallpapers_section, container, false); } catch (InflateException e) { // Do nothing } int light = ContextCompat.getColor(context, R.color.drawable_tint_dark); int dark = ContextCompat.getColor(context, R.color.drawable_tint_light); noConnection = (ImageView) layout.findViewById(R.id.no_connected_icon); mProgress = (ProgressBar) layout.findViewById(R.id.progress); mRecyclerView = (RecyclerView) layout.findViewById(R.id.wallsGrid); fastScroller = (RecyclerFastScroller) layout.findViewById(R.id.rvFastScroller); mSwipeRefreshLayout = (SwipeRefreshLayout) layout.findViewById(R.id.swipeRefreshLayout); if (!ShowcaseActivity.wallsPicker) { showWallsAdviceDialog(getActivity()); } noConnection.setImageDrawable(new IconicsDrawable(context).icon(GoogleMaterial.Icon.gmd_cloud_off) .color(ThemeUtils.darkTheme ? light : dark).sizeDp(144)); noConnection.setVisibility(View.GONE); showProgressBar(); setupRecyclerView(false, 0); mRecyclerView.setVisibility(View.GONE); mSwipeRefreshLayout.setProgressBackgroundColorSchemeColor(ThemeUtils.darkTheme ? dark : light); mSwipeRefreshLayout.setColorSchemeResources( ThemeUtils.darkTheme ? R.color.dark_theme_accent : R.color.light_theme_accent, ThemeUtils.darkTheme ? R.color.dark_theme_accent : R.color.light_theme_accent, ThemeUtils.darkTheme ? R.color.dark_theme_accent : R.color.light_theme_accent); mSwipeRefreshLayout.setEnabled(false); setupLayout(false, getActivity(), noConnection); return layout; }
From source file:com.mycelium.wallet.simplex.SimplexMainActivity.java
/** Activity UI logic Start **/ private void setLayout(SimplexUITypes uiType) { _simplexUIType = uiType;/* w ww . j a v a 2s.c o m*/ switch (uiType) { case Loading: findViewById(R.id.llSimplexValidationWait).setVisibility(View.VISIBLE); findViewById(R.id.llSimplexLoadingProgress).setVisibility(View.GONE); findViewById(R.id.llSimplexErrorWrapper).setVisibility(View.GONE); break; case RetryLater: findViewById(R.id.llSimplexValidationWait).setVisibility(View.GONE); findViewById(R.id.llSimplexLoadingProgress).setVisibility(View.GONE); findViewById(R.id.llSimplexErrorWrapper).setVisibility(View.VISIBLE); } }
From source file:de.vanita5.twittnuker.activity.support.AccountSelectorActivity.java
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); mFirstCreated = savedInstanceState == null; mPreferences = getSharedPreferences(SHARED_PREFERENCES_NAME, MODE_PRIVATE); setContentView(R.layout.activity_account_selector); mAdapter = new AccountsAdapter(this); final boolean isSingleSelection = isSingleSelection(); mListView.setChoiceMode(isSingleSelection ? ListView.CHOICE_MODE_NONE : ListView.CHOICE_MODE_MULTIPLE); mAdapter.setChoiceMode(mListView.getChoiceMode()); mAdapter.setSortEnabled(false);//from w ww .j a v a 2 s. c o m if (isSingleSelection) { mListView.setOnItemClickListener(this); } mSelectAccountButtons.setVisibility(isSingleSelection ? View.GONE : View.VISIBLE); mListView.setAdapter(mAdapter); getLoaderManager().initLoader(0, null, this); }
From source file:com.vrem.wifianalyzer.wifi.accesspoint.AccessPointDetailTest.java
@Test public void testMakeViewFullWithVendorShortNotVisible() throws Exception { // setup//www .j a va 2s.co m WiFiDetail wiFiDetail = withWiFiDetail(SSID, new WiFiAdditional(StringUtils.EMPTY, false)); // execute View actual = fixture.makeView(null, null, wiFiDetail, false); // validate assertNull(actual.findViewById(R.id.vendorLong)); assertEquals(View.GONE, actual.findViewById(R.id.vendorShort).getVisibility()); }
From source file:com.cloverstudio.spika.utils.Utils.java
/** * /*from w w w.ja va2 s . com*/ * @param fileId * @param imageView * @param progressBar * @param size * @param stubId */ public static void displayImage(String fileId, ImageView imageView, ProgressBar progressBar, String size, int stubId, boolean downloadFromUrl) { if (fileId != null && !fileId.equals("null") && !fileId.equals("")) { ImageLoader.getImageLoader().DisplayImage(fileId, imageView, progressBar, size, downloadFromUrl); } else { ImageLoader.getImageLoader().cancelDisplayTaskFor(imageView); imageView.setImageResource(stubId); progressBar.setVisibility(View.GONE); } }
From source file:id.zelory.tanipedia.activity.KomoditasActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_komoditas); toolbar = (Toolbar) findViewById(R.id.anim_toolbar); setSupportActionBar(toolbar);/*from www . j a va2 s . c o m*/ getSupportActionBar().setDisplayHomeAsUpEnabled(true); CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar); collapsingToolbar.setTitle("Harga Komoditas"); animation = AnimationUtils.loadAnimation(this, R.anim.simple_grow); drawerLayout = (DrawerLayout) findViewById(R.id.nav_drawer); setUpNavDrawer(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.getMenu().getItem(3).setChecked(true); TextView nama = (TextView) navigationView.findViewById(R.id.nama); nama.setText(PrefUtils.ambilString(this, "nama")); TextView email = (TextView) navigationView.findViewById(R.id.email); email.setText(PrefUtils.ambilString(this, "email")); navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(MenuItem menuItem) { menuItem.setChecked(true); drawerLayout.closeDrawers(); Intent intent; switch (menuItem.getItemId()) { case R.id.cuaca: intent = new Intent(KomoditasActivity.this, CuacaActivity.class); break; case R.id.berita: intent = new Intent(KomoditasActivity.this, BeritaActivity.class); break; case R.id.tanya: intent = new Intent(KomoditasActivity.this, TanyaActivity.class); break; case R.id.harga: return true; case R.id.logout: PrefUtils.simpanString(KomoditasActivity.this, "nama", null); intent = new Intent(KomoditasActivity.this, LoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); return true; case R.id.tentang: intent = new Intent(KomoditasActivity.this, TentangActivity.class); startActivity(intent); return true; default: return true; } startActivity(intent); finish(); return true; } }); recyclerView = (RecyclerView) findViewById(R.id.scrollableview); recyclerView.setHasFixedSize(true); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(linearLayoutManager); imageHeader = (ImageView) findViewById(R.id.header); imageHeader.setVisibility(View.GONE); fabButton = (FabButton) findViewById(R.id.determinate); fabButton.showProgress(true); new DownloadData().execute(); fabButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { fabButton.showProgress(true); new DownloadData().execute(); } }); }
From source file:edu.sfsu.cs.orange.ocr.language.TranslateAsyncTask.java
@Override protected synchronized void onPostExecute(Boolean result) { super.onPostExecute(result); if (result) { //Log.i(TAG, "SUCCESS"); if (targetLanguageTextView != null) { targetLanguageTextView.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL), Typeface.NORMAL); }//from w w w .j a v a 2 s .c o m textView.setText(translatedText); textView.setVisibility(View.VISIBLE); textView.setTextColor(activity.getResources().getColor(R.color.translation_text)); // Crudely scale betweeen 22 and 32 -- bigger font for shorter text int scaledSize = Math.max(22, 32 - translatedText.length() / 4); textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, scaledSize); } else { Log.e(TAG, "FAILURE"); targetLanguageTextView.setTypeface(Typeface.defaultFromStyle(Typeface.ITALIC), Typeface.ITALIC); targetLanguageTextView.setText("Unavailable"); } // Turn off the indeterminate progress indicator if (progressView != null) { progressView.setVisibility(View.GONE); } }
From source file:com.intel.xdk.device.Device.java
@Override public void initialize(CordovaInterface cordova, final CordovaWebView webView) { super.initialize(cordova, webView); this.activity = cordova.getActivity(); this.webView = webView; //remote site support remoteLayout = new AbsoluteLayout(activity); remoteLayout.setBackgroundColor(Color.BLACK); //hide the remote site display until needed remoteLayout.setVisibility(View.GONE); //create the close button remoteClose = new ImageButton(activity); remoteClose.setBackgroundColor(Color.TRANSPARENT); Drawable remoteCloseImage = null;/*w w w . j a v a 2 s.c om*/ remoteCloseImage = activity.getResources().getDrawable( activity.getResources().getIdentifier("remote_close", "drawable", activity.getPackageName())); File remoteCloseImageFile = new File(activity.getFilesDir(), "_intelxdk/remote_close.png"); if (remoteCloseImageFile.exists()) { remoteCloseImage = (Drawable.createFromPath(remoteCloseImageFile.getAbsolutePath())); } else { remoteCloseImage = (activity.getResources().getDrawable( activity.getResources().getIdentifier("remote_close", "drawable", activity.getPackageName()))); } //set the button image //remoteClose.setImageDrawable(remoteCloseImage); remoteClose.setBackgroundDrawable(remoteCloseImage); //set up the button click action remoteClose.setOnClickListener(new OnClickListener() { public void onClick(View v) { closeRemoteSite(); } }); //add the close button remoteLayout.addView(remoteClose); final ViewGroup parent = (ViewGroup) webView.getEngine().getView().getParent(); activity.runOnUiThread(new Runnable() { public void run() { if (parent != null) { //add layout to activity root layout parent.addView(remoteLayout, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER)); } } }); //Initialize the orientation. lastOrientation = "unknown"; //Listen to the orientation change. OrientationEventListener listener = new OrientationEventListener(activity) { @Override public void onOrientationChanged(int orientation) { //Log.d("orientation","orientation: " + orientation); String currentOrientation = "unknown"; boolean orientationChanged = false; //int displayOrientation = 0; if (orientation > 345 || orientation < 15) { currentOrientation = "portrait"; displayOrientation = 0; } else if (orientation > 75 && orientation < 105) { currentOrientation = "landscape"; displayOrientation = 90; } else if (orientation > 165 && orientation < 195) { currentOrientation = "portrait"; displayOrientation = 180; } else if (orientation > 255 && orientation < 285) { currentOrientation = "landscape"; displayOrientation = -90; } if (currentOrientation.equals("unknown")) { currentOrientation = lastOrientation; } if (!currentOrientation.equals(lastOrientation)) { orientationChanged = true; Log.d("orientation", "Orientation changes from " + lastOrientation + " to " + currentOrientation + ", current orientation: " + orientation + "."); } if (orientationChanged) { String js = "javascript:try{intel.xdk.device.orientation='" + displayOrientation + "';}catch(e){}var e = document.createEvent('Events');e.initEvent('intel.xdk.device.orientation.change', true, true);e.success=true;e.orientation='" + displayOrientation + "';document.dispatchEvent(e);"; injectJS(js); } lastOrientation = currentOrientation; } }; listener.enable(); registerScreenStatusReceiver(); //cache references to methods for use in injectJS try { evaluateJavascript = webView.getClass().getMethod("evaluateJavascript", String.class, ValueCallback.class); } catch (Exception e) { } try { sendJavascript = webView.getClass().getMethod("sendJavascript", String.class); } catch (Exception e) { } emptyVC = new ValueCallback<String>() { @Override public void onReceiveValue(String s) { } }; }
From source file:sjizl.com.FileUploadTest2.java
@SuppressLint("NewApi") @Override/* ww w. j a v a2 s . co m*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.fileuploadtest2); //ac_image_grid TextView textView2_under_title; final ImageLoader imageLoader = ImageLoader.getInstance(); imageLoader.init(ImageLoaderConfiguration.createDefault(getApplicationContext())); progressBar_hole = (ProgressBar) findViewById(R.id.progressBar_hole); progressBar_hole.setVisibility(View.INVISIBLE); right_lin = (LinearLayout) findViewById(R.id.right_lin); middle_lin = (LinearLayout) findViewById(R.id.middle_lin); //right_lin.setBackgroundColor(Color.BLUE); right_lin = (LinearLayout) findViewById(R.id.right_lin); left_lin1 = (LinearLayout) findViewById(R.id.left_lin1); left_lin3 = (LinearLayout) findViewById(R.id.left_lin3); left_lin4 = (LinearLayout) findViewById(R.id.left_lin4); middle_lin = (LinearLayout) findViewById(R.id.middle_lin); textView2_under_title = (TextView) findViewById(R.id.textView2_under_title); ((LinearLayout) textView2_under_title.getParent()).removeView(textView2_under_title); textView2_under_title.setVisibility(View.GONE); ImageView imageView2_dashboard = (ImageView) findViewById(R.id.imageView2_dashboard); if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } Button upload_photo0 = (Button) findViewById(R.id.upload_photo0); Button upload_photo1 = (Button) findViewById(R.id.upload_photo1); Button upload_photo2 = (Button) findViewById(R.id.upload_photo2); upload_photo0.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "UploadActivity!", Toast.LENGTH_LONG).show(); Intent dashboard = new Intent(getApplicationContext(), UploadActivity.class); startActivity(dashboard); } }); upload_photo1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "FileChooserExampleActivity!", Toast.LENGTH_LONG).show(); Intent dashboard = new Intent(getApplicationContext(), FileChooserExampleActivity.class); startActivity(dashboard); } }); upload_photo2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "FileChooserExampleActivity!", Toast.LENGTH_LONG).show(); Intent dashboard = new Intent(getApplicationContext(), FileChooserExampleActivity.class); startActivity(dashboard); } }); final ImageView left_button; left_button = (ImageView) findViewById(R.id.imageView1_back); Brows(); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //startImagePagerActivity(position); Intent dashboard = new Intent(getApplicationContext(), ProfileActivity.class); dashboard.putExtra("user", naam); dashboard.putExtra("user_foto", foto); dashboard.putExtra("user_foto_num", foto_num); startActivity(dashboard); } }); CommonUtilities u = new CommonUtilities(); u.setHeaderConrols(getApplicationContext(), this, right_lin, left_lin3, left_lin4, left_lin1, left_button); ; }