maqshid / splash-screen

package com.mahans.soundefek; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.widget.TextView; public class MainActivity extends AppCompatActivity { Animation topAnim, bottomAnim; ImageView image; TextView text, text_logo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); topAnim = AnimationUtils.loadAnimation(this, R.anim.top_animation); bottomAnim = AnimationUtils.loadAnimation(this, R.anim.bottom_animation); image = findViewById(R.id.img_1); text = findViewById(R.id.text_b); text_logo= findViewById(R.id.text1); text.setAnimation(topAnim); image.setAnimation(bottomAnim); text_logo.setAnimation(bottomAnim); new Handler().postDelayed(new Runnable() { @Override public void run() { startActivity(new Intent(MainActivity.this, HomeActivity.class)); finish(); } }, 4000); } @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { hideSystemUI(); } } private void hideSystemUI() { // Enables regular immersive mode. // For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE. // Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY View decorView = getWindow().getDecorView(); decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_FULLSCREEN); } }

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<ImageView
    android:layout_width="76dp"
    android:layout_height="76dp"
    android:layout_gravity="center"
    android:layout_marginTop="310dp"
    android:src="@drawable/logo"
    android:id="@+id/img_1"/>

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAlignment="center"
    android:text="@string/power"
    android:id="@+id/text_b"
    android:textSize="18sp"
    android:textStyle="bold"
    android:textColor="@color/black"
    android:layout_marginTop="270dp"/>

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAlignment="center"
    android:text="@string/pembuat"
    android:id="@+id/text1"
    android:textSize="18sp"
    android:textStyle="normal"
    android:textColor="@color/black"
    android:layout_marginTop="5dp"/>

About

package com.mahans.soundefek; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.widget.TextView; public class MainActivity extends AppCompatActivity { Animation topAnim, bottomAnim; ImageView image; TextView text, text_logo; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); topAnim = AnimationUtils.loadAnimation(this, R.anim.top_animation); bottomAnim = AnimationUtils.loadAnimation(this, R.anim.bottom_animation); image = findViewById(R.id.img_1); text = findViewById(R.id.text_b); text_logo= findViewById(R.id.text1); text.setAnimation(topAnim); image.setAnimation(bottomAnim); text_logo.setAnimation(bottomAnim); new Handler().postDelayed(new Runnable() { @Override public void run() { startActivity(new Intent(MainActivity.this, HomeActivity.class)); finish(); } }, 4000); } @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { hideSystemUI(); } } private void hideSystemUI() { // Enables regular immersive mode. // For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE. // Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY View decorView = getWindow().getDecorView(); decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_FULLSCREEN); } }


Languages

Language:Java 100.0%