Commit 75649fba authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Adds scrolling down when user starts typing on the field - for a better UX.

parent af59049e
...@@ -7,6 +7,7 @@ import android.view.ViewGroup ...@@ -7,6 +7,7 @@ import android.view.ViewGroup
import android.view.ViewTreeObserver import android.view.ViewTreeObserver
import android.widget.AdapterView import android.widget.AdapterView
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
import android.widget.ScrollView
import android.widget.Toast import android.widget.Toast
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.net.toUri import androidx.core.net.toUri
...@@ -52,8 +53,10 @@ class ServerFragment : Fragment(), ServerView { ...@@ -52,8 +53,10 @@ class ServerFragment : Fragment(), ServerView {
private var protocol = "https://" private var protocol = "https://"
private lateinit var serverUrlDisposable: Disposable private lateinit var serverUrlDisposable: Disposable
private val layoutListener = ViewTreeObserver.OnGlobalLayoutListener { private val layoutListener = ViewTreeObserver.OnGlobalLayoutListener {
text_server_url.isCursorVisible = if (KeyboardHelper.isSoftKeyboardShown(scroll_view.rootView)) {
KeyboardHelper.isSoftKeyboardShown(scroll_view.rootView) scroll_view.fullScroll(ScrollView.FOCUS_DOWN)
text_server_url.isCursorVisible = true
}
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
......
...@@ -10,7 +10,7 @@ buildscript { ...@@ -10,7 +10,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha12' classpath 'com.android.tools.build:gradle:3.3.0-alpha13'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
classpath 'com.google.gms:google-services:4.0.2' classpath 'com.google.gms:google-services:4.0.2'
......
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