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
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.70'
ext.kotlin_version = '1.5.31'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
9 changes: 4 additions & 5 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdkVersion 31
defaultConfig {
applicationId "com.goodiebag.pinview.example"
minSdkVersion 15
targetSdkVersion 28
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -25,8 +24,8 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.0.0'
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.3.1'
testImplementation 'junit:junit:4.13.2'
implementation project(':pinview')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Expand Down
5 changes: 3 additions & 2 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.goodiebag.pinview.example

import android.annotation.SuppressLint
import android.graphics.Color
import android.os.Bundle
import android.widget.Toast
Expand All @@ -13,11 +14,10 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main)

val pinview1 = findViewById<Pinview>(R.id.pinview1)
pinview1.setPinViewEventListener(object : PinViewEventListener {
override fun onDataEntered(pinview: Pinview?, fromUser: Boolean) {
Toast.makeText(this@MainActivity, pinview!!.value, Toast.LENGTH_SHORT).show()
}
})
pinview1.setPinViewEventListener { pinview: Pinview, fromUser: Boolean ->
Toast.makeText(this@MainActivity, pinview.value, Toast.LENGTH_SHORT).show()
}
setFont(pinview1)

// pinView Customize
val pinview5 = findViewById<Pinview>(R.id.pinview5)
Expand All @@ -29,4 +29,11 @@ class MainActivity : AppCompatActivity() {
showCursor(true)
}
}

@SuppressLint("NewApi")
private fun setFont(pinview1: Pinview) {
val typeface = resources.getFont(R.font.poppins_semibold)
pinview1.setTypeface(typeface)
}

}
Binary file added example/src/main/res/font/poppins_semibold.ttf
Binary file not shown.
8 changes: 5 additions & 3 deletions example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@
app:pinBackground="@drawable/example_drawable"
app:pinHeight="40dp"
app:pinLength="4"
app:pinWidth="40dp"/>
app:pinWidth="40dp"
app:textSize="9sp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Custom Pin View"/>
android:text="Custom Pin View (with dp textSize)"/>

<com.goodiebag.pinview.Pinview
android:id="@+id/pinview5"
Expand All @@ -97,6 +98,7 @@
app:inputType="text"
app:pinHeight="40dp"
app:pinLength="4"
app:pinWidth="40dp"/>
app:pinWidth="40dp"
app:textSize="18dp"/>

</LinearLayout>
9 changes: 4 additions & 5 deletions pinview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 29
compileSdkVersion 31

defaultConfig {
minSdkVersion 15
targetSdkVersion 29
targetSdkVersion 31
versionCode 3
versionName "1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -26,8 +25,8 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.3.1'
testImplementation 'junit:junit:4.13.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
Expand Down
10 changes: 1 addition & 9 deletions pinview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.goodiebag.pinview">

<application
android:allowBackup="true"
android:supportsRtl="true">

</application>

</manifest>
package="com.goodiebag.pinview"/>
Loading