Skip to content

Commit

Permalink
Criando mais um sample
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrofsn committed Jun 19, 2018
1 parent 422eb1e commit 2a58a04
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package br.com.redcode.revealpassword.sample

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import br.com.redcode.revealpassword.library.showOrHidePassword
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
Expand All @@ -11,6 +12,9 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main)

editTextWithImageForRevealPassword.changeIcon(android.R.drawable.ic_delete)

editTextWithImageForRevealPassword.changeHint(getString(R.string.app_name))

buttonShowHidePassword.setOnClickListener { editTextSampleFunction.showOrHidePassword() }
}
}
26 changes: 23 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Default" />
android:text="Default UI component from library" />

<br.com.redcode.revealpassword.library.EditTextWithImageForRevealPassword
android:layout_width="match_parent"
Expand All @@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Custom from XML (only)" />
android:text="UI component customized in XML (no kotlin/java references)" />

<br.com.redcode.revealpassword.library.EditTextWithImageForRevealPassword
android:layout_width="match_parent"
Expand All @@ -34,12 +34,32 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Sample on XML with Kotlin changing icon and label" />
android:text="Custom with Kotlin" />

<br.com.redcode.revealpassword.library.EditTextWithImageForRevealPassword
android:id="@+id/editTextWithImageForRevealPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Just using the function from library" />

<EditText
android:id="@+id/editTextSampleFunction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:inputType="textWebPassword"
android:text="\@pedrofsn" />

<Button
android:id="@+id/buttonShowHidePassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show/hide password" />

</LinearLayout>

0 comments on commit 2a58a04

Please sign in to comment.