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.ccxt.whl.activity.ChatActivity.java

/**
 * ?/*from   w w  w. ja v a 2s.c  om*/
 * 
 * @param view
 */
@Override
public void onClick(View view) {

    int id = view.getId();
    if (id == R.id.btn_send) {// ??(?)
        String s = mEditTextContent.getText().toString();
        sendText(s);
    } else if (id == R.id.btn_take_picture) {
        selectPicFromCamera();// 
    } else if (id == R.id.btn_picture) {
        selectPicFromLocal(); // 
    } else if (id == R.id.btn_location) { // ?
        startActivityForResult(new Intent(this, BaiduMapActivity.class), REQUEST_CODE_MAP);
    } else if (id == R.id.iv_emoticons_normal) { // 
        more.setVisibility(View.VISIBLE);
        iv_emoticons_normal.setVisibility(View.INVISIBLE);
        iv_emoticons_checked.setVisibility(View.VISIBLE);
        btnContainer.setVisibility(View.GONE);
        expressionContainer.setVisibility(View.VISIBLE);
        hideKeyboard();
    } else if (id == R.id.iv_emoticons_checked) { // ??
        iv_emoticons_normal.setVisibility(View.VISIBLE);
        iv_emoticons_checked.setVisibility(View.INVISIBLE);
        btnContainer.setVisibility(View.VISIBLE);
        expressionContainer.setVisibility(View.GONE);
        more.setVisibility(View.GONE);

    } else if (id == R.id.btn_video) {
        // ?
        Intent intent = new Intent(ChatActivity.this, ImageGridActivity.class);
        startActivityForResult(intent, REQUEST_CODE_SELECT_VIDEO);
    } else if (id == R.id.btn_file) { // 
        selectFileFromLocal();
    }
}

From source file:com.nit.vicky.StudyOptionsFragment.java

