Java Code Examples for android.widget.TextView.getVisibility()

The following are Jave code examples for showing how to use getVisibility() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: JavaIsFun   File: Classe.java   View Source Code Vote up 7 votes
public void ant(View view) {

        TextView texto1 = (TextView) findViewById(R.id.texto1);
        TextView texto2 = (TextView) findViewById(R.id.texto2);
        TextView texto3 = (TextView) findViewById(R.id.texto3);

        if (texto3.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto3).setVisibility(View.GONE);
            findViewById(R.id.texto2).setVisibility(View.VISIBLE);
        } else if (texto2.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto2).setVisibility(View.GONE);
            findViewById(R.id.texto1).setVisibility(View.VISIBLE);
            findViewById(R.id.ant).setVisibility(View.GONE);
            findViewById(R.id.prox).setVisibility(View.VISIBLE);

        }
    }
 
Example 2
Project: JavaIsFun   File: Condicao7.java   View Source Code Vote up 7 votes
public void avancarTxt(View view) {
    ImageView imageView44 = (ImageView) findViewById(R.id.imageView44);
    TextView exp2 = (TextView) findViewById(R.id.exp2);
    if(imageView44.getVisibility()==View.VISIBLE) {
        findViewById(R.id.voltar).setVisibility(View.VISIBLE);
        findViewById(R.id.proximo).setVisibility(View.GONE);
        findViewById(R.id.exp2).setVisibility(View.VISIBLE);
        findViewById(R.id.avancar).setVisibility(View.VISIBLE);
        findViewById(R.id.imageView44).setVisibility(View.GONE);
    }else
    if (exp2.getVisibility() == View.VISIBLE) {
        findViewById(R.id.voltar).setVisibility(View.VISIBLE);
        findViewById(R.id.proximo).setVisibility(View.VISIBLE);
        findViewById(R.id.exp3).setVisibility(View.VISIBLE);
        findViewById(R.id.exp2).setVisibility(View.GONE);
        findViewById(R.id.avancar).setVisibility(View.GONE);
        findViewById(R.id.imageView44).setVisibility(View.GONE);


    }
}
 
Example 3
Project: chromium-for-android-56-debug-video   File: SuggestionView.java   View Source Code Vote up 6 votes
/**
 * Sets a description line for the omnibox suggestion.
 *
 * @param str The description text.
 * @param isUrl Whether this text is a URL (as opposed to a normal string).
 */
private void showDescriptionLine(Spannable str, boolean isUrl) {
    TextView textLine = mContentsView.mTextLine2;
    if (textLine.getVisibility() != VISIBLE) {
        textLine.setVisibility(VISIBLE);
    }
    textLine.setText(str, BufferType.SPANNABLE);

    // Force left-to-right rendering for URLs. See UrlBar constructor for details.
    if (isUrl) {
        textLine.setTextColor(URL_COLOR);
        ApiCompatibilityUtils.setTextDirection(textLine, TEXT_DIRECTION_LTR);
    } else {
        textLine.setTextColor(getStandardFontColor());
        ApiCompatibilityUtils.setTextDirection(textLine, TEXT_DIRECTION_INHERIT);
    }
}
 
Example 4
Project: JavaIsFun   File: Classe.java   View Source Code Vote up 6 votes
public void prox(View view) {
    TextView texto1 = (TextView) findViewById(R.id.texto1);
    TextView texto2 = (TextView) findViewById(R.id.texto2);
    TextView texto3 = (TextView) findViewById(R.id.texto3);

    if (texto1.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto1).setVisibility(View.GONE);
        findViewById(R.id.texto2).setVisibility(View.VISIBLE);
        findViewById(R.id.ant).setVisibility(View.VISIBLE);
    } else if (texto2.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto2).setVisibility(View.GONE);
        findViewById(R.id.texto3).setVisibility(View.VISIBLE);
        findViewById(R.id.imageButton46).setVisibility(View.VISIBLE);
        findViewById(R.id.prox).setVisibility(View.GONE);
    }
}
 
