android-animation

KenBurnsView how to set image resource?

◇◆丶佛笑我妖孽 提交于 2019-12-24 02:30:31
问题 I'm trying to use Faria's KenBurnsView library in my application. KenBurnsView is some extension of ImageView, with a nice animating effect. You may have seen the effect in Foursquare app's images. For the actual picture, the view uses the XML defined "android:src" property. But I want to set the image resource during run-time through Java code. I have tried setImageResource, setBackgroundResource, set".."drawabale and many other methods. But no matter what, my image setting command always

How to adjust relative layout when zooming an item?

喜你入骨 提交于 2019-12-23 23:06:44
问题 I have created a screen in which have created RelativeLayout dynamically. After that I have added some ImageView under RelativeLayout . The requirement is that when I click on any Image View then that ImageView should be zoom by 20% and other images show be adjusted automatically. So I have two problems: How to zoom a particular ImageView (other ImagesView should be zoom out if already zoomed in) How to adjust other Image View when perform zoom in and zoom out Please suggest, I have not

How does Android ObjectAnimator recognize the attributes setter methods?

試著忘記壹切 提交于 2019-12-23 22:41:44
问题 How is ObjectAnimator able to call the appropriate method setX if the attribute x is specified as a string? What I mean is, what technique is used to recognize that I want to animate the attribute rotation of my view and call the appropriate method setRotation of that view? I've already understood how ObjectAnimator works and have managed to use it, it is quite simple, I am just curious about the operating principles. 回答1: There are a number of ways to animate the rotation of a view: 1.

Android - keyboard won't appear for edittext after animation happens

偶尔善良 提交于 2019-12-23 22:39:32
问题 I have seen questions/solutions here for the keyboard not showing up, but none relating to my specific issue. When you click an EditText, the keyboard shows up fine. But, when I animate the EditText first, then when you click the EditText the keyboard will NOT show up. Any ideas why this could be happening? In my Activity I first animate my logo, and after it's done animating I create a fade-in animation for the EditTexts. After they finish the animation, I try and click any of them but the

Animating drawable alpha property

 ̄綄美尐妖づ 提交于 2019-12-23 20:36:36
问题 I want to animate the alpha property of a ViewGroup's background Drawable. I get a reference to the background's drawable using view.getBackground(). Then I use the following code (from this thread): if (backgroundDrawable.getAlpha() == 0) { ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(backgroundDrawable, PropertyValuesHolder.ofInt("alpha", 255)); animator.setTarget(backgroundDrawable); animator.setDuration(2000); animator.start(); } else { ObjectAnimator animator =

NullPointerException while working with GestureDetector

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 18:17:52
问题 Below is the code of loading frameanimation for two different images on the occurrence of different events.First event is while the activity start.Others are the onTouch() where i making use of GestureDetector for the onDown() and onScroll() The problem is that i get NullPointerException while its in the OnScroll() .I found that it is not getting the Y coordinates what can be the issue. package com.example.animationtry; import android.os.Bundle; import android.app.Activity; import android

Using animation on a ViewPager and setFillAfter

寵の児 提交于 2019-12-23 17:08:05
问题 I have a ViewPager which I need to move as a whole on button press. I use an animation for this. When I press it, I translate the 'x' for it. I use setFillAfter(true) to keep the new position. But when I change the page of the ViewPager, it jumps back to the original x-position! I only saw this issue on Android 4.1, with Android 4.0 there is no problem! So it looks like some kind of regression in Android. I attached a testproject where I could reproduce the issue without all my other stuff

Removing the background of a frame animation in Android

主宰稳场 提交于 2019-12-23 12:33:00
问题 How can I remove the background of a frame animation (or set it to be transparent )? When I set the background colour in the xml layout file to be transparent, it turns up black when running it. When I setBackgroundColor(0); in the Java code I get the following exception : java.lang.ClassCastException: android.graphics.drawable.ColorDrawable cannot be cast to android.graphics.drawable.AnimationDrawable /res/layout/dialog_loading.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns

Share Image element transition display incorrect size

↘锁芯ラ 提交于 2019-12-23 07:04:32
问题 I have a recycle view to show all photo thumbnail items. When click on item, I use transition for imageview in this item to Detail activity. The problem is that image source is gotten from internet by UIL. And sometime (not always) the images not reload correct size like this: // on view holder item click final Pair<View, String>[] pairs = TransitionHelper.createSafeTransitionParticipants(this, false, new Pair<>(((ItemViewHolder) viewHolder).thumbnail, getString(R.string.TransitionName

how to make a imageview go in a curve

蹲街弑〆低调 提交于 2019-12-23 04:13:26
问题 i am new in android...i want to make a ferris wheel game and i need to move the ferris wheel chair in the wheel...i use: TranslateAnimation transAnimation1 = new TranslateAnimation(0, 145, 0, 275); transAnimation1.setDuration(6000); ChairA1.startAnimation(transAnimation1); TranslateAnimation transAnimation2 = new TranslateAnimation(0, 50, 0, 50); transAnimation2.setDuration(6000); ChairA2.startAnimation(transAnimation2); TranslateAnimation transAnimation3 = new TranslateAnimation(0, 50, 0, 50