private void initAllContentViews(LayoutInflater inflater) {
    mStudyOptionsView = inflater.inflate(R.layout.studyoptions, null);
    Themes.setContentStyle(mStudyOptionsView, Themes.CALLER_STUDYOPTIONS);
    mTextDeckName = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_deck_name);
    mTextDeckDescription = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_deck_description);
    mButtonStart = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_start);
    mButtonQuiz = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_quiz);
    //        mButtonUp = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_limitup);
    //        mButtonDown = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_limitdown);
    //        mToggleLimitToggle = (ToggleButton) mStudyOptionsView.findViewById(R.id.studyoptions_limittoggle);

    // mToggleNight = (ToggleButton) mStudyOptionsView
    // .findViewById(R.id.studyoptions_night);
    // mToggle.setChecked(mInvertedColors);

    if (AnkiDroidApp.colIsOpen()
            && AnkiDroidApp.getCol().getDecks().isDyn(AnkiDroidApp.getCol().getDecks().selected())) {
        Button rebBut = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_rebuild_cram);
        rebBut.setOnClickListener(mButtonClickListener);
        Button emptyBut = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_empty_cram);
        emptyBut.setOnClickListener(mButtonClickListener);
        ((LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_cram_buttons))
                .setVisibility(View.VISIBLE);
    }//from w  w w  .j  ava 2s. co  m

    if (mFragmented) {
        Button but = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_options);
        but.setOnClickListener(mButtonClickListener);
        mFragmentedCram = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_new_filtercram);
        if (AnkiDroidApp.colIsOpen()
                && AnkiDroidApp.getCol().getDecks().isDyn(AnkiDroidApp.getCol().getDecks().selected())) {
            mFragmentedCram.setEnabled(false);
            mFragmentedCram.setVisibility(View.GONE);
        } else {
            // If we are in fragmented mode, then the cram option in menu applies to all decks, so we need an extra
            // button in StudyOptions side of screen to create dynamic deck filtered on this deck
            mFragmentedCram.setEnabled(true);
            mFragmentedCram.setVisibility(View.VISIBLE);
        }
        mFragmentedCram.setOnClickListener(mButtonClickListener);
    } else {
        mAddNote = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_add);
        if (AnkiDroidApp.colIsOpen()) {
            Collection col = AnkiDroidApp.getCol();
            if (col.getDecks().isDyn(col.getDecks().selected())) {
                mAddNote.setEnabled(false);
            }
        }
        mCardBrowser = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_card_browser);
        mStatisticsButton = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_statistics);
        mDeckOptions = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_options);
        mAddNote.setOnClickListener(mButtonClickListener);
        mCardBrowser.setOnClickListener(mButtonClickListener);
        mStatisticsButton.setOnClickListener(mButtonClickListener);
        mDeckOptions.setOnClickListener(mButtonClickListener);
    }

    mGlobalBar = (View) mStudyOptionsView.findViewById(R.id.studyoptions_global_bar);
    mGlobalMatBar = (View) mStudyOptionsView.findViewById(R.id.studyoptions_global_mat_bar);
    mBarsMax = (View) mStudyOptionsView.findViewById(R.id.studyoptions_progressbar_content);
    mTextTodayNew = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_new);
    mTextTodayLrn = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_lrn);
    mTextTodayRev = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_rev);
    mTextNewTotal = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_total_new);
    mTextTotal = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_total);
    mTextETA = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_eta);
    mSmallChart = (LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_mall_chart);

    mGlobalMatBar.setVisibility(View.INVISIBLE);
    mGlobalBar.setVisibility(View.INVISIBLE);

    mDeckCounts = (LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_deckcounts);
    mDeckChart = (LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_chart);

    mButtonStart.setOnClickListener(mButtonClickListener);
    mButtonQuiz.setOnClickListener(mButtonClickListener);
    //        mButtonUp.setOnClickListener(mButtonClickListener);
    //        mButtonDown.setOnClickListener(mButtonClickListener);
    //        mToggleLimitToggle.setOnClickListener(mButtonClickListener);
    // mToggleCram.setOnClickListener(mButtonClickListener);
    // mToggleNight.setOnClickListener(mButtonClickListener);

    // The view that shows the congratulations view.
    mCongratsView = inflater.inflate(R.layout.studyoptions_congrats, null);
    // The view that shows the learn more options
    mCustomStudyDetailsView = inflater.inflate(R.layout.styled_custom_study_details_dialog, null);
    mCustomStudyTextView1 = (TextView) mCustomStudyDetailsView.findViewById(R.id.custom_study_details_text1);
    mCustomStudyTextView2 = (TextView) mCustomStudyDetailsView.findViewById(R.id.custom_study_details_text2);
    mCustomStudyEditText = (EditText) mCustomStudyDetailsView.findViewById(R.id.custom_study_details_edittext2);

    Themes.setWallpaper(mCongratsView);

    mTextCongratsMessage = (TextView) mCongratsView.findViewById(R.id.studyoptions_congrats_message);
    Themes.setTextViewStyle(mTextCongratsMessage);

    mTextCongratsMessage.setOnClickListener(mButtonClickListener);
    mButtonCongratsUndo = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_undo);
    mButtonCongratsUnbury = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_unbury);
    mButtonCongratsCustomStudy = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_customstudy);
    mButtonCongratsOpenOtherDeck = (Button) mCongratsView
            .findViewById(R.id.studyoptions_congrats_open_other_deck);
    if (mFragmented) {
        mButtonCongratsOpenOtherDeck.setVisibility(View.GONE);
    }

    mButtonCongratsUndo.setOnClickListener(mButtonClickListener);
    mButtonCongratsUnbury.setOnClickListener(mButtonClickListener);
    mButtonCongratsCustomStudy.setOnClickListener(mButtonClickListener);
    mButtonCongratsOpenOtherDeck.setOnClickListener(mButtonClickListener);
}

From source file:com.pitchedapps.primenumbercalculator.Calculator.java

License:asdf

void afterAdvancedPad(View view) {
    enterReveal(view);
    findViewById(R.id.pad_advanced).setVisibility(View.INVISIBLE);
    findViewById(R.id.pad_advanced).startAnimation(fadeOutAnimation());
}

