android.view.animation.LayoutAnimationController Java Examples

The following examples show how to use android.view.animation.LayoutAnimationController. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainMenuMgr.java    From android_tv_metro with Apache License 2.0 6 votes vote down vote up
private void intLayoutAnim()
{
    Animation slideIn = new TranslateAnimation(TranslateAnimation.RELATIVE_TO_SELF, -1, TranslateAnimation.ABSOLUTE, 0,
            TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.ABSOLUTE, 0);
    slideIn.setDuration(KAnimTimeShort);
    mAnimIn = new LayoutAnimationController(slideIn, LayoutAnimDelay);

    Animation slideOut = new TranslateAnimation(TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.RELATIVE_TO_SELF, -1,
             TranslateAnimation.ABSOLUTE, 0, TranslateAnimation.ABSOLUTE, 0);
    slideOut.setDuration(KAnimTimeShort);

    slideOut.setFillAfter(true);
    mAnimOut = new LayoutAnimationController(slideOut, LayoutAnimDelay);
    mAnimOut.setOrder(LayoutAnimationController.ORDER_REVERSE);

    mainMenu.setLayoutAnimation(mAnimIn);
    mHideShowListener = new HideShowListener();
    mainMenu.setLayoutAnimationListener(mHideShowListener);

    mReady.autoSetVal(true, AnimationBlockTimer);
}
 
Example #2
Source File: MyArticleTypeFragment.java    From LLApp with Apache License 2.0 6 votes vote down vote up
@Override
protected void onInitView() {
    mSwipeRefreshLayout.setColorSchemeResources(
            R.color.username1,
            R.color.username2,
            R.color.username3,
            R.color.username4,
            R.color.username5,
            R.color.username6);
    mSwipeRefreshLayout.setOnRefreshListener(this);

    mAdapter = new CategoryAdapter(getContext(),R.layout.category_item,mDatas);

    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.addItemDecoration(new RecycleViewDivider(getActivity(), LinearLayoutManager.HORIZONTAL));
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.setOnLoadMoreListener(this);
    mRecyclerView.setEmpty();
    LayoutAnimationController lac = new LayoutAnimationController(AnimationUtils.loadAnimation(getContext(),R.anim.fade_in));
    lac.setOrder(LayoutAnimationController.ORDER_NORMAL);
    mRecyclerView.setLayoutAnimation(lac);
    mRecyclerView.startLayoutAnimation();

    getData(true);

}
 
Example #3
Source File: EventsFragment.java    From Deadline with GNU General Public License v3.0 6 votes vote down vote up
private void setupEventList() {
    RecyclerView recyclerView = mBinding.listEvents;
    mEventsAdapter = new EventsAdapter(getContext(), mViewModel);

    recyclerView.setAdapter(mEventsAdapter);

    ItemTouchHelper touchHelper = new ItemTouchHelper(new EventTouchHelperCallback(mEventsAdapter));
    touchHelper.attachToRecyclerView(recyclerView);

    LayoutAnimationController animationController = AnimationUtils.loadLayoutAnimation(getActivity(), R.anim.layout_fall_down);
    recyclerView.setLayoutAnimation(animationController);

    mEventsAdapter.setEventItemActionListener(new EventItemActionListener() {
        @Override
        public void onItemClicked(String eventId) {
            Bundle bundle = new Bundle();
            bundle.putString(EditFragment.ARG_EDIT_EVENT_ID, eventId);
            Navigation.findNavController(getView()).navigate(R.id.action_events_to_edit, bundle);
        }
    });
}
 
Example #4
Source File: ValidatorFragment.java    From rootvalidator with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

    AnimationSet set = new AnimationSet(true);
    Animation fadeIn = new AlphaAnimation(0.0f, 1.0f);
    fadeIn.setDuration(350);
    set.addAnimation(fadeIn);
    Animation dropDown = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f
    );
    dropDown.setDuration(400);
    set.addAnimation(dropDown);
    LayoutAnimationController controller = new LayoutAnimationController(set, 0.2f);
    recyclerView.setLayoutAnimation(controller);

    recyclerView.setAdapter(adapter);

    fab.setVisibility(View.INVISIBLE);
    introBox.setVisibility(View.VISIBLE);
    workingBox.setVisibility(View.GONE);
    recyclerView.setVisibility(View.GONE);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
}
 
