Android studio UpToDown animation welcome screen app create ?
Hello Guys how to create Android studio up to down animation welcome screen create
Let's create your app first open your Android Studio and create the project Name you want it.then gradel run finished. You look to page MainActivty.xml
Second is MainActivaty.java. Now go to you
MainActivaty.xml here you design you
layout. constantlayout change Relativelayout height ="match parent"
And width="match parent" orientation="Vatical" guys after that creat codeing
now create anim folder Right Mouse click and now go to New and create an Animation Resource file
name it you any want. now set coding
MainActivaty.xml here you design you
layout. constantlayout change Relativelayout height ="match parent"
And width="match parent" orientation="Vatical" guys after that creat codeing
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="#7A3535"> <ImageView android:layout_width="300dp"
android:layout_height="200dp"
android:id="@+id/gh"
android:layout_marginTop="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/kl"/> <TextView android:textSize="25dp"
android:textColor="#0CFA68" android:id="@+id/jkj"
android:layout_marginTop="50dp"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" hello gues welocome blogger"
android:layout_below="@+id/gh"/> </RelativeLayout>guys now res folder right mouse click and open android Resource file directory and name this anim
now create anim folder Right Mouse click and now go to New and create an Animation Resource file
name it you any want. now set coding
Animation file coading
<set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromXDelta="0%p"
android:fromYDelta="-100%p"
android:duration="8000"> </translate> </set> you create two anmation resorce file<set xmlns:
android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="-100%p"
android:fromYDelta="0%p"
android:duration="8000"> </translate> </set>
just this type now got to your Mainactivaty.java and casteing your Imageview and textview
here are coading Example package com.dbzshiva.youtbe;
import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private ImageView img; TextView textView; Animation anima,animation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); img=(ImageView)findViewById(R.id.gh); textView=(TextView) findViewById(R.id.jkj); anima = AnimationUtils.loadAnimation(this,R.anim.uptdown); animation = AnimationUtils.loadAnimation(this,R.anim.downtouip); img.setAnimation(animation); textView.setAnimation(anima);
now run your applation your vatual device. you look your up and down anmation. thank for
reading my aticals.
No comments