本文整理汇总了Java中se.emilsjolander.stickylistheaders.StickyListHeadersListView.setAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java StickyListHeadersListView.setAdapter方法的具体用法?Java StickyListHeadersListView.setAdapter怎么用?Java StickyListHeadersListView.setAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类se.emilsjolander.stickylistheaders.StickyListHeadersListView
的用法示例。
在下文中一共展示了StickyListHeadersListView.setAdapter方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo_main);
mList = (StickyListHeadersListView)findViewById(R.id.list);
mList.setAreHeadersSticky(true);
AsyncTask<Void,Void,Void> asyncTask = new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... voids) {
fetchPhoneContacts();
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
mList.setAdapter(new DemoListAdapter(DemoMainActivity.this,mContacts));
}
};
asyncTask.execute();
}
示例2: initData
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
private void initData() {
StickyListHeadersListView listView = (StickyListHeadersListView) findViewById(R.id.lv_datas);
MainListDataAdapter mainListDataAdapter = new MainListDataAdapter(this);
if (listView != null) {
listView.setAdapter(mainListDataAdapter);
}
List<IMainListData> mainListDatas = MainListDataFactory.getInstance().getMainListDatas();
Collections.sort(mainListDatas, new Comparator<IMainListData>() {
@Override
public int compare(IMainListData lhs, IMainListData rhs) {
int result = lhs.getMainTitle() - rhs.getMainTitle();
if (result == 0) {
result = lhs.getSubTitle() - rhs.getSubTitle();
}
return result;
}
});
mainListDataAdapter.setDataList(mainListDatas);
}
示例3: initDatabaseDependentViews
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@Override
public void initDatabaseDependentViews() {
Student student = UnicapApplication.getCurrentStudent();
List<SubjectTest> subjectTests = student.getSubjectTestsOrdered();
if (subjectTests.size() == 0) {
setContentView(R.layout.content_empty_calendar);
return;
}
StickyListHeadersListView subjectCalendarListView = (StickyListHeadersListView) getContentView().findViewById(R.id.calendar_list);
SubjectCalendarListItemAdapter subjectCalendarListItemAdapter = new SubjectCalendarListItemAdapter(subjectTests, getActivity());
subjectCalendarListView.setAdapter(subjectCalendarListItemAdapter);
}
示例4: onCreateView
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.image_list_fragment, container, false);
mStickyList = (StickyListHeadersListView) view.findViewById(R.id.image_list_view);
mStickyList.setOnItemClickListener(this);
mAdapter = new ImageListAdapter(this.getActivity());
mStickyList.setAdapter(mAdapter);
mStickyList.setDrawingListUnderStickyHeader(false);
IntentFilter filter = new IntentFilter(EvernoteMars.END_NOTE_LOADING);
filter.addAction(MarsImagesApp.MISSION_CHANGED);
filter.addAction(MarsImagesApp.IMAGE_SELECTED);
filter.addAction(MarsImagesApp.NOTES_CLEARED);
filter.addAction(MarsImagesApp.LOCATIONS_LOADED);
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(mMessageReceiver, filter);
return view;
}
示例5: initViews
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
private void initViews(View view) {
mEmptyView = (EmptyLayout) view.findViewById(R.id.error_layout);
mListView = (StickyListHeadersListView) view
.findViewById(R.id.listview);
mListView.setOnScrollListener(mScrollListener);
mListView.setOnItemClickListener(this);
View header = LayoutInflater.from(getActivity()).inflate(
R.layout.v2_list_header_user_center, null);
mIvAvatar = (ImageView) header.findViewById(R.id.iv_avatar);
mTvName = (TextView) header.findViewById(R.id.tv_name);
mTvFollowing = (TextView) header.findViewById(R.id.tv_following_count);
mTvFollower = (TextView) header.findViewById(R.id.tv_follower_count);
mTvLastestLoginTime = (TextView) header
.findViewById(R.id.tv_latest_login_time);
mBtnPrivateMsg = (TextView) header
.findViewById(R.id.tv_private_message);
mBtnPrivateMsg.setOnClickListener(this);
mBtnFollowUser = (TextView) header.findViewById(R.id.tv_follow_user);
mBtnFollowUser.setOnClickListener(this);
mListView.addHeaderView(header);
if (mAdapter == null) {
mAdapter = new UserCenterAdapter(this);
mState = STATE_REFRESH;
mEmptyView.setErrorType(EmptyLayout.NETWORK_LOADING);
sendGetUserInfomation();
}
mListView.setAdapter(mAdapter);
}
示例6: initAdapter
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
private void initAdapter() {
// use LangListAdapter to show all supported languages.
StickyListHeadersListView stickyList = (StickyListHeadersListView) findViewById(R.id.list);
adapter = new DownloadDBListAdapter(this);
stickyList.setAdapter(adapter);
}
示例7: initViews
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
private void initViews(View view) {
mEmptyView = (EmptyLayout) view.findViewById(R.id.error_layout);
mListView = (StickyListHeadersListView) view
.findViewById(R.id.listview);
mListView.setOnScrollListener(mScrollListener);
mListView.setOnItemClickListener(this);
View header = LayoutInflater.from(getActivity()).inflate(
R.layout.v2_list_header_user_center, null);
mIvAvatar = (ImageView) header.findViewById(R.id.iv_avatar);
mTvName = (TextView) header.findViewById(R.id.tv_name);
mTvFollowing = (TextView) header.findViewById(R.id.tv_following_count);
mTvFollower = (TextView) header.findViewById(R.id.tv_follower_count);
mTvLastestLoginTime = (TextView) header
.findViewById(R.id.tv_latest_login_time);
mBtnPrivateMsg = (TextView) header
.findViewById(R.id.tv_private_message);
mBtnPrivateMsg.setOnClickListener(this);
mBtnFollowUser = (TextView) header.findViewById(R.id.tv_follow_user);
mBtnFollowUser.setOnClickListener(this);
mListView.addHeaderView(header);
if (mAdapter == null) {
mAdapter = new UserCenterAdapter(this);
mState = STATE_REFRESH;
mEmptyView.setErrorType(EmptyLayout.NETWORK_LOADING);
sendGetUserInfomation();
}
mListView.setAdapter(mAdapter);
}
示例8: onCreate
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh_layout);
refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
refreshLayout.setRefreshing(false);
}
}, 1000);
}
});
mAdapter = new TestBaseAdapter(this);
stickyList = (StickyListHeadersListView) findViewById(R.id.list);
stickyList.setOnItemClickListener(this);
stickyList.setOnHeaderClickListener(this);
stickyList.setOnStickyHeaderChangedListener(this);
stickyList.setOnStickyHeaderOffsetChangedListener(this);
stickyList.addHeaderView(getLayoutInflater().inflate(R.layout.list_header, null));
stickyList.addFooterView(getLayoutInflater().inflate(R.layout.list_footer, null));
stickyList.setEmptyView(findViewById(R.id.empty));
stickyList.setDrawingListUnderStickyHeader(true);
stickyList.setAreHeadersSticky(true);
stickyList.setAdapter(mAdapter);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(
this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer icon to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description */
R.string.drawer_close /* "close drawer" description */
);
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
restoreButton = (Button) findViewById(R.id.restore_button);
restoreButton.setOnClickListener(buttonListener);
openExpandableListButton = (Button) findViewById(R.id.open_expandable_list_button);
openExpandableListButton.setOnClickListener(buttonListener);
updateButton = (Button) findViewById(R.id.update_button);
updateButton.setOnClickListener(buttonListener);
clearButton = (Button) findViewById(R.id.clear_button);
clearButton.setOnClickListener(buttonListener);
stickyCheckBox = (CheckBox) findViewById(R.id.sticky_checkBox);
stickyCheckBox.setOnCheckedChangeListener(checkBoxListener);
fadeCheckBox = (CheckBox) findViewById(R.id.fade_checkBox);
fadeCheckBox.setOnCheckedChangeListener(checkBoxListener);
drawBehindCheckBox = (CheckBox) findViewById(R.id.draw_behind_checkBox);
drawBehindCheckBox.setOnCheckedChangeListener(checkBoxListener);
fastScrollCheckBox = (CheckBox) findViewById(R.id.fast_scroll_checkBox);
fastScrollCheckBox.setOnCheckedChangeListener(checkBoxListener);
stickyList.setStickyHeaderTopOffset(-20);
}
示例9: onCreate
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.public_chat_container);
TextView city = (TextView) findViewById(R.id.city_name);
tvConnectionProblem = (TextView) findViewById(R.id.connection_problem);
tf = Typeface.createFromAsset(getAssets(), "fonts/Raleway_Thin.otf");
city.setTypeface(tf);
city.setText(Controller.getInstance().getCity().getId());
editText = (EditText) findViewById(R.id.editText);
editText.clearFocus();
slidingMenu = (SlidingMenu) findViewById(R.id.slidingmenulayout);
slidingMenu.setOnOpenListener(this);
sendBt = (ImageView) findViewById(R.id.send);
sendBt.setOnClickListener(this);
if(getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA) == false){
findViewById(R.id.send_picture).setVisibility(View.GONE);
} else{
findViewById(R.id.send_picture).setOnClickListener(this);
}
menuPrivate = (ImageView) findViewById(R.id.menu_private);
menuPrivate.setOnClickListener(this);
chatAdapter = new PublicChatAdapter(this, new ArrayList<Message>());
listMessages = (StickyListHeadersListView) findViewById(R.id.list);
listMessages.setAdapter(chatAdapter);
listMessages.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
matchAdapter = new MatchAdapter(this, new ArrayList<Match>());
listPrivate = (ListView) findViewById(R.id.list_private);
listPrivate.setAdapter(matchAdapter);
listPrivate.setOnItemClickListener(this);
networkStateReceiver = new NetworkStateReceiver(this);
Server.addEventsListener(this);
Server.getMatches();
scheduler = Executors.newSingleThreadScheduledExecutor();
}
示例10: onCreate
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.private_chat);
isComingBackFromTakingPhoto = false;
remoteUser = Controller.getInstance().getUser(getIntent().getStringExtra("tokenId"));
TextView fbName = (TextView) findViewById(R.id.fbName);
tf = Typeface.createFromAsset(getAssets(), "fonts/Raleway_Thin.otf");
fbName.setTypeface(tf);
fbName.setText(getIntent().getStringExtra("realName"));
((ImageView) findViewById(R.id.avatar)).setImageBitmap(remoteUser.getAvatar());
findViewById(R.id.back).setOnClickListener(this);
findViewById(R.id.photos).setOnClickListener(this);
findViewById(R.id.photos).setEnabled(false);
if(getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA) == false){
findViewById(R.id.send_picture).setVisibility(View.GONE);
} else{
findViewById(R.id.send_picture).setOnClickListener(this);
}
editText = (EditText) findViewById(R.id.editText);
editText.clearFocus();
sendBt = (ImageView) findViewById(R.id.send);
sendBt.setOnClickListener(this);
tvConnectionProblem = (TextView) findViewById(R.id.connection_problem);
slideshow = (SlideshowView) findViewById(R.id.slideshow);
slideshowSep = findViewById(R.id.slideshow_sep);
chatAdapter = new PrivateChatAdapter(this, DatabaseHelper.getInstance().getPrivateMessages(remoteUser));
listMessages = (StickyListHeadersListView) findViewById(R.id.list);
listMessages.setAdapter(chatAdapter);
listMessages.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
Server.addEventsListener(this);
Server.addProfileListener(this);
Server.getUserFacebookPictureSlideshow(remoteUser);
scheduler = Executors.newSingleThreadScheduledExecutor();
networkStateReceiver = new NetworkStateReceiver(this);
}
示例11: setUpLicenseListView
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入方法依赖的package包/类
public void setUpLicenseListView() {
StickyListHeadersListView list = findViewById(R.id.list_license);
list.addHeaderView(LayoutInflater.from(getContext()).inflate(R.layout.list_header_license, null, false));
list.setAdapter(new LicenseListAdapter(getContext()));
list.setOnItemClickListener(this);
}