当前位置: 首页>>代码示例>>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;未经允许,请勿转载。