use of android.view.animation.LayoutAnimationController in project instructure-android by instructure.
the class OpenPollExpandableListFragment method configureViews.
@Override
public void configureViews(View rootView) {
if (getArguments() != null) {
ArrayList<Course> courseList = (ArrayList<Course>) getArguments().getSerializable(Constants.COURSES_LIST);
if (courseList != null) {
courseMap = createCourseMap(courseList);
} else {
courseMap = new HashMap<>();
}
} else {
courseMap = new HashMap<>();
}
// set an animation for adding list items
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(getActivity(), R.anim.list_layout_controller);
getExpandableListView().setLayoutAnimation(controller);
pollMap = new HashMap<>();
}
use of android.view.animation.LayoutAnimationController in project instructure-android by instructure.
the class StudentPollFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
handleArguments(getArguments());
if (poll != null) {
updateViews(poll);
PollsManager.getFirstPagePollChoices(poll.getId(), pollChoiceCallback, true);
}
if (pollSession != null) {
showResults = pollSession.has_public_results();
isPublished = pollSession.is_published();
getTotalResults();
}
if (hasSubmitted || !isPublished) {
updateViewsSubmitted();
}
// set an animation for adding list items
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(getActivity(), R.anim.list_layout_controller);
listView.setLayoutAnimation(controller);
setupListeners();
if (getActivity() instanceof BaseActivity) {
((BaseActivity) getActivity()).setTitle(R.string.poll);
}
}
use of android.view.animation.LayoutAnimationController in project android_packages_apps_Dialer by MoKee.
the class SpeedDialFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Trace.beginSection(TAG + " onCreateView");
mParentView = inflater.inflate(R.layout.speed_dial_fragment, container, false);
mListView = (PhoneFavoriteListView) mParentView.findViewById(R.id.contact_tile_list);
mListView.setOnItemClickListener(this);
mListView.setVerticalScrollBarEnabled(false);
mListView.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_RIGHT);
mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
mListView.getDragDropController().addOnDragDropListener(mContactTileAdapter);
final ImageView dragShadowOverlay = (ImageView) getActivity().findViewById(R.id.contact_tile_drag_shadow_overlay);
mListView.setDragShadowOverlay(dragShadowOverlay);
mEmptyView = (EmptyContentView) mParentView.findViewById(R.id.empty_list_view);
mEmptyView.setImage(R.drawable.empty_speed_dial);
mEmptyView.setActionClickedListener(this);
mContactTileFrame = mParentView.findViewById(R.id.contact_tile_frame);
final LayoutAnimationController controller = new LayoutAnimationController(AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in));
controller.setDelay(0);
mListView.setLayoutAnimation(controller);
mListView.setAdapter(mContactTileAdapter);
mListView.setOnScrollListener(mScrollListener);
mListView.setFastScrollEnabled(false);
mListView.setFastScrollAlwaysVisible(false);
// prevent content changes of the list from firing accessibility events.
mListView.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_NONE);
ContentChangedFilter.addToParent(mListView);
Trace.endSection();
return mParentView;
}
use of android.view.animation.LayoutAnimationController in project file.io-app by rumaan.
the class UploadHistoryActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_upload_history);
ButterKnife.bind(this);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle(getString(R.string.upload_history_title));
actionBar.setDisplayHomeAsUpEnabled(true);
}
final UploadHistoryListAdapter uploadHistoryListAdapter = new UploadHistoryListAdapter(this);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(linearLayoutManager);
uploadItemViewModel = ViewModelProviders.of(this).get(UploadItemViewModel.class);
uploadItemViewModel.getUploadHistoryList().observe(this, new Observer<List<UploadItem>>() {
@Override
public void onChanged(@Nullable List<UploadItem> uploadItems) {
if ((uploadItems == null) || uploadItems.isEmpty()) {
noUploadsView.setVisibility(View.VISIBLE);
recyclerView.setVisibility(View.INVISIBLE);
} else {
noUploadsView.setVisibility(View.INVISIBLE);
recyclerView.setVisibility(View.VISIBLE);
uploadHistoryListAdapter.setUploadItemList(uploadItems);
recyclerView.addItemDecoration(getSectionCallback(uploadItemViewModel.getUploadHistoryList().getValue()));
}
}
});
recyclerView.setAdapter(uploadHistoryListAdapter);
uploadHistoryListAdapter.setOnUploadItemLongClickListener(this);
LayoutAnimationController layoutAnimationController = AnimationUtils.loadLayoutAnimation(this, R.anim.layout_anim_fall_down);
recyclerView.setLayoutAnimation(layoutAnimationController);
}
use of android.view.animation.LayoutAnimationController in project Manhua by ag2s20150909.
the class ListActivity method showList.
private void showList(final ChaptersBean chapters) {
if (chapters == null) {
return;
}
if (chapters.code != 0) {
mHander.obtainMessage(0, chapters.message).sendToTarget();
return;
}
int possion;
book = BookShelf.getBookById(book.bookid);
possion = book != null ? book.index : 1;
if (adapter == null) {
adapter = new BookListAdapter(ListActivity.this, chapters, possion);
// lv.setLayoutAnimation(new LayoutAnimationController(AnimationUtils.loadAnimation(this, R.anim.list_animation), 0.5f));
lv.setAdapter(adapter);
} else {
adapter.updateView(chapters, possion);
}
lv.setLayoutAnimation(new LayoutAnimationController(AnimationUtils.loadAnimation(this, R.anim.list_animation), 0.5f));
lv.setSelection(possion - 1);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> p1, View p2, int p3, long p4) {
try {
Intent i = new Intent(ListActivity.this, BookContentActivity.class);
i.putExtra("data", chapters);
i.putExtra("book", book);
i.putExtra("index", p3 + 1);
// Toast.makeText(ListActivity.this,data.get(p3).get("url"),1).show();
startActivity(i);
} catch (Exception e) {
e.printStackTrace();
mHander.obtainMessage(0, e.getMessage()).sendToTarget();
}
}
});
}
Aggregations