android-animation

Shared element transition among fragments that belong to different activities in Android lollipop

大城市里の小女人 提交于 2019-12-22 04:01:58
问题 I have a shared element in a fragment that belongs to one Activity. I want to make a shared element transition in Android Lollipop with an element that is part of a fragment that belongs to another activity. Is it possible? How can I achieve that? 回答1: It's possible. First, when you detect in your fragment that transition is about to happen, build a array of Pair<View, String> which you populate with view and transition name. For example, if you want to animate from thumbnail image to full

Zoom out animation - Android

≡放荡痞女 提交于 2019-12-22 01:30:52
问题 I am using zoom in animation for a view in my app. When the user clicks on a button the next activity zooms in from that button. This is what I have achieved using the code give below. Since the in the video mentioned above, the code that was shown only worked for jellybean and above I had to use the code given below. Next_Activity.java (The activity with zoom in animation) Bundle b = getIntent().getExtras(); // Bundle passed from previous activity to this activity x = b.getInt("X"); //b is

ActionBarSherlock animation moves position

纵然是瞬间 提交于 2019-12-21 20:05:21
问题 I have a menu option in my ActionBarSherlock Actionbar that kicks off an AsyncTask. I'm trying to get the icon to animate while the background task is running. I have it working, except when I click on the icon, the icon itself will "jump" a couple pixels over to the right, and it's very noticeable. Not exactly sure what is causing that to happen. This is what I have so far: private MenuItem refreshItem; private void DoRefresh() { final LayoutInflater inflater = (LayoutInflater)activity

how to rotate an image continuously?

一世执手 提交于 2019-12-21 07:55:48
问题 I am trying to rotate this image by using a thread. what should I do? public class Start extends Activity { View base; Bitmap rotate, base1, rotate1; ImageView rotator; float angle, pivX, pivY; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.start); base = findViewById(R.id.base); rotator = (ImageView) findViewById(R.id.rotator); pivX = (rotator.getLeft()) / 2; pivY = (rotator.getTop()) / 2; Thread thread = new Thread(

Anyway to programmatically animate layout weight property of linear layout

ⅰ亾dé卋堺 提交于 2019-12-21 07:00:48
问题 I have two views in a linear layout, I programmatically change their layout_weight property. Is there a way I could animate this change in weight so when the weight is changed views slides towards a new size? 回答1: You can simply use ObjectAnimator. ObjectAnimator anim = ObjectAnimator.ofFloat( viewToAnimate, "weight", startValue, endValue); anim.setDuration(2500); anim.start(); The one problem is that View class has no setWeight() method (which is required by ObjectAnimator). To address this

Android - Layout Animation Doesn't stay on top

百般思念 提交于 2019-12-21 06:45:14
问题 I need to make 2 screens with custom animation like explained below : Screen 1 Screen 2 ----------------------------- ------------------------------ | | | | | | | | | | | | | | | | | | | List 1 | List2 | ---------> | List 3 | List 4 | | (75% width) |(25% wid)| |(25%wid)| (75% width) | | | | | | | | | | | | | ----------------------------- ------------------------------ User makes a long touch on an item in List 1 and slides from left to right. The view containing List 1 moves from left to

RecyclerView - SlideIn animation on activity start

浪子不回头ぞ 提交于 2019-12-21 06:28:00
问题 How can I add a slide in animation on my recycler view items one after the other. Like as the activity starts, the list items of the recycler view slides in one by one. I am using LinearLayoutManager Not all at the same time should slide in. And not even while scrolling. Just at the time of activity creation. I searched but didn't find anything. I want to achieve something like this : https://youtu.be/Q8TXgCzxEnw?t=30s 回答1: I put together a sample app a couple of months ago that has a

RecyclerView - SlideIn animation on activity start

冷暖自知 提交于 2019-12-21 06:26:25
问题 How can I add a slide in animation on my recycler view items one after the other. Like as the activity starts, the list items of the recycler view slides in one by one. I am using LinearLayoutManager Not all at the same time should slide in. And not even while scrolling. Just at the time of activity creation. I searched but didn't find anything. I want to achieve something like this : https://youtu.be/Q8TXgCzxEnw?t=30s 回答1: I put together a sample app a couple of months ago that has a

Animate RecyclerView items one by one

橙三吉。 提交于 2019-12-21 05:14:19
问题 I'm trying to animate my RecyclerView items in my app. I tried using this code in my adapter: public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { myHolder = holder as MyView; if (position > mCurrentPosition) { int currentAnim = Android.Resource.Animation.SlideInLeft; SetAnimation(holder.ItemView, currentAnim); mCurrentPosition = position; } } private void SetAnimation(View view, int currentAnim) { Animation anim = AnimationUtils.LoadAnimation(mContext,

How to programmatically animate an ImageView

瘦欲@ 提交于 2019-12-21 03:57:30
问题 I am trying to animate an ImageView when the said image view is clicked. Specifically I want the size of the ImageView gets bigger (say .20 bigger) and the immediately shrink back to its original size). So far I have been experimenting with this code with no luck. // thumbLike is the imageView I would like to animate. button.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub ScaleAnimation scaleAnim = new ScaleAnimation(1.0f, 2