Example 5
Project: JavaIsFun   File: Condicao7.java   View Source Code Vote up 6 votes
public void voltarTxt(View view) {
    findViewById(R.id.voltar).setVisibility(View.GONE);
    findViewById(R.id.avancar).setVisibility(View.VISIBLE);
    findViewById(R.id.imageView44).setVisibility(View.VISIBLE);
    TextView exp3 = (TextView) findViewById(R.id.exp3);
    if (exp3.getVisibility() == View.VISIBLE) {
        findViewById(R.id.voltar).setVisibility(View.VISIBLE);
        findViewById(R.id.proximo).setVisibility(View.VISIBLE);
        findViewById(R.id.exp3).setVisibility(View.GONE);
        findViewById(R.id.exp2).setVisibility(View.VISIBLE);
        findViewById(R.id.avancar).setVisibility(View.VISIBLE);
        findViewById(R.id.imageView44).setVisibility(View.GONE);


    }
}
 
Example 6
Project: JavaIsFun   File: Classe4.java   View Source Code Vote up 6 votes
public void prox(View view) {
    ImageView imageViewtop = (ImageView) findViewById(R.id.corretoerrado);
    ImageView classpeixe = (ImageView) findViewById(R.id.classpeixe);
    ImageView classcachorro = (ImageView) findViewById(R.id.classcachorro);
    ImageView classgato = (ImageView) findViewById(R.id.classgato);
    ImageView classabelha = (ImageView) findViewById(R.id.classabelha);
    TextView erradoabelha = (TextView) findViewById(R.id.erradoAbelha);
    TextView erradocachorro = (TextView) findViewById(R.id.erradoCachorro);
    TextView erradogato = (TextView) findViewById(R.id.erradoGato);
    imageViewtop.setVisibility(View.GONE);
    if (classabelha.getVisibility() == View.VISIBLE || erradoabelha.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classabelha).setVisibility(View.GONE);
        findViewById(R.id.classgato).setVisibility(View.VISIBLE);
        findViewById(R.id.antP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classgato.getVisibility() == View.VISIBLE || erradogato.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classgato).setVisibility(View.GONE);
        findViewById(R.id.classcachorro).setVisibility(View.VISIBLE);
        findViewById(R.id.antP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classcachorro.getVisibility() == View.VISIBLE || erradocachorro.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classcachorro).setVisibility(View.GONE);
        findViewById(R.id.classpeixe).setVisibility(View.VISIBLE);
        findViewById(R.id.proxP).setVisibility(View.GONE);
        findViewById(R.id.antP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    }
}
 
Example 7
Project: editor-sql   File: FloatingActionButton.java   View Source Code Vote up 5 votes
public int getLabelVisibility() {
    TextView labelView = getLabelView();
    if (labelView != null) {
        return labelView.getVisibility();
    }

    return -1;
}
 
Example 8
Project: MDWechat   File: FloatingActionButton.java   View Source Code Vote up 5 votes
public int getLabelVisibility() {
    TextView labelView = getLabelView();
    if (labelView != null) {
        return labelView.getVisibility();
    }

    return -1;
}
 
Example 9
Project: ChatExchange-old   File: FloatingActionButton.java   View Source Code Vote up 5 votes
public int getLabelVisibility() {
    TextView labelView = getLabelView();
    if (labelView != null) {
        return labelView.getVisibility();
    }

    return -1;
}
 
Example 10
Project: Toodoo   File: FloatingActionButton.java   View Source Code Vote up 5 votes
public int getLabelVisibility() {
    TextView labelView = getLabelView();
    if (labelView != null) {
        return labelView.getVisibility();
    }

    return -1;
}
 
