Skip to content

Commit 07300cb

Browse files
committed
Splash screen and translated
Custom splash screen and internalization
1 parent 8334bb3 commit 07300cb

10 files changed

Lines changed: 453 additions & 323 deletions

File tree

app/src/main/AndroidManifest.xml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,31 @@
1515
android:theme="@style/Theme.TheAnimeDatabase"
1616
tools:targetApi="31">
1717
<activity
18-
android:name=".MainActivity"
18+
android:name=".SplashScreen"
19+
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
1920
android:exported="true">
20-
<intent-filter>
21-
<action android:name="android.intent.action.MAIN" />
21+
<intent-filter>
22+
<action android:name="android.intent.action.MAIN" />
2223

23-
<category android:name="android.intent.category.LAUNCHER" />
24-
</intent-filter>
24+
<category android:name="android.intent.category.LAUNCHER" />
25+
</intent-filter>
26+
</activity>
27+
<activity
28+
android:name=".MainActivity"
29+
android:exported="true"
30+
android:screenOrientation="fullSensor">
2531
</activity>
2632
<activity
27-
android:name=".AnimeDetailsActivity">
33+
android:name=".AnimeDetailsActivity"
34+
android:screenOrientation="fullSensor">
2835
</activity>
2936
<activity
30-
android:name=".AnimeDetailsImageActivity">
37+
android:name=".AnimeDetailsImageActivity"
38+
android:screenOrientation="fullSensor">
3139
</activity>
3240
<activity
3341
android:name=".LoginActivity"
42+
android:screenOrientation="fullSensor"
3443
android:exported="true">
3544
<intent-filter>
3645
<action android:name="android.intent.action.VIEW" />

app/src/main/java/pmm/ignacio/theanimedatabase/AnimeDetailsActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ private void SetAnimeDetailsText() {
102102
anime_detail_popularity.setText(String.valueOf(_anime.popularity));
103103
anime_detail_num_episodes.setText(String.valueOf(_anime.numEpisodes));
104104
anime_detail_synopsis.setText(_anime.synopsis);
105-
anime_detail_synopsis.setMovementMethod(new ScrollingMovementMethod());
106105
Picasso.get().load(_anime.mainPicture.medium).into(anime_detail_image);
107106
anime_detail_image.setOnClickListener(v -> {
108107
Intent intent = new Intent(AnimeDetailsActivity.this, AnimeDetailsImageActivity.class);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package pmm.ignacio.theanimedatabase;
2+
3+
import android.animation.ObjectAnimator;
4+
import android.app.Activity;
5+
import android.content.Intent;
6+
import android.os.Bundle;
7+
import android.os.Handler;
8+
import android.view.animation.Animation;
9+
import android.widget.ImageView;
10+
11+
public class SplashScreen extends Activity {
12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
setContentView(R.layout.activity_splash_screen);
16+
17+
getWindow().setFlags(
18+
android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,
19+
android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN
20+
);
21+
22+
ImageView background = findViewById(R.id.SplashScreenImage);
23+
Animation slideAnim = android.view.animation.AnimationUtils.loadAnimation(this, R.anim.side_slide);
24+
background.startAnimation(slideAnim);
25+
26+
new Handler().postDelayed(() -> {
27+
Intent intent = new Intent(SplashScreen.this, MainActivity.class);
28+
startActivity(intent);
29+
finish();
30+
}, 3000);
31+
}
32+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<set
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
5+
<!--THIS CODE IS FOR SIDE ANIMATION-->
6+
<translate
7+
android:duration="1500"
8+
android:fromXDelta="-90%"
9+
android:fromYDelta="0%"
10+
android:toXDelta="0%"
11+
android:toYDelta="0%"
12+
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
13+
android:fillAfter="true"
14+
android:fillEnabled="true"
15+
/>
16+
17+
<alpha
18+
android:duration="1500"
19+
android:fromAlpha="0.1"
20+
android:toAlpha="1.0" />
21+
</set>

0 commit comments

Comments
 (0)