-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: aabhasjindal <aabhas.j@zolostays.com>
- Loading branch information
aabhasjindal
committed
Oct 15, 2019
1 parent
4eb7da5
commit c4d418f
Showing
22 changed files
with
596 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
app/src/androidTest/java/in/aabhasjindal/otpview/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
app/src/androidTest/java/in/aabhasjindal/otpview/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package `in`.aabhasjindal.otpview | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see [Testing documentation](http://d.android.com/tools/testing) | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
|
||
} | ||
} |
56 changes: 0 additions & 56 deletions
56
app/src/main/java/in/aabhasjindal/otpview/MainActivity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package `in`.aabhasjindal.otpview | ||
|
||
import `in`.aabhasjindal.otptextview.OTPListener | ||
import `in`.aabhasjindal.otptextview.OtpTextView | ||
import android.os.Build | ||
import android.os.Bundle | ||
import android.view.WindowManager | ||
import android.widget.Button | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AppCompatActivity | ||
import es.dmoral.toasty.Toasty | ||
|
||
class MainActivity : AppCompatActivity() { | ||
private var otpTextView: OtpTextView? = null | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
val window = window | ||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) | ||
window.statusBarColor = resources.getColor(R.color.black) | ||
} | ||
val errorButton = findViewById<Button>(R.id.button) | ||
val successButton = findViewById<Button>(R.id.button2) | ||
otpTextView = findViewById(R.id.otp_view) | ||
otpTextView?.requestFocusOTP() | ||
otpTextView?.otpListener = object : OTPListener { | ||
override fun onInteractionListener() { | ||
|
||
} | ||
|
||
override fun onOTPComplete(otp: String) { | ||
Toasty.success(this@MainActivity, "The OTP is $otp", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
errorButton.setOnClickListener { otpTextView?.showError() } | ||
successButton.setOnClickListener { otpTextView?.showSuccess() } | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
app/src/test/java/in/aabhasjindal/otpview/ExampleUnitTest.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
app/src/test/java/in/aabhasjindal/otpview/ExampleUnitTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package `in`.aabhasjindal.otpview | ||
|
||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
|
||
/** | ||
* Example local unit test, which will execute on the development machine (host). | ||
* | ||
* @see [Testing documentation](http://d.android.com/tools/testing) | ||
*/ | ||
class ExampleUnitTest { | ||
@Test | ||
fun additionIsCorrect() { | ||
assertEquals(4, (2 + 2).toLong()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
otptextview/src/androidTest/java/in/aabhasjindal/otptextview/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
otptextview/src/androidTest/java/in/aabhasjindal/otptextview/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package `in`.aabhasjindal.otptextview | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see [Testing documentation](http://d.android.com/tools/testing) | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getTargetContext() | ||
|
||
assertEquals("in.aabhasjindal.otptextview.test", appContext.getPackageName()) | ||
} | ||
} |
Oops, something went wrong.