Skip to content

Commit

Permalink
Layout standardization
Browse files Browse the repository at this point in the history
  • Loading branch information
MrApplejuice committed Jun 27, 2024
1 parent 0eea892 commit 178656f
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class DiaperLoggingController(val fragment: BaseFragment, childId: Int) : Loggin
saveButton.visibility = if (wetLogic.state || solidLogic.state) {
View.VISIBLE
} else {
View.INVISIBLE
View.GONE
}
}

Expand Down Expand Up @@ -387,7 +387,7 @@ class NotesLoggingController(val fragment: BaseFragment, childId: Int) : Logging
saveButton.visibility = if (noteEditor.text.isNotEmpty()) {
View.VISIBLE
} else {
View.INVISIBLE
View.GONE
}
}
}
Expand Down
130 changes: 62 additions & 68 deletions app/src/main/res/layout/diaper_logging_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,139 +5,133 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/noteEditor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:gravity="top|left"
android:hint="@string/activity_notes_hint"
android:inputType="textLongMessage|textMultiLine|text"
android:maxLines="5"
android:minLines="1"
android:selectAllOnFocus="false"
android:singleLine="false"
app:layout_constraintEnd_toEndOf="parent"
<FrameLayout
android:id="@+id/sleepIcon"
android:layout_width="48dp"
android:layout_height="0dp"
android:background="@color/diaper_enabled"
android:minHeight="48dp"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_min="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0"
android:scaleType="fitCenter"
android:src="@drawable/pkg_diaper"
android:tintMode="src_in"
android:visibility="visible"
app:tint="@color/fixed_color_button_text_color" />
</FrameLayout>


<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@+id/sleepIcon"
app:layout_constraintTop_toTopOf="parent">

<FrameLayout
android:id="@+id/sleepIcon"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@color/diaper_enabled"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent"
<EditText
android:id="@+id/noteEditor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:gravity="top|left"
android:hint="@string/activity_notes_hint"
android:inputType="textLongMessage|textMultiLine|text"
android:maxLines="5"
android:minLines="1"
android:selectAllOnFocus="false"
android:singleLine="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0"
android:scaleType="fitCenter"
android:src="@drawable/pkg_diaper"
android:tintMode="src_in"
android:visibility="visible"
app:tint="@color/fixed_color_button_text_color" />
</FrameLayout>
app:layout_constraintTop_toBottomOf="@+id/wetButtonGroup" />

<ImageButton
android:id="@+id/sendButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_weight="0"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="@+id/solidButtonGroup"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/noteEditor"
app:srcCompat="@android:drawable/ic_menu_save" />

<LinearLayout
android:id="@+id/solidButtonGroup"
android:id="@+id/wetButtonGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/wetButtonGroup"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageButton
android:id="@+id/solidDisabledButton"
android:id="@+id/wetDisabledButton"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_weight="0"
android:scaleType="fitCenter"
android:src="@drawable/pkg_no_poop"
android:src="@drawable/pkg_not_wet"
android:tintMode="src_in"
android:visibility="gone"
app:tint="?android:attr/textColorSecondary" />
app:tint="?android:attr/textColorSecondary"
tools:layout_editor_absoluteX="544dp"
tools:layout_editor_absoluteY="29dp" />

<ImageButton
android:id="@+id/solidEnabledButton"
android:id="@+id/wetEnabledButton"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_weight="0"
android:backgroundTint="#80FF80"
android:scaleType="fitCenter"
android:src="@drawable/pkg_poop"
android:src="@drawable/pkg_wet"
android:tintMode="src_in"
android:visibility="visible"
app:tint="@color/fixed_color_button_text_color" />
app:tint="@color/fixed_color_button_text_color"
tools:layout_editor_absoluteX="370dp"
tools:layout_editor_absoluteY="0dp" />
</LinearLayout>

<LinearLayout
android:id="@+id/wetButtonGroup"
android:id="@+id/solidButtonGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/sleepIcon"
app:layout_constraintStart_toEndOf="@+id/wetButtonGroup"
app:layout_constraintTop_toTopOf="parent">

<ImageButton
android:id="@+id/wetDisabledButton"
android:id="@+id/solidDisabledButton"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_weight="0"
android:scaleType="fitCenter"
android:src="@drawable/pkg_not_wet"
android:src="@drawable/pkg_no_poop"
android:tintMode="src_in"
android:visibility="gone"
app:tint="?android:attr/textColorSecondary"
tools:layout_editor_absoluteX="544dp"
tools:layout_editor_absoluteY="29dp" />
app:tint="?android:attr/textColorSecondary" />

<ImageButton
android:id="@+id/wetEnabledButton"
android:id="@+id/solidEnabledButton"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_weight="0"
android:backgroundTint="#80FF80"
android:scaleType="fitCenter"
android:src="@drawable/pkg_wet"
android:src="@drawable/pkg_poop"
android:tintMode="src_in"
android:visibility="visible"
app:tint="@color/fixed_color_button_text_color"
tools:layout_editor_absoluteX="370dp"
tools:layout_editor_absoluteY="0dp" />


app:tint="@color/fixed_color_button_text_color" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/feeding_logging_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
android:id="@+id/sleepIcon"
android:layout_width="48dp"
android:layout_height="0dp"
android:layout_margin="8dp"
android:background="@color/feeding_enabled"
android:minHeight="48dp"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHeight_min="48dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

Expand Down Expand Up @@ -59,7 +60,7 @@
android:minLines="1"
android:selectAllOnFocus="false"
android:singleLine="false"
app:layout_constraintTop_toBottomOf="@+id/sendButton" />
app:layout_constraintTop_toBottomOf="@+id/feedingTypeGroup" />


<ImageButton
Expand All @@ -70,7 +71,7 @@
android:layout_weight="0"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/feedingTypeGroup"
app:layout_constraintTop_toBottomOf="@+id/noteEditor"
app:srcCompat="@android:drawable/ic_menu_save" />

<LinearLayout
Expand Down
Loading

0 comments on commit 178656f

Please sign in to comment.