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


Java ListView.getFooterViewsCount方法代碼示例

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


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

示例1: isLastMessageVisible

import android.widget.ListView; //導入方法依賴的package包/類
public static boolean isLastMessageVisible(ListView messageListView) {
	if(messageListView == null || messageListView.getAdapter() == null) {
		return false;
	}
	
    if (messageListView.getLastVisiblePosition() >= messageListView.getAdapter().getCount() - 1 - messageListView.getFooterViewsCount()) {
        return true;
    } else {
        return false;
    }
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:12,代碼來源:ListViewUtil.java

示例2: setSongList

import android.widget.ListView; //導入方法依賴的package包/類
public void setSongList(String json) throws JSONException{
    View requestView = viewPager.findViewById(R.id.requests_page);
    TextView searchMsg = (TextView) requestView.findViewById(R.id.searchMsg);
    ListView songListView = (ListView) requestView.findViewById(R.id.songListView);
    Integer curPage, lastPage;

    try {
        JSONObject searchObject = new JSONObject(json);
        JSONArray songs = new JSONArray(searchObject.getString("data"));
        ArrayList<Song> songList = new ArrayList<>();
        curPage = searchObject.getInt("current_page");
        lastPage = searchObject.getInt("last_page");

        for (int i = 0; i < songs.length(); i++){
            JSONObject songObject = songs.getJSONObject(i);

            if(songObject != null){
                String artist = songObject.getString("artist");
                String title = songObject.getString("title");
                Integer songID = songObject.getInt("id");
                boolean requestable = songObject.getBoolean("requestable");
                Song song = new Song(artist, title, songID, requestable);

                songList.add(song);
            }
        }

        if(songs.length() == 0) {
            searchMsg.setVisibility(View.VISIBLE);
            searchMsg.setText("No songs found for query.");
        } else {
            searchMsg.setVisibility(View.INVISIBLE);
        }

        if(searchFooter == null || songListView.getFooterViewsCount() == 0) {
            createSearchFooter(curPage, lastPage);
            songListView.addFooterView(searchFooter);
        }
        else {
            createSearchFooter(curPage, lastPage);
        }
        SongAdapter sAdapt = new SongAdapter(this, R.layout.request_cell, songList);
        songListView.setAdapter(sAdapt);
    }
    catch(JSONException ex){
        searchMsg.setVisibility(View.VISIBLE);
        searchMsg.setText("An error occurred while retrieving songs. Please try again.");
    }
}
 
開發者ID:R-a-dio,項目名稱:R-a-dio-Amazing-Android-App,代碼行數:50,代碼來源:ActivityMain.java


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