Search in sources :

Example 1 with BaseActivity

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);
    }
}
Also used : LayoutAnimationController(android.view.animation.LayoutAnimationController) BaseActivity(com.instructure.androidpolling.app.activities.BaseActivity)

Example 2 with BaseActivity

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));
}
Also used : LayoutAnimationController(android.view.animation.LayoutAnimationController) BaseActivity(com.instructure.androidpolling.app.activities.BaseActivity)

Example 3 with BaseActivity

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));
}
Also used : SwipeDismissListViewTouchListener(com.instructure.androidpolling.app.util.SwipeDismissListViewTouchListener) ListView(android.widget.ListView) ExpandableListView(android.widget.ExpandableListView) LayoutAnimationController(android.view.animation.LayoutAnimationController) BaseActivity(com.instructure.androidpolling.app.activities.BaseActivity)

Aggregations

LayoutAnimationController (android.view.animation.LayoutAnimationController)3 BaseActivity (com.instructure.androidpolling.app.activities.BaseActivity)3 ExpandableListView (android.widget.ExpandableListView)1 ListView (android.widget.ListView)1 SwipeDismissListViewTouchListener (com.instructure.androidpolling.app.util.SwipeDismissListViewTouchListener)1