Example #5
Source File: EntityFragment.java    From homeassist with Apache License 2.0 6 votes vote down vote up
private void refreshPreferenceConfigs() {
    Activity activity = getActivity();
    if (activity != null && !activity.isFinishing()) {
        Display display = getActivity().getWindowManager().getDefaultDisplay();
        DisplayMetrics outMetrics = new DisplayMetrics();
        display.getMetrics(outMetrics);

        float density = getResources().getDisplayMetrics().density;
        //float dpHeight = outMetrics.heightPixels / density;
        float dpWidth = outMetrics.widthPixels / density;

        //final int spanCount = getResources().getInteger(R.integer.grid_columns);
        int spanCount = (int) Math.floor(dpWidth / 90.0d);
        final int prefCount = Integer.parseInt(mSharedPref.getString("num_columns", "0"));
        if (prefCount != 0) {
            spanCount = prefCount;
        }

        mRecyclerView.setLayoutManager(new GridLayoutManager(getContext(), spanCount));

        int resId = R.anim.grid_anim;
        LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(getContext(), resId);
        mRecyclerView.setLayoutAnimation(animation);
    }
}
 
Example #6
Source File: StaggeredGridActivity.java    From RecyclerViewAnimation with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_grid);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    mRecyclerView = (StaggeredGridRecyclerView) findViewById(R.id.recycler_view);
    mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
    mStaggeredGridAdapter = new StaggeredGridAdapter();
    mStaggeredGridAdapter.setDataSet(mockData());
    mRecyclerView.setAdapter(mStaggeredGridAdapter);
    LayoutAnimationController controller = MyLayoutAnimationHelper.makeLayoutAnimationController();
    ViewGroup viewGroup = (ViewGroup) findViewById(R.id.root_view);
    viewGroup.setLayoutAnimation(controller);
    viewGroup.scheduleLayoutAnimation();
}
 
Example #7
Source File: MainActivity.java    From Synapse with Apache License 2.0 6 votes vote down vote up
private void solveData() {
    mButler.clear();

    final boolean ready = isDataSetReady();

    if (ready) {
        final LayoutAnimationController controller =
                AnimationUtils.loadLayoutAnimation(this, R.anim.layout_animation_from_bottom);

        mRecyclerView.setLayoutAnimation(controller);
        mRecyclerView.scheduleLayoutAnimation();

        dataSetReady();
    } else {
        dataSetUnready();
    }
}
 
Example #8
Source File: ProjectListFragment.java    From PHONK with GNU General Public License v3.0 6 votes vote down vote up
public void loadFolder(String folder) {
    clear();

    mProjectFolder = folder;

    mListProjects = PhonkScriptHelper.listProjects(mProjectFolder, mOrderByName);
    mProjectAdapter.setArray(mListProjects);
    mGrid.setAdapter(mProjectAdapter);
    // mGrid.clearAnimation();
    // mGrid.startAnimation(mAnim);

    notifyAddedProject();

    final Context context = mGrid.getContext();
    final LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation(context, R.anim.fav_grid_anim);

    mGrid.setLayoutAnimation(controller);
    mGrid.getAdapter().notifyDataSetChanged();
    mGrid.scheduleLayoutAnimation();

    MLog.d(TAG, "loading " + mProjectFolder);
}
 
Example #9
Source File: LayoutAnimationFragment.java    From AndroidAll with Apache License 2.0 5 votes vote down vote up
private void setAnimationByCode(){
    Animation animation= AnimationUtils.loadAnimation(getActivity(), R.anim.slide_in_left);
    //得到一个LayoutAnimationController对象;
    LayoutAnimationController controller = new LayoutAnimationController(animation);
    //设置控件显示的顺序;
    controller.setOrder(LayoutAnimationController.ORDER_REVERSE);
    //设置控件显示间隔时间;
    controller.setDelay(0.5f);
    //为ListView设置LayoutAnimationController属性;
    listView.setLayoutAnimation(controller);
    listView.startLayoutAnimation();
}
 
Example #10
Source File: MyLayoutAnimationHelper.java    From RecyclerViewAnimation with Apache License 2.0 5 votes vote down vote up
public static void applyAnimation(RecyclerView recyclerView) {
    LayoutAnimationController controller = new LayoutAnimationController(getAnimationSetFromLeft());
    controller.setDelay(0.1f);
    controller.setOrder(LayoutAnimationController.ORDER_NORMAL);

    recyclerView.setLayoutAnimation(controller);
    recyclerView.getAdapter().notifyDataSetChanged();
    recyclerView.scheduleLayoutAnimation();
}
 
