fix to enable pip for CallNotification Controller

methods to update UI are not yet implemented. maybe it's better to make two Activities: one for Call and one for CallNotification...

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-10-27 12:47:45 +02:00
parent 0d1e0af9d1
commit 03913b40a2
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 16 additions and 6 deletions

View File

@ -76,6 +76,7 @@ class MagicCallActivity : BaseActivity() {
RouterTransaction.with(CallNotificationController(intent.extras)) RouterTransaction.with(CallNotificationController(intent.extras))
.pushChangeHandler(HorizontalChangeHandler()) .pushChangeHandler(HorizontalChangeHandler())
.popChangeHandler(HorizontalChangeHandler()) .popChangeHandler(HorizontalChangeHandler())
.tag(CallNotificationController.TAG)
) )
} else { } else {
router!!.setRoot( router!!.setRoot(
@ -153,11 +154,20 @@ class MagicCallActivity : BaseActivity() {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig) super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
isInPipMode = isInPictureInPictureMode isInPipMode = isInPictureInPictureMode
val callController = router?.getControllerWithTag(CallController.TAG) as CallController if (router?.getControllerWithTag(CallNotificationController.TAG) != null) {
if (isInPictureInPictureMode) { val callNotificationController = router?.getControllerWithTag(CallNotificationController.TAG) as CallNotificationController
callController.updateUiForPipMode() if (isInPictureInPictureMode) {
} else { // callNotificationController.updateUiForPipMode()
callController.updateUiForNormalMode() } else {
// callNotificationController.updateUiForNormalMode()
}
} else if (router?.getControllerWithTag(CallController.TAG) != null) {
val callController = router?.getControllerWithTag(CallController.TAG) as CallController
if (isInPictureInPictureMode) {
callController.updateUiForPipMode()
} else {
callController.updateUiForNormalMode()
}
} }
} }

View File

@ -101,7 +101,7 @@ import okhttp3.Cache;
@AutoInjector(NextcloudTalkApplication.class) @AutoInjector(NextcloudTalkApplication.class)
public class CallNotificationController extends BaseController { public class CallNotificationController extends BaseController {
private static final String TAG = "CallNotificationController"; public static final String TAG = "CallNotificationController";
@Inject @Inject
NcApi ncApi; NcApi ncApi;