Example 11
Project: SimpleRssReader   File: MainActivity.java   View Source Code Vote up 5 votes
private void onSearchViewQueryChange(final String query, final ImageButton navigateBack,
                               final TextView results) {
    final boolean isDarkThemeSelected = ThemeUtils.isDarkThemeSelected(this);
    final Drawable drawable;

    if (!TextUtils.isEmpty(query)) {
        if (isDarkThemeSelected) {
            drawable = getDrawable(R.drawable.ic_clear_white_24dp);
        } else {
            drawable = getDrawable(R.drawable.ic_clear_black_24dp);
        }
    } else {
        if (results.getVisibility() != View.INVISIBLE) {
            results.setVisibility(View.INVISIBLE);
        }

        if (isDarkThemeSelected) {
            drawable = getDrawable(R.drawable.ic_arrow_back_white_24dp);
        } else {
            drawable = getDrawable(R.drawable.ic_arrow_back_black_24dp);
        }
    }

    if (navigateBack.getDrawable() != drawable) {
        navigateBack.setImageDrawable(drawable);
    }

    if (mSearchResultsCursor != null && !mSearchResultsCursor.isEmpty()) {
        resetCardViewBackground(mSearchResultsCursor.getAll(), List.class);
        mSearchResultsCursor = null;
    }
}
 
Example 12
Project: SimpleRssReader   File: MainActivity.java   View Source Code Vote up 5 votes
private void showSearchViewCursorPosition(final TextView results) {
    if (mSearchResultsCursor != null) {
        final String currentPosition = mSearchResultsCursor.toString();

        if (!TextUtils.isEmpty(currentPosition)) {
            if (results.getVisibility() != View.VISIBLE) {
                results.setVisibility(View.VISIBLE);
            }
            results.setText(currentPosition);
        }
    }
}
 
Example 13
Project: decoy   File: SettingsAdapter.java   View Source Code Vote up 5 votes
private void setTextView(TextView textView, String value) {
    if(textView == null || TextUtils.isEmpty(value)) {
        return;
    }
    if(textView.getVisibility() != View.VISIBLE) {
        textView.setVisibility(View.VISIBLE);
    }
    textView.setText(value);
}
 
Example 14
Project: JavaIsFun   File: Classe4.java   View Source Code Vote up 5 votes
public void ant(View view) {
    ImageView imageViewtop = (ImageView) findViewById(R.id.corretoerrado);

    TextView textocorreto = (TextView) findViewById(R.id.textCorreto);
    TextView erradocachorro = (TextView) findViewById(R.id.erradoCachorro);
    TextView erradogato = (TextView) findViewById(R.id.erradoGato);
    ImageView classpeixe = (ImageView) findViewById(R.id.classpeixe);
    ImageView classcachorro = (ImageView) findViewById(R.id.classcachorro);
    ImageView classgato = (ImageView) findViewById(R.id.classgato);
    ImageView classabelha = (ImageView) findViewById(R.id.classabelha);


    if (classgato.getVisibility() == View.VISIBLE || erradogato.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classgato).setVisibility(View.GONE);
        findViewById(R.id.classabelha).setVisibility(View.VISIBLE);
        findViewById(R.id.antP).setVisibility(View.GONE);
        findViewById(R.id.proxP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classcachorro.getVisibility() == View.VISIBLE || erradocachorro.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classcachorro).setVisibility(View.GONE);
        findViewById(R.id.classgato).setVisibility(View.VISIBLE);
        findViewById(R.id.proxP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);
    } else if (classpeixe.getVisibility() == View.VISIBLE || textocorreto.getVisibility() == View.VISIBLE) {
        findViewById(R.id.classpeixe).setVisibility(View.GONE);
        findViewById(R.id.classcachorro).setVisibility(View.VISIBLE);
        findViewById(R.id.proxP).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        imageViewtop.setVisibility(View.GONE);

    }

}
 
