Skip to content

Commit

Permalink
activity_main.xml added a editText to test show function.
Browse files Browse the repository at this point in the history
  • Loading branch information
oneHamidreza committed Jun 26, 2020
1 parent 9e2514f commit 588cbe8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,15 @@ class MainActivity : AppCompatActivity() {

}

binding.btShow.setOnClickListener {
val id = try {
binding.etPageId.text.toString().toInt()
} catch (e: Exception) {
ID_HOME
}
if (id in ID_HOME..ID_ACCOUNT)
binding.bottomNavigation.show(id)
}

}
}
10 changes: 9 additions & 1 deletion Sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,20 @@
android:textSize="16sp" />

<EditText
android:id="@+id/etPageId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:hint="Test EditText" />
android:inputType="numberDecimal"
android:hint="Page ID" />

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

</LinearLayout>

Expand Down

0 comments on commit 588cbe8

Please sign in to comment.