Skip to content

Commit ffbcb08

Browse files
committed
apply convention to login
1 parent dbd0485 commit ffbcb08

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

app/src/androidTest/kotlin/com/hana053/micropost/pages/login/LoginActivityTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class LoginActivityTest : InjectableTest by InjectableTestImpl() {
3535
@Rule @JvmField
3636
val activityRule = ActivityTestRule(LoginActivity::class.java, false, false)
3737

38-
val loginBtn: Matcher<View> = withId(R.id.loginBtn)
39-
val emailEditText: Matcher<View> = withId(R.id.emailEditText)
40-
val passwordEditText: Matcher<View> = withId(R.id.passwordEditText)
38+
val loginBtn: Matcher<View> = withId(R.id.btn_login)
39+
val emailEditText: Matcher<View> = withId(R.id.et_email)
40+
val passwordEditText: Matcher<View> = withId(R.id.et_password)
4141

4242
@Test
4343
fun shouldBeOpened() {

app/src/main/kotlin/com/hana053/micropost/pages/login/LoginView.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import rx.Observable
1111
class LoginView(override val content: ViewGroup) : ViewWrapper {
1212

1313
// Events
14-
val emailChanges: Observable<String> = content.emailEditText
14+
val emailChanges: Observable<String> = content.et_email
1515
.textChanges()
1616
.map { it.toString() }
17-
val passwordChanges: Observable<String> = content.passwordEditText
17+
val passwordChanges: Observable<String> = content.et_password
1818
.textChanges()
1919
.map { it.toString() }
20-
val loginClicks = content.loginBtn.clicks()
20+
val loginClicks = content.btn_login.clicks()
2121

2222
// Props
23-
val loginEnabled = content.loginBtn.enabled()
23+
val loginEnabled = content.btn_login.enabled()
2424
}

app/src/main/res/layout/activity_login.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
android:layout_height="wrap_content">
2626

2727
<android.support.v7.widget.AppCompatEditText
28-
android:id="@+id/emailEditText"
28+
android:id="@+id/et_email"
2929
android:layout_width="match_parent"
3030
android:layout_height="wrap_content"
3131
android:hint="@string/email"
@@ -37,7 +37,7 @@
3737
android:layout_height="wrap_content">
3838

3939
<android.support.v7.widget.AppCompatEditText
40-
android:id="@+id/passwordEditText"
40+
android:id="@+id/et_password"
4141
android:layout_width="match_parent"
4242
android:layout_height="wrap_content"
4343
android:hint="@string/password"
@@ -52,7 +52,7 @@
5252
android:background="@drawable/border_top">
5353

5454
<Button
55-
android:id="@+id/loginBtn"
55+
android:id="@+id/btn_login"
5656
android:layout_width="wrap_content"
5757
android:layout_height="wrap_content"
5858
android:layout_alignParentEnd="true"

0 commit comments

Comments
 (0)