本文整理汇总了Java中jp.wasabeef.recyclerview.animators.FadeInUpAnimator类的典型用法代码示例。如果您正苦于以下问题:Java FadeInUpAnimator类的具体用法?Java FadeInUpAnimator怎么用?Java FadeInUpAnimator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FadeInUpAnimator类属于jp.wasabeef.recyclerview.animators包,在下文中一共展示了FadeInUpAnimator类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initRecyclerView
import jp.wasabeef.recyclerview.animators.FadeInUpAnimator; //导入依赖的package包/类
private void initRecyclerView() {
mRecyclerview.setLayoutManager(new LinearLayoutManager(this));
mRecyclerview.setHasFixedSize(true);
mRecyclerview.setItemAnimator(new FadeInUpAnimator());
mAdapter = new CityAdapter(this, dataList);
mRecyclerview.setAdapter(mAdapter);
mAdapter.setOnItemClickListener((view, pos) -> {
if (currentLevel == LEVEL_PROVINCE) {
selectedProvince = provincesList.get(pos);
mRecyclerview.smoothScrollToPosition(0);
queryCities();
} else if (currentLevel == LEVEL_CITY) {
String city = Util.replaceCity(cityList.get(pos).CityName);
if (isChecked) {
OrmLite.getInstance().save(new CityORM(city));
RxBus.getDefault().post(new MultiUpdate());
PLog.d("是多城市管理模式");
} else {
mSharedPreferenceUtil.setCityName(city);
RxBus.getDefault().post(new ChangeCityEvent());
}
finish();
}
});
}
开发者ID:JasonChow1989,项目名称:SeeWeather-master,代码行数:27,代码来源:ChoiceCityActivity.java
示例2: LessonDialogBuilder
import jp.wasabeef.recyclerview.animators.FadeInUpAnimator; //导入依赖的package包/类
public LessonDialogBuilder(Context context, Lesson lesson) {
super(context);
positiveText(R.string.action_close);
customView(R.layout.dialog_view_lesson, true);
ButterKnife.bind(this, customView);
TeacherSubject[] subjects = lesson.getSubjects();
String subjectText = "";
int color;
if (subjects.length > 1) {
List<Integer> colors = new ArrayList<>();
for (int i = 0; i < subjects.length; i++) {
if (i != 0) {
subjectText += ", ";
}
subjectText += subjects[i].getShorthand();
colors.add(subjects[i].getColor());
}
color = ColorUtils.averageColor(colors);
} else {
color = subjects[0].getColor();
subjectText = subjects[0].getFullName();
}
Drawable colorIndicator = ResourcesCompat.getDrawable(context.getResources(), R.drawable.circle, context.getTheme());
if (colorIndicator != null) {
colorIndicator.setColorFilter(color, PorterDuff.Mode.SRC_IN);
icon(colorIndicator);
}
title(subjectText);
day.setText(CalendarUtils.dayToString(context, lesson.getDay()));
if (lesson.getFirstLessonNumber() == lesson.getLastLessonNumber()) {
hours.setText(String.valueOf(lesson.getFirstLessonNumber()));
} else {
hours.setText(context.getString(R.string.format_lesson_number, lesson.getFirstLessonNumber(), lesson.getLastLessonNumber()));
}
CalendarInterval lessonTime = LessonTimeFactory.fromLesson(lesson);
time.setText(lessonTime.toString());
if (subjects.length > 1 || subjects.length == 0) {
layoutSubject.setVisibility(View.GONE);
} else {
subject.setText(subjects[0].getFullName());
teacher.setText(subjects[0].getTeacher().getLastName());
room.setText(subjects[0].getRoom());
layoutList.setVisibility(View.GONE);
}
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
list.setLayoutManager(layoutManager);
RecyclerView.ItemAnimator animator = new FadeInUpAnimator();
list.setItemAnimator(animator);
SubjectAdapter adapter = new SubjectAdapter();
adapter.addAll(Arrays.asList(lesson.getSubjects()));
list.setAdapter(adapter);
list.getLayoutParams().height = adapter.getItemCount() * context.getResources().getDimensionPixelSize(R.dimen.list_item_height_icon);
}
开发者ID:heinrichreimer,项目名称:android-wg-planer,代码行数:74,代码来源:LessonDialogBuilder.java
注:本文中的jp.wasabeef.recyclerview.animators.FadeInUpAnimator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论