Example #11
Source File: RecyclerViewActivity.java    From RecyclerViewAnimation with Apache License 2.0 5 votes vote down vote up
/**
 * 播放RecyclerView动画
 *
 * @param animation
 * @param isReverse
 */
public void playLayoutAnimation(Animation animation, boolean isReverse) {
    LayoutAnimationController controller = new LayoutAnimationController(animation);
    controller.setDelay(0.1f);
    controller.setOrder(isReverse ? LayoutAnimationController.ORDER_REVERSE : LayoutAnimationController.ORDER_NORMAL);

    mRecyclerView.setLayoutAnimation(controller);
    mRecyclerView.getAdapter().notifyDataSetChanged();
    mRecyclerView.scheduleLayoutAnimation();
}
 
Example #12
Source File: RecyclerViewActivity.java    From RecyclerViewAnimation with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main_list);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setAdapter(new DemoRecyclerViewAdapter());
    LayoutAnimationController controller = MyLayoutAnimationHelper.makeLayoutAnimationController();
    ViewGroup viewGroup = (ViewGroup) findViewById(R.id.root_view);
    viewGroup.setLayoutAnimation(controller);
    viewGroup.scheduleLayoutAnimation();
}
 
Example #13
Source File: AnimatedRecyclerView.java    From AnimatedRecyclerView with MIT License 5 votes vote down vote up
public AnimatedRecyclerView(Context context, int orientation, boolean reverse,
                            int animationDuration, int layoutManagerType, int columns,
                            int animation, LayoutAnimationController animationController) {
    super(context);
    this.orientation = orientation;
    this.reverse = reverse;
    this.animationDuration = animationDuration;
    this.layoutManagerType = layoutManagerType;
    this.columns = columns;
    this.animation = animation;
    this.animationController = animationController;
    init(context, null);
}
 
Example #14
Source File: ActionSheetDialog.java    From RecordVideo with Apache License 2.0 5 votes vote down vote up
private void init() {
    widthScale(0.95f);
    /** LayoutAnimation */
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,
            0f, Animation.RELATIVE_TO_SELF, 6f, Animation.RELATIVE_TO_SELF, 0);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(350);
    animation.setStartOffset(150);

    mLac = new LayoutAnimationController(animation, 0.12f);
    mLac.setInterpolator(new DecelerateInterpolator());
}
 
Example #15
Source File: ProdukActivity.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 5 votes vote down vote up
public void generateListTechnology(List<Produk> produkList){
    try{
        int resId = R.anim.layout_animation_from_down;
        LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(this, resId);
        produkAdapter = new ProdukAdapter(this, produkList);
        RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 2);
        recyclerView.setLayoutManager(mLayoutManager);
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.setLayoutAnimation(animation);
        recyclerView.setAdapter(produkAdapter);
    }catch (Exception e){

    }
}
 
Example #16
Source File: PengaduanTenantActivity.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 5 votes vote down vote up
public void generateListPengaduan(List<Pengaduan> pengaduanList){
    try{
        int resId = R.anim.layout_animation_from_down;
        LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(this, resId);

        pengaduanAdapter = new PengaduanAdapter(this, pengaduanList);
        RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 1);
        recyclerView.setLayoutManager(mLayoutManager);
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.setLayoutAnimation(animation);
        recyclerView.setAdapter(pengaduanAdapter);
    }catch (Exception e){

    }
}
 
Example #17
Source File: GalleryActivity.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 5 votes vote down vote up
public void generateListTechnology(List<Gallery> tenantList){
    try{
        int resId = R.anim.layout_animation_from_down;
        LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(this, resId);
        galleryAdapter = new GalleryAdapter(this, tenantList);
        RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 3);
        recyclerView.setLayoutManager(mLayoutManager);
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.setLayoutAnimation(animation);
        recyclerView.setAdapter(galleryAdapter);
    }catch (Exception e){

    }
}
 
Example #18
Source File: EntryListView.java    From Aegis with GNU General Public License v3.0 5 votes vote down vote up
public void runEntriesAnimation() {
    final Context context = _recyclerView.getContext();
    final LayoutAnimationController controller =
            AnimationUtils.loadLayoutAnimation(context, R.anim.layout_animation_fall_down);

    _recyclerView.setLayoutAnimation(controller);
    _recyclerView.scheduleLayoutAnimation();
}
 
