Introduce mavericks-compose and room list module - WIP
This commit is contained in:
parent
1238047b08
commit
4ce0b62241
18 changed files with 328 additions and 43 deletions
|
|
@ -57,6 +57,7 @@ android {
|
|||
dependencies {
|
||||
implementation project(":libraries:ui:theme")
|
||||
implementation project(":libraries:ui:screens:login")
|
||||
implementation project(":libraries:ui:screens:roomlist")
|
||||
implementation project(":libraries:sdk:matrix")
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
|
|
@ -67,4 +68,6 @@ dependencies {
|
|||
implementation 'androidx.activity:activity-compose:1.6.0'
|
||||
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
|
||||
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
|
||||
|
||||
implementation 'com.airbnb.android:mavericks-compose:2.7.0'
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package io.element.android.x
|
||||
|
||||
import android.app.Application
|
||||
import com.airbnb.mvrx.Mavericks
|
||||
import io.element.android.x.sdk.matrix.MatrixInstance
|
||||
|
||||
class ElementXApplication : Application() {
|
||||
|
|
@ -8,5 +9,6 @@ class ElementXApplication : Application() {
|
|||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
MatrixInstance.init(this)
|
||||
Mavericks.initialize(this)
|
||||
}
|
||||
}
|
||||
|
|
@ -3,14 +3,30 @@ package io.element.android.x
|
|||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import io.element.android.x.ui.screen.login.LoginActivity
|
||||
import io.element.android.x.ui.screen.login.RoomListActivity
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
private val launcher =
|
||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||
if (it.resultCode == RESULT_OK) {
|
||||
// Launch the room Activity and finish
|
||||
startRoomActivityAndFinish()
|
||||
} else {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// Just start the LoginActivity for now.
|
||||
// TODO if a session exist, start the room list
|
||||
startActivity(Intent(this, LoginActivity::class.java))
|
||||
launcher.launch(Intent(this, LoginActivity::class.java))
|
||||
}
|
||||
|
||||
private fun startRoomActivityAndFinish() {
|
||||
startActivity(Intent(this, RoomListActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue