Skip to content

Commit

Permalink
Make the navigate_back work
Browse files Browse the repository at this point in the history
  • Loading branch information
regdocs committed Oct 13, 2022
1 parent b05a3c4 commit 03b3688
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/com/thedhobighat/FragTrackYourOrder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.fragment.app.FragmentManager
import androidx.navigation.Navigation
import com.airbnb.paris.extensions.style
import com.google.gson.Gson
Expand All @@ -32,6 +33,10 @@ class FragTrackYourOrder : Fragment() {
if (status.delivered.state)
view.findViewById<ConstraintLayout>(R.id.bool_delivered).setBackgroundResource(R.drawable.round_all_around_but_red)

view.findViewById<ConstraintLayout>(R.id.navigate_back).setOnClickListener {
activity?.supportFragmentManager?.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
}

return view
}
}
14 changes: 8 additions & 6 deletions app/src/main/res/layout/frag_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
android:orientation="vertical">

<TextView
android:layout_marginTop="40dp"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
android:layout_marginTop="20dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="5dp"
android:id="@+id/textView"
android:layout_width="match_parent"
Expand All @@ -26,9 +26,9 @@

<TextView
android:layout_marginTop="5dp"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
android:layout_marginBottom="40dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="20dp"
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -45,6 +45,8 @@
android:scrollbars="none"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
Expand Down

0 comments on commit 03b3688

Please sign in to comment.