use of com.instructure.androidpolling.app.activities.BaseActivity 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 com.instructure.androidpolling.app.activities.BaseActivity in project instructure-android by instructure.
the class AddQuestionFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setRetainInstance(true);
// set an animation for adding list items
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(getActivity(), R.anim.list_layout_controller);
answerContainer.setLayoutAnimation(controller);
checkBundle(getArguments());
((BaseActivity) getActivity()).setActionBarTitle(getString(R.string.createPoll));
}
use of com.instructure.androidpolling.app.activities.BaseActivity in project instructure-android by instructure.
the class QuestionListFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setHasOptionsMenu(true);
// clear the list so we don't get duplicates
pollList.clear();
openSessions.clear();
closedSessions.clear();
setupClickListeners();
touchListener = new SwipeDismissListViewTouchListener(expandableListView, new SwipeDismissListViewTouchListener.DismissCallbacks() {
@Override
public boolean canDismiss(int position) {
return true;
}
@Override
public void onDismiss(ListView listView, int[] reverseSortedPositions) {
for (int position : reverseSortedPositions) {
// set the poll that we want to remove after the api call returns successfully
pollToDelete = (Poll) expandableListView.getItemAtPosition(position);
confirmDelete();
}
}
});
expandableListView.setOnTouchListener(touchListener);
expandableListView.setOnScrollListener(touchListener.makeScrollListener());
// set an animation for adding list items
LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(getActivity(), R.anim.list_layout_controller);
expandableListView.setLayoutAnimation(controller);
((BaseActivity) getActivity()).setActionBarTitle(getString(R.string.pollQuestions));
}
Aggregations