Skip to content

Commit

Permalink
refactor(messages): add back button
Browse files Browse the repository at this point in the history
  • Loading branch information
andrekir committed Sep 30, 2023
1 parent c26b6dd commit fdb94fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/com/geeksville/mesh/ui/MessagesFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ class MessagesFragment : Fragment(), Logging {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.toolbar.setNavigationOnClickListener {
parentFragmentManager.popBackStack()
}

setFragmentResultListener("requestKey") { _, bundle->
// get the result from bundle
contactKey = bundle.getString("contactKey").toString()
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/messages_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAdvancedBackground">
Expand All @@ -13,7 +12,8 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="parent"
app:navigationIcon="?android:attr/homeAsUpIndicator">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -41,7 +41,7 @@
app:layout_constraintBottom_toTopOf="@+id/quickChatView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar" >
app:layout_constraintTop_toBottomOf="@id/toolbar">

</androidx.recyclerview.widget.RecyclerView>

Expand All @@ -58,7 +58,7 @@

<LinearLayout
android:id="@+id/quickChatLayout"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</HorizontalScrollView>
Expand Down

0 comments on commit fdb94fb

Please sign in to comment.