Search in sources :

Example 11 with LayoutAnimationController

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<>();
}
Also used : ArrayList(java.util.ArrayList) LayoutAnimationController(android.view.animation.LayoutAnimationController) Course(com.instructure.canvasapi2.models.Course)

Example 12 with LayoutAnimationController

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

Example 13 with LayoutAnimationController

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;
}
Also used : LayoutAnimationController(android.view.animation.LayoutAnimationController) ImageView(android.widget.ImageView)

Example 14 with LayoutAnimationController

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);
}
Also used : LayoutAnimationController(android.view.animation.LayoutAnimationController) List(java.util.List) UploadHistoryListAdapter(com.thecoolguy.rumaan.fileio.adapters.UploadHistoryListAdapter) UploadItem(com.thecoolguy.rumaan.fileio.data.models.UploadItem) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ActionBar(android.support.v7.app.ActionBar) UploadItemViewModel(com.thecoolguy.rumaan.fileio.data.UploadItemViewModel)

Example 15 with 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();
            }
        }
    });
}
Also used : BookListAdapter(cn.liuyin.manhua.adapter.BookListAdapter) LayoutAnimationController(android.view.animation.LayoutAnimationController) AdapterView(android.widget.AdapterView) Intent(android.content.Intent) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Aggregations

LayoutAnimationController (android.view.animation.LayoutAnimationController)35 ListView (android.widget.ListView)11 TranslateAnimation (android.view.animation.TranslateAnimation)9 Animation (android.view.animation.Animation)8 Paint (android.graphics.Paint)7 Cursor (android.database.Cursor)6 AlphaAnimation (android.view.animation.AlphaAnimation)6 AnimationSet (android.view.animation.AnimationSet)6 ListAdapter (android.widget.ListAdapter)6 SimpleCursorAdapter (android.widget.SimpleCursorAdapter)6 View (android.view.View)5 Intent (android.content.Intent)3 AdapterView (android.widget.AdapterView)3 ImageView (android.widget.ImageView)3 BaseActivity (com.instructure.androidpolling.app.activities.BaseActivity)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 ViewGroup (android.view.ViewGroup)2 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)2 SearchAdapter (cn.liuyin.manhua.adapter.SearchAdapter)2 SwipeDismissListViewTouchListener (com.instructure.androidpolling.app.util.SwipeDismissListViewTouchListener)2