File tree Expand file tree Collapse file tree
java/de/eldecker/droid/romanhelden Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import android .content .Context ;
88import android .content .Intent ;
99import android .content .SharedPreferences ;
10+ import android .graphics .drawable .Animatable ;
1011import android .os .Bundle ;
1112import android .util .Log ;
1213import android .view .Menu ;
1314import android .view .MenuInflater ;
1415import android .view .MenuItem ;
16+ import android .view .animation .Animation ;
17+ import android .view .animation .AnimationUtils ;
1518import android .widget .TextView ;
1619import android .widget .Toast ;
1720
@@ -135,11 +138,25 @@ private void neuerName() {
135138 _nameRecord = erzeugeName ( genreEnum );
136139 String name = _nameRecord .toString ();
137140 _nameTextView .setText ( name );
141+ starteAnimation ();
138142
139143 namenZaehlerErhoehen ();
140144 }
141145
142146
147+ /**
148+ * Tween-Animation auf (neu erzeugten) Namen anwenden.
149+ */
150+ private void starteAnimation () {
151+
152+ Animation tweenAnimation =
153+ AnimationUtils .loadAnimation ( this ,
154+ R .anim .tween_animation );
155+
156+ _nameTextView .startAnimation ( tweenAnimation );
157+ }
158+
159+
143160 /**
144161 * Zähler für Anzahl der erzeugten Namen in SharedPreferences um 1 erhöhen.
145162 */
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <set xmlns : android =" http://schemas.android.com/apk/res/android" >
3+
4+ <alpha
5+ android : fromAlpha =" 0.1"
6+ android : toAlpha =" 1.0"
7+ android : duration =" 1500" />
8+
9+ <scale
10+ android : fromXScale =" 0.1"
11+ android : toXScale =" 1.0"
12+ android : fromYScale =" 0.1"
13+ android : toYScale =" 1.0"
14+ android : pivotX =" 50%"
15+ android : pivotY =" 50%"
16+ android : duration =" 1500" />
17+
18+ </set >
Original file line number Diff line number Diff line change 3434 android : text =" @string/name_beispiel"
3535 android : textStyle =" bold"
3636 android : gravity =" center_horizontal|center_vertical"
37- android : textSize =" 40sp "
37+ android : textSize =" 50sp "
3838 app : layout_constraintBottom_toBottomOf =" parent"
3939 app : layout_constraintEnd_toEndOf =" parent"
4040 app : layout_constraintStart_toStartOf =" parent"
You can’t perform that action at this time.
0 commit comments