How to make Text view Auto change Text Flipper in Android Studio Source Code

 How to make textview Auto change Text Flipper in Android Studio Source Code.


Carefully! Follow the Steps.....


Flipper Java Code.


MainActivity.java File Code.


Step 1:

Make sure you have ad this line.


//ad this veriable for flipper
private AdapterViewFlipper adapterViewFlipper;



After adding this line 



Step 2:

Copy source code and paste this source code into MainActivity.java Class
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);


//Flipper COder Here By Ajjuvirus
adapterViewFlipper =(AdapterViewFlipper)findViewById(R.id.View_flliper_Id);
CustomAdapter customAdapter=new CustomAdapter(this,ImageNames);
adapterViewFlipper.setAdapter(customAdapter);
//you can change its timing from this line
adapterViewFlipper.setFlipInterval(6000);
adapterViewFlipper.setAutoStart(true);


Step 3:

Go to  MainActivity.xml file.
Copy this source code and Paste it.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/icon_color_bg"
android:gravity="center"
android:orientation="vertical"
>
<AdapterViewFlipper
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/View_flliper_Id">
</AdapterViewFlipper>

</LinearLayout>

After pasting it...

Create new XML File & Name is Flipper Items 
and Copy this source code and paste in that XML file.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@drawable/icon_color_bg"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">

<TextView
android:layout_width="match_parent"
android:id="@+id/flipText"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:textColor="@color/black"
android:singleLine="false"
android:fontFamily="@font/kaushan_script"
android:gravity="center"
android:padding="20dp"
android:textSize="20sp" />


</LinearLayout>

Now Run your App and see is working or not let me know.


I am Always here yo help you...

Keep supporting and Loving....



More Related Topics.



if unfortunately source code not working comment blow. 

Comments

Popular posts from this blog

Click Ads Earn Money 💰 watch ads and earn $5 dollars per Ad with proof👍

All Language Translator App Android Studio Source code by ajjuvirus.inc

Kotlin coroutines on Android Step by Step Basic to advance