From source file:com.actionbarsherlock.internal.ActionBarSherlockCompat.java

private void showProgressBars(IcsProgressBar horizontalProgressBar, IcsProgressBar spinnyProgressBar) {
    final int features = mFeatures;//getLocalFeatures();
    if ((features & (1 << Window.FEATURE_INDETERMINATE_PROGRESS)) != 0
            && spinnyProgressBar.getVisibility() == View.INVISIBLE) {
        spinnyProgressBar.setVisibility(View.VISIBLE);
    }//from w w  w .j  a  v  a 2  s.c  o  m
    // Only show the progress bars if the primary progress is not complete
    if ((features & (1 << Window.FEATURE_PROGRESS)) != 0 && horizontalProgressBar.getProgress() < 10000) {
        horizontalProgressBar.setVisibility(View.VISIBLE);
    }
}

From source file:com.androidquery.AQuery.java

/**
 * Set view visibility to View.INVISIBLE.
 *
 * @return self//from   w w  w . j a  va 2s .  c  om
 */
public AQuery invisible() {

    /*
    if(view != null && view.getVisibility() != View.INVISIBLE){
       view.setVisibility(View.INVISIBLE);
    }
            
    return self();
    */
    return visibility(View.INVISIBLE);
}

From source file:fi.mikuz.boarder.gui.DropboxMenu.java

/**
 * Convenience function to change UI state based on being logged in
 *///from ww  w .  j a v a 2 s. c om
private void setLoggedIn(boolean loggedIn) {
    mLoggedIn = loggedIn;
    if (loggedIn) {
        mDropboxContent.setVisibility(View.VISIBLE);
        mAuthDropbox.setText("Unlink from Dropbox");
    } else {
        mDropboxContent.setVisibility(View.INVISIBLE);
        mAuthDropbox.setText("Link with Dropbox");
    }
}

From source file:org.openremote.android.console.AppSettingsActivity.java

/**
 * Auto discovery servers and add them in a list view.
 * Click a list item and make it as current server.
 * //from w  w  w  .  j a  v a2s  . c  o  m
 * @return the list view
 */
private ListView constructAutoServersView() {
    final ListView lv = new ListView(this);
    lv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 200));
    lv.setPadding(20, 5, 5, 10);
    lv.setBackgroundColor(0);
    lv.setCacheColorHint(0);
    lv.setItemsCanFocus(true);
    lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    final ArrayAdapter<String> serverListAdapter = new ArrayAdapter<String>(appSettingsView.getContext(),
            R.layout.server_list_item, new ArrayList<String>());
    lv.setAdapter(serverListAdapter);

    new IPAutoDiscoveryServer() {
        @Override
        protected void onProgressUpdate(Void... values) {
            if (progressLayout != null) {
                progressLayout.setVisibility(View.VISIBLE);
            }
        }

        @Override
        protected void onPostExecute(List<String> result) {
            int length = result.size();
            for (int i = 0; i < length; i++) {
                serverListAdapter.add(result.get(i));
            }
            if (length > 0) {
                lv.setItemChecked(0, true);
                currentServer = serverListAdapter.getItem(0);
                AppSettingsModel.setCurrentServer(AppSettingsActivity.this, currentServer);
            }
            if (progressLayout != null) {
                progressLayout.setVisibility(View.INVISIBLE);
            }
            requestPanelList();
            checkAuthentication();
            requestAccess();
        }
    }.execute((Void) null);

    lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            currentServer = (String) parent.getItemAtPosition(position);
            AppSettingsModel.setCurrentServer(AppSettingsActivity.this, currentServer);
            requestPanelList();
            checkAuthentication();
            requestAccess();
        }
    });

    return lv;
}

From source file:com.moonpi.swiftnotes.MainActivity.java

