本文整理了Java中android.widget.TextView.isShown()
方法的一些代码示例,展示了TextView.isShown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.isShown()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:isShown
暂无
代码示例来源:origin: stackoverflow.com
public ArrayList<TextView> getFilteredTextViews()
{
ArrayList<TextView> textViewList = solo.getCurrentViews(TextView.class);
ArrayList<TextView> filteredTextViewList = new ArrayList<TextView>();
for (TextView textview : textViewList ) {
if (textview != null && textview.isShown())
{
filteredTextViewList .add(view);
}
}
return filteredTextViewList;
}
代码示例来源:origin: stackoverflow.com
public void click_button1 (View view){
TextView textview=(TextView)parent.findViewById(R.id.textView1);
if(!textview.isShown()) //Check if the view is currently visible or not.
textview.setVisibility(View.VISIBLE);
else
textview.setVisibility(View.INVISIBLE);
}
代码示例来源:origin: coding-blocks/GSoC-Info-Android
@Override
public void onClick(View view) {
if (answer.isShown()) {
answer.setVisibility(GONE);
}else {
answer.setVisibility(View.VISIBLE);
}
}
});
代码示例来源:origin: stackoverflow.com
private void ButtonInstructionOnCheck(final ToggleButton button, final TextView textView, final String string){
textView.setText(string);
button.setOnCheckedChangeListener(new OnCheckedChangeListener(){
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
if(textView.isShown() == false){
textView.setVisibility(View.VISIBLE);
}else if(textView.isShown() == true){
textView.setVisibility(View.INVISIBLE);
}
}
});
}
代码示例来源:origin: WiInputMethod/VE
public int lightViewAnimate(View v, MotionEvent event){
int index = ViewsUtil.computeDirection(event.getX(), event.getY(), v.getHeight(), v.getWidth());
if (index == Global.ERR){
for (int i = 0;i <mLightNum ;i++){
if(mLightView[i].isShown())animate(mLightView[i],offAnim_noraml_hide[i],View.GONE);
}
} else if (mLightView[index].isShown()) {
animate(mLightView[index], offAnim[index], View.GONE);
// mOutLightView[index].setVisibility(View.VISIBLE);
// animate(mOutLightView[index], outAnim[index], View.GONE);
}
return index;
}
代码示例来源:origin: TedaLIEz/ParsingPlayer
private void showSeekTextView(int seekPos, int totalDuration) {
if (!mTextView.isShown()) {
mTextView.setVisibility(VISIBLE);
}
mTextView.setText(String.format(getResources().getString(R.string.seekTime),
Util.stringForTime(seekPos), Util.stringForTime(totalDuration)));
}
代码示例来源:origin: stackoverflow.com
public class MainActivity extends Activity {
private Handler h;
TextView txt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txt=(TextView)findViewById(R.id.txt);
Runnable r=new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
Log.e("bf", "fd");
h.postDelayed(this, 500);
if (txt.isShown()){
txt.setVisibility(View.INVISIBLE);
}
else{
txt.setVisibility(View.VISIBLE);
}
}
};
h=new Handler();
h.post(r);
}
}
代码示例来源:origin: stackoverflow.com
paragraphmore.setVisibility(paragraphmore.isShown()
? View.GONE
: View.VISIBLE );
代码示例来源:origin: WiInputMethod/VE
public boolean HideLightView(float x, float y, float width, float height) {
int index = ViewsUtil.computeDirection(x, y, (int) height, (int) width);
for (int i =0;i<mLightNum;i++){
if (i == index )continue;
if(mLightView[i].isShown())
animate(mLightView[i],offAnim_noraml_hide[i],View.GONE);
}
viewsWraper.setVisibility(View.GONE);
return true;
}
代码示例来源:origin: WiInputMethod/VE
public boolean ShowLightView(float x, float y, float width, float height, String text) {
boolean mLightShow = false;
viewsWraper.setVisibility(View.VISIBLE);
for (int i = 0; i < 4; ++i) {
mLightShow |= mLightView[i].isShown();
}
int index = ViewsUtil.computeDirection(x, y, (int) height, (int) width);
int[] follow = {1,3,0,2};
if (index!= -1 && !mLightShow) {
animate(mLightView[index],showAnim[index],View.VISIBLE);
String showText = " ";
if(StringUtil.isAllLetter(text)){
if(text.length() > follow[index])
showText = (String) text.subSequence(follow[index], follow[index]+1);
} else {
showText = text;
}
mLightView[index].setText(showText);
}
return true;
}
代码示例来源:origin: stackoverflow.com
if (txt.isShown() ) {
txt.setVisibility(View.INVISIBLE);
代码示例来源:origin: ravidsrk/android-testing-guide
@Test
public void testUI() {
Activity activity = activityTestRule.getActivity();
assertNotNull(activity.findViewById(R.id.text_hello));
TextView helloView = activity.findViewById(R.id.text_hello);
assertTrue(helloView.isShown());
assertEquals("Hello World!", helloView.getText());
assertEquals(InstrumentationRegistry.getTargetContext().getString(R.string.hello_world), helloView.getText());
assertNull(activity.findViewById(android.R.id.button1));
}
代码示例来源:origin: ymback/NGA-CLIENT-VER-OPEN-SOURCE
@Override
protected void onFinishInflate() {
mProgressBar = findViewById(R.id.progress_bar);
mListView = findViewById(R.id.list);
mEmptyView = findViewById(R.id.tv_error);
updateVisibility();
mListView.setOnItemClickListener((parent, view, position, id) -> mPresenter.insertTopicCategory(mCategoryList.get(position)));
setOnClickListener(v -> {
if (mEmptyView.isShown()) {
mPresenter.loadTopicCategory(this);
updateVisibility();
}
});
super.onFinishInflate();
}
代码示例来源:origin: AllenCoder/Recyclerview
@Override
public void onWindowFocusChanged(final boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus){
Logger.d(TAG, "onResume: "+(isShown(ly_a)));
Logger.d(TAG, "onResume: "+(isShown(ly_a)));
Logger.d(TAG, "onResume: "+(isShown(tv_valid)));
Logger.d(TAG, "onResume: "+(tv_invalid.isShown()));
}
}
代码示例来源:origin: AllenCoder/Recyclerview
@Override
protected void onResume() {
super.onResume();
Logger.d(TAG, "onCreate: "+(tv_unrepeat.getVisibility()== VISIBLE));
Logger.d(TAG, "onCreate: "+(tv_repeat.getVisibility()== VISIBLE));
Logger.d(TAG, "onCreate: "+(tv_valid.getVisibility()== VISIBLE));
Logger.d(TAG, "onCreate: "+(tv_invalid.getVisibility()== VISIBLE));
Logger.d(TAG, "onResume: "+(isShown(ly_a)));
Logger.d(TAG, "onResume: "+(isShown(ly_a)));
Logger.d(TAG, "onResume: "+(isShown(tv_valid)));
Logger.d(TAG, "onResume: "+(tv_invalid.isShown()));
}
static final int VISIBILITY_MASK = 0x0000000C;
内容来源于网络,如有侵权,请联系作者删除!