本文整理匯總了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;
}
}
示例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.");
}
}