android-animation

How to prepare curve translate animation for android?

只愿长相守 提交于 2019-12-30 05:56:39
问题 There are 4 types of animations in android - rotate, alpha,scale and translate. I want to prepare curved translate animation. Is it possible.? 回答1: What Android version do you use? Since API level 11 you can use custom Animators which can easily implement your curve translation. If you use a version below that there is afaik only the possibility to manually concatenate multiple linear translations using the translate animation and setting animation listeners EDIT: Example: View view; animator

Android ImageView blur animation

会有一股神秘感。 提交于 2019-12-30 02:31:08
问题 I'm looking to add a blur animation to an ImageView , but with a set duration. So, for example I want an image to blur out over time. I already have the method to blur the image, but what I need is to make it go from blur to none blur over, say, 2 seconds. Can anybody help me out? EDIT: This is the method I currently have to blur the image. public Bitmap blur(Bitmap sentBitmap, int radius) { // Stack Blur Algorithm by Mario Klingemann <mario@quasimondo.com> Bitmap bitmap = sentBitmap.copy

Tutorial — Android Map Pin drop animation — Working right [closed]

时光毁灭记忆、已成空白 提交于 2019-12-30 00:42:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I needed the map pin drop animation for my android application. Doing a lot of research, i found nothing useful . So i created a small hack. Just posting the code so that other can use it and modify it

How to generate looping animation with ViewPropertyAnimator?

旧时模样 提交于 2019-12-29 06:47:15
问题 I want to build an animation of TextViews, which repeats itself just after completion. For each View I want to animate, I use the following piece of code final float oldX = v.getX(); final float newX = v.getX() - (float)totalWidth; final AnimatorListenerAdapter listener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { v.setX(oldX); animFinished = true; //This line won't compile //v.animate().setDuration(animDuration).setInterpolator(newsInterpolator

Google Maps Android API v2: Visualizing the search radius with the helping of ValueAnimator

自作多情 提交于 2019-12-29 04:06:09
问题 I want to add an animated circle to Google Maps view similar to the circle you see on this image. The circle should be pulsing from the center to the largest radius indicating current user's location and the area of searching. Here is relevant code block Circle circle = mMap.addCircle(new CircleOptions() .center(new LatLng(lat, lon)) .strokeColor(Color.CYAN).radius(1000)); valueAnimator = new ValueAnimator(); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

Activity navigation: custom animation with popEnter and popExit like fragments

戏子无情 提交于 2019-12-28 18:23:10
问题 Changing activities with an animation is possible using the code below: Bundle animation = ActivityOptions.makeCustomAnimation(App.getContext(), R.anim.enter_from_right, R.anim.exit_to_left).toBundle(); startActivity(intent, animation); For fragments you can do something similar on FragmentTransaction: // ... transaction.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left); // ... This works! But I'd like to have an animation when pressing back (pop from backstack). For fragments

Android objectAnimator animate backgroundColor of Layout

有些话、适合烂在心里 提交于 2019-12-28 05:45:25
问题 I have a problem. I want to animate the background color of a LinearLayout , using ObjectAnimator . The problem is that it animates, but it does neither care about duration nor valueFrom and valueTo . This is my xml file: <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="2000" android:propertyName="backgroundColor" android:repeatCount="infinite" android:repeatMode="reverse" android:valueFrom="#FF0000" android:valueTo="#000000" /> In Java I call like

Android Animation Flicker

懵懂的女人 提交于 2019-12-28 02:10:06
问题 I've been trawling through as many threads on this topic that I can find on the flicker that arises in Android 2.2 when dealing with AnimationListeners, but I can't quite solve my issue. What I've got is a LinearLayout 'popover' that the user touches to move down about 100 pixels, and touches again to move it back up. I've finally got it working on the first part without any flicker (thanks to the suggestion to call clearAnimation() on the view being animated), but when doing the opposite (ie

swap fragment in an activity via animation

柔情痞子 提交于 2019-12-28 01:38:59
问题 I want to swap two fragment in an activity via animation.Suppose PageA is for fragement A and left side on the screen and PageB is for fragment B i.e. on the right side of the screen. Now i want that when i click a button on pageA then PageA will move to the right side of the screen with some transition animation. I tried the below code to replace the position FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager

How do android screen coordinates work?

让人想犯罪 __ 提交于 2019-12-27 11:35:21
问题 I am working with Android Animation and I have found the Android coordinate system to be quite confusing so I am here to ask this question about how coordinates work in Android. I am following this image for moving one view to another but it seems it's not working: 回答1: This image presents both orientation(Landscape/Portrait) To get MaxX and MaxY, read on. For Android device screen coordinates, below concept will work. Display mdisp = getWindowManager().getDefaultDisplay(); Point mdispSize =