Example usage for android.view View INVISIBLE

List of usage examples for android.view View INVISIBLE

Introduction

In this page you can find the example usage for android.view View INVISIBLE.

Prototype

int INVISIBLE

To view the source code for android.view View INVISIBLE.

Click Source Link

Document

This view is invisible, but it still takes up space for layout purposes.

Usage

From source file:com.fabioarias.ui.Store.java

/**
 * This method is called to initiate the view components and to apply
 * listeners to view components.//from  w  ww  .java 2s .  com
 * 
 * @param v
 *            the container view
 */
private void setupViewComponents(View v) {
    ListView grid = (ListView) v.findViewById(R.id.list);
    Button checkout = (Button) v.findViewById(R.id.checkout);
    Button cancelar = (Button) v.findViewById(R.id.cancelar);
    ImageButton scanInvoice = (ImageButton) v.findViewById(R.id.scanButton_1);
    ImageButton scanVendor = (ImageButton) v.findViewById(R.id.scanButton_2);
    scanVendor.setVisibility(View.INVISIBLE);
    ImageButton scanCashier = (ImageButton) v.findViewById(R.id.scanButton_3);
    scanCashier.setVisibility(View.INVISIBLE);
    codigoVendedor = (EditText) v.findViewById(R.id.codigoVendedor);
    codigoVendedor.setVisibility(View.INVISIBLE);
    codigoCajero = (EditText) v.findViewById(R.id.codigoCajero);
    codigoCajero.setVisibility(View.INVISIBLE);
    numeroBoleta = (EditText) v.findViewById(R.id.numeroBoleta);
    if (((MainActivity) getActivity()).getFactura() != null) {
        numeroBoleta.setText(((MainActivity) getActivity()).getFactura().getNumero());
    }
    if (((MainActivity) getActivity()).getStore_codigo_vendedor() != null) {
        codigoVendedor.setText(((MainActivity) getActivity()).getStore_codigo_vendedor());

    }
    if (((MainActivity) getActivity()).getStore_codigo_cajero() != null) {
        codigoCajero.setText(((MainActivity) getActivity()).getStore_codigo_cajero());
    }
    setTouchNClick(cancelar);
    setTouchNClick(checkout);
    setTouchNClick(scanInvoice);
    setTouchNClick(scanVendor);
    setTouchNClick(scanCashier);
    grid.setAdapter(new StoreAdapter(((MainActivity) getActivity()).getCart()));
}

From source file:com.google.android.panoramio.ImageGrid.java

private void initGridView() {
    setContentView(R.layout.image_grid);
    gridView = (GridView) findViewById(R.id.gridview);
    final ImageAdapter imageAdapter = new ImageAdapter(mContext);
    gridView.setAdapter(imageAdapter);/* w  w  w.  j  a  v a2s. co m*/
    progressBar = (ProgressBar) findViewById(R.id.a_progressbar);
    gridView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            // Create an intent to show a particular item.
            final Intent i = new Intent(ImageGrid.this, ViewImage.class);
            i.putExtra(ImageManager.PANORAMIO_ITEM_EXTRA, position);
            startActivity(i);
        }
    });
    gridView.setOnHierarchyChangeListener(new OnHierarchyChangeListener() {
        public void onChildViewAdded(View parent, View child) {
            progressBar.setVisibility(View.INVISIBLE);
            ((ViewGroup) parent).getChildAt(0).setSelected(true);
        }

        public void onChildViewRemoved(View parent, View child) {
        }
    });

    textView = (TextView) findViewById(R.id.place_name);
    textView.setText(query);
    PanoramioLeftNavService.getLeftNavBar(this);
    gridView.requestFocus();
}

From source file:com.developer4droid.contactslister.backend.image_load.EnhancedImageDownloader.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 holder The ImageView to bind the downloaded image to.
 *//*from w ww  . j a v a  2 s  .  c o  m*/
public void download(String url, ProgressImageView holder) {
    Bitmap bitmap = getBitmapFromCache(url, holder);

    if (bitmap == null) {
        forceDownload(url, holder);
    } else {
        cancelPotentialDownload(url, holder.imageView);
        holder.imageView.setImageBitmap(bitmap);
        holder.progress.setVisibility(View.INVISIBLE);
    }
}

From source file:com.microsoft.onedrive.apiexplorer.DeltaFragment.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final BaseApplication app = (BaseApplication) getActivity().getApplication();
    if (app.goToWifiSettingsIfDisconnected()) {
        return;/*from  w  w  w  .  ja  va2 s  . c  om*/
    }

    if (getArguments() != null) {
        mItemId = getArguments().getString(ARG_ITEM_ID);
        mItemName = getArguments().getString(ARG_ITEM_NAME_ID);
    }

    if (getView() != null) {
        getView().findViewById(android.R.id.progress).setVisibility(View.VISIBLE);
        getView().findViewById(R.id.json).setVisibility(View.INVISIBLE);
    }

    setHasOptionsMenu(true);
}

