|
@@ -5,6 +5,7 @@ import android.app.Activity;
|
5
|
5
|
import android.content.Context;
|
6
|
6
|
import android.graphics.Color;
|
7
|
7
|
import android.os.Build;
|
|
8
|
+import android.view.MenuItem;
|
8
|
9
|
import android.view.Window;
|
9
|
10
|
import android.widget.LinearLayout;
|
10
|
11
|
|
|
@@ -17,7 +18,7 @@ import com.reactnativenavigation.views.ScrollDirectionListener;
|
17
|
18
|
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
18
|
19
|
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
19
|
20
|
|
20
|
|
-public class ScreenLayout extends LinearLayout implements ScrollDirectionListener.OnScrollChanged {
|
|
21
|
+public class ScreenLayout extends LinearLayout implements ScrollDirectionListener.OnScrollChanged, MenuItem.OnMenuItemClickListener {
|
21
|
22
|
|
22
|
23
|
private final ScreenParams screenParams;
|
23
|
24
|
private ContentView contentView;
|
|
@@ -39,7 +40,7 @@ public class ScreenLayout extends LinearLayout implements ScrollDirectionListene
|
39
|
40
|
}
|
40
|
41
|
|
41
|
42
|
private void addTitleBar() {
|
42
|
|
- topBar.addTitleBarAndSetButtons(screenParams.buttons);
|
|
43
|
+ topBar.addTitleBarAndSetButtons(screenParams.buttons, this);
|
43
|
44
|
topBar.setTitle(screenParams.title);
|
44
|
45
|
}
|
45
|
46
|
|
|
@@ -102,4 +103,10 @@ public class ScreenLayout extends LinearLayout implements ScrollDirectionListene
|
102
|
103
|
public void onScrollChanged(ScrollDirectionListener.Direction direction) {
|
103
|
104
|
|
104
|
105
|
}
|
|
106
|
+
|
|
107
|
+ @Override
|
|
108
|
+ public boolean onMenuItemClick(MenuItem item) {
|
|
109
|
+
|
|
110
|
+ return false;
|
|
111
|
+ }
|
105
|
112
|
}
|