Skip to content

Commit

Permalink
Second version: FR / EN support + background
Browse files Browse the repository at this point in the history
  • Loading branch information
wadael committed Dec 9, 2021
1 parent 7998337 commit 4993e80
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ This app CAN be used as a starting point for a richer version that would include
-- speed (slider for a multiplier)
- ...


2021/12/09 :
- added French translation
- corrected missed sentences
- added homemade background



2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.FearLitany">
android:theme="@style/Theme.FearLitany" >
<activity
android:name=".MainActivity"
android:exported="true">
Expand Down
43 changes: 20 additions & 23 deletions app/src/main/java/org/wadael/fearlitany/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,52 +13,49 @@ public class MainActivity extends AppCompatActivity {

Animation fade = null;
TextView tv = null;

String text = null;
int verse = 1;

@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
// getSupportActionBar().hide();
setContentView(R.layout.activity_main);

fade = AnimationUtils.loadAnimation(this, R.anim.fade);

/*
final Animation fade = AnimationUtils.loadAnimation(this, R.anim.fade);
final Animation fadein = AnimationUtils.loadAnimation(this, R.anim.fadein);
final Animation fadeout = AnimationUtils.loadAnimation(this, R.anim.fadeout);
*/

// LinearLayout whole = findViewById(R.id.whole);
tv = findViewById(R.id.text);
Integer nb = getResources().getInteger(R.integer.scount);

fade.setAnimationListener(
new Animation.AnimationListener(){
new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
int resId = getResources().getIdentifier("s" + verse, "string", getPackageName());
String s = getString(resId);
tv.setText(s);

int resId = getResources().getIdentifier("s" + verse++, "string", getPackageName());
text = getString(resId);
tv.setText(text);

}

@Override
public void onAnimationRepeat(Animation animation) {}
public void onAnimationRepeat(Animation animation) {
}

@Override
public void onAnimationEnd(Animation animation) {
verse++;
fade.reset();

if(verse<=nb) tv.startAnimation(fade);
fade.cancel();
if (verse < nb+1) {
tv.startAnimation(fade);
}
else {
if (verse == nb+1) {
tv.startAnimation(fadein);
}
}
}

}
);

tv.startAnimation(fade);

}
}
}
}
13 changes: 9 additions & 4 deletions app/src/main/res/anim/fade.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fillBefore="true">
android:shareInterpolator="true"
android:fillAfter="true"
android:duration="5000">

<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="2000" >
android:duration="1500" >
</alpha>

<alpha
android:startOffset="3500"
android:startOffset="3000"
android:fromAlpha="1"
android:toAlpha="0"
android:duration="2000" >
</alpha>
</set>

</set>
Binary file added app/src/main/res/drawable/dunepainbox2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EAB209"
android:background="@drawable/dunepainbox2"
android:orientation="vertical"
tools:context=".MainActivity"
android:id="@+id/whole"
>
<!-- -->

<TextView
android:id="@+id/spacer0"
Expand All @@ -35,11 +36,11 @@
android:layout_gravity="center_horizontal"
android:backgroundTint="#CF1111"
android:fontFamily="@font/comfortaa_light"
android:text="Hello World!"
android:text="Fear Litany"
android:textAlignment="center"
android:textSize="34sp"
android:textColor="@color/black"

/>
android:textSize="34sp" />
</LinearLayout>


Expand Down
5 changes: 0 additions & 5 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

This file was deleted.

5 changes: 0 additions & 5 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

This file was deleted.

Binary file added app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

<resources>
<string name="app_name">Litanie contre la peur</string>
<integer name="scount">7</integer>

<string name="s1">Je ne connais pas la peur, car la peur tue l\'esprit. </string>
<string name="s2">La peur est la petite mort qui conduit à l\'oblitération totale.</string>
<string name="s3">J\'affronterai ma peur.</string>
<string name="s4">Je lui permettrai de passer sur moi, au travers de moi. </string>
<string name="s5">Et lorsqu\'elle sera passée, je tournerai mon oeil intérieur sur son chemin. </string>
<string name="s6">Et là où elle sera passée, il n\'y aura plus rien.</string>
<string name="s7">Rien que moi</string>

<!-- pour eviter build issue sur le nombre de textes à traduire -->
<string name="s8">Rien que moi2</string>
</resources>
19 changes: 3 additions & 16 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@
<string name="s4">I will face my fear.</string>
<string name="s5">I will permit it to pass over me and through me.</string>
<string name="s6">And when it has gone past, I will turn the inner eye to see its path.</string>
<string name="s7">Where the fear has gone there will be nothing."</string>
<string name="s8">Only I will remain."</string>
</resources>


<!--
I must not fear.
Fear is the mind-killer.
Fear is the little-death that brings total obliteration.
I will face my fear.
I will permit it to pass over me and through me.
And when it has gone past, I will turn the inner eye to see its path.
Where the fear has gone there will be nothing. Only I will remain."
-->
<string name="s7">Where the fear has gone there will be nothing.</string>
<string name="s8">Only I will remain.</string>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath 'com.android.tools.build:gradle:7.0.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit 4993e80

Please sign in to comment.