Commit fafa7d06 authored by Konstantin Tskhovrebov's avatar Konstantin Tskhovrebov 🤖

Add stub fragment.

parent 8ca6bb27
......@@ -2,11 +2,13 @@ package ru.terrakok.gitlabclient
import android.content.Intent
import android.net.Uri
import ru.terrakok.gitlabclient.toothpick.DI
import ru.terrakok.gitlabclient.ui.about.AboutFragment
import ru.terrakok.gitlabclient.ui.auth.AuthFlowFragment
import ru.terrakok.gitlabclient.ui.auth.AuthFragment
import ru.terrakok.gitlabclient.ui.drawer.DrawerFlowFragment
import ru.terrakok.gitlabclient.ui.global.BaseFragment
import ru.terrakok.gitlabclient.ui.global.StubFragment
import ru.terrakok.gitlabclient.ui.issue.IssueFlowFragment
import ru.terrakok.gitlabclient.ui.issue.IssueFragment
import ru.terrakok.gitlabclient.ui.issue.IssueInfoFragment
......@@ -134,6 +136,8 @@ object Screens {
Screens.PROJECT_FLOW -> ProjectFlowFragment.create(data as Long)
Screens.PROJECT_MAIN_FLOW -> ProjectMainFlowFragment()
Screens.PROJECT_INFO_SCREEN -> ProjectInfoFragment()
Screens.PROJECT_ISSUES_SCREEN -> StubFragment.create(DI.PROJECT_FLOW_SCOPE)
Screens.PROJECT_MR_SCREEN -> StubFragment.create(DI.PROJECT_FLOW_SCOPE)
Screens.MR_FLOW -> {
val (projectId, mrId) = data as Pair<Long, Long>
......
package ru.terrakok.gitlabclient.ui.global
import android.os.Bundle
import ru.terrakok.gitlabclient.R
import ru.terrakok.gitlabclient.extension.argument
import ru.terrakok.gitlabclient.model.system.flow.FlowRouter
import toothpick.Toothpick
import javax.inject.Inject
/**
* Created by Konstantin Tskhovrebov (aka @terrakok) on 05.09.18.
*/
class StubFragment : BaseFragment() {
override val layoutRes = R.layout.fragment_stub
private val scopeName: String by argument(ARG_SCOPE)
@Inject
lateinit var router: FlowRouter
override fun onCreate(savedInstanceState: Bundle?) {
Toothpick.inject(this, Toothpick.openScope(scopeName))
super.onCreate(savedInstanceState)
}
override fun onBackPressed() {
router.exit()
}
companion object {
private const val ARG_SCOPE = "arg_scope"
fun create(scope: String) = StubFragment().apply {
arguments = Bundle().apply {
putString(ARG_SCOPE, scope)
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Under construction" />
</FrameLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment