本文整理了Java中android.widget.TextView.setVisibility()
方法的一些代码示例,展示了TextView.setVisibility()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setVisibility()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setVisibility
暂无
代码示例来源:origin: navasmdc/MaterialDesignLibrary
public void setTitle(String title) {
this.title = title;
if(title == null)
titleTextView.setVisibility(View.GONE);
else{
titleTextView.setVisibility(View.VISIBLE);
titleTextView.setText(title);
}
}
代码示例来源:origin: navasmdc/MaterialDesignLibrary
public void setTitle(String title) {
this.title = title;
if(title == null)
titleTextView.setVisibility(View.GONE);
else{
titleTextView.setVisibility(View.VISIBLE);
titleTextView.setText(title);
}
}
代码示例来源:origin: k9mail/k-9
public void updateFooter(final String text) {
if (footerView == null) {
return;
}
FooterViewHolder holder = (FooterViewHolder) footerView.getTag();
if (text != null) {
holder.main.setText(text);
holder.main.setVisibility(View.VISIBLE);
} else {
holder.main.setVisibility(View.GONE);
}
}
代码示例来源:origin: k9mail/k-9
private void updateWithThreadCount(MessageViewHolder holder, int threadCount) {
if (threadCount > 1) {
holder.threadCount.setText(String.format("%d", threadCount));
holder.threadCount.setVisibility(View.VISIBLE);
} else {
holder.threadCount.setVisibility(View.GONE);
}
}
代码示例来源:origin: k9mail/k-9
/**
* Clear the text field for the additional headers display if they are
* not shown, to save UI resources.
*/
private void hideAdditionalHeaders() {
mAdditionalHeadersView.setVisibility(View.GONE);
mAdditionalHeadersView.setText("");
}
代码示例来源:origin: rey5137/material
public void setNameText(CharSequence name){
mNameView.setText(name);
mNameView.setVisibility(TextUtils.isEmpty(name) ? View.GONE : View.VISIBLE);
}
代码示例来源:origin: rey5137/material
public void setAddressText(CharSequence address){
mAddressView.setText(address);
mAddressView.setVisibility(TextUtils.isEmpty(address) ? View.GONE : View.VISIBLE);
}
代码示例来源:origin: naman14/Timber
@Override
public void success(String s, Response response) {
lyrics = s;
if (s.equals("Sorry, We don't have lyrics for this song yet.\n")) {
lyricsTextView.setText(R.string.no_lyrics);
} else {
lyricsTextView.setText(s);
poweredbyTextView.setVisibility(View.VISIBLE);
}
}
代码示例来源:origin: GitLqr/LQRWeChat
@Override
public void setRecordingTipView() {
if (this.mRecordWindow != null) {
this.mStateIV.setVisibility(View.VISIBLE);
this.mStateIV.setImageResource(R.mipmap.ic_volume_1);
this.mStateTV.setVisibility(View.VISIBLE);
this.mStateTV.setText(R.string.voice_rec);
this.mStateTV.setBackgroundResource(R.drawable.bg_voice_popup);
this.mTimerTV.setVisibility(View.GONE);
}
}
代码示例来源:origin: lygttpod/SuperTextView
private void setTextString(TextView textView, CharSequence textString) {
textView.setText(textString);
if (!TextUtils.isEmpty(textString)) {
textView.setVisibility(VISIBLE);
}
}
代码示例来源:origin: GitLqr/LQRWeChat
@Override
public void setCancelTipView() {
if (this.mRecordWindow != null) {
this.mTimerTV.setVisibility(View.GONE);
this.mStateIV.setVisibility(View.VISIBLE);
this.mStateIV.setImageResource(R.mipmap.ic_volume_cancel);
this.mStateTV.setVisibility(View.VISIBLE);
this.mStateTV.setText(R.string.voice_cancel);
this.mStateTV.setBackgroundResource(R.drawable.corner_voice_style);
}
}
代码示例来源:origin: k9mail/k-9
private void updateAddressField(TextView v, CharSequence text, View label) {
boolean hasText = !TextUtils.isEmpty(text);
v.setText(text);
v.setVisibility(hasText ? View.VISIBLE : View.GONE);
label.setVisibility(hasText ? View.VISIBLE : View.GONE);
}
代码示例来源:origin: GitLqr/LQRWeChat
@Override
public void setTimeoutTipView(int counter) {
if (this.mRecordWindow != null) {
this.mStateIV.setVisibility(View.GONE);
this.mStateTV.setVisibility(View.VISIBLE);
this.mStateTV.setText(R.string.voice_rec);
this.mStateTV.setBackgroundResource(R.drawable.bg_voice_popup);
this.mTimerTV.setText(String.format("%s", new Object[]{Integer.valueOf(counter)}));
this.mTimerTV.setVisibility(View.VISIBLE);
}
}
代码示例来源:origin: pockethub/PocketHub
private HttpImageGetter hide(final TextView view) {
view.setText(null);
view.setVisibility(GONE);
view.setTag(null);
return this;
}
代码示例来源:origin: lipangit/JiaoZiVideoPlayer
@Override
public void changeUrl(JZDataSource jzDataSource, long seekToInAdvance) {
super.changeUrl(jzDataSource, seekToInAdvance);
titleTextView.setText(jzDataSource.title);
startButton.setVisibility(INVISIBLE);
replayTextView.setVisibility(View.GONE);
mRetryLayout.setVisibility(View.GONE);
}
代码示例来源:origin: android-hacker/VirtualXposed
/**
* Overrides the description text view for the picker activity if specified by the intent.
* If not specified then makes the description invisible.
*/
private void overrideDescriptionIfSupplied(String descriptionOverride) {
TextView descriptionView = (TextView) findViewById(R.id.description);
if (!TextUtils.isEmpty(descriptionOverride)) {
descriptionView.setText(descriptionOverride);
} else {
descriptionView.setVisibility(View.GONE);
}
}
代码示例来源:origin: smuyyh/BookReader
public void showTipView(String tip) {
tipView.setText(tip);
Animation mShowAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
-1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
mShowAction.setDuration(500);
tipView.startAnimation(mShowAction);
tipView.setVisibility(View.VISIBLE);
}
代码示例来源:origin: facebook/facebook-android-sdk
private void onCurrentPlaceSelected(Place place) {
currentPlaceNameTextView.setText(place.get(Place.NAME));
currentPlaceNameTextView.setVisibility(View.VISIBLE);
currentPlaceAddressTextView.setText(PlaceTextUtils.getAddress(place));
currentPlaceAddressTextView.setVisibility(View.VISIBLE);
}
代码示例来源:origin: ivacf/archi
@Override
public void onError(Throwable error) {
Log.e(TAG, "Error loading GitHub repos ", error);
progressBar.setVisibility(View.GONE);
if (error instanceof HttpException
&& ((HttpException) error).code() == 404) {
infoTextView.setText(R.string.error_username_not_found);
} else {
infoTextView.setText(R.string.error_loading_repos);
}
infoTextView.setVisibility(View.VISIBLE);
}
代码示例来源:origin: ivacf/archi
@Override
public void showOwner(final User owner) {
ownerNameText.setText(owner.name);
ownerEmailText.setText(owner.email);
ownerEmailText.setVisibility(owner.hasEmail() ? View.VISIBLE : View.GONE);
ownerLocationText.setText(owner.location);
ownerLocationText.setVisibility(owner.hasLocation() ? View.VISIBLE : View.GONE);
ownerLayout.setVisibility(View.VISIBLE);
}
内容来源于网络,如有侵权,请联系作者删除!