From source file:com.lepin.activity.MyCarVeficActivity.java

/**
 * ?//from  w  w  w . j  a va 2  s  .c o m
 */
public void loadCard() {
    final User user = util.getUser(MyCarVeficActivity.this);
    Car car = null;
    if (user != null) {
        car = user.getCar();
    }
    if (car != null) {
        if (car.getLicence() != null)// 
        {
            vfCard.setText(car.getLicence());
        }

        if (car.getState() != null)// ?
        {
            if (car.getState().equals(Car.STATE_AUDIT_UNPASS))// 
            {
                vfNum.setEnabled(true);
                vfTypeLayout.setEnabled(true);
                vfNum.requestFocus();
            } else if (car.getState().equals(Car.STATE_WAIT_AUDIT))// ?
            {
                vfNum.setEnabled(true);
                vfTypeLayout.setEnabled(true);
                vfNum.requestFocus();
            } else if (car.getState().equals(Car.STATE_AUDITING))// 
            {
                vfNum.setEnabled(false);
                vfTypeLayout.setEnabled(false);
                vfSelect.setVisibility(View.GONE);
                vfNum.setText(car.getCarNum());
                vfSubmit.setVisibility(View.INVISIBLE);
            } else if (car.getState().equals(Car.STATE_AUDITED))// ?
            {
                vfNum.setEnabled(false);
                vfTypeLayout.setEnabled(false);
                vfSelect.setVisibility(View.GONE);
                vfNum.setText(car.getCarNum());
                vfSubmit.setVisibility(View.INVISIBLE);
            }
        }
        if (car.getCarSize() != null) {
            if (car.getCarSize().equals(Car.CARSIZE_SMALL_CAR)) {
                vfType.setText(getString(R.string.car_vefic_small));
            } else if (car.getCarSize().equals(Car.CARSIZE_MIDSIZE_CAR)) {
                vfType.setText(getString(R.string.car_vefic_medium));
            } else if (car.getCarSize().equals(Car.CARSIZE_LARGE_CAR)) {
                vfType.setText(getString(R.string.car_vefic_large));
            } else {
                vfType.setText(getString(R.string.car_vefic_other));
            }
        }
    }
}

From source file:behsaman.storytellerandroid.ScreenSlidePageFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false);

    // Set the title view to show the page number.
    ((TextView) rootView.findViewById(android.R.id.text1)).setText(
            //getString(R.string.title_template_step, mPageNumber + 1));
            "Piece " + dataModel.getIndex());
    ((TextView) rootView.findViewById(R.id.textview_fragment_textviewer)).setText(this.dataModel.getText_val());

    final ImageView imgView = (ImageView) rootView.findViewById(R.id.imageViewComic);

    //Comics has picture as well
    if (storyType == STORY_TYPE.TEXT_ONLY)
        imgView.setVisibility(View.INVISIBLE);
    else {/*from ww w  . java 2s.co  m*/
        //Load picture
        //dataModel.get
        // Start downloading piece one and show progress bar
        ServerIO.getInstance().download(dataModel.getPicture_file_addr(), new MyBinaryHttpResponseHandler() {
            @Override
            public void onFailure(int statusCode, Header[] headers, byte[] binaryData, Throwable error) {
                Log.e(TAG, "FAILLLEEEDDD:" + error.getMessage() + "\tStatusCode:" + statusCode + "\tBinaryData:"
                        + binaryData);
                ServerIO.getInstance().connectionError(parentContext);
            }

            @Override
            public void onSuccess(int statusCode, Header[] headers, byte[] binaryData) {
                String dir = Utils.getCacheDir(parentContext).getAbsolutePath();
                File f = new File(
                        dir + "/" + dataModel.getStory_id().toString() + dataModel.getId().toString());
                try {
                    FileOutputStream writer = new FileOutputStream(f);
                    writer.write(binaryData);
                    writer.close();
                    FileInputStream inStream = new FileInputStream(f);
                    Bitmap bitmap_skip = BitmapFactory.decodeStream(inStream);
                    imgView.setImageBitmap(bitmap_skip);
                } catch (Exception e) {
                    Log.e(TAG, e.getMessage());
                }
            }
        });
    }

    return rootView;
}

From source file:fr.bde_eseo.eseomega.lacommande.OrderHistoryFragment.java