Example 15
Project: JavaIsFun   File: Classe2.java   View Source Code Vote up 5 votes
public void prox(View view) {
    TextView texto1 = (TextView) findViewById(R.id.texto1);
    TextView texto2 = (TextView) findViewById(R.id.texto2);
    TextView texto3 = (TextView) findViewById(R.id.texto3);
    TextView texto4 = (TextView) findViewById(R.id.texto4);
    TextView texto5 = (TextView) findViewById(R.id.texto5);
    TextView texto6 = (TextView) findViewById(R.id.texto6);
    TextView texto7 = (TextView) findViewById(R.id.texto7);

    if (texto1.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto1).setVisibility(View.GONE);
        findViewById(R.id.texto2).setVisibility(View.VISIBLE);
        findViewById(R.id.ant).setVisibility(View.VISIBLE);
    } else if (texto2.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto2).setVisibility(View.GONE);
        findViewById(R.id.texto3).setVisibility(View.VISIBLE);
    } else if (texto3.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto3).setVisibility(View.GONE);
        findViewById(R.id.texto4).setVisibility(View.VISIBLE);
    } else if (texto4.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto4).setVisibility(View.GONE);
        findViewById(R.id.texto5).setVisibility(View.VISIBLE);
    } else if (texto5.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto5).setVisibility(View.GONE);
        findViewById(R.id.texto6).setVisibility(View.VISIBLE);
    }else if (texto6.getVisibility() == View.VISIBLE) {
        findViewById(R.id.texto6).setVisibility(View.GONE);
        findViewById(R.id.texto7).setVisibility(View.VISIBLE);
        findViewById(R.id.prox).setVisibility(View.GONE);
    }
}
 
Example 16
Project: JavaIsFun   File: Classe2.java   View Source Code Vote up 5 votes
public void ant(View view) {

        TextView texto1 = (TextView) findViewById(R.id.texto1);
        TextView texto2 = (TextView) findViewById(R.id.texto2);
        TextView texto3 = (TextView) findViewById(R.id.texto3);
        TextView texto4 = (TextView) findViewById(R.id.texto4);
        TextView texto5 = (TextView) findViewById(R.id.texto5);
        TextView texto6 = (TextView) findViewById(R.id.texto6);
        TextView texto7 = (TextView) findViewById(R.id.texto7);

        if (texto2.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto2).setVisibility(View.GONE);
            findViewById(R.id.texto1).setVisibility(View.VISIBLE);
            findViewById(R.id.ant).setVisibility(View.GONE);
            findViewById(R.id.prox).setVisibility(View.VISIBLE);
        } else if (texto3.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto3).setVisibility(View.GONE);
            findViewById(R.id.texto2).setVisibility(View.VISIBLE);
        } else if (texto4.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto4).setVisibility(View.GONE);
            findViewById(R.id.texto3).setVisibility(View.VISIBLE);
        } else if (texto5.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto5).setVisibility(View.GONE);
            findViewById(R.id.texto4).setVisibility(View.VISIBLE);
        } else if (texto6.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto6).setVisibility(View.GONE);
            findViewById(R.id.texto5).setVisibility(View.VISIBLE);
            findViewById(R.id.prox).setVisibility(View.GONE);
        } else if (texto7.getVisibility() == View.VISIBLE) {
            findViewById(R.id.texto7).setVisibility(View.GONE);
            findViewById(R.id.texto6).setVisibility(View.VISIBLE);
        }
    }
 
Example 17
Project: grafika   File: ContinuousCaptureActivity.java   View Source Code Vote up 4 votes
@Override
public void handleMessage(Message msg) {
    ContinuousCaptureActivity activity = mWeakActivity.get();
    if (activity == null) {
        Log.d(TAG, "Got message for dead activity");
        return;
    }

    switch (msg.what) {
        case MSG_BLINK_TEXT: {
            TextView tv = (TextView) activity.findViewById(R.id.recording_text);

            // Attempting to make it blink by using setEnabled() doesn't work --
            // it just changes the color.  We want to change the visibility.
            int visibility = tv.getVisibility();
            if (visibility == View.VISIBLE) {
                visibility = View.INVISIBLE;
            } else {
                visibility = View.VISIBLE;
            }
            tv.setVisibility(visibility);

            int delay = (visibility == View.VISIBLE) ? 1000 : 200;
            sendEmptyMessageDelayed(MSG_BLINK_TEXT, delay);
            break;
        }
        case MSG_FRAME_AVAILABLE: {
            activity.drawFrame();
            break;
        }
        case MSG_FILE_SAVE_COMPLETE: {
            activity.fileSaveComplete(msg.arg1);
            break;
        }
        case MSG_BUFFER_STATUS: {
            long duration = (((long) msg.arg1) << 32) |
                            (((long) msg.arg2) & 0xffffffffL);
            activity.updateBufferStatus(duration);
            break;
        }
        default:
            throw new RuntimeException("Unknown message " + msg.what);
    }
}