Example #19
Source File: ActionSheetDialog.java    From AutoTest with MIT License 5 votes vote down vote up
private void init() {
    widthScale(0.95f);
    /** LayoutAnimation */
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,
            0f, Animation.RELATIVE_TO_SELF, 6f, Animation.RELATIVE_TO_SELF, 0);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(350);
    animation.setStartOffset(150);

    mLac = new LayoutAnimationController(animation, 0.12f);
    mLac.setInterpolator(new DecelerateInterpolator());
}
 
Example #20
Source File: ActionSheetDialog.java    From SprintNBA with Apache License 2.0 5 votes vote down vote up
private void init() {
    widthScale(0.95f);
    /** LayoutAnimation */
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,
            0f, Animation.RELATIVE_TO_SELF, 6f, Animation.RELATIVE_TO_SELF, 0);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(350);
    animation.setStartOffset(150);

    mLac = new LayoutAnimationController(animation, 0.12f);
    mLac.setInterpolator(new DecelerateInterpolator());
}
 
Example #21
Source File: NormalListDialog.java    From SprintNBA with Apache License 2.0 5 votes vote down vote up
private void init() {
    widthScale(0.8f);

    /** LayoutAnimation */
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 2f, Animation.RELATIVE_TO_SELF,
            0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(550);

    mLac = new LayoutAnimationController(animation, 0.12f);
    mLac.setInterpolator(new DecelerateInterpolator());
}
 
Example #22
Source File: WorkSpaceActivity.java    From ThinkMap with Apache License 2.0 5 votes vote down vote up
private void initListViewAnim() {
    Animation animation = AnimationUtils.loadAnimation(this, R.anim.right_in);
    LayoutAnimationController controller = new LayoutAnimationController(animation);
    controller.setDelay(0.3f);
    controller.setOrder(0);
    controller.setInterpolator(new EaseCubicInterpolator(0.47f, 0.01f, 0.44f, 0.99f));
    rcvCurrentFiles.setLayoutAnimation(controller);
}
 
Example #23
Source File: RearrangeableLayout.java    From RearrangeableLayout with MIT License 5 votes vote down vote up
private void init(Context context, AttributeSet attrs) {
    mStartTouch = null;
    mSelectedChild = null;
    mContainer = new SparseArray<Parcelable>(5);
    mListener = null;
    mChildStartRect = null;
    mChildEndRect = null;

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RearrangeableLayout);
    float strokeWidth = a.getDimension(R.styleable.RearrangeableLayout_outlineWidth, 2.0f);
    int color = a.getColor(R.styleable.RearrangeableLayout_outlineColor, Color.GRAY);
    float alpha = a.getFloat(R.styleable.RearrangeableLayout_selectionAlpha, 0.5f);
    mSelectionZoom = a.getFloat(R.styleable.RearrangeableLayout_selectionZoom, 1.2f);
    a.recycle();

    float filter[] = new float[] {
            1f, 0f, 0f, 0f, 0f,
            0f, 1f, 0f, 0f, 0f,
            0f, 0f, 1f, 0f, 0f,
            0f, 0f, 0f, alpha, 0f
    };
    ColorMatrixColorFilter colorFilter = new ColorMatrixColorFilter(new ColorMatrix(filter));

    mOutlinePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mOutlinePaint.setStyle(Paint.Style.STROKE);
    mOutlinePaint.setStrokeWidth(strokeWidth);
    mOutlinePaint.setColor(color);
    mOutlinePaint.setColorFilter(colorFilter);

    mSelectionPaint = new Paint();
    mSelectionPaint.setColorFilter(colorFilter);

    Animation trans = new TranslateAnimation(Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0,
            Animation.RELATIVE_TO_PARENT, 1, Animation.RELATIVE_TO_PARENT, 0);
    trans.setDuration(500);
    trans.setInterpolator(new AccelerateInterpolator(1.0f));

    LayoutAnimationController c = new LayoutAnimationController(trans, 0.25f);
    setLayoutAnimation(c);
}
 
Example #24
Source File: ActionSheetDialog.java    From FlycoDialog_Master with MIT License 5 votes vote down vote up
private void init() {
    widthScale(0.95f);
    /** LayoutAnimation */
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF,
            0f, Animation.RELATIVE_TO_SELF, 6f, Animation.RELATIVE_TO_SELF, 0);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(350);
    animation.setStartOffset(150);

    mLac = new LayoutAnimationController(animation, 0.12f);
    mLac.setInterpolator(new DecelerateInterpolator());
}
 
