File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
flowr/src/main/java/com/fueled/flowr Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 66import android .os .Bundle ;
77import android .support .annotation .ColorInt ;
88import android .support .annotation .Nullable ;
9+ import android .support .v4 .app .Fragment ;
910import android .support .v4 .app .FragmentManager ;
1011import android .support .v7 .app .AppCompatActivity ;
1112
@@ -61,6 +62,11 @@ protected int getDefaultNavigationBarColor() {
6162 return Color .BLACK ;
6263 }
6364
65+ @ Override
66+ public void onCurrentFragmentChanged (@ Nullable Fragment currentFragment ) {
67+ // Do Nothing. No Default implementation is required.
68+ }
69+
6470 @ SuppressWarnings ("WrongConstant" )
6571 @ Override
6672 public void setScreenOrientation (int orientation ) {
Original file line number Diff line number Diff line change @@ -509,6 +509,7 @@ public void syncScreenState() {
509509 }
510510
511511 if (screen != null ) {
512+ screen .onCurrentFragmentChanged (getCurrentFragment ());
512513 screen .setScreenOrientation (screenOrientation );
513514 screen .setNavigationBarColor (navigationBarColor );
514515 }
Original file line number Diff line number Diff line change 11package com .fueled .flowr ;
22
33import android .support .annotation .ColorInt ;
4+ import android .support .annotation .Nullable ;
5+ import android .support .v4 .app .Fragment ;
46import android .support .v4 .app .FragmentManager ;
57
68/**
1012
1113public interface FlowrScreen {
1214
15+ /**
16+ * Return the FragmentManager for interacting with fragments associated
17+ * with this screen.
18+ */
1319 FragmentManager getScreenFragmentManager ();
1420
21+ /**
22+ * Invoke the {@code onBackPressed} method for this screen.
23+ */
1524 void invokeOnBackPressed ();
1625
26+ /**
27+ * Indicates that the fragment currently being displayed has changed.
28+ *
29+ * @param currentFragment the fragment currently displayed or {@code null} if no fragment
30+ * is being displayed.
31+ */
32+ void onCurrentFragmentChanged (@ Nullable Fragment currentFragment );
33+
34+ /**
35+ * Specify the screen orientation to be used for this screen.
36+ *
37+ * @param orientation the screen orientation to be used.
38+ */
1739 void setScreenOrientation (int orientation );
1840
41+ /**
42+ * Specify the navigation bar color to be used for this screen.
43+ *
44+ * @param color the navigation bar color to be used.
45+ */
1946 void setNavigationBarColor (@ ColorInt int color );
2047}
You can’t perform that action at this time.
0 commit comments