當前位置: 首頁>>代碼示例>>Java>>正文


Java TextView.getVisibility方法代碼示例

本文整理匯總了Java中android.widget.TextView.getVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java TextView.getVisibility方法的具體用法?Java TextView.getVisibility怎麽用?Java TextView.getVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.TextView的用法示例。


在下文中一共展示了TextView.getVisibility方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ant

import android.widget.TextView; //導入方法依賴的package包/類
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);

        }
    }
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:18,代碼來源:Classe.java

示例2: avancarTxt

import android.widget.TextView; //導入方法依賴的package包/類
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);


    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:22,代碼來源:Condicao7.java

示例3: showDescriptionLine

import android.widget.TextView; //導入方法依賴的package包/類
/**
 * 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);
    }
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:23,代碼來源:SuggestionView.java

示例4: prox

import android.widget.TextView; //導入方法依賴的package包/類
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);
    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:17,代碼來源:Classe.java

示例5: voltarTxt

import android.widget.TextView; //導入方法依賴的package包/類
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);


    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:17,代碼來源:Condicao7.java

示例6: prox

import android.widget.TextView; //導入方法依賴的package包/類
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);
    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:32,代碼來源:Classe4.java

示例7: getLabelVisibility

import android.widget.TextView; //導入方法依賴的package包/類
public int getLabelVisibility() {
    TextView labelView = getLabelView();
    if (labelView != null) {
        return labelView.getVisibility();
    }

    return -1;
}
 
開發者ID:WeiMei-Tian,項目名稱:editor-sql,代碼行數:9,代碼來源:FloatingActionButton.java

示例8: onSearchViewQueryChange

import android.widget.TextView; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:33,代碼來源:MainActivity.java

示例9: showSearchViewCursorPosition

import android.widget.TextView; //導入方法依賴的package包/類
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);
        }
    }
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:13,代碼來源:MainActivity.java

示例10: setTextView

import android.widget.TextView; //導入方法依賴的package包/類
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);
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:10,代碼來源:SettingsAdapter.java

示例11: ant

import android.widget.TextView; //導入方法依賴的package包/類
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);

    }

}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:45,代碼來源:Classe4.java

示例12: prox

import android.widget.TextView; //導入方法依賴的package包/類
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);
    }
}
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:32,代碼來源:Classe2.java

示例13: ant

import android.widget.TextView; //導入方法依賴的package包/類
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);
        }
    }
 
開發者ID:jvbeltra,項目名稱:JavaIsFun,代碼行數:34,代碼來源:Classe2.java

示例14: handleMessage

import android.widget.TextView; //導入方法依賴的package包/類
@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);
    }
}
 
開發者ID:AndyZhu1991,項目名稱:grafika,代碼行數:45,代碼來源:ContinuousCaptureActivity.java


注:本文中的android.widget.TextView.getVisibility方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。