diff --git a/buildSrc/src/main/java/dependencies/Versions.kt b/buildSrc/src/main/java/dependencies/Versions.kt
index 2ae8c683b..0631d9756 100644
--- a/buildSrc/src/main/java/dependencies/Versions.kt
+++ b/buildSrc/src/main/java/dependencies/Versions.kt
@@ -2,6 +2,7 @@ package dependencies
private object Versions {
val androidCompileSdkVersion = 28
+ val androidTargetSdkVersion = 28
val androidMinSdkVersion = 21
private val versionMajor = 1
diff --git a/corecomponent/androidcomponent/build.gradle b/corecomponent/androidcomponent/build.gradle
index a542eec1e..600b6a275 100644
--- a/corecomponent/androidcomponent/build.gradle
+++ b/corecomponent/androidcomponent/build.gradle
@@ -15,10 +15,9 @@ dependencies {
api Dep.AndroidX.constraint
api Dep.AndroidX.design
api Dep.AndroidX.coreKtx
- implementation Dep.Kotlin.stdlibJvm
+ api Dep.Kotlin.stdlibJvm
api Dep.Dagger.androidSupport
- implementation Dep.Kotlin.stdlibJvm
api Dep.Kotlin.coroutines
api Dep.Klock.jvm
@@ -33,7 +32,7 @@ dependencies {
implementation Dep.Dagger.core
implementation Dep.Dagger.androidSupport
- implementation Dep.Groupie.groupie
+ api Dep.Groupie.groupie
testImplementation Dep.Test.junit
testImplementation Dep.MockK.jvm
diff --git a/corecomponent/androidcomponent/proguard-rules-navigation.pro b/corecomponent/androidcomponent/proguard-rules-navigation.pro
index 7b499fb33..932911d37 100644
--- a/corecomponent/androidcomponent/proguard-rules-navigation.pro
+++ b/corecomponent/androidcomponent/proguard-rules-navigation.pro
@@ -14,5 +14,5 @@
-keepnames class io.github.droidkaigi.confsched2019.session.ui.TabularFormSessionPagesFragment
-keepnames class io.github.droidkaigi.confsched2019.settings.ui.SettingsFragment
-keepnames class io.github.droidkaigi.confsched2019.sponsor.ui.SponsorFragment
--keepnames class io.github.droidkaigi.confsched2019.staff.ui.StaffSearchFragment
+-keepnames class io.github.droidkaigi.confsched2019.staff_dfm.ui.StaffSearchFragment
-keepnames class io.github.droidkaigi.confsched2019.survey.ui.SessionSurveyFragment
\ No newline at end of file
diff --git a/corecomponent/androidcomponent/src/main/res/navigation/navigation.xml b/corecomponent/androidcomponent/src/main/res/navigation/navigation.xml
index 0281799c7..e724e33f2 100644
--- a/corecomponent/androidcomponent/src/main/res/navigation/navigation.xml
+++ b/corecomponent/androidcomponent/src/main/res/navigation/navigation.xml
@@ -175,7 +175,7 @@
diff --git a/feature/staff_dfm/.gitignore b/feature/staff_dfm/.gitignore
new file mode 100644
index 000000000..796b96d1c
--- /dev/null
+++ b/feature/staff_dfm/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/feature/staff_dfm/build.gradle b/feature/staff_dfm/build.gradle
new file mode 100644
index 000000000..0c915daae
--- /dev/null
+++ b/feature/staff_dfm/build.gradle
@@ -0,0 +1,56 @@
+import dependencies.Versions
+import dependencies.Dep
+
+apply plugin: 'com.android.dynamic-feature'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-kapt'
+
+android {
+ compileSdkVersion Versions.androidCompileSdkVersion
+ defaultConfig {
+ minSdkVersion Versions.androidMinSdkVersion
+ targetSdkVersion Versions.androidTargetSdkVersion
+ }
+
+ signingConfigs {
+ debug {
+ keyAlias 'droidkaigi_debug'
+ keyPassword 'droidkaigi'
+ storeFile file("${project.rootDir}/frontend/android/debug.keystore")
+ storePassword 'droidkaigi'
+ }
+ }
+
+ dataBinding {
+ enabled true
+ }
+}
+
+dependencies {
+ implementation project(':frontend:android')
+
+ implementation project(':corecomponent:androidcomponent')
+ implementation project(":data:repository")
+ implementation project(":feature:system")
+ implementation project(":model")
+
+ implementation Dep.InjectedVmProvider.extension
+ implementation Dep.InjectedVmProvider.injectedVmProvider
+ implementation Dep.InjectedVmProvider.ktx
+
+ implementation Dep.Groupie.groupie
+ implementation Dep.Groupie.databinding
+
+ implementation Dep.Picasso.picasso
+ implementation Dep.Picasso.picassoTransformation
+
+ kapt Dep.Dagger.compiler
+ kapt Dep.Dagger.androidProcessor
+ compileOnly Dep.Dagger.assistedInjectAnnotations
+ kapt Dep.Dagger.assistedInjectProcessor
+
+ testImplementation Dep.Test.junit
+ testImplementation Dep.MockK.jvm
+ androidTestImplementation Dep.Test.testRunner
+ androidTestImplementation Dep.Test.espressoCore
+}
diff --git a/feature/staff_dfm/src/main/AndroidManifest.xml b/feature/staff_dfm/src/main/AndroidManifest.xml
new file mode 100644
index 000000000..984cb8f9c
--- /dev/null
+++ b/feature/staff_dfm/src/main/AndroidManifest.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/StaffSearchFragment.kt b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/StaffSearchFragment.kt
new file mode 100644
index 000000000..e227639f8
--- /dev/null
+++ b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/StaffSearchFragment.kt
@@ -0,0 +1,134 @@
+package io.github.droidkaigi.confsched2019.staff_dfm.ui
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.Menu
+import android.view.MenuInflater
+import android.view.MenuItem
+import android.view.View
+import android.view.ViewGroup
+import android.view.inputmethod.EditorInfo
+import android.view.inputmethod.InputMethodManager
+import androidx.appcompat.widget.SearchView
+import androidx.core.content.ContextCompat
+import androidx.core.view.isVisible
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import com.xwray.groupie.GroupAdapter
+import com.xwray.groupie.Item
+import com.xwray.groupie.ViewHolder
+import io.github.droidkaigi.confsched2019.App
+import io.github.droidkaigi.confsched2019.ext.changed
+import io.github.droidkaigi.confsched2019.ext.requireValue
+import io.github.droidkaigi.confsched2019.staff_dfm.R
+import io.github.droidkaigi.confsched2019.staff_dfm.databinding.FragmentStaffSearchBinding
+import io.github.droidkaigi.confsched2019.staff_dfm.ui.actioncreator.StaffSearchActionCreator
+import io.github.droidkaigi.confsched2019.staff_dfm.ui.di.DaggerStaffComponent
+import io.github.droidkaigi.confsched2019.staff_dfm.ui.di.StaffModule
+import io.github.droidkaigi.confsched2019.staff_dfm.ui.item.StaffItem
+import io.github.droidkaigi.confsched2019.staff_dfm.ui.store.StaffSearchStore
+import me.tatarka.injectedvmprovider.InjectedViewModelProviders
+import javax.inject.Inject
+import javax.inject.Provider
+
+class StaffSearchFragment : Fragment() {
+ private lateinit var binding: FragmentStaffSearchBinding
+
+ @Inject lateinit var searchActionCreator: StaffSearchActionCreator
+ private var searchView: SearchView? = null
+ @Inject lateinit var searchStoreProvider: Provider
+ private val searchStore: StaffSearchStore by lazy {
+ InjectedViewModelProviders.of(requireActivity()).get(searchStoreProvider)
+ }
+
+ private val groupAdapter = GroupAdapter()
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ setHasOptionsMenu(true)
+ binding = DataBindingUtil.inflate(
+ inflater,
+ R.layout.fragment_staff_search,
+ container,
+ false
+ )
+ return binding.root
+ }
+
+ override fun onActivityCreated(savedInstanceState: Bundle?) {
+ super.onActivityCreated(savedInstanceState)
+
+ val appComponent = (requireContext().applicationContext as App).appCmponent
+ val component = DaggerStaffComponent.builder()
+ .appComponent(appComponent)
+ .staffModule(StaffModule(this))
+ .build()
+ component.inject(this)
+
+ binding.searchRecycler.adapter = groupAdapter
+
+ searchStore.loadingState.changed(viewLifecycleOwner) { loadingState ->
+ binding.progressBar.isVisible = loadingState.isLoading
+ }
+
+ searchStore.staffContents.changed(viewLifecycleOwner) { staffContents ->
+ searchActionCreator.search(
+ searchStore.query,
+ staffContents
+ )
+ }
+
+ searchStore.searchResult.changed(viewLifecycleOwner) { result ->
+ val items = mutableListOf- >()
+ items += result.staffs.map { staff -> StaffItem(staff) }
+ groupAdapter.update(items)
+ }
+
+ if (!searchStore.loadingState.requireValue().isLoaded) {
+ searchActionCreator.load()
+ }
+ }
+
+ override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
+ super.onCreateOptionsMenu(menu, inflater)
+ inflater.inflate(R.menu.menu_toolbar_staff_search, menu)
+
+ val searchMenuItem: MenuItem = menu.findItem(R.id.menu_search)
+ searchView = (searchMenuItem.actionView as SearchView).apply {
+ setQuery(searchStore.query, false)
+ isIconified = false
+ clearFocus()
+ imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
+ queryHint = getString(R.string.staff_search_hint)
+ setOnQueryTextListener(object : SearchView.OnQueryTextListener {
+ override fun onQueryTextSubmit(s: String): Boolean {
+ return false
+ }
+
+ override fun onQueryTextChange(query: String): Boolean {
+ searchActionCreator.search(
+ query,
+ searchStore.staffContents.requireValue()
+ )
+ return false
+ }
+ })
+ maxWidth = Int.MAX_VALUE
+ setOnCloseListener { false }
+ }
+ }
+
+ override fun onPause() {
+ super.onPause()
+ hideKeyboard()
+ }
+
+ private fun hideKeyboard() {
+ val imm = ContextCompat.getSystemService(requireContext(), InputMethodManager::class.java)
+ val view = activity?.currentFocus
+ imm?.hideSoftInputFromWindow(view?.windowToken, 0)
+ }
+}
diff --git a/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/actioncreator/StaffSearchActionCreator.kt b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/actioncreator/StaffSearchActionCreator.kt
new file mode 100644
index 000000000..1d1856084
--- /dev/null
+++ b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/actioncreator/StaffSearchActionCreator.kt
@@ -0,0 +1,55 @@
+package io.github.droidkaigi.confsched2019.staff_dfm.ui.actioncreator
+
+import androidx.lifecycle.Lifecycle
+import io.github.droidkaigi.confsched2019.action.Action
+import io.github.droidkaigi.confsched2019.data.repository.StaffRepository
+import io.github.droidkaigi.confsched2019.di.PageScope
+import io.github.droidkaigi.confsched2019.dispatcher.Dispatcher
+import io.github.droidkaigi.confsched2019.ext.coroutineScope
+import io.github.droidkaigi.confsched2019.model.LoadingState
+import io.github.droidkaigi.confsched2019.model.StaffContents
+import io.github.droidkaigi.confsched2019.model.StaffSearchResult
+import io.github.droidkaigi.confsched2019.system.actioncreator.ErrorHandler
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
+import javax.inject.Inject
+
+@PageScope
+class StaffSearchActionCreator @Inject constructor(
+ override val dispatcher: Dispatcher,
+ private val staffRepository: StaffRepository,
+ @PageScope private val lifecycle: Lifecycle
+) : CoroutineScope by lifecycle.coroutineScope, ErrorHandler {
+
+ fun load() = launch {
+ try {
+ dispatcher.dispatch(Action.StaffSearchLoadingStateChanged(LoadingState.LOADING))
+ // load cache data
+ dispatcher.dispatch(Action.StaffLoaded(staffRepository.staffContents()))
+ // fetch from api
+ staffRepository.refresh()
+ // load fetched data
+ dispatcher.dispatch(Action.StaffLoaded(staffRepository.staffContents()))
+ dispatcher.dispatch(Action.StaffSearchLoadingStateChanged(LoadingState.LOADED))
+ } catch (e: Exception) {
+ dispatcher.dispatch(Action.StaffSearchLoadingStateChanged(LoadingState.INITIALIZED))
+ }
+ }
+
+ fun search(query: String?, staffContents: StaffContents) {
+ // if we do not have query, we should show all staffs
+ if (query.isNullOrBlank()) {
+ dispatcher.launchAndDispatch(
+ Action.StaffSearchResultLoaded(
+ StaffSearchResult(
+ staffContents.staffs,
+ query
+ )
+ )
+ )
+ return
+ }
+ val searchResult = staffContents.search(query)
+ dispatcher.launchAndDispatch(Action.StaffSearchResultLoaded(searchResult))
+ }
+}
diff --git a/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/di/StaffComponent.kt b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/di/StaffComponent.kt
new file mode 100644
index 000000000..7157f8527
--- /dev/null
+++ b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/di/StaffComponent.kt
@@ -0,0 +1,24 @@
+package io.github.droidkaigi.confsched2019.staff_dfm.ui.di
+
+import dagger.Component
+import io.github.droidkaigi.confsched2019.di.AppComponent
+import io.github.droidkaigi.confsched2019.di.PageScope
+import io.github.droidkaigi.confsched2019.staff_dfm.ui.StaffSearchFragment
+
+@PageScope
+@Component(
+ modules = [
+ StaffModule::class
+ ],
+ dependencies = [AppComponent::class]
+)
+interface StaffComponent {
+ @Component.Builder
+ interface Builder {
+ fun build(): StaffComponent
+ fun appComponent(appComponent: AppComponent): Builder
+ fun staffModule(staffModule: StaffModule): Builder
+ }
+
+ fun inject(fragment: StaffSearchFragment)
+}
diff --git a/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/di/StaffModule.kt b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/di/StaffModule.kt
new file mode 100644
index 000000000..0af6a3863
--- /dev/null
+++ b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/di/StaffModule.kt
@@ -0,0 +1,17 @@
+package io.github.droidkaigi.confsched2019.staff_dfm.ui.di
+
+import androidx.lifecycle.Lifecycle
+import dagger.Module
+import dagger.Provides
+import io.github.droidkaigi.confsched2019.di.PageScope
+import io.github.droidkaigi.confsched2019.staff_dfm.ui.StaffSearchFragment
+
+@Module
+class StaffModule(private val fragment: StaffSearchFragment) {
+
+ @Provides
+ @PageScope
+ fun providesLifecycle(): Lifecycle {
+ return fragment.viewLifecycleOwner.lifecycle
+ }
+}
diff --git a/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/item/StaffItem.kt b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/item/StaffItem.kt
new file mode 100644
index 000000000..1a125a372
--- /dev/null
+++ b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/item/StaffItem.kt
@@ -0,0 +1,46 @@
+package io.github.droidkaigi.confsched2019.staff_dfm.ui.item
+
+import androidx.core.content.ContextCompat
+import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
+import com.squareup.picasso.Picasso
+import com.xwray.groupie.databinding.BindableItem
+import io.github.droidkaigi.confsched2019.model.Staff
+import io.github.droidkaigi.confsched2019.staff_dfm.R
+import io.github.droidkaigi.confsched2019.staff_dfm.databinding.ItemStaffBinding
+import jp.wasabeef.picasso.transformations.CropCircleTransformation
+
+class StaffItem(
+ val staff: Staff
+) : BindableItem(staff.id.hashCode().toLong()) {
+
+ override fun getLayout(): Int = R.layout.item_staff
+
+ override fun bind(itemBinding: ItemStaffBinding, position: Int) {
+ itemBinding.staff = staff
+ val context = itemBinding.staffImage.context
+ val placeHolderColor = ContextCompat.getColor(
+ context,
+ io.github.droidkaigi.confsched2019.widget.component.R.color.gray2
+ )
+ val placeHolder = VectorDrawableCompat.create(
+ context.resources,
+ io.github.droidkaigi.confsched2019.widget.component.R.drawable.ic_person_outline_black_24dp,
+ null
+ )
+ placeHolder?.setTint(placeHolderColor)
+ staff.iconUrl?.let { iconUrl ->
+ itemBinding.staffImage.clearColorFilter()
+ Picasso.get()
+ .load(iconUrl)
+ .transform(CropCircleTransformation())
+ .apply {
+ placeHolder?.let {
+ placeholder(it)
+ }
+ }
+ .into(itemBinding.staffImage)
+ } ?: run {
+ itemBinding.staffImage.setImageDrawable(placeHolder)
+ }
+ }
+}
diff --git a/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/store/StaffSearchStore.kt b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/store/StaffSearchStore.kt
new file mode 100644
index 000000000..43e1ff289
--- /dev/null
+++ b/feature/staff_dfm/src/main/java/io/github/droidkaigi/confsched2019/staff_dfm/ui/store/StaffSearchStore.kt
@@ -0,0 +1,31 @@
+package io.github.droidkaigi.confsched2019.staff_dfm.ui.store
+
+import androidx.lifecycle.LiveData
+import io.github.droidkaigi.confsched2019.action.Action
+import io.github.droidkaigi.confsched2019.dispatcher.Dispatcher
+import io.github.droidkaigi.confsched2019.ext.toLiveData
+import io.github.droidkaigi.confsched2019.model.LoadingState
+import io.github.droidkaigi.confsched2019.model.StaffContents
+import io.github.droidkaigi.confsched2019.model.StaffSearchResult
+import io.github.droidkaigi.confsched2019.store.Store
+import kotlinx.coroutines.channels.map
+import javax.inject.Inject
+
+class StaffSearchStore @Inject constructor(
+ dispatcher: Dispatcher
+) : Store() {
+ val query get() = searchResult.value?.query
+
+ val loadingState: LiveData = dispatcher
+ .subscribe()
+ .map { it.loadingState }
+ .toLiveData(this, LoadingState.LOADING)
+ val searchResult = dispatcher
+ .subscribe()
+ .map { it.searchResult }
+ .toLiveData(this, StaffSearchResult.EMPTY)
+ val staffContents = dispatcher
+ .subscribe()
+ .map { it.staffContents }
+ .toLiveData(this, StaffContents.EMPTY)
+}
diff --git a/feature/staff_dfm/src/main/res/layout/fragment_staff_search.xml b/feature/staff_dfm/src/main/res/layout/fragment_staff_search.xml
new file mode 100644
index 000000000..0a76893d2
--- /dev/null
+++ b/feature/staff_dfm/src/main/res/layout/fragment_staff_search.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
diff --git a/feature/staff_dfm/src/main/res/layout/item_staff.xml b/feature/staff_dfm/src/main/res/layout/item_staff.xml
new file mode 100644
index 000000000..d169d3b78
--- /dev/null
+++ b/feature/staff_dfm/src/main/res/layout/item_staff.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/feature/staff_dfm/src/main/res/menu/menu_toolbar_staff_search.xml b/feature/staff_dfm/src/main/res/menu/menu_toolbar_staff_search.xml
new file mode 100644
index 000000000..03a7049ab
--- /dev/null
+++ b/feature/staff_dfm/src/main/res/menu/menu_toolbar_staff_search.xml
@@ -0,0 +1,13 @@
+
+
diff --git a/feature/staff_dfm/src/main/res/values-ja/strings.xml b/feature/staff_dfm/src/main/res/values-ja/strings.xml
new file mode 100644
index 000000000..214dbb92d
--- /dev/null
+++ b/feature/staff_dfm/src/main/res/values-ja/strings.xml
@@ -0,0 +1,5 @@
+
+
+ 検索する…
+ スタッフ
+
diff --git a/feature/staff_dfm/src/main/res/values/strings.xml b/feature/staff_dfm/src/main/res/values/strings.xml
new file mode 100644
index 000000000..835f74bd0
--- /dev/null
+++ b/feature/staff_dfm/src/main/res/values/strings.xml
@@ -0,0 +1,5 @@
+
+
+ Search…
+ Committee member
+
diff --git a/feature/staff_dfm/src/main/res/xml/preferences.xml b/feature/staff_dfm/src/main/res/xml/preferences.xml
new file mode 100644
index 000000000..532b9f74b
--- /dev/null
+++ b/feature/staff_dfm/src/main/res/xml/preferences.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/frontend/android/build.gradle b/frontend/android/build.gradle
index 718a3b662..84e4cea44 100644
--- a/frontend/android/build.gradle
+++ b/frontend/android/build.gradle
@@ -67,7 +67,7 @@ android {
// That may be a bug of r8
optimizeCode = false
removeUnusedCode = true
- removeUnusedResources = true
+ removeUnusedResources = false // Prevent error of "Resource shrinker cannot be used for multi-apk applications" when gradle sync.
codeShrinker = 'r8'
}
}
@@ -84,7 +84,7 @@ android {
// That may be a bug of r8
optimizeCode = false
removeUnusedCode = true
- removeUnusedResources = true
+ removeUnusedResources = false // Prevent error of "Resource shrinker cannot be used for multi-apk applications" when gradle sync.
codeShrinker = 'r8'
}
}
@@ -109,6 +109,8 @@ android {
exclude 'META-INF/*.version'
exclude 'META-INF/proguard/*.pro'
}
+
+ dynamicFeatures = [":feature:staff_dfm"]
}
dependencies {
@@ -120,7 +122,6 @@ dependencies {
implementation project(":feature:sponsor")
implementation project(":feature:settings")
implementation project(":feature:contributor")
- implementation project(":feature:staff")
implementation project(':feature:user')
implementation project(':feature:survey')
implementation project(':feature:system')
diff --git a/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/App.kt b/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/App.kt
index 2d03a4cb0..b6674cddb 100644
--- a/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/App.kt
+++ b/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/App.kt
@@ -15,6 +15,7 @@ import dagger.android.AndroidInjector
import dagger.android.DaggerApplication
import io.fabric.sdk.android.Fabric
import io.github.droidkaigi.confsched2019.announcement.ui.subscribeAnnouncementTopic
+import io.github.droidkaigi.confsched2019.di.AppComponent
import io.github.droidkaigi.confsched2019.di.createAppComponent
import io.github.droidkaigi.confsched2019.ext.changedForever
import io.github.droidkaigi.confsched2019.model.SystemProperty
@@ -30,6 +31,10 @@ open class App : DaggerApplication() {
@Inject lateinit var systemStore: SystemStore
@Inject lateinit var systemActionCreator: SystemActionCreator
+ val appCmponent: AppComponent by lazy {
+ createAppComponent()
+ }
+
override fun onCreate() {
super.onCreate()
@@ -118,6 +123,6 @@ open class App : DaggerApplication() {
}
override fun applicationInjector(): AndroidInjector {
- return createAppComponent()
+ return appCmponent
}
}
diff --git a/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/di/AppComponent.kt b/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/di/AppComponent.kt
index 0ae9031ee..8080c7d4f 100644
--- a/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/di/AppComponent.kt
+++ b/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/di/AppComponent.kt
@@ -6,6 +6,8 @@ import dagger.Component
import dagger.android.AndroidInjector
import dagger.android.support.AndroidSupportInjectionModule
import io.github.droidkaigi.confsched2019.App
+import io.github.droidkaigi.confsched2019.data.repository.StaffRepository
+import io.github.droidkaigi.confsched2019.dispatcher.Dispatcher
import io.github.droidkaigi.confsched2019.ui.MainActivityModule
import javax.inject.Singleton
@@ -30,6 +32,9 @@ interface AppComponent : AndroidInjector {
}
override fun inject(app: App)
+
+ fun dispatcher(): Dispatcher
+ fun staffRepository(): StaffRepository
}
fun Application.createAppComponent() = DaggerAppComponent.builder()
diff --git a/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/ui/MainActivity.kt b/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/ui/MainActivity.kt
index 89e7850ae..cf325d66d 100644
--- a/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/ui/MainActivity.kt
+++ b/frontend/android/src/main/java/io/github/droidkaigi/confsched2019/ui/MainActivity.kt
@@ -34,9 +34,6 @@ import io.github.droidkaigi.confsched2019.about.ui.AboutFragment
import io.github.droidkaigi.confsched2019.about.ui.AboutFragmentModule
import io.github.droidkaigi.confsched2019.announcement.ui.AnnouncementFragment
import io.github.droidkaigi.confsched2019.announcement.ui.AnnouncementFragmentModule
-import io.github.droidkaigi.confsched2019.contributor.ContributorFragment
-import io.github.droidkaigi.confsched2019.contributor.ContributorFragmentModule
-import io.github.droidkaigi.confsched2019.contributor.di.ContributorAssistedInjectModule
import io.github.droidkaigi.confsched2019.databinding.ActivityMainBinding
import io.github.droidkaigi.confsched2019.di.PageScope
import io.github.droidkaigi.confsched2019.ext.changed
@@ -56,8 +53,6 @@ import io.github.droidkaigi.confsched2019.session.ui.TabularFormSessionPagesFrag
import io.github.droidkaigi.confsched2019.session.ui.TabularFromSessionPagesFragmentModule
import io.github.droidkaigi.confsched2019.sponsor.ui.SponsorFragment
import io.github.droidkaigi.confsched2019.sponsor.ui.SponsorFragmentModule
-import io.github.droidkaigi.confsched2019.staff.ui.StaffSearchFragment
-import io.github.droidkaigi.confsched2019.staff.ui.StaffSearchFragmentModule
import io.github.droidkaigi.confsched2019.survey.ui.SessionSurveyFragment
import io.github.droidkaigi.confsched2019.survey.ui.SessionSurveyFragmentModule
import io.github.droidkaigi.confsched2019.system.actioncreator.ActivityActionCreator
@@ -323,16 +318,6 @@ abstract class MainActivityModule {
@ContributesAndroidInjector(modules = [SessionSurveyFragmentModule::class])
abstract fun contributeSessionSurveyFragment(): SessionSurveyFragment
- @PageScope
- @ContributesAndroidInjector(modules = [StaffSearchFragmentModule::class])
- abstract fun contributeStaffSearchFragment(): StaffSearchFragment
-
- @PageScope
- @ContributesAndroidInjector(
- modules = [ContributorFragmentModule::class, ContributorAssistedInjectModule::class]
- )
- abstract fun contrbutorContributorFragment(): ContributorFragment
-
@Module
companion object {
@JvmStatic @Provides fun provideNavController(mainActivity: MainActivity): NavController {
diff --git a/frontend/android/src/main/res/values-ja/strings.xml b/frontend/android/src/main/res/values-ja/strings.xml
index 525128fb3..22abc5c19 100644
--- a/frontend/android/src/main/res/values-ja/strings.xml
+++ b/frontend/android/src/main/res/values-ja/strings.xml
@@ -1,3 +1,4 @@
全体アンケートに\nご協力ください
+ スタッフ
diff --git a/frontend/android/src/main/res/values/strings.xml b/frontend/android/src/main/res/values/strings.xml
index 589f26d07..7e8d77f71 100644
--- a/frontend/android/src/main/res/values/strings.xml
+++ b/frontend/android/src/main/res/values/strings.xml
@@ -2,4 +2,5 @@
DroidKaigi 2019
logo image
Please fill out the entire survey
+ Staff
diff --git a/settings.gradle b/settings.gradle
index 130879a7a..14c76929c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -15,6 +15,7 @@ include ':frontend:android',
':feature:staff',
':feature:survey',
':feature:notification',
+ ':feature:staff_dfm',
':model',
':data:api',
':data:api-impl',