|
@@ -40,6 +40,8 @@ import java.util.Map;
|
40
|
40
|
*/
|
41
|
41
|
public class RnnToolBar extends Toolbar {
|
42
|
42
|
|
|
43
|
+ private static final int ANIMATE_DURATION = 180;
|
|
44
|
+
|
43
|
45
|
private List<Screen> mScreens;
|
44
|
46
|
private AsyncTask mSetupToolbarTask;
|
45
|
47
|
private Drawable mBackground;
|
|
@@ -81,7 +83,7 @@ public class RnnToolBar extends Toolbar {
|
81
|
83
|
} else {
|
82
|
84
|
resetTitleTextColor();
|
83
|
85
|
}
|
84
|
|
-
|
|
86
|
+
|
85
|
87
|
if (screen.toolBarHidden != null && screen.toolBarHidden) {
|
86
|
88
|
hideToolbar();
|
87
|
89
|
} else {
|
|
@@ -112,20 +114,30 @@ public class RnnToolBar extends Toolbar {
|
112
|
114
|
}
|
113
|
115
|
}
|
114
|
116
|
|
115
|
|
- private void showToolbar() {
|
|
117
|
+ public void showToolbar(boolean animated) {
|
116
|
118
|
ActionBar actionBar = ((AppCompatActivity) getContext()).getSupportActionBar();
|
117
|
119
|
if (actionBar != null) {
|
|
120
|
+ actionBar.setShowHideAnimationEnabled(animated);
|
118
|
121
|
actionBar.show();
|
119
|
122
|
}
|
120
|
123
|
}
|
121
|
124
|
|
122
|
|
- private void hideToolbar() {
|
|
125
|
+ public void hideToolbar(boolean animated) {
|
123
|
126
|
ActionBar actionBar = ((AppCompatActivity) getContext()).getSupportActionBar();
|
124
|
127
|
if (actionBar != null) {
|
|
128
|
+ actionBar.setShowHideAnimationEnabled(animated);
|
125
|
129
|
actionBar.hide();
|
126
|
130
|
}
|
127
|
131
|
}
|
128
|
132
|
|
|
133
|
+ private void showToolbar() {
|
|
134
|
+ showToolbar(false);
|
|
135
|
+ }
|
|
136
|
+
|
|
137
|
+ private void hideToolbar() {
|
|
138
|
+ hideToolbar(false);
|
|
139
|
+ }
|
|
140
|
+
|
129
|
141
|
@SuppressWarnings({"ConstantConditions"})
|
130
|
142
|
public void showBackButton(Screen screen) {
|
131
|
143
|
ActionBar actionBar = ContextProvider.getActivityContext().getSupportActionBar();
|