Example #25
Source File: NormalListDialog.java    From FlycoDialog_Master with MIT License 5 votes vote down vote up
private void init() {
    widthScale(0.8f);

    /** LayoutAnimation */
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 2f, Animation.RELATIVE_TO_SELF,
            0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(550);

    mLac = new LayoutAnimationController(animation, 0.12f);
    mLac.setInterpolator(new DecelerateInterpolator());
}
 
Example #26
Source File: MarkActivity.java    From school_shop with MIT License 5 votes vote down vote up
private void initSearchTagList() {
	searchListView = (ListView)findViewById(R.id.mark_tab_choose_listView);
	tagTextView = (EmojiconEditText)findViewById(R.id.search_tag_brand);
	
	String[] mStrings = { "Abbaye de Belloc",
			"\ue32dAbbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi",
			"Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu",
			"Airag", "Airedale", "Aisy Cendre", "Abertam", "Abondance", "Ackawi",
			"Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu",
			"Airag", "Airedale", "Aisy Cendre" };
	
	initSearchListener();
	AnimationSet animationSet = new AnimationSet(false);
	Animation animation = new AlphaAnimation(0,1);   //AlphaAnimation 控制渐变透明的动画效果
	animation.setDuration(300);     //动画时间毫秒数
	animationSet.addAnimation(animation);    //加入动画集合
	LayoutAnimationController controller = new LayoutAnimationController(animationSet, 1);
	
	// 设置列表内容
	mListItems = new ArrayList<String>();
	mListItems.addAll(Arrays.asList(mStrings));
	mListItems.set(0, getResources().getString(R.string.add_tag_text));
	
	tagSearchAdapter = new TagSearchAdapter(this, R.layout.item_search_tag_list, mListItems);
	searchListView.setLayoutAnimation(controller);
	searchListView.setAdapter(tagSearchAdapter);
}
 
Example #27
Source File: MainUIActivity.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public void listAnim()
{
    LayoutAnimationController layoutanimationcontroller = new LayoutAnimationController(AnimationUtils.loadAnimation(this, 0x7f040008));
    layoutanimationcontroller.setOrder(0);
    layoutanimationcontroller.setInterpolator(new DecelerateInterpolator());
    layoutanimationcontroller.setDelay(0.5F);
    G.setLayoutAnimation(layoutanimationcontroller);
}
 
Example #28
Source File: DynamicDetailFragment.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
private void a(ViewGroup viewgroup, ViewGroup viewgroup1)
{
    viewgroup.setVisibility(4);
    viewgroup1.setVisibility(0);
    AnimationSet animationset = new AnimationSet(true);
    AlphaAnimation alphaanimation = new AlphaAnimation(0.0F, 1.0F);
    alphaanimation.setDuration(80L);
    animationset.addAnimation(alphaanimation);
    TranslateAnimation translateanimation = new TranslateAnimation(1, 0.0F, 1, 0.0F, 1, -1F, 1, 0.0F);
    translateanimation.setDuration(100L);
    translateanimation.setInterpolator(new DecelerateInterpolator());
    animationset.addAnimation(translateanimation);
    viewgroup1.setLayoutAnimation(new LayoutAnimationController(animationset, 0.7F));
    viewgroup1.requestLayout();
}
 
Example #29
Source File: ConferenceListFragment.java    From conference-central-android-app with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getListView().setFastScrollEnabled(true);
    LayoutAnimationController controller = AnimationUtils
            .loadLayoutAnimation(getActivity(), R.anim.list_layout_controller);
    getListView().setLayoutAnimation(controller);
    mAdapter = new ConferenceDataAdapter(getActivity());
    setEmptyText(getString(R.string.no_conferences));
    setListAdapter(mAdapter);
    setListShown(false);
}
 
Example #30
Source File: FlyTxtView.java    From FlyTxtView with Apache License 2.0 5 votes vote down vote up
public void init() {
	animationSet = new AnimationSet(true);
	layoutAnimationController = new LayoutAnimationController(animationSet, 0.3f);
	layoutAnimationController.setOrder(LayoutAnimationController.ORDER_NORMAL);
	setAnimation(null);
	setLayoutAnimation(layoutAnimationController);
}