File tree Expand file tree Collapse file tree 3 files changed +27
-14
lines changed
java/com/dylanc/loadinghelper/sample Expand file tree Collapse file tree 3 files changed +27
-14
lines changed Original file line number Diff line number Diff line change 3939 */
4040public class ToolbarAdapter extends LoadingHelper .Adapter <ToolbarAdapter .ViewHolder > {
4141
42- private String title ;
43- private NavIconType type ;
42+ private final String title ;
43+ private final NavIconType type ;
4444 private int menuId ;
4545 private Function1 <? super MenuItem , Boolean > onMenuItemClick ;
4646
Original file line number Diff line number Diff line change 11package com .dylanc .loadinghelper .sample .animation ;
22
3- import android .animation .Animator ;
4- import android .animation .AnimatorListenerAdapter ;
53import android .view .View ;
64
75import com .dylanc .loadinghelper .LoadingHelper ;
1311 */
1412public class FadeAnimation implements LoadingHelper .Animation {
1513
14+ private static final long DEFAULT_DURATION = 500 ;
15+ private final long duration ;
16+
17+ public FadeAnimation () {
18+ this (DEFAULT_DURATION );
19+ }
20+
21+ public FadeAnimation (long duration ) {
22+ this .duration = duration ;
23+ }
24+
1625 @ Override
1726 public void onStartShowAnimation (@ NotNull View view , @ NotNull Object viewType ) {
1827 view .setAlpha (0 );
19- view .animate ().alpha (1 ).setDuration (500 ). setListener ( null );
28+ view .animate ().alpha (1 ).setDuration (duration );
2029 }
2130
2231 @ Override
2332 public void onStartHideAnimation (@ NotNull View view , @ NotNull Object viewType ) {
24- view .animate ().alpha (0f ).setDuration (500 ).setListener (new AnimatorListenerAdapter () {
25- @ Override
26- public void onAnimationEnd (Animator animation ) {
27- view .setAlpha (1 );
28- view .setVisibility (View .GONE );
29- }
33+ view .setAlpha (1 );
34+ view .animate ().alpha (0 ).setDuration (duration ).withEndAction (() -> {
35+ view .setAlpha (1 );
36+ view .setVisibility (View .GONE );
3037 });
3138 }
3239}
Original file line number Diff line number Diff line change 55 android : orientation =" vertical" >
66
77 <ScrollView
8- android : id =" @+id/content_parent"
98 android : layout_width =" match_parent"
109 android : layout_height =" 0dp"
11- android : layout_weight =" 1" />
10+ android : layout_weight =" 1" >
11+
12+ <LinearLayout
13+ android : id =" @+id/content_parent"
14+ android : layout_width =" match_parent"
15+ android : layout_height =" wrap_content"
16+ android : orientation =" vertical" />
17+ </ScrollView >
1218
1319 <LinearLayout
1420 android : layout_width =" match_parent"
1521 android : layout_height =" 48dp"
16- android : elevation =" 4dp"
1722 android : background =" @android:color/white"
23+ android : elevation =" 4dp"
1824 android : orientation =" horizontal" >
1925
2026 <EditText
You can’t perform that action at this time.
0 commit comments