RightToLeftDecimalEditText

EditText which allows to append decimal numbers from right to left

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

io.pravikant
ArtifactId

ArtifactId

rtledittext
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

RightToLeftDecimalEditText
EditText which allows to append decimal numbers from right to left
Project URL

Project URL

https://github.com/iampravikant/RightToLeftDecimalEditText
Source Code Management

Source Code Management

https://github.com/iampravikant/RightToLeftDecimalEditText

Download rtledittext

How to add to project

<!-- https://jarcasting.com/artifacts/io.pravikant/rtledittext/ -->
<dependency>
    <groupId>io.pravikant</groupId>
    <artifactId>rtledittext</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/io.pravikant/rtledittext/
implementation 'io.pravikant:rtledittext:1.0.0'
// https://jarcasting.com/artifacts/io.pravikant/rtledittext/
implementation ("io.pravikant:rtledittext:1.0.0")
'io.pravikant:rtledittext:aar:1.0.0'
<dependency org="io.pravikant" name="rtledittext" rev="1.0.0">
  <artifact name="rtledittext" type="aar" />
</dependency>
@Grapes(
@Grab(group='io.pravikant', module='rtledittext', version='1.0.0')
)
libraryDependencies += "io.pravikant" % "rtledittext" % "1.0.0"
[io.pravikant/rtledittext "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 27.1.1
org.jetbrains.kotlin : kotlin-stdlib-jdk7 jar 1.2.0

Project Modules

There are no modules declared in this project.

MIT Licence

RightToLeft Decimal EditText

EditText which allows to append decimal numbers from right to left

Example

alt text

Usage

Step 1: Add RightToLeftDecimalEditText in XML

<io.pravikant.rtledittext.RightToLeftDecimalEditText
        android:id="@+id/main_weight"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Weight"
        app:rtl_decimal_points="3"
        app:rtl_decimal_value="0.000" />

Step 2 (Optional): Define decimalPoints and decimalValue in code

main_weight.setDecimalPoints(3)
main_weight.setDecimalValue(BigDecimal(56))

Step 3 (Optional): Define nextFocusableView and listener in code

main_weight.setNextFocusableView(main_width)
main_width.setNextFocusableView(main_height)
main_height.setListener(object : RightToLeftDecimalEditText.RightToLeftDecimalEditTextListener {
    override fun onKeyboardEnterClicked() {
        onSubmit()
    }
})

Step 4: Get the BigDecimal value

main_weight.getDecimalValue()

Attributes

<attr name="rtl_decimal_points" format="integer" />
<attr name="rtl_decimal_value" format="float" />

Download

Gradle:

repositories {
  mavenCentral()
  google()
}

dependencies {
  implementation 'io.pravikant:rtledittext:1.0.0'
}

Note: Don't forget to add mavenCentral() under repositories in root-level build.gradle

Maven:

<dependency>
  <groupId>io.pravikant</groupId>
  <artifactId>rtledittext</artifactId>
  <version>1.0.0</version>
  <type>aar</type>
</dependency>

Author

Pramod Ravikant

alt text alt text alt text

Licence

This project is licensed under the MIT License - see the LICENSE file for details

Versions

Version
1.0.0