Prevent potential crash + fixed camera display on dialer for tablets in portrait

This commit is contained in:
Sylvain Berfini 2021-04-01 10:30:51 +02:00
parent 3b8e83e1ed
commit eade07060a
2 changed files with 6 additions and 2 deletions

View file

@ -43,7 +43,11 @@ class AccountSettingsViewModelFactory(private val identity: String) :
return AccountSettingsViewModel(account) as T return AccountSettingsViewModel(account) as T
} }
} }
return AccountSettingsViewModel(coreContext.core.defaultAccount!!) as T val defaultAccount = coreContext.core.defaultAccount
if (defaultAccount != null) {
return AccountSettingsViewModel(defaultAccount) as T
}
return coreContext.core.accountList.firstOrNull() as T
} }
} }

View file

@ -30,7 +30,7 @@
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/dialer_background" /> android:src="@drawable/dialer_background" />
<TextureView <org.linphone.mediastream.video.capture.CaptureTextureView
android:id="@+id/video_preview_window" android:id="@+id/video_preview_window"
android:visibility="@{viewModel.showPreview ? View.VISIBLE : View.GONE, default=gone}" android:visibility="@{viewModel.showPreview ? View.VISIBLE : View.GONE, default=gone}"
android:layout_width="match_parent" android:layout_width="match_parent"