Remove duplicated class
This commit is contained in:
parent
ffd8ac859d
commit
d3bc9f52fd
@ -23,6 +23,7 @@ import com.airbnb.mvrx.Loading
|
|||||||
import com.airbnb.mvrx.Success
|
import com.airbnb.mvrx.Success
|
||||||
import com.google.i18n.phonenumbers.PhoneNumberUtil
|
import com.google.i18n.phonenumbers.PhoneNumberUtil
|
||||||
import im.vector.riotx.R
|
import im.vector.riotx.R
|
||||||
|
import im.vector.riotx.core.epoxy.loadingItem
|
||||||
import im.vector.riotx.core.resources.ColorProvider
|
import im.vector.riotx.core.resources.ColorProvider
|
||||||
import im.vector.riotx.core.resources.StringProvider
|
import im.vector.riotx.core.resources.StringProvider
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
@ -38,7 +39,7 @@ class DiscoverySettingsController @Inject constructor(
|
|||||||
override fun buildModels(data: DiscoverySettingsState) {
|
override fun buildModels(data: DiscoverySettingsState) {
|
||||||
when (data.identityServer) {
|
when (data.identityServer) {
|
||||||
is Loading -> {
|
is Loading -> {
|
||||||
settingsLoadingItem {
|
loadingItem {
|
||||||
id("identityServerLoading")
|
id("identityServerLoading")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,8 +70,8 @@ class DiscoverySettingsController @Inject constructor(
|
|||||||
|
|
||||||
when (data.phoneNumbersList) {
|
when (data.phoneNumbersList) {
|
||||||
is Incomplete -> {
|
is Incomplete -> {
|
||||||
settingsLoadingItem {
|
loadingItem {
|
||||||
id("phoneLoading")
|
id("msisdnLoading")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is Fail -> {
|
is Fail -> {
|
||||||
@ -165,17 +166,17 @@ class DiscoverySettingsController @Inject constructor(
|
|||||||
}
|
}
|
||||||
when (data.emailList) {
|
when (data.emailList) {
|
||||||
is Incomplete -> {
|
is Incomplete -> {
|
||||||
settingsLoadingItem {
|
loadingItem {
|
||||||
id("mailLoading")
|
id("mailLoading")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is Fail -> {
|
is Fail -> {
|
||||||
settingsInfoItem {
|
settingsInfoItem {
|
||||||
id("mailListError")
|
id("mailListError")
|
||||||
helperText(data.emailList.error.message)
|
helperText(data.emailList.error.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is Success -> {
|
is Success -> {
|
||||||
val emails = data.emailList.invoke()
|
val emails = data.emailList.invoke()
|
||||||
if (emails.isEmpty()) {
|
if (emails.isEmpty()) {
|
||||||
settingsInfoItem {
|
settingsInfoItem {
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020 New Vector Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package im.vector.riotx.features.discovery
|
|
||||||
|
|
||||||
import android.widget.ProgressBar
|
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.core.view.isVisible
|
|
||||||
import com.airbnb.epoxy.EpoxyAttribute
|
|
||||||
import com.airbnb.epoxy.EpoxyModelClass
|
|
||||||
import com.airbnb.epoxy.EpoxyModelWithHolder
|
|
||||||
import im.vector.riotx.R
|
|
||||||
import im.vector.riotx.core.epoxy.VectorEpoxyHolder
|
|
||||||
import im.vector.riotx.core.extensions.setTextOrHide
|
|
||||||
|
|
||||||
@EpoxyModelClass(layout = R.layout.item_loading)
|
|
||||||
abstract class SettingsLoadingItem : EpoxyModelWithHolder<SettingsLoadingItem.Holder>() {
|
|
||||||
|
|
||||||
@EpoxyAttribute var loadingText: String? = null
|
|
||||||
|
|
||||||
override fun bind(holder: Holder) {
|
|
||||||
super.bind(holder)
|
|
||||||
holder.textView.setTextOrHide(loadingText)
|
|
||||||
holder.progressBar.isVisible = true
|
|
||||||
holder.progressBar.animate()
|
|
||||||
}
|
|
||||||
|
|
||||||
class Holder : VectorEpoxyHolder() {
|
|
||||||
val textView by bind<TextView>(R.id.loadingText)
|
|
||||||
val progressBar by bind<ProgressBar>(R.id.loadingProgress)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user