Browse code

Initial commit (losing old history)

Dario Rodriguez authored on 08/04/2026 17:25:38
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,285 @@
1
+<?xml version="1.0" encoding="utf-8"?><!--
2
+  ~ Copyright (c) 2023 Samson Achiaga
3
+  ~
4
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
5
+  ~ you may not use this file except in compliance with the License.
6
+  ~ You may obtain a copy of the License at
7
+  ~
8
+  ~     http://www.apache.org/licenses/LICENSE-2.0
9
+  ~
10
+  ~ Unless required by applicable law or agreed to in writing, software
11
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
12
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+  ~ See the License for the specific language governing permissions and
14
+  ~ limitations under the License.
15
+  -->
16
+
17
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
18
+    xmlns:app="http://schemas.android.com/apk/res-auto"
19
+    xmlns:tools="http://schemas.android.com/tools"
20
+    tools:context=".ui.EditNoteFragment">
21
+
22
+    <data>
23
+
24
+        <import type="com.certified.audionote.utils.UtilKt" />
25
+
26
+        <import type="com.certified.audionote.utils.ReminderAvailableState" />
27
+
28
+        <import type="com.certified.audionote.utils.ReminderCompletionState" />
29
+
30
+        <variable
31
+            name="viewModel"
32
+            type="com.certified.audionote.ui.NotesViewModel" />
33
+
34
+        <variable
35
+            name="reminderAvailableState"
36
+            type="ReminderAvailableState" />
37
+
38
+        <variable
39
+            name="reminderCompletionState"
40
+            type="ReminderCompletionState" />
41
+
42
+        <variable
43
+            name="note"
44
+            type="com.certified.audionote.model.Note" />
45
+    </data>
46
+
47
+    <androidx.constraintlayout.widget.ConstraintLayout
48
+        android:id="@+id/parent"
49
+        android:layout_width="match_parent"
50
+        android:layout_height="match_parent"
51
+        android:background="@{note.color}">
52
+
53
+        <androidx.appcompat.widget.AppCompatImageButton
54
+            android:id="@+id/btn_back"
55
+            android:layout_width="wrap_content"
56
+            android:layout_height="wrap_content"
57
+            android:layout_gravity="center"
58
+            android:layout_marginStart="@dimen/_8sdp"
59
+            android:layout_marginTop="@dimen/_16sdp"
60
+            android:background="@null"
61
+            android:contentDescription="@string/back_button"
62
+            android:padding="@dimen/_4sdp"
63
+            android:tint="@color/black_day_white_night"
64
+            app:layout_constraintStart_toStartOf="parent"
65
+            app:layout_constraintTop_toTopOf="parent"
66
+            app:srcCompat="@drawable/ic_arrow_back_black_24dp"
67
+            tools:ignore="TouchTargetSizeCheck" />
68
+
69
+        <androidx.appcompat.widget.AppCompatImageButton
70
+            android:id="@+id/btn_share"
71
+            android:layout_width="wrap_content"
72
+            android:layout_height="wrap_content"
73
+            android:layout_gravity="center"
74
+            android:layout_marginEnd="@dimen/_8sdp"
75
+            android:background="@null"
76
+            android:contentDescription="@string/share_button"
77
+            android:padding="@dimen/_4sdp"
78
+            android:tint="@color/black_day_white_night"
79
+            app:layout_constraintEnd_toEndOf="parent"
80
+            app:layout_constraintTop_toTopOf="@+id/btn_delete"
81
+            app:srcCompat="@drawable/ic_share_black_24dp"
82
+            tools:ignore="TouchTargetSizeCheck" />
83
+
84
+        <androidx.appcompat.widget.AppCompatImageButton
85
+            android:id="@+id/btn_delete"
86
+            android:layout_width="wrap_content"
87
+            android:layout_height="wrap_content"
88
+            android:layout_marginEnd="@dimen/_8sdp"
89
+            android:background="@null"
90
+            android:contentDescription="@string/delete_button"
91
+            android:padding="@dimen/_4sdp"
92
+            android:tint="@color/black_day_white_night"
93
+            app:layout_constraintEnd_toStartOf="@+id/btn_share"
94
+            app:layout_constraintTop_toTopOf="@+id/btn_back"
95
+            app:srcCompat="@drawable/ic_delete_black_24dp"
96
+            tools:ignore="TouchTargetSizeCheck" />
97
+
98
+        <com.google.android.material.textview.MaterialTextView
99
+            android:id="@+id/tv_title"
100
+            android:layout_width="wrap_content"
101
+            android:layout_height="wrap_content"
102
+            android:layout_marginStart="@dimen/_32sdp"
103
+            android:fontFamily="@font/open_sans_bold"
104
+            android:text="@string/edit_note"
105
+            android:textColor="@color/black_day_white_night"
106
+            android:textSize="@dimen/_18ssp"
107
+            app:layout_constraintBottom_toBottomOf="@+id/btn_back"
108
+            app:layout_constraintStart_toEndOf="@+id/btn_back"
109
+            app:layout_constraintTop_toTopOf="@+id/btn_back" />
110
+
111
+        <ScrollView
112
+            android:id="@+id/scrollView2"
113
+            android:layout_width="0dp"
114
+            android:layout_height="0dp"
115
+            android:layout_marginStart="@dimen/_16sdp"
116
+            android:layout_marginEnd="@dimen/_16sdp"
117
+            android:paddingTop="@dimen/_16sdp"
118
+            app:layout_constraintBottom_toTopOf="@+id/card_add_reminder"
119
+            app:layout_constraintEnd_toEndOf="parent"
120
+            app:layout_constraintStart_toStartOf="parent"
121
+            app:layout_constraintTop_toBottomOf="@+id/btn_back">
122
+
123
+            <androidx.constraintlayout.widget.ConstraintLayout
124
+                android:layout_width="match_parent"
125
+                android:layout_height="wrap_content">
126
+
127
+                <com.google.android.material.textfield.TextInputEditText
128
+                    android:id="@+id/et_note_title"
129
+                    android:layout_width="0dp"
130
+                    android:layout_height="wrap_content"
131
+                    android:background="@null"
132
+                    android:fontFamily="@font/open_sans_semi_bold"
133
+                    android:gravity="start|top"
134
+                    android:hint="@string/note_title_required"
135
+                    android:inputType="textMultiLine"
136
+                    android:maxLength="50"
137
+                    android:text="@{note.title}"
138
+                    android:textSize="@dimen/_16ssp"
139
+                    app:layout_constraintEnd_toEndOf="parent"
140
+                    app:layout_constraintStart_toStartOf="parent"
141
+                    app:layout_constraintTop_toTopOf="parent"
142
+                    tools:ignore="TouchTargetSizeCheck,TextContrastCheck" />
143
+
144
+                <com.google.android.material.textfield.TextInputEditText
145
+                    android:id="@+id/et_note_description"
146
+                    android:layout_width="0dp"
147
+                    android:layout_height="0dp"
148
+                    android:layout_marginTop="@dimen/_10sdp"
149
+                    android:background="@null"
150
+                    android:ems="10"
151
+                    android:fontFamily="@font/open_sans_regular"
152
+                    android:gravity="start|top"
153
+                    android:hint="@string/description"
154
+                    android:inputType="textMultiLine"
155
+                    android:text="@{note.description}"
156
+                    android:textSize="@dimen/_12ssp"
157
+                    app:layout_constraintBottom_toTopOf="@+id/guideline2"
158
+                    app:layout_constraintEnd_toEndOf="@+id/et_note_title"
159
+                    app:layout_constraintHorizontal_bias="1.0"
160
+                    app:layout_constraintStart_toStartOf="@+id/et_note_title"
161
+                    app:layout_constraintTop_toBottomOf="@+id/et_note_title"
162
+                    tools:ignore="TextContrastCheck" />
163
+
164
+                <androidx.constraintlayout.widget.Guideline
165
+                    android:id="@+id/guideline2"
166
+                    android:layout_width="wrap_content"
167
+                    android:layout_height="wrap_content"
168
+                    android:orientation="horizontal"
169
+                    app:layout_constraintGuide_percent=".4" />
170
+
171
+                <com.google.android.material.textview.MaterialTextView
172
+                    android:id="@+id/tv_timer"
173
+                    android:layout_width="wrap_content"
174
+                    android:layout_height="wrap_content"
175
+                    android:layout_marginTop="@dimen/_16sdp"
176
+                    android:fontFamily="@font/open_sans_regular"
177
+                    android:textColor="@color/black_day_white_night"
178
+                    android:textSize="@dimen/_24ssp"
179
+                    app:layout_constraintBottom_toTopOf="@+id/btn_record"
180
+                    app:layout_constraintEnd_toEndOf="parent"
181
+                    app:layout_constraintStart_toStartOf="parent"
182
+                    app:layout_constraintTop_toBottomOf="@+id/et_note_description"
183
+                    app:timeText="@{note.audioLength}"
184
+                    tools:text="00:00" />
185
+
186
+                <androidx.appcompat.widget.AppCompatImageButton
187
+                    android:id="@+id/btn_record"
188
+                    android:layout_width="wrap_content"
189
+                    android:layout_height="wrap_content"
190
+                    android:layout_marginTop="@dimen/_16sdp"
191
+                    android:layout_marginBottom="@dimen/_8sdp"
192
+                    android:background="@null"
193
+                    android:contentDescription="@string/record_button"
194
+                    app:layout_constraintBottom_toBottomOf="parent"
195
+                    app:layout_constraintEnd_toEndOf="parent"
196
+                    app:layout_constraintStart_toStartOf="parent"
197
+                    app:layout_constraintTop_toBottomOf="@+id/tv_timer"
198
+                    app:srcCompat="@drawable/ic_audio_not_playing" />
199
+
200
+            </androidx.constraintlayout.widget.ConstraintLayout>
201
+        </ScrollView>
202
+
203
+        <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
204
+            android:id="@+id/fab_update_note"
205
+            android:layout_width="wrap_content"
206
+            android:layout_height="wrap_content"
207
+            android:layout_marginEnd="@dimen/_16sdp"
208
+            android:layout_marginBottom="@dimen/_8sdp"
209
+            android:backgroundTint="@color/fab_background_tint"
210
+            android:text="@string/save"
211
+            android:textAllCaps="false"
212
+            android:textSize="@dimen/_14ssp"
213
+            app:icon="@drawable/ic_done_black_24dp"
214
+            app:iconSize="@dimen/_27sdp"
215
+            app:layout_constraintBottom_toBottomOf="@+id/scrollView2"
216
+            app:layout_constraintEnd_toEndOf="parent" />
217
+
218
+        <com.google.android.material.card.MaterialCardView
219
+            android:id="@+id/card_add_reminder"
220
+            android:layout_width="0dp"
221
+            android:layout_height="wrap_content"
222
+            android:elevation="@dimen/_4sdp"
223
+            app:cardBackgroundColor="@null"
224
+            app:layout_constraintBottom_toBottomOf="parent"
225
+            app:layout_constraintEnd_toEndOf="parent"
226
+            app:layout_constraintStart_toStartOf="parent">
227
+
228
+            <androidx.constraintlayout.widget.ConstraintLayout
229
+                android:id="@+id/parent_add_reminder"
230
+                android:layout_width="match_parent"
231
+                android:layout_height="match_parent"
232
+                android:background="@{note.color}"
233
+                android:backgroundTint="#27FFFFFF"
234
+                android:backgroundTintMode="screen"
235
+                android:paddingStart="@dimen/_8sdp"
236
+                android:paddingTop="@dimen/_4sdp"
237
+                android:paddingEnd="@dimen/_8sdp"
238
+                android:paddingBottom="@dimen/_4sdp">
239
+
240
+                <androidx.appcompat.widget.AppCompatImageButton
241
+                    android:id="@+id/appCompatImageView3"
242
+                    android:layout_width="wrap_content"
243
+                    android:layout_height="wrap_content"
244
+                    android:background="@null"
245
+                    android:padding="@dimen/_4sdp"
246
+                    android:src="@drawable/ic_alarm_on_black_24dp"
247
+                    android:tint="@color/black_day_white_night"
248
+                    app:layout_constraintBottom_toBottomOf="parent"
249
+                    app:layout_constraintStart_toStartOf="parent"
250
+                    app:layout_constraintTop_toTopOf="parent" />
251
+
252
+                <com.google.android.material.textview.MaterialTextView
253
+                    android:id="@+id/tv_reminder_date"
254
+                    android:layout_width="wrap_content"
255
+                    android:layout_height="wrap_content"
256
+                    android:layout_marginStart="@dimen/_16sdp"
257
+                    android:fontFamily="@font/open_sans_regular"
258
+                    android:padding="@dimen/_4sdp"
259
+                    android:text="@{UtilKt.formatReminderDate(note.reminder)}"
260
+                    android:textColor="@color/black_day_white_night"
261
+                    android:textSize="@dimen/_14ssp"
262
+                    app:layout_constraintBottom_toBottomOf="parent"
263
+                    app:layout_constraintStart_toEndOf="@+id/appCompatImageView3"
264
+                    app:layout_constraintTop_toTopOf="parent"
265
+                    app:strikeThrough="@{viewModel.reminderCompletionState == ReminderCompletionState.COMPLETED}"
266
+                    app:visible="@{viewModel.reminderAvailableState == ReminderAvailableState.HAS_REMINDER}" />
267
+
268
+                <com.google.android.material.textview.MaterialTextView
269
+                    android:layout_width="wrap_content"
270
+                    android:layout_height="wrap_content"
271
+                    android:layout_marginStart="@dimen/_16sdp"
272
+                    android:fontFamily="@font/open_sans_regular"
273
+                    android:text="@string/click_to_add_a_reminder_to_this_note"
274
+                    android:textSize="@dimen/_12ssp"
275
+                    app:layout_constraintBottom_toBottomOf="@+id/appCompatImageView3"
276
+                    app:layout_constraintStart_toEndOf="@+id/appCompatImageView3"
277
+                    app:layout_constraintTop_toTopOf="@+id/appCompatImageView3"
278
+                    app:visible="@{viewModel.reminderAvailableState == ReminderAvailableState.NO_REMINDER}" />
279
+
280
+            </androidx.constraintlayout.widget.ConstraintLayout>
281
+
282
+        </com.google.android.material.card.MaterialCardView>
283
+
284
+    </androidx.constraintlayout.widget.ConstraintLayout>
285
+</layout>
0 286
\ No newline at end of file