Java Code Examples for android.widget.ListView.setVisibility()

The following are Jave code examples for showing how to use setVisibility() of the android.widget.ListView 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: Image-Text-Reader-And-Tools   File: PdfNoteSelectActivity.java   View Source Code Vote up 6 votes
@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);

}
 
Example 2
Project: UbiBike-client   File: TabFragmentOthers.java   View Source Code Vote up 6 votes
@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;
}
 
Example 3
Project: Orin   File: DonationsDialog.java   View Source Code Vote up 6 votes
@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);
}
 
Example 4
Project: LucaHome-AndroidApplication   File: DownloadYoutubeVideoTask.java   View Source Code Vote up 6 votes
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!");
    }
}
 
Example 5
Project: buildAPKsApps   File: BrightnessProfiles.java   View Source Code Vote up 6 votes
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);
  }
}
 
Example 6
Project: Image-Text-Reader-And-Tools   File: NoteActivity.java   View Source Code Vote up 5 votes
@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);

}
 
Example 7
Project: Earthquake-App   File: EarthquakeActivity.java   View Source Code Vote up 5 votes
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);
}
 
Example 8
Project: open-rmbt   File: RMBTTestResultDetailFragment.java   View Source Code Vote up 5 votes
@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;
}
 
Example 9
Project: open-rmbt   File: ResultDetailsView.java   View Source Code Vote up 5 votes
/**
 * 
 * @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;
}
 
Example 10
Project: OTAUpdates   File: MainActivity.java   View Source Code Vote up 5 votes
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();
}
 
Example 11
Project: FinalProject   File: MaterialSearchView.java   View Source Code Vote up 5 votes
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);
}
 
Example 12
Project: techstar-shop   File: ActivityCompanyProduct.java   View Source Code Vote up 4 votes
@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);
//            }
//        });
    }
 
Example 13
Project: aos-Video   File: ArchosTracksChooserDialog.java   View Source Code Vote up 4 votes
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);
}
 
Example 14
Project: Pocket-Plays-for-Twitch   File: TracksChooserDialog.java   View Source Code Vote up 4 votes
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);
}