Skip to main content

Posts

Showing posts with the label scaling

Falling Animation in ANDROID using Animation of Translate

Falling animation is used to bring transition to a view between two X points or two Y points. In Android, you can apply this scaling effect to almost anything, from simple text, to images, buttons, etc… in res/anim/falling.xml suppose if transition to be done between two different X indexes use.. <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <translate android:fromXDelta="-100%p" android:toXDelta="0" android:duration="2000"/> </set> suppose if transition to be done between two different Y indexes use.. <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <translate android:fr...

Scaling Animation In ANDROID

Scaling animation is used to scale a view. In Android, you can apply this scaling effect to almost anything, from simple text, to images, buttons, etc…  Here simply I will explain a scaling textview which you can apply to other views also... In res/anim/scale.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <scale android:fromXScale="0.0" android:toXScale="1.0" android:fromYScale="0.0" android:toYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:duration="2000" /> </set> Java source code is given below public class Textviewanimation extends Activity { Animation fadeIn,fadeOut; TextView tv; Button startanimation; @Override public void onCreate(Bundle savedInstanceState) ...

Custom AlertBox in Android

in main.xml file: < ?xml version="1.0" encoding="utf-8"?> < LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > < Button android:id="@+id/button1" android:layout_width="120dp" android:layout_height="wrap_content" android:text="Button" /> < /LinearLayout> in dialog.xml :(xml for custom dialog box) : < ?xml version="1.0" encoding="utf-8"?> < LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > < ImageView android:id="@+id/imageView1" android:layout_widt...

Working with images in Corona

Loading an Image : syntax: display.newImage( filename [, baseDirectory] [, left, top] ) example: newImage = display.newImage( "image.png", 10, 20 ) myImage2 = display.newImage( "image.png" ) Image Autoscaling: The default behavior of display.newImage() is to auto-scale large images.To control manually we can use boolean value. syntax: display.newImage( [parentGroup,] filename [, baseDirectory] [, x, y] [,isFullResolution] ) example: newImage = display.newImage( "image.png", 10, 20, true ) Images with Dynamic Resolution : syntax: display.newImageRect( [parentGroup,] filename [, baseDirectory] w,h ) example: newImage = display.newImageRect( "Image.png", 100, 100 )