protected void deleteNote(Context context, final int position) {
    try {// w  w w . j a  v a2s  .  co  m
        new AlertDialog.Builder(context).setTitle(R.string.dialog_delete_title)
                .setMessage(getResources().getString(R.string.dialog_delete) + " '"
                        + notes.getJSONObject(position).getString("title") + "'?")
                .setPositiveButton(R.string.yes_button, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        JSONArray newArray = new JSONArray();

                        // Copy contents to new array, without the removed item
                        for (int i = 0; i < notes.length(); i++) {
                            if (i != position) {
                                try {
                                    newArray.put(notes.get(i));

                                } catch (JSONException e) {
                                    e.printStackTrace();
                                }
                            }
                        }

                        notes = newArray;
                        adapter.adapterData = notes;
                        adapter.notifyDataSetChanged();

                        try {
                            root.put("notes", notes);

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }

                        writeToJSON();

                        // If no notes, show 'Press + to add new note' text, invisible otherwise
                        if (notes.length() == 0)
                            noNotes.setVisibility(View.VISIBLE);

                        else
                            noNotes.setVisibility(View.INVISIBLE);

                        Toast toast = Toast.makeText(getApplicationContext(),
                                getResources().getString(R.string.toast_deleted), Toast.LENGTH_SHORT);
                        toast.show();
                    }
                }).setNegativeButton(R.string.no_button, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                    }
                }).show();

    } catch (JSONException e) {
        e.printStackTrace();
    }
}

From source file:com.hichinaschool.flashcards.anki.StudyOptionsFragment.java

