public class UiUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
dpToPx(android.content.Context context,
float dp) |
static void |
enlargeAnim(android.view.View view,
long startOffset)
SpeedDial opening animation.
|
static void |
fadeInAnim(android.view.View view)
Fade out animation.
|
static void |
fadeOutAnim(android.view.View view)
Fade out animation.
|
static int |
getAccentColor(android.content.Context context) |
static android.graphics.Bitmap |
getBitmapFromDrawable(android.graphics.drawable.Drawable drawable)
Creates a
Bitmap from a Drawable. |
static android.graphics.drawable.Drawable |
getDrawableFromBitmap(android.graphics.Bitmap bitmap)
Creates a
Drawable from a Bitmap. |
static int |
getPrimaryColor(android.content.Context context) |
static android.graphics.drawable.Drawable |
getRotateDrawable(android.graphics.drawable.Drawable drawable,
float angle) |
static void |
performTap(android.view.View view)
Perform a tap of
ViewConfiguration.getTapTimeout() milliseconds on the view. |
static int |
pxToDp(float px) |
static void |
rotateBackward(android.view.View view,
boolean animate)
Rotate a view back to its default angle (0°).
|
static void |
rotateForward(android.view.View view,
float angle,
boolean animate)
Rotate a view of the specified degrees.
|
static void |
shrinkAnim(android.view.View view,
boolean removeView)
Closing animation.
|
static void |
shrinkAnim(android.view.View view,
long startOffset)
SpeedDial closing animation.
|
public static int getPrimaryColor(android.content.Context context)
public static int getAccentColor(android.content.Context context)
public static int dpToPx(android.content.Context context,
float dp)
public static int pxToDp(float px)
public static void fadeOutAnim(android.view.View view)
view - view to animate.public static void fadeInAnim(android.view.View view)
view - view to animate.public static void enlargeAnim(android.view.View view,
long startOffset)
view - view that starts that animation.startOffset - a delay in time to start the animationpublic static void shrinkAnim(android.view.View view,
long startOffset)
view - view that starts that animation.startOffset - a delay in time to start the animationpublic static void shrinkAnim(android.view.View view,
boolean removeView)
view - view that starts that animation.removeView - true to remove the view when the animation is over, false otherwise.public static void rotateForward(android.view.View view,
float angle,
boolean animate)
view - The view to rotate.animate - true to animate the rotation, false to be instant.rotateBackward(View, boolean)public static void rotateBackward(android.view.View view,
boolean animate)
view - The view to rotate.animate - true to animate the rotation, false to be instant.rotateForward(View, float, boolean)public static android.graphics.drawable.Drawable getRotateDrawable(android.graphics.drawable.Drawable drawable,
float angle)
@Nullable
public static android.graphics.Bitmap getBitmapFromDrawable(@Nullable
android.graphics.drawable.Drawable drawable)
Bitmap from a Drawable.@Nullable
public static android.graphics.drawable.Drawable getDrawableFromBitmap(@Nullable
android.graphics.Bitmap bitmap)
Drawable from a Bitmap.public static void performTap(android.view.View view)
ViewConfiguration.getTapTimeout() milliseconds on the view.view - the view you want to tap