Skip to content

Commit

Permalink
Merge branch 'develop' into feature/PWN-9042-reset-timestamp-on-error
Browse files Browse the repository at this point in the history
  • Loading branch information
kabramovp2p authored Jun 27, 2023
2 parents afbe6a0 + 349c96b commit 54bfdf4
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.p2p.wallet.auth.widget

import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.res.getIntOrThrow
import androidx.core.content.res.getResourceIdOrThrow
import androidx.core.view.isVisible
import android.content.Context
import android.graphics.drawable.GradientDrawable
Expand Down Expand Up @@ -89,6 +91,14 @@ open class PhoneNumberInputView @JvmOverloads constructor(
unit
)
}
if (styleAttrs.hasValue(R.styleable.UiKitEditText_android_nextFocusDown)) {
val nextFocusDown = styleAttrs.getResourceIdOrThrow(R.styleable.UiKitEditText_android_nextFocusDown)
binding.editTextPhoneNumber.nextFocusDownId = nextFocusDown
}
if (styleAttrs.hasValue(R.styleable.UiKitEditText_android_imeOptions)) {
val imeOptions = styleAttrs.getIntOrThrow(R.styleable.UiKitEditText_android_imeOptions)
binding.editTextPhoneNumber.imeOptions = imeOptions
}
binding.inputViewContainer.background = bgNormal
styleAttrs.recycle()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:enabled="false"
android:imeOptions="actionNext"
android:inputType="textEmailAddress"
android:nextFocusDown="@id/editTextPhoneNumber"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_email_hint"
app:labelText="@string/striga_email" />
Expand All @@ -101,7 +103,9 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
android:backgroundTint="@color/bg_snow"
android:imeOptions="actionNext"
android:inputType="number"
android:nextFocusDown="@id/editTextFirstName"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
android:textSize="22sp"
app:labelText="@string/striga_phone_number" />
Expand All @@ -122,7 +126,9 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="@id/editTextLastname"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_enter_hint"
app:labelText="@string/striga_first_name" />
Expand All @@ -133,7 +139,9 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
android:imeOptions="actionNext"
android:inputType="textPersonName"
android:nextFocusDown="@id/editTextBirthday"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_enter_hint"
app:labelText="@string/striga_surname" />
Expand All @@ -155,6 +163,7 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:digits="0123456789."
android:imeOptions="actionDone"
android:inputType="number"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_date_of_birth_hint"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:imeOptions="actionNext"
android:nextFocusDown="@id/editTextCity"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_select_from_list_hint"
app:isDropdown="true"
Expand All @@ -129,6 +131,8 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
android:imeOptions="actionNext"
android:nextFocusDown="@id/editTextAddressLine"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_full_city_name_hint"
app:labelText="@string/striga_city" />
Expand All @@ -140,7 +144,9 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
android:imeOptions="actionNext"
android:inputType="textPostalAddress"
android:nextFocusDown="@id/editTextPostalCode"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_address_line_hint"
app:labelText="@string/striga_address_line" />
Expand All @@ -151,7 +157,9 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
android:imeOptions="actionNext"
android:inputType="text"
android:nextFocusDown="@id/editTextStateOrRegion"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_postal_code_hint"
app:labelText="@string/striga_postal_code" />
Expand All @@ -162,6 +170,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
android:imeOptions="actionDone"
android:inputType="text"
android:textAppearance="@style/UiKit.TextAppearance.Regular.Title2"
app:hintText="@string/striga_recommended_hint"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/AppVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ object AppVersions {
const val VERSION_MINOR = 7
const val VERSION_HOTFIX = 1
const val VERSION_PATCH = 0
const val VERSION_BUILD = 2993
const val VERSION_BUILD = 2995
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/LastCommit.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
object LastCommit {
const val COMMIT_HASH = "0b8bf19ef64062aac8c3b670dfce6b11205224c9"
const val COMMIT_HASH = "f7820ad8e70ed731d30e3a7c66b590edffa9d38c"
}
10 changes: 10 additions & 0 deletions ui-kit/src/main/kotlin/org/p2p/uikit/components/UiKitEditText.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.p2p.uikit.components

import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.res.getIntOrThrow
import androidx.core.content.res.getResourceIdOrThrow
import androidx.core.view.isVisible
import android.content.Context
import android.graphics.drawable.GradientDrawable
Expand All @@ -10,6 +11,7 @@ import android.os.Parcelable
import android.text.Editable
import android.text.method.DigitsKeyListener
import android.util.AttributeSet
import android.view.View
import org.p2p.core.common.TextContainer
import org.p2p.core.common.bind
import org.p2p.uikit.R
Expand Down Expand Up @@ -109,6 +111,14 @@ class UiKitEditText @JvmOverloads constructor(
val digits = styleAttrs.getString(R.styleable.UiKitEditText_android_digits)
digits?.let(::setDigits)
}
if(styleAttrs.hasValue(R.styleable.UiKitEditText_android_nextFocusDown)) {
val nextFocusDown = styleAttrs.getResourceIdOrThrow(R.styleable.UiKitEditText_android_nextFocusDown)
binding.editTextField.nextFocusDownId = nextFocusDown
}
if(styleAttrs.hasValue(R.styleable.UiKitEditText_android_imeOptions)) {
val imeOptions = styleAttrs.getIntOrThrow(R.styleable.UiKitEditText_android_imeOptions)
binding.editTextField.imeOptions = imeOptions
}

styleAttrs.recycle()

Expand Down
30 changes: 16 additions & 14 deletions ui-kit/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<attr name="sliderIcon" format="reference" />
<attr name="sliderText" format="string" />
<attr name="leftIcon" format="reference"/>
<attr name="leftIcon" format="reference" />

<declare-styleable name="UiKitSliderButton">
<attr name="android:textColor" />
Expand Down Expand Up @@ -107,23 +107,25 @@
<attr name="android:hint" />
<attr name="android:drawableEnd" />
<attr name="android:textAppearance" />
<attr name="android:backgroundTint"/>
<attr name="android:textSize"/>
<attr name="isDropdown" format="boolean"/>
<attr name="android:backgroundTint" />
<attr name="android:textSize" />
<attr name="android:nextFocusDown" />
<attr name="android:imeActionId" />
<attr name="isDropdown" format="boolean" />
</declare-styleable>

<!-- can be extended if there is need -->
<!-- you can add icon to title, background tint etc-->
<!-- can be extended if there is need -->
<!-- you can add icon to title, background tint etc-->
<declare-styleable name="UiKitInformerView">
<attr name="leftIcon"/>
<attr name="leftIconTint" format="color"/>
<attr name="title" format="string"/>
<attr name="caption" format="string"/>
<attr name="infoLine" format="string"/>
<attr name="infoLineColor" format="color"/>
<attr name="leftIcon" />
<attr name="leftIconTint" format="color" />
<attr name="title" format="string" />
<attr name="caption" format="string" />
<attr name="infoLine" format="string" />
<attr name="infoLineColor" format="color" />
<attr name="infoLinePosition" format="enum">
<enum name="bottom" value="0"/>
<enum name="captionLine" value="1"/>
<enum name="bottom" value="0" />
<enum name="captionLine" value="1" />
</attr>
</declare-styleable>

Expand Down

0 comments on commit 54bfdf4

Please sign in to comment.