private void initAllContentViews(LayoutInflater inflater) {
    mStudyOptionsView = inflater.inflate(R.layout.studyoptions, null);
    Themes.setContentStyle(mStudyOptionsView, Themes.CALLER_STUDYOPTIONS);
    mTextDeckName = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_deck_name);
    mTextDeckDescription = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_deck_description);
    mButtonStart = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_start);
    //        mButtonUp = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_limitup);
    //        mButtonDown = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_limitdown);
    //        mToggleLimitToggle = (ToggleButton) mStudyOptionsView.findViewById(R.id.studyoptions_limittoggle);

    // mToggleNight = (ToggleButton) mStudyOptionsView
    // .findViewById(R.id.studyoptions_night);
    // mToggle.setChecked(mInvertedColors);

    if (AnkiDroidApp.colIsOpen()
            && AnkiDroidApp.getCol().getDecks().isDyn(AnkiDroidApp.getCol().getDecks().selected())) {
        Button rebBut = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_rebuild_cram);
        rebBut.setOnClickListener(mButtonClickListener);
        Button emptyBut = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_empty_cram);
        emptyBut.setOnClickListener(mButtonClickListener);
        ((LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_cram_buttons))
                .setVisibility(View.VISIBLE);
    }// w w  w.j  av a2s.  c o m

    if (mFragmented) {
        Button but = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_options);
        but.setOnClickListener(mButtonClickListener);
        // HiChina
        //            mFragmentedCram = (Button) mStudyOptionsView.findViewById(R.id.studyoptions_new_filtercram);
        //            if (AnkiDroidApp.colIsOpen() && AnkiDroidApp.getCol().getDecks().isDyn(AnkiDroidApp.getCol().getDecks().selected())) {
        //                mFragmentedCram.setEnabled(false);
        //                mFragmentedCram.setVisibility(View.GONE);
        //            } else {
        //                // If we are in fragmented mode, then the cram option in menu applies to all decks, so we need an extra
        //                // button in StudyOptions side of screen to create dynamic deck filtered on this deck
        //                mFragmentedCram.setEnabled(true);
        //                mFragmentedCram.setVisibility(View.VISIBLE);
        //            }
        //            mFragmentedCram.setOnClickListener(mButtonClickListener);
    } else {
        mAddNote = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_add);
        if (AnkiDroidApp.colIsOpen()) {
            Collection col = AnkiDroidApp.getCol();
            if (col.getDecks().isDyn(col.getDecks().selected())) {
                mAddNote.setEnabled(false);
            }
        }
        // HiChina
        //            mCardBrowser = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_card_browser);
        //            mStatisticsButton = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_statistics);
        //            mDeckOptions = (ImageButton) mStudyOptionsView.findViewById(R.id.studyoptions_options);
        //            mAddNote.setOnClickListener(mButtonClickListener);
        //            mCardBrowser.setOnClickListener(mButtonClickListener);
        //            mStatisticsButton.setOnClickListener(mButtonClickListener);
        //            mDeckOptions.setOnClickListener(mButtonClickListener);
    }

    mGlobalBar = (View) mStudyOptionsView.findViewById(R.id.studyoptions_global_bar);
    mGlobalMatBar = (View) mStudyOptionsView.findViewById(R.id.studyoptions_global_mat_bar);
    mBarsMax = (View) mStudyOptionsView.findViewById(R.id.studyoptions_progressbar_content);
    mTextTodayNew = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_new);
    mTextTodayLrn = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_lrn);
    mTextTodayRev = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_rev);
    mTextNewTotal = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_total_new);
    mTextTotal = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_total);
    mTextETA = (TextView) mStudyOptionsView.findViewById(R.id.studyoptions_eta);
    mSmallChart = (LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_mall_chart);

    mGlobalMatBar.setVisibility(View.INVISIBLE);
    mGlobalBar.setVisibility(View.INVISIBLE);

    mDeckCounts = (LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_deckcounts);
    mDeckChart = (LinearLayout) mStudyOptionsView.findViewById(R.id.studyoptions_chart);

    mButtonStart.setOnClickListener(mButtonClickListener);
    //        mButtonUp.setOnClickListener(mButtonClickListener);
    //        mButtonDown.setOnClickListener(mButtonClickListener);
    //        mToggleLimitToggle.setOnClickListener(mButtonClickListener);
    // HiChina
    // mToggleCram.setOnClickListener(mButtonClickListener);
    // mToggleNight.setOnClickListener(mButtonClickListener);

    // The view that shows the congratulations view.
    mCongratsView = inflater.inflate(R.layout.studyoptions_congrats, null);
    // The view that shows the learn more options
    mCustomStudyDetailsView = inflater.inflate(R.layout.styled_custom_study_details_dialog, null);
    mCustomStudyTextView1 = (TextView) mCustomStudyDetailsView.findViewById(R.id.custom_study_details_text1);
    mCustomStudyTextView2 = (TextView) mCustomStudyDetailsView.findViewById(R.id.custom_study_details_text2);
    mCustomStudyEditText = (EditText) mCustomStudyDetailsView.findViewById(R.id.custom_study_details_edittext2);

    Themes.setWallpaper(mCongratsView);

    mTextCongratsMessage = (TextView) mCongratsView.findViewById(R.id.studyoptions_congrats_message);
    Themes.setTextViewStyle(mTextCongratsMessage);

    mTextCongratsMessage.setOnClickListener(mButtonClickListener);
    mButtonCongratsUndo = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_undo);
    mButtonCongratsUnbury = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_unbury);
    mButtonCongratsCustomStudy = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_customstudy);
    mButtonCongratsOpenOtherDeck = (Button) mCongratsView
            .findViewById(R.id.studyoptions_congrats_open_other_deck);
    if (mFragmented) {
        mButtonCongratsOpenOtherDeck.setVisibility(View.GONE);
    }

    mButtonCongratsUndo.setOnClickListener(mButtonClickListener);
    mButtonCongratsUnbury.setOnClickListener(mButtonClickListener);
    mButtonCongratsCustomStudy.setOnClickListener(mButtonClickListener);
    mButtonCongratsOpenOtherDeck.setOnClickListener(mButtonClickListener);
}

From source file:com.androidquery.AbstractAQuery.java

/**
 * Set view visibility to View.INVISIBLE.
 *
 * @return self/* ww w.ja  va 2s. c o m*/
 */
public T invisible() {

    /*
    if(view != null && view.getVisibility() != View.INVISIBLE){
       view.setVisibility(View.INVISIBLE);
    }
            
    return self();
    */
    return visibility(View.INVISIBLE);
}