本文整理汇总了Java中android.widget.ListView.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java ListView.setVisibility方法的具体用法?Java ListView.setVisibility怎么用?Java ListView.setVisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ListView
的用法示例。
在下文中一共展示了ListView.setVisibility方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onResume
import android.widget.ListView; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
String[] names_of = fileList(); //arr.length
int name_size = names_of.length;
not=(LinearLayout)findViewById(R.id.not);
ListView names = (ListView)findViewById(R.id.LIST);
ArrayAdapter<String> nameAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, names_of);
if (names_of.length<1){
not.setVisibility(View.VISIBLE);
names.setVisibility(View.GONE);
}else {
not.setVisibility(View.GONE);
names.setVisibility(View.VISIBLE);
}
names.setAdapter(nameAdapter);
}
示例2: onCreateView
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
fragView = inflater.inflate(R.layout.tab_fragment_others, container, false);
messageOthers = (TextView) fragView.findViewById(R.id.messageOthers);
listStations = (ListView) fragView.findViewById(R.id.otherStations);
callbacks = (Callbacks) getActivity();
common = new Common(getContext());
sortedStations = callbacks.getSortedStations();
if (sortedStations.isEmpty()) {
listStations.setVisibility(View.INVISIBLE);
messageOthers.setText(R.string.stations_not);
messageOthers.setVisibility(View.VISIBLE);
} else {
updateGUI(sortedStations);
onItemClickListener(sortedStations);
}
return fragView;
}
示例3: onPostExecute
import android.widget.ListView; //导入方法依赖的package包/类
@Override
protected void onPostExecute(List<SkuDetails> skuDetails) {
super.onPostExecute(skuDetails);
DonationsDialog dialog = donationDialogWeakReference.get();
if (dialog == null) return;
if (skuDetails == null || skuDetails.isEmpty()) {
dialog.dismiss();
return;
}
View customView = ((MaterialDialog) dialog.getDialog()).getCustomView();
//noinspection ConstantConditions
customView.findViewById(R.id.progress_container).setVisibility(View.GONE);
ListView listView = ButterKnife.findById(customView, R.id.list);
listView.setAdapter(new SkuDetailsAdapter(dialog, skuDetails));
listView.setVisibility(View.VISIBLE);
}
示例4: displayYoutubeIdDialog
import android.widget.ListView; //导入方法依赖的package包/类
private void displayYoutubeIdDialog(@NonNull ArrayList<YoutubeVideoData> youtubeVideoDataList) {
final Dialog dialog = new Dialog(_context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_listview);
TextView title = dialog.findViewById(R.id.dialog_title_text_view);
title.setText(_context.getResources().getString(R.string.select_youtube_video));
final YoutubeVideoListAdapter listAdapter = new YoutubeVideoListAdapter(_context, youtubeVideoDataList, dialog::dismiss);
ListView listView = dialog.findViewById(R.id.dialog_list_view);
listView.setAdapter(listAdapter);
listView.setVisibility(View.VISIBLE);
Button closeButton = dialog.findViewById(R.id.dialog_button_close);
closeButton.setOnClickListener(view -> dialog.dismiss());
dialog.setCancelable(true);
dialog.show();
Window window = dialog.getWindow();
if (window != null) {
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
} else {
Logger.getInstance().Warning(TAG, "Window is null!");
}
}
示例5: lockBrightnessControls
import android.widget.ListView; //导入方法依赖的package包/类
private void lockBrightnessControls(boolean lock) {
SeekBar slider = (SeekBar) findViewById(R.id.slider);
ListView profileList = (ListView) findViewById(R.id.profile_list);
// Note: setEnabled() doesn't seem to work with this ListView, nor does
// calling setEnabled() on the individual children of the ListView.
// The items become grayed out, but the click handlers are still registered.
// As a work around, simply hide the entire list view.
if (lock) {
profileList.setVisibility(View.GONE);
slider.setEnabled(false);
} else {
profileList.setVisibility(View.VISIBLE);
slider.setEnabled(true);
}
}
示例6: init
import android.widget.ListView; //导入方法依赖的package包/类
public void init(){
earthquakeListView = (ListView) findViewById(R.id.list);
noInternetConection = (TextView)findViewById(R.id.no_internet_conection);
progressBar = (ProgressBar)findViewById(R.id.progressbar);
earthquakeListView.setVisibility(View.GONE);
noInternetConection.setVisibility(View.GONE);
}
示例7: onCreateView
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState)
{
// The last two arguments ensure LayoutParams are inflated
// properly.
super.onCreateView(inflater, container, savedInstanceState);
final View view = inflater.inflate(R.layout.test_result_detail, container, false);
final Bundle args = getArguments();
/*
* ((TextView) view.findViewById(R.id.text1)).setText(Integer
* .toString(args.getInt(ARG_UID)));
*/
listView = (ListView) view.findViewById(R.id.valueList);
listView.setVisibility(View.GONE);
emptyView = (TextView) view.findViewById(R.id.infoText);
emptyView.setVisibility(View.GONE);
progessBar = (ProgressBar) view.findViewById(R.id.progressBar);
if ((testResultDetailTask == null || testResultDetailTask != null || testResultDetailTask.isCancelled())
&& args.getString(ARG_UID) != null)
{
testResultDetailTask = new CheckTestResultDetailTask((RMBTMainActivity) getActivity(), at.rtr.rmbt.android.views.ResultDetailsView.ResultDetailType.SPEEDTEST);
testResultDetailTask.setEndTaskListener(this);
testResultDetailTask.execute(args.getString(ARG_UID));
}
itemList = new ArrayList<HashMap<String, String>>();
// listView.setEmptyView(emptyView);
return view;
}
示例8: createView
import android.widget.ListView; //导入方法依赖的package包/类
/**
*
* @param inflater
* @return
*/
public View createView(final LayoutInflater inflater)
{
final View view = inflater.inflate(R.layout.test_result_detail, this);
listView = (ListView) view.findViewById(R.id.valueList);
listView.setVisibility(View.GONE);
emptyView = (TextView) view.findViewById(R.id.infoText);
emptyView.setVisibility(View.GONE);
progessBar = (ProgressBar) view.findViewById(R.id.progressBar);
return view;
}
示例9: onPostExecute
import android.widget.ListView; //导入方法依赖的package包/类
protected void onPostExecute(Boolean result) {
adapter.notifyDataSetChanged();
pb.setVisibility(View.INVISIBLE);
ota_list = (ListView) findViewById(R.id.ota_list);
ota_list.setVisibility((adapter.isEmpty())?View.GONE:View.VISIBLE);
sb.getView().setBackgroundColor(ContextCompat.getColor(MainActivity.this, R.color.colorSecond));
sb.show();
}
示例10: initiateView
import android.widget.ListView; //导入方法依赖的package包/类
private void initiateView() {
LayoutInflater.from(mContext).inflate(R.layout.search_view, this, true);
mSearchLayout = findViewById(R.id.search_layout);
mSearchTopBar = (RelativeLayout) mSearchLayout.findViewById(R.id.search_top_bar);
mSuggestionsListView = (ListView) mSearchLayout.findViewById(R.id.suggestion_list);
mSearchSrcTextView = (EditText) mSearchLayout.findViewById(R.id.searchTextView);
mBackBtn = (ImageButton) mSearchLayout.findViewById(R.id.action_up_btn);
mVoiceBtn = (ImageButton) mSearchLayout.findViewById(R.id.action_voice_btn);
mEmptyBtn = (ImageButton) mSearchLayout.findViewById(R.id.action_empty_btn);
mTintView = mSearchLayout.findViewById(R.id.transparent_view);
mSearchSrcTextView.setOnClickListener(mOnClickListener);
mBackBtn.setOnClickListener(mOnClickListener);
mVoiceBtn.setOnClickListener(mOnClickListener);
mEmptyBtn.setOnClickListener(mOnClickListener);
mTintView.setOnClickListener(mOnClickListener);
allowVoiceSearch = false;
showVoice(true);
initSearchView();
mSuggestionsListView.setVisibility(GONE);
setAnimationDuration(AnimationUtil.ANIMATION_DURATION_MEDIUM);
}
示例11: onCreate
import android.widget.ListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product_list);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
prgLoading = (TSProgressBar) findViewById(R.id.prgLoading);
listMenu = (ListView) findViewById(R.id.listMenu);
edtKeyword = (EditText) findViewById(R.id.edtKeyword);
btnSearch = (ImageButton) findViewById(R.id.btnSearch);
txtAlert = (TextView) findViewById(R.id.txtAlert);
Intent iGet = getIntent();
brandId = iGet.getStringExtra("brand_id");
brandName = iGet.getStringExtra("brand_name");
Log.d("","Company ID: "+brandId);
getSupportActionBar().setTitle(brandName);
mHandler = new Handler(Looper.getMainLooper());
listMenu.setVisibility(View.VISIBLE);
getBrandProduct();
// btnSearch.setOnClickListener(new View.OnClickListener() {
//
// public void onClick(View arg0) {
// try {
// Keyword = URLEncoder.encode(edtKeyword.getText().toString(), "utf-8");
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
// ProductService += "&keyword="+Keyword;
// IOConnect = 0;
// listMenu.invalidateViews();
// clearData();
// new getDataTask().execute();
// }
// });
// listMenu.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//
// public void onItemClick(AdapterView<?> arg0, View arg1, int position,
// long arg3) {
//
// Intent iDetail = new Intent(ActivityCompanyProduct.this, ActivityProductDetail.class);
// iDetail.putExtra("product_id", Product_ID.get(position));
// startActivity(iDetail);
// }
// });
}
示例12: setUpView
import android.widget.ListView; //导入方法依赖的package包/类
private void setUpView(View view) {
ListView listView1 = (ListView) view.findViewById(R.id.listview1);
ListView listView2 = (ListView) view.findViewById(R.id.listview2);
LinearLayout textEmptyMessageContainer = (LinearLayout) view.findViewById(R.id.text_empty_container);
LinearLayout audioEmptyMessageContainer = (LinearLayout) view.findViewById(R.id.audio_empty_container);
View switchToremoteDisplayText = view.findViewById(R.id.switch_remote_empty_message_text);
View switchToremoteDisplayAudio = view.findViewById(R.id.switch_remote_empty_message_audio);
partitionTracks();
mTextAdapter = new SubtitleTracksListAdapter(getActivity(), R.layout.tracks_row_layout,
mTextTracks, mSelectedTextPosition, this);
mTextAdapter.setOnMenuClickListener(this);
mAudioVideoAdapter = new AudioTracksListAdapter(getActivity(), R.layout.tracks_row_layout,
mAudioTracks, mSelectedAudioPosition, this);
mAudioVideoAdapter.setOnMenuClickListener(this);
listView1.setAdapter(mTextAdapter);
listView2.setAdapter(mAudioVideoAdapter);
TabHost tabs = (TabHost) view.findViewById(R.id.tabhost);
tabs.setup();
// create tab 1
switchToremoteDisplayText.setVisibility(View.GONE);
switchToremoteDisplayAudio.setVisibility(View.GONE);
TabHost.TabSpec tab1 = tabs.newTabSpec("tab1");
if (mTextTracks == null || mTextTracks.isEmpty()) {
listView1.setVisibility(View.INVISIBLE);
tab1.setContent(R.id.text_empty_container);
if(!mArchosCastManager.isRemoteDisplayConnected()){
switchToremoteDisplayText.setVisibility(View.VISIBLE);
}
} else {
textEmptyMessageContainer.setVisibility(View.INVISIBLE);
tab1.setContent(R.id.listview1);
}
tab1.setIndicator(getString(R.string.ccl_caption_subtitles));
tabs.addTab(tab1);
// create tab 2
TabHost.TabSpec tab2 = tabs.newTabSpec("tab2");
if (mAudioTracks == null || mAudioTracks.isEmpty()) {
listView2.setVisibility(View.INVISIBLE);
tab2.setContent(R.id.audio_empty_container);
if(!mArchosCastManager.isRemoteDisplayConnected()){
switchToremoteDisplayAudio.setVisibility(View.VISIBLE);
}
} else {
audioEmptyMessageContainer.setVisibility(View.INVISIBLE);
tab2.setContent(R.id.listview2);
}
tab2.setIndicator(getString(R.string.ccl_caption_audio));
tabs.addTab(tab2);
}
示例13: setUpView
import android.widget.ListView; //导入方法依赖的package包/类
private void setUpView(View view) {
ListView listView1 = (ListView) view.findViewById(R.id.listview1);
ListView listView2 = (ListView) view.findViewById(R.id.listview2);
TextView textEmptyMessageView = (TextView) view.findViewById(R.id.text_empty_message);
TextView audioEmptyMessageView = (TextView) view.findViewById(R.id.audio_empty_message);
partitionTracks();
mTextAdapter = new TracksListAdapter(getActivity(), R.layout.tracks_row_layout,
mTextTracks, mSelectedTextPosition);
mAudioVideoAdapter = new TracksListAdapter(getActivity(), R.layout.tracks_row_layout,
mAudioTracks, mSelectedAudioPosition);
listView1.setAdapter(mTextAdapter);
listView2.setAdapter(mAudioVideoAdapter);
TabHost tabs = (TabHost) view.findViewById(R.id.tabhost);
tabs.setup();
// create tab 1
TabHost.TabSpec tab1 = tabs.newTabSpec("tab1");
if (mTextTracks == null || mTextTracks.isEmpty()) {
listView1.setVisibility(View.INVISIBLE);
tab1.setContent(R.id.text_empty_message);
} else {
textEmptyMessageView.setVisibility(View.INVISIBLE);
tab1.setContent(R.id.listview1);
}
tab1.setIndicator(getString(R.string.ccl_caption_subtitles));
tabs.addTab(tab1);
// create tab 2
TabHost.TabSpec tab2 = tabs.newTabSpec("tab2");
if (mAudioTracks == null || mAudioTracks.isEmpty()) {
listView2.setVisibility(View.INVISIBLE);
tab2.setContent(R.id.audio_empty_message);
} else {
audioEmptyMessageView.setVisibility(View.INVISIBLE);
tab2.setContent(R.id.listview2);
}
tab2.setIndicator(getString(R.string.ccl_caption_audio));
tabs.addTab(tab2);
}