diff --git a/app/src/main/java/com/nextcloud/talk/newarch/features/account/serverentry/ServerEntryView.kt b/app/src/main/java/com/nextcloud/talk/newarch/features/account/serverentry/ServerEntryView.kt
index 6f6cd5660..f356b67fb 100644
--- a/app/src/main/java/com/nextcloud/talk/newarch/features/account/serverentry/ServerEntryView.kt
+++ b/app/src/main/java/com/nextcloud/talk/newarch/features/account/serverentry/ServerEntryView.kt
@@ -24,7 +24,7 @@ package com.nextcloud.talk.newarch.features.account.serverentry
import android.os.Bundle
import android.view.*
-import androidx.core.view.isVisible
+import androidx.core.view.isInvisible
import androidx.core.widget.doOnTextChanged
import androidx.lifecycle.Observer
import com.bluelinelabs.conductor.RouterTransaction
@@ -55,20 +55,21 @@ class ServerEntryView : BaseView() {
viewModel = viewModelProvider(factory).get(ServerEntryViewModel::class.java)
val view = super.onCreateView(inflater, container)
- view.serverEntryTextInputEditText.setCompoundDrawablesWithIntrinsicBounds(null, null, resources?.getDrawable(R.drawable.ic_arrow_forward_white_24px), null)
- view.serverEntryTextInputEditText.compoundDrawables[2].alpha = 99
+ view.serverEntryTextInputLayout.endIconDrawable?.alpha = 99
+ view.host_url_input_helper_text.setText(String.format(resources!!.getString(R.string.nc_server_helper_text), resources?.getString(R.string.nc_server_product_name)))
viewModel.apply {
checkState.observe(this@ServerEntryView, Observer {
when (it.checkState) {
ServerEntryCapabilitiesCheckState.WAITING_FOR_INPUT -> {
view.serverEntryTextInputLayout.isEnabled = true
- view.serverEntryProgressBar.isVisible = false
+ view.serverEntryProgressBar.isInvisible = true
}
ServerEntryCapabilitiesCheckState.CHECKING -> {
view.serverEntryTextInputLayout.isEnabled = false
view.serverEntryTextInputEditText.compoundDrawables[2].alpha = 0
- view.serverEntryProgressBar.isVisible = true
+ view.serverEntryProgressBar.isInvisible = false
+ view.error_text.isInvisible = true
}
ServerEntryCapabilitiesCheckState.SERVER_SUPPORTED -> {
val bundle = Bundle()
@@ -79,9 +80,9 @@ class ServerEntryView : BaseView() {
// Unsupported
else -> {
view.serverEntryTextInputLayout.isEnabled = true
- view.serverEntryProgressBar.isVisible = false
- view.serverEntryTextInputLayout.error = resources?.getString(R.string.nc_server_unsupported)
- view.serverEntryTextInputEditText.compoundDrawables[2].alpha = 99
+ view.serverEntryProgressBar.isInvisible = true
+ view.error_text.isInvisible = false
+ view.serverEntryTextInputLayout.endIconDrawable?.alpha = 99
}
}
})
@@ -91,34 +92,21 @@ class ServerEntryView : BaseView() {
view.serverEntryTextInputLayout.error = null
if (text.isNullOrBlank()) {
- view.serverEntryTextInputEditText.compoundDrawables[2].alpha = 99
+ view.serverEntryTextInputLayout.endIconDrawable?.alpha = 99
} else {
- view.serverEntryTextInputEditText.compoundDrawables[2].alpha = 255
+ view.serverEntryTextInputLayout.endIconDrawable?.alpha = 255
}
}
- view.serverEntryTextInputEditText.setOnTouchListener { v, event ->
- val drawableLeft = 0
- val drawableTop = 1
- val drawableRight = 2
- val drawableBottom = 3
-
- if (event.action == MotionEvent.ACTION_UP) {
- if (event.rawX >= (view.serverEntryTextInputEditText.right - view.serverEntryTextInputEditText.compoundDrawables[drawableRight].bounds.width())) {
- if (view.serverEntryTextInputEditText.compoundDrawables[drawableRight].alpha == 255) {
- view.serverEntryTextInputEditText?.text?.let { serverUrl ->
- var baseUrl = serverUrl.toString()
- if (!serverUrl.startsWith("http://") && !serverUrl.startsWith("https://")) {
- baseUrl = "https://$serverUrl"
- }
- viewModel.fetchCapabilities(baseUrl)
- true
- }
- }
+ view.serverEntryTextInputLayout.setEndIconOnClickListener {
+ view.serverEntryTextInputEditText?.text?.let { serverUrl ->
+ var baseUrl = serverUrl.toString()
+ if (!serverUrl.startsWith("http://") && !serverUrl.startsWith("https://")) {
+ baseUrl = "https://$serverUrl"
}
+ viewModel.fetchCapabilities(baseUrl)
+ true
}
-
- false
}
return view
@@ -134,4 +122,4 @@ class ServerEntryView : BaseView() {
DisplayUtils.applyColorToStatusBar(activity!!, resources!!.getColor(R.color.colorPrimary))
DisplayUtils.applyColorToNavgiationBar(activity!!.window, resources!!.getColor(R.color.colorPrimary))
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/res/layout/server_entry_view.xml b/app/src/main/res/layout/server_entry_view.xml
index a2ec25105..42d01bd28 100644
--- a/app/src/main/res/layout/server_entry_view.xml
+++ b/app/src/main/res/layout/server_entry_view.xml
@@ -1,4 +1,5 @@
-
-
+ android:layout_gravity="center"
+ android:background="@color/colorPrimary"
+ android:fillViewport="true"
+ android:orientation="vertical">
-
-
-
+ android:gravity="center"
+ android:orientation="vertical"
+ android:padding="16dp">
-
+
-
+ android:theme="@style/TextInputLayoutLogin"
+ app:endIconContentDescription="@string/nc_server_connect"
+ app:endIconDrawable="@drawable/ic_arrow_forward_white_24px"
+ app:endIconMode="custom"
+ app:endIconTint="@color/white">
-
+
+
+
+
+
+
+
+
+ android:lineSpacingMultiplier="1.2"
+ android:paddingStart="16dp"
+ android:paddingTop="4dp"
+ android:paddingEnd="8dp"
+ android:paddingBottom="2dp"
+ android:text="@string/nc_server_helper_text"
+ android:textColor="#B3FFFFFF" />
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 82151633f..c2be87d9e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -23,7 +23,10 @@
Settings
- Server address
+ Server address https://…
+ Test server connection
+ The link to your %1$s web interface when you open it in the browser.
+ Testing connection
Please finish your %1$s installation
Please upgrade your %1$s database
Please bring your %1$s out of maintenance
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 1fe73c78a..c2c1fb076 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -81,4 +81,38 @@
- @color/fg_default
- @color/fg_default
+
+
+
+
+
+
+
+
diff --git a/scripts/analysis/lint-results.txt b/scripts/analysis/lint-results.txt
index 55ab1c4cc..7dbc70215 100644
--- a/scripts/analysis/lint-results.txt
+++ b/scripts/analysis/lint-results.txt
@@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
- Lint Report: 11 errors and 569 warnings
+ Lint Report: 11 errors and 566 warnings