Android Layout Animations from bottom to top and top to bottom on ImageView click

Try this : Create anim folder inside your res folder and copy this four files : slide_in_bottom.xml : <?xml version=”1.0″ encoding=”utf-8″?> <translate xmlns:android=”http://schemas.android.com/apk/res/android” android:fromYDelta=”100%p” android:duration=”@android:integer/config_longAnimTime”/> slide_out_bottom.xml : <?xml version=”1.0″ encoding=”utf-8″?> <translate xmlns:android=”http://schemas.android.com/apk/res/android” android:fromYDelta=”0″ android:duration=”@android:integer/config_longAnimTime” /> slide_in_top.xml : <?xml version=”1.0″ encoding=”utf-8″?> <translate xmlns:android=”http://schemas.android.com/apk/res/android” android:toYDelta=”0%p” android:duration=”@android:integer/config_longAnimTime” /> slide_out_top.xml : <?xml version=”1.0″ encoding=”utf-8″?> <translate xmlns:android=”http://schemas.android.com/apk/res/android” android:toYDelta=”100%p” android:duration=”@android:integer/config_longAnimTime” /> … Read more

How to slide the ActionBar along with the NavigationDrawer

PLEASE NOTE: This answer was originally written when Android 4.4 (KitKat) was still pretty new. Since Android 5.0 and especially because of the introduction of the ToolBar this answer cannot be considered up-to-date anymore! But from a technical perspective and for those of you who want to learn about the inner workings of Android this … Read more

How to animate ImageView from center-crop to fill the screen and vice versa (facebook style)?

Ok, i’ve found a possible way to do it. i’ve made the layoutParams as variables that keep changing using the ObjectAnimator of the nineOldAndroids library. i think it’s not the best way to achieve it since it causes a lot of onDraw and onLayout, but if the container has only a few views and doesn’t … Read more

How to make the textview blinking

You can use this: TextView myText = (TextView) findViewById(R.id.myText ); Animation anim = new AlphaAnimation(0.0f, 1.0f); anim.setDuration(50); //You can manage the blinking time with this parameter anim.setStartOffset(20); anim.setRepeatMode(Animation.REVERSE); anim.setRepeatCount(Animation.INFINITE); myText.startAnimation(anim); It’s the same answer I gave in this post Blinking Text in android view

How to remove Black background between start new activity during slide_left animation?

Setting the Theme didn’t work for me, but adding an exit animation did. overridePendingTransition (R.anim.push_up_in,R.anim.hold); For the exit animation, I just used an animation that does nothing. <?xml version=”1.0″ encoding=”utf-8″?> <set xmlns:android=”http://schemas.android.com/apk/res/android”> <translate android:fromYDelta=”0%p” android:toYDelta=”0%p” android:duration=”2000″/> </set>

Android – Expandable TextView with Animation

You can check my blog post on ExpandableTexTView: The idea is, initially the TextView will show a small portion of a long text and when it is clicked, it will show the rest of the text. So here is the code that how I solved it. package com.rokonoid.widget; import android.content.Context; import android.content.res.TypedArray; import android.text.SpannableStringBuilder; import … Read more

FragmentTransaction animation to slide in over top

Update (June 16, 2020) Starting from fragment library 1.2.0 the recommanded way to fix this issue is to use FragmentContainerView with FragmentTransaction.setCustomAnimations(). According to the documentation: Fragments using exit animations are drawn before all others for FragmentContainerView. This ensures that exiting Fragments do not appear on top of the view. Steps to fix this issue … Read more