本文整理汇总了Java中se.emilsjolander.stickylistheaders.StickyListHeadersListView类的典型用法代码示例。如果您正苦于以下问题:Java StickyListHeadersListView类的具体用法?Java StickyListHeadersListView怎么用?Java StickyListHeadersListView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StickyListHeadersListView类属于se.emilsjolander.stickylistheaders包,在下文中一共展示了StickyListHeadersListView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onCreateView
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_all_track_list, container, false);
vFoldingPaneLayout = (FoldingPaneLayout) view.findViewById(R.id.vFoldingPaneLayout);
vLeftMenu = (MainFoldingView) view.findViewById(R.id.vLeftMenu);
lvTracks = (StickyListHeadersListView) view.findViewById(R.id.lvTracks);
lyTooltipframe = (ToolTipRelativeLayout) view.findViewById(R.id.lyTooltipframe);
emptyView = view.findViewById(R.id.emptyView);
strM = getResources().getString(R.string.strM);
strKm = getResources().getString(R.string.strKm);
strRecording = getResources().getString(R.string.strRecording);
// TODO Use "injected" views...
setupView();
return view;
}
示例3: getHeaderView
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
@Override
public View getHeaderView(int position, View convertView, ViewGroup parent) {
if(convertView == null){
convertView = LayoutInflater.from(getActivity())
.inflate(R.layout.item_selection_all_tracks, null);
}
//?????不加会报空指针
convertView.setLayoutParams(new StickyListHeadersListView.LayoutParams(
StickyListHeadersListView.LayoutParams.MATCH_PARENT,
StickyListHeadersListView.LayoutParams.WRAP_CONTENT));
convertView.setBackgroundColor(getResources().getColor(COLORS[position%COLORS.length]));
String sl = TrackUtil.getListSelection(tracks.tracks.get(position));
((TextView)convertView).setText(sl);
return convertView;
}
示例4: 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);
}
示例5: 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);
}
示例6: afterViews
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
@AfterViews
void afterViews()
{
oneAdapter = new OneAdapter(this);
onelist.setAdapter( oneAdapter );
onelist.setAnimExecutor( new AnimationExecutor() );
onelist.setOnHeaderClickListener( new StickyListHeadersListView.OnHeaderClickListener()
{
@Override
public void onHeaderClick( StickyListHeadersListView l,View header,int itemPosition,long headerId,boolean currentlySticky )
{
if ( onelist.isHeaderCollapsed( headerId ) )
{
onelist.expand( headerId );
}
else
{
onelist.collapse( headerId );
}
}
} );
}
示例7: 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;
}
示例8: onCreate
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.addresses);
AddressCache.initialize(this);
CollectionCache.initialize(this);
UserAddressCache.initialize(this);
clearCachedIfRequired();
lv = (StickyListHeadersListView) findViewById(R.id.stickyheaderslistview);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> av, View view, int i, long l) {
submitAddress(i);
}
});
}
示例9: updateView
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
private void updateView() {
// sF();
if (talk.size() == 0 || client.getTimeout() > 10000) {
LOGD(TAG, "adapter " + adapter.getCount());
LOGD(TAG, "talk " + talk.size());
empty.setVisibility(TextView.VISIBLE);
mProgressBar.setVisibility(ProgressBar.GONE);
stickyList.setVisibility(StickyListHeadersListView.GONE);
} else {
empty.setVisibility(TextView.GONE);
mProgressBar.setVisibility(ProgressBar.GONE);
stickyList.setVisibility(StickyListHeadersListView.VISIBLE);
}
}
示例10: onStickyHeaderOffsetChanged
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void onStickyHeaderOffsetChanged(StickyListHeadersListView l, View header, int offset) {
if (fadeHeader && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
header.setAlpha(1 - (offset / (float) header.getMeasuredHeight()));
}
}
示例11: onStickyHeaderChanged
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
@Override
public void onStickyHeaderChanged(StickyListHeadersListView stickyListHeadersListView, View header, int position, long headerId) {
Log.d(LOG_TAG, String.format("onStickyHeaderChanged, position = %d, headerId = %d", position, headerId));
if (CalendarManager.getInstance().getEvents().size() > 0) {
CalendarEvent event = CalendarManager.getInstance().getEvents().get(position);
if (event != null) {
mCalendarView.scrollToDate(event);
mCalendarPickerController.onScrollToDate(event.getInstanceDay());
}
}
}
示例12: IndexScroller
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
public IndexScroller(Context context, StickyListHeadersListView lv) {
mDensity = context.getResources().getDisplayMetrics().density;
mScaledDensity = context.getResources().getDisplayMetrics().scaledDensity;
mListView = lv;
setAdapter(mListView.getAdapter());
mIndexbarWidth = 20 * mDensity;
mIndexbarMargin = 10 * mDensity;
mPreviewPadding = 5 * mDensity;
}
示例13: initViews
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
@Override
protected void initViews() {
setContentView(R.layout.activity_register_doctor_schedule);
initTitleAndSubTitle();
lvSticky = (StickyListHeadersListView) this.findViewById(R.id.lv);
}
示例14: attachToListView
import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //导入依赖的package包/类
public void attachToListView(@NonNull StickyListHeadersListView listView) {
AbsListViewScrollDetectorImpl scrollDetector = new AbsListViewScrollDetectorImpl();
scrollDetector.setScrollDirectionListener(null);
scrollDetector.setOnScrollListener(null);
scrollDetector.setListView(listView.getWrappedList());
scrollDetector.setScrollThreshold(getResources().getDimensionPixelOffset(R.dimen.fab_scroll_threshold));
listView.setOnScrollListener(scrollDetector);
}
示例15: 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);
}