mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-11 06:44:09 +01:00
fixing detekt errors :|
Signed-off-by: Julius Linus <julius.linus@nextcloud.com>
This commit is contained in:
parent
847c21d710
commit
5a18a05654
@ -15,5 +15,4 @@ class TranslateRepositoryImpl @Inject constructor(private val ncApi: NcApi) : Tr
|
|||||||
): Observable<String> {
|
): Observable<String> {
|
||||||
return ncApi.translateMessage(authorization, url, text, toLanguage, fromLanguage).map { it.ocs?.data!!.text }
|
return ncApi.translateMessage(authorization, url, text, toLanguage, fromLanguage).map { it.ocs?.data!!.text }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -290,5 +290,4 @@ class TranslateActivity : BaseActivity() {
|
|||||||
private const val FROM_LABEL = "fromLabel"
|
private const val FROM_LABEL = "fromLabel"
|
||||||
private const val TO_LABEL = "toLabel"
|
private const val TO_LABEL = "toLabel"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,10 @@ import io.reactivex.disposables.Disposable
|
|||||||
import io.reactivex.schedulers.Schedulers
|
import io.reactivex.schedulers.Schedulers
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class TranslateViewModel @Inject constructor(private val repository: TranslateRepository,
|
class TranslateViewModel @Inject constructor(
|
||||||
private val userManager: UserManager) : ViewModel() {
|
private val repository: TranslateRepository,
|
||||||
|
private val userManager: UserManager
|
||||||
|
) : ViewModel() {
|
||||||
|
|
||||||
sealed interface ViewState
|
sealed interface ViewState
|
||||||
|
|
||||||
@ -33,8 +35,13 @@ class TranslateViewModel @Inject constructor(private val repository: TranslateRe
|
|||||||
val url: String = ApiUtils.getUrlForTranslation(currentUser.baseUrl)
|
val url: String = ApiUtils.getUrlForTranslation(currentUser.baseUrl)
|
||||||
val calculatedFromLanguage = if (fromLanguage == null || fromLanguage == "") { null } else { fromLanguage }
|
val calculatedFromLanguage = if (fromLanguage == null || fromLanguage == "") { null } else { fromLanguage }
|
||||||
Log.i(TAG, "translateMessage Called")
|
Log.i(TAG, "translateMessage Called")
|
||||||
repository.translateMessage(authorization, url,text,toLanguage,
|
repository.translateMessage(
|
||||||
calculatedFromLanguage)
|
authorization,
|
||||||
|
url,
|
||||||
|
text,
|
||||||
|
toLanguage,
|
||||||
|
calculatedFromLanguage
|
||||||
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
?.observeOn(AndroidSchedulers.mainThread())
|
?.observeOn(AndroidSchedulers.mainThread())
|
||||||
?.subscribe(TranslateObserver())
|
?.subscribe(TranslateObserver())
|
||||||
@ -61,5 +68,4 @@ class TranslateViewModel @Inject constructor(private val repository: TranslateRe
|
|||||||
companion object {
|
companion object {
|
||||||
private val TAG = TranslateViewModel::class.simpleName
|
private val TAG = TranslateViewModel::class.simpleName
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user