Skip to content

Commit cde2c73

Browse files
committed
Fix double toolbar issue in Plant Details page
Changes include: - Remove the duplicate toolbar in the collapsing layout - Show plant name above watering details - Change text size of plant description We will look into a different layout when we start implementing Material design.
1 parent 23d9e21 commit cde2c73

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

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

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@
5959
app:imageFromUrl="@{viewModel.plant.imageUrl}"
6060
app:layout_collapseMode="parallax" />
6161

62-
<androidx.appcompat.widget.Toolbar
63-
android:id="@+id/detail_toolbar"
64-
android:layout_width="match_parent"
65-
android:layout_height="?attr/actionBarSize"
66-
app:layout_collapseMode="pin"
67-
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
68-
6962
</com.google.android.material.appbar.CollapsingToolbarLayout>
7063

7164
</com.google.android.material.appbar.AppBarLayout>
@@ -83,21 +76,35 @@
8376
android:layout_height="match_parent">
8477

8578
<TextView
86-
android:id="@+id/plant_watering"
79+
android:id="@+id/plant_name"
80+
style="?android:attr/textAppearanceLarge"
8781
android:layout_width="0dp"
8882
android:layout_height="wrap_content"
8983
android:layout_marginStart="@dimen/margin_small"
9084
android:layout_marginTop="@dimen/margin_normal"
9185
android:layout_marginEnd="@dimen/margin_small"
86+
android:text="@{viewModel.plant.name}"
9287
app:layout_constraintEnd_toEndOf="parent"
9388
app:layout_constraintStart_toStartOf="parent"
9489
app:layout_constraintTop_toTopOf="parent"
90+
tools:text="Sunflower" />
91+
92+
<TextView
93+
android:id="@+id/plant_watering"
94+
android:layout_width="0dp"
95+
android:layout_height="wrap_content"
96+
android:layout_marginStart="@dimen/margin_small"
97+
android:layout_marginTop="@dimen/margin_small"
98+
android:layout_marginEnd="@dimen/margin_small"
99+
app:layout_constraintEnd_toEndOf="parent"
100+
app:layout_constraintStart_toStartOf="parent"
101+
app:layout_constraintTop_toBottomOf="@+id/plant_name"
95102
app:wateringText="@{viewModel.plant.wateringInterval}"
96103
tools:text="Watering needs: every 7 days" />
97104

98105
<TextView
99-
android:id="@+id/plant_detail"
100-
style="?android:attr/textAppearanceLarge"
106+
android:id="@+id/plant_description"
107+
style="?android:attr/textAppearanceMedium"
101108
android:layout_width="0dp"
102109
android:layout_height="wrap_content"
103110
android:layout_marginStart="@dimen/margin_small"

0 commit comments

Comments
 (0)