Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.appdevforall.keygen.plugin.fragments

import android.graphics.Rect
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.TextView
import android.widget.Toast
Expand Down Expand Up @@ -97,6 +99,7 @@ class KeystoreGeneratorFragment : Fragment(), BuildStatusListener {
super.onViewCreated(view, savedInstanceState)
initializeViews(view)
setupClickListeners()
setupFocusScroll()
updateButtonStates()
}

Expand Down Expand Up @@ -175,6 +178,33 @@ class KeystoreGeneratorFragment : Fragment(), BuildStatusListener {
}
}

private fun setupFocusScroll() {
val fields = arrayOf<EditText>(
keystoreNameInput,
keystorePasswordInput,
keyAliasInput,
keyPasswordInput,
certificateNameInput,
organizationalUnitInput,
organizationInput,
cityInput,
stateInput,
countryInput
)
for (field in fields) {
field.setOnFocusChangeListener { focused, hasFocus ->
if (hasFocus) {
focused.post {
focused.requestRectangleOnScreen(
Rect(0, 0, focused.width, focused.height),
false
)
}
}
}
}
}

private fun clearValidationErrors() {
tilKeystoreName.error = null
tilKeystorePassword.error = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:paddingBottom="100dp">

<ScrollView
android:layout_width="match_parent"
Expand Down Expand Up @@ -269,8 +270,4 @@

</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="40dp" />

</LinearLayout>