|
|
@ -67,7 +67,7 @@ public class StartActivity extends AppCompatActivity implements NfcAdapter.Creat |
|
|
|
|
|
|
|
|
|
|
|
private final BoardManager boardManager; |
|
|
|
private final BoardManager boardManager; |
|
|
|
private DrawerController drawerController; |
|
|
|
private DrawerController drawerController; |
|
|
|
private NavigationController threadNavigationController; |
|
|
|
private NavigationController mainNavigationController; |
|
|
|
private BrowseController browseController; |
|
|
|
private BrowseController browseController; |
|
|
|
|
|
|
|
|
|
|
|
private ImagePickDelegate imagePickDelegate; |
|
|
|
private ImagePickDelegate imagePickDelegate; |
|
|
@ -100,14 +100,14 @@ public class StartActivity extends AppCompatActivity implements NfcAdapter.Creat |
|
|
|
drawerController.setChildController(splitNavigationController); |
|
|
|
drawerController.setChildController(splitNavigationController); |
|
|
|
|
|
|
|
|
|
|
|
splitNavigationController.setLeftController(toolbarNavigationController); |
|
|
|
splitNavigationController.setLeftController(toolbarNavigationController); |
|
|
|
threadNavigationController = toolbarNavigationController; |
|
|
|
mainNavigationController = toolbarNavigationController; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
drawerController.setChildController(toolbarNavigationController); |
|
|
|
drawerController.setChildController(toolbarNavigationController); |
|
|
|
threadNavigationController = toolbarNavigationController; |
|
|
|
mainNavigationController = toolbarNavigationController; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
browseController = new BrowseController(this); |
|
|
|
browseController = new BrowseController(this); |
|
|
|
toolbarNavigationController.pushController(browseController, false); |
|
|
|
mainNavigationController.pushController(browseController, false); |
|
|
|
|
|
|
|
|
|
|
|
setContentView(drawerController.view); |
|
|
|
setContentView(drawerController.view); |
|
|
|
addController(drawerController); |
|
|
|
addController(drawerController); |
|
|
@ -183,7 +183,7 @@ public class StartActivity extends AppCompatActivity implements NfcAdapter.Creat |
|
|
|
// Handle WatchNotifier clicks
|
|
|
|
// Handle WatchNotifier clicks
|
|
|
|
if (intent.getExtras() != null) { |
|
|
|
if (intent.getExtras() != null) { |
|
|
|
int pinId = intent.getExtras().getInt("pin_id", -2); |
|
|
|
int pinId = intent.getExtras().getInt("pin_id", -2); |
|
|
|
if (pinId != -2 && threadNavigationController.getTop() instanceof BrowseController) { |
|
|
|
if (pinId != -2 && mainNavigationController.getTop() instanceof BrowseController) { |
|
|
|
if (pinId == -1) { |
|
|
|
if (pinId == -1) { |
|
|
|
drawerController.onMenuClicked(); |
|
|
|
drawerController.onMenuClicked(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -210,11 +210,26 @@ public class StartActivity extends AppCompatActivity implements NfcAdapter.Creat |
|
|
|
Logger.w(TAG, "Can not save instance state, the board loadable is null"); |
|
|
|
Logger.w(TAG, "Can not save instance state, the board loadable is null"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Loadable thread = null; |
|
|
|
Loadable thread = null; |
|
|
|
List<Controller> controllers = threadNavigationController.getControllerList(); |
|
|
|
|
|
|
|
for (Controller controller : controllers) { |
|
|
|
if (drawerController.getChildController() instanceof SplitNavigationController) { |
|
|
|
if (controller instanceof ViewThreadController) { |
|
|
|
SplitNavigationController splitNavigationController = (SplitNavigationController) drawerController.getChildController(); |
|
|
|
thread = ((ViewThreadController) controller).getLoadable(); |
|
|
|
if (splitNavigationController.rightController instanceof NavigationController) { |
|
|
|
break; |
|
|
|
NavigationController rightNavigationController = (NavigationController) splitNavigationController.rightController; |
|
|
|
|
|
|
|
for (Controller controller : rightNavigationController.getControllerList()) { |
|
|
|
|
|
|
|
if (controller instanceof ViewThreadController) { |
|
|
|
|
|
|
|
thread = ((ViewThreadController) controller).getLoadable(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
List<Controller> controllers = mainNavigationController.getControllerList(); |
|
|
|
|
|
|
|
for (Controller controller : controllers) { |
|
|
|
|
|
|
|
if (controller instanceof ViewThreadController) { |
|
|
|
|
|
|
|
thread = ((ViewThreadController) controller).getLoadable(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -229,7 +244,7 @@ public class StartActivity extends AppCompatActivity implements NfcAdapter.Creat |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public NdefMessage createNdefMessage(NfcEvent event) { |
|
|
|
public NdefMessage createNdefMessage(NfcEvent event) { |
|
|
|
Controller controller = threadNavigationController.getTop(); |
|
|
|
Controller controller = mainNavigationController.getTop(); |
|
|
|
if (controller instanceof NfcAdapter.CreateNdefMessageCallback) { |
|
|
|
if (controller instanceof NfcAdapter.CreateNdefMessageCallback) { |
|
|
|
return ((NfcAdapter.CreateNdefMessageCallback) controller).createNdefMessage(event); |
|
|
|
return ((NfcAdapter.CreateNdefMessageCallback) controller).createNdefMessage(event); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|