31 lines
1.2 KiB
Kotlin
31 lines
1.2 KiB
Kotlin
|
package com.adlerosn.brasilfurfest
|
||
|
|
||
|
import android.content.Intent
|
||
|
import android.support.v7.app.AppCompatActivity
|
||
|
import android.os.Bundle
|
||
|
import com.adlerosn.brasilfurfest.helper.resourcesAliased
|
||
|
import com.adlerosn.brasilfurfest.schedule.RoomPartyPreviewerActivity
|
||
|
import com.adlerosn.brasilfurfest.updater.startup.UpdaterActivity
|
||
|
|
||
|
//Entry point
|
||
|
class MainActivity : AppCompatActivity() {
|
||
|
|
||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||
|
super.onCreate(savedInstanceState)
|
||
|
setContentView(R.layout.activity_main)
|
||
|
resourcesAliased = this.resources
|
||
|
when {
|
||
|
(this.intent != null) && (this.intent?.data?.path?.startsWith("/app/roomparty") ?: false) ->
|
||
|
startActivity(Intent(this, RoomPartyPreviewerActivity::class.java).apply {
|
||
|
data = this@MainActivity.intent?.data
|
||
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME
|
||
|
})
|
||
|
else ->
|
||
|
startActivity(Intent(this, UpdaterActivity::class.java).apply {
|
||
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME
|
||
|
})
|
||
|
}
|
||
|
finish()
|
||
|
}
|
||
|
}
|