@Override
public void onResume() {
    super.onResume();
    firstDisplay = true;/*  www.  j a  v  a  2s  .c  o  m*/
    // Delay to update data
    run = true;

    if (progressBarToken != null)
        progressBarToken.setVisibility(View.INVISIBLE);
    if (fab != null)
        fab.setVisibility(View.VISIBLE);
    if (viewToken != null)
        viewToken.setVisibility(View.INVISIBLE);

    if (mHandler == null) {
        mHandler = new android.os.Handler();
        mHandler.postDelayed(updateTimerThread, RUN_START);
    } else {
        mHandler.removeCallbacks(updateTimerThread);
        mHandler.postDelayed(updateTimerThread, RUN_START);
    }
}

From source file:io.openkit.leaderboards.OKLeaderboardsFragment.java

private void getLeaderboards() {
    startedLeaderboardsRequest = true;// w  w w  . j a v  a 2  s. co  m

    spinnerBar.setVisibility(View.VISIBLE);

    //Get the leaderboards
    OKLeaderboard.getLeaderboards(new OKLeaderboardsListResponseHandler() {

        @Override
        public void onSuccess(List<OKLeaderboard> leaderboardList, int playerCount) {
            listAdapter = new OKLeaderboardsListAdapter(OKLeaderboardsFragment.this.getActivity(),
                    android.R.layout.simple_list_item_1, leaderboardList);

            numPlayers = playerCount;

            //Add a header to the list. Must be done before setting list adapter
            listHeaderTextView.setText(numPlayers + " Players");

            //Display the list
            OKLeaderboardsFragment.this.setListAdapter(listAdapter);
            listView.setVisibility(View.VISIBLE);
            spinnerBar.setVisibility(View.INVISIBLE);
        }

        @Override
        public void onFailure(Throwable e, JSONObject errorResponse) {
            spinnerBar.setVisibility(View.INVISIBLE);
            if (OKLeaderboardsFragment.this.getActivity() != null) {
                Toast toast = Toast.makeText(OKLeaderboardsFragment.this.getActivity(),
                        "Couldn't connect to server to get leaderboards", Toast.LENGTH_LONG);
                toast.show();
            }
        }
    });
}

From source file:com.fsa.en.dron.activity.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    RateThisApp.Config config = new RateThisApp.Config(5, 10);
    config.setTitle(R.string.my_own_title);
    config.setMessage(R.string.my_own_message);
    config.setYesButtonText(R.string.my_own_rate);
    config.setNoButtonText(R.string.my_own_thanks);
    config.setCancelButtonText(R.string.my_own_cancel);
    RateThisApp.init(config);/*from  w  ww  .j a v a  2 s  .  com*/
    RateThisApp.setCallback(new RateThisApp.Callback() {
        @Override
        public void onYesClicked() {
            final String appPackageName = getPackageName(); // getPackageName() from Context or Activity  object
            try {
                startActivity(
                        new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
            } catch (android.content.ActivityNotFoundException anfe) {
                startActivity(new Intent(Intent.ACTION_VIEW,
                        Uri.parse("http://play.google.com/store/apps/details?id=" + appPackageName)));
            }
        }

        @Override
        public void onNoClicked() {
            TastyToast.makeText(getApplicationContext(), "Vuelve pronto!", TastyToast.LENGTH_LONG,
                    TastyToast.INFO);
        }

        @Override
        public void onCancelClicked() {
            TastyToast.makeText(getApplicationContext(), "Prometo tomar mejores fotografias!",
                    TastyToast.LENGTH_LONG, TastyToast.ERROR);
        }
    });
    button = (Button) findViewById(R.id.button);
    button.setVisibility(View.INVISIBLE);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            checkConnection();
        }
    });
    BottomNavigationBar bottomNavigationBar = (BottomNavigationBar) findViewById(R.id.bottom_navigation_bar);
    bottomNavigationBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_RIPPLE);
    bottomNavigationBar.setMode(BottomNavigationBar.MODE_FIXED);
    bottomNavigationBar.setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC);
    bottomNavigationBar.setBarBackgroundColor(R.color.material_light_blue_800);
    bottomNavigationBar.setActiveColor(R.color.material_grey_900);
    bottomNavigationBar.setInActiveColor(R.color.material_blue_grey_200);
    bottomNavigationBar.addItem(new BottomNavigationItem(R.drawable.compose, "Mensaje"))
            .addItem(new BottomNavigationItem(R.drawable.sociales, "Sociales"))
            .addItem(new BottomNavigationItem(R.drawable.share, "Cuntale a un amigo")).initialise();
    bottomNavigationBar.setTabSelectedListener(new BottomNavigationBar.OnTabSelectedListener() {
        @Override
        public void onTabSelected(int position) {
            switch (position) {
            case 0:
                Intent email = new Intent(Intent.ACTION_SEND);
                email.putExtra(Intent.EXTRA_EMAIL, new String[] { "marceloespinoza00@gmail.com" });
                email.putExtra(Intent.EXTRA_SUBJECT, "Formosa en dron");
                email.putExtra(Intent.EXTRA_TEXT, "Dej tu mensaje");
                email.setType("message/rfc822");
                startActivity(Intent.createChooser(email, "Elige un cliente :"));
                break;
            case 1:
                Intent intent = new Intent(getApplication(), FacebookActivity.class);
                startActivity(intent);
                break;
            case 2:

                Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
                sharingIntent.setType("text/plain");
                sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Formosa en dron");
                sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT,
                        "https://play.google.com/store/apps/details?id=com.fsa.en.dron");
                startActivity(Intent.createChooser(sharingIntent, "Compartir via"));
                break;

            }

        }

        @Override
        public void onTabUnselected(int position) {

        }

        @Override
        public void onTabReselected(int position) {
            switch (position) {
            case 0:

                break;
            case 1:
                Intent intent = new Intent(getApplication(), FacebookActivity.class);
                startActivity(intent);
                break;
            case 2:

                break;

            }
        }
    });
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    LayoutInflater inflator = LayoutInflater.from(this);
    View v = inflator.inflate(R.layout.toolbar_title, null);
    Typeface budget = Typeface.createFromAsset(getAssets(), "fonts/Budget.otf");
    Typeface typographica = Typeface.createFromAsset(getAssets(), "fonts/TypoGraphica.otf");
    TextView mToolbarCustomTitle = (TextView) v.findViewById(R.id.title);
    TextView mToolbarCustomSubTitle = (TextView) v.findViewById(R.id.subtitle);
    mToolbarCustomTitle.setText("Formosa");
    mToolbarCustomSubTitle.setText("en dron");
    mToolbarCustomTitle.setTypeface(typographica);
    mToolbarCustomSubTitle.setTypeface(budget);
    getSupportActionBar().setCustomView(v);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            int id = item.getItemId();
            if (id == R.id.recargar) {
                checkConnection();
            }
            if (id == R.id.info) {
                showDialog();
            }
            return false;
        }
    });
    recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    recyclerView.addOnItemTouchListener(new GalleryAdapter.RecyclerTouchListener(getApplicationContext(),
            recyclerView, new GalleryAdapter.ClickListener() {
                @Override
                public void onClick(View view, int position) {
                    Bundle bundle = new Bundle();
                    bundle.putSerializable("images", images);
                    bundle.putInt("position", position);

                    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
                    SlideshowDialogFragment newFragment = SlideshowDialogFragment.newInstance();
                    newFragment.setArguments(bundle);
                    newFragment.show(ft, "slideshow");
                }

                @Override
                public void onLongClick(View view, int position) {

                }
            }));
    pDialog = new ProgressDialog(this);
    images = new ArrayList<>();
    mAdapter = new GalleryAdapter(getApplicationContext(), images);
    RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(getApplicationContext(), 2);
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setAdapter(mAdapter);

}

From source file:org.npr.android.news.NewsListAdapter.java

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
        convertView = inflater.inflate(R.layout.news_item, parent, false);
    }/*from  ww w .  j av a 2  s  .c  o  m*/

    Story story = getItem(position);

    ImageView image = (ImageView) convertView.findViewById(R.id.NewsItemImage);
    TextView teaser = (TextView) convertView.findViewById(R.id.NewsItemTeaserText);
    TextView name = (TextView) convertView.findViewById(R.id.NewsItemNameText);

    if (story != null) {
        image.setImageDrawable(getContext().getResources()
                .getDrawable(isPlayable(story) ? R.drawable.icon_listen_main : R.drawable.bullet));
        image.setVisibility(View.VISIBLE);
        name.setTypeface(headlineTypeface, Typeface.NORMAL);
        name.setText(story.toString());
        String teaserText = story.getMiniTeaser();
        if (teaserText == null) {
            teaserText = story.getTeaser();
        }
        if (teaserText != null && teaserText.length() > 0) {
            // Disable for now.
            //        teaser.setText(story.getTeaser());
            //        teaser.setVisibility(View.VISIBLE);
        } else {
            teaser.setVisibility(View.INVISIBLE);
        }
        teaser.setVisibility(View.GONE);
    } else {
        // null marker means it's the end of the list.
        image.setVisibility(View.INVISIBLE);
        teaser.setVisibility(View.INVISIBLE);
        name.setTypeface(Typeface.SANS_SERIF, Typeface.ITALIC);
        name.setText(R.string.msg_load_more);
    }
    return convertView;
}