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,256 @@
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.AddNoteFragment">
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
+        <com.google.android.material.textview.MaterialTextView
70
+            android:id="@+id/tv_title"
71
+            android:layout_width="wrap_content"
72
+            android:layout_height="wrap_content"
73
+            android:layout_marginStart="@dimen/_32sdp"
74
+            android:fontFamily="@font/open_sans_bold"
75
+            android:text="@string/new_note"
76
+            android:textColor="@color/black_day_white_night"
77
+            android:textSize="@dimen/_18ssp"
78
+            app:layout_constraintBottom_toBottomOf="@+id/btn_back"
79
+            app:layout_constraintStart_toEndOf="@+id/btn_back"
80
+            app:layout_constraintTop_toTopOf="@+id/btn_back" />
81
+
82
+        <ScrollView
83
+            android:id="@+id/scrollView2"
84
+            android:layout_width="0dp"
85
+            android:layout_height="0dp"
86
+            android:layout_marginStart="@dimen/_16sdp"
87
+            android:layout_marginEnd="@dimen/_16sdp"
88
+            android:paddingTop="@dimen/_16sdp"
89
+            app:layout_constraintBottom_toTopOf="@+id/card_add_reminder"
90
+            app:layout_constraintEnd_toEndOf="parent"
91
+            app:layout_constraintStart_toStartOf="parent"
92
+            app:layout_constraintTop_toBottomOf="@+id/btn_back">
93
+
94
+            <androidx.constraintlayout.widget.ConstraintLayout
95
+                android:layout_width="match_parent"
96
+                android:layout_height="wrap_content">
97
+
98
+                <com.google.android.material.textfield.TextInputEditText
99
+                    android:id="@+id/et_note_title"
100
+                    android:layout_width="0dp"
101
+                    android:layout_height="wrap_content"
102
+                    android:background="@null"
103
+                    android:fontFamily="@font/open_sans_semi_bold"
104
+                    android:gravity="start|top"
105
+                    android:hint="@string/note_title_required"
106
+                    android:inputType="textMultiLine"
107
+                    android:maxLength="50"
108
+                    android:text="@{note.title}"
109
+                    android:textSize="@dimen/_16ssp"
110
+                    app:layout_constraintEnd_toEndOf="parent"
111
+                    app:layout_constraintStart_toStartOf="parent"
112
+                    app:layout_constraintTop_toTopOf="parent"
113
+                    tools:ignore="TouchTargetSizeCheck,TextContrastCheck" />
114
+
115
+                <com.google.android.material.textfield.TextInputEditText
116
+                    android:id="@+id/et_note_description"
117
+                    android:layout_width="0dp"
118
+                    android:layout_height="0dp"
119
+                    android:layout_marginTop="@dimen/_10sdp"
120
+                    android:background="@null"
121
+                    android:ems="10"
122
+                    android:fontFamily="@font/open_sans_regular"
123
+                    android:gravity="start|top"
124
+                    android:hint="@string/description"
125
+                    android:inputType="textMultiLine"
126
+                    android:text="@{note.description}"
127
+                    android:textSize="@dimen/_12ssp"
128
+                    app:layout_constraintBottom_toTopOf="@+id/guideline2"
129
+                    app:layout_constraintEnd_toEndOf="@+id/et_note_title"
130
+                    app:layout_constraintHorizontal_bias="1.0"
131
+                    app:layout_constraintStart_toStartOf="@+id/et_note_title"
132
+                    app:layout_constraintTop_toBottomOf="@+id/et_note_title"
133
+                    tools:ignore="TextContrastCheck" />
134
+
135
+                <androidx.constraintlayout.widget.Guideline
136
+                    android:id="@+id/guideline2"
137
+                    android:layout_width="wrap_content"
138
+                    android:layout_height="wrap_content"
139
+                    android:orientation="horizontal"
140
+                    app:layout_constraintGuide_percent=".4" />
141
+
142
+                <com.google.android.material.textview.MaterialTextView
143
+                    android:id="@+id/tv_timer"
144
+                    android:layout_width="wrap_content"
145
+                    android:layout_height="wrap_content"
146
+                    android:layout_marginTop="@dimen/_16sdp"
147
+                    android:fontFamily="@font/open_sans_regular"
148
+                    android:textColor="@color/black_day_white_night"
149
+                    android:textSize="@dimen/_24ssp"
150
+                    app:layout_constraintBottom_toTopOf="@+id/btn_record"
151
+                    app:layout_constraintEnd_toEndOf="parent"
152
+                    app:layout_constraintStart_toStartOf="parent"
153
+                    app:layout_constraintTop_toBottomOf="@+id/et_note_description"
154
+                    app:timeText="@{note.audioLength}"
155
+                    tools:text="00:00" />
156
+
157
+                <androidx.appcompat.widget.AppCompatImageButton
158
+                    android:id="@+id/btn_record"
159
+                    android:layout_width="wrap_content"
160
+                    android:layout_height="wrap_content"
161
+                    android:layout_marginTop="@dimen/_16sdp"
162
+                    android:layout_marginBottom="@dimen/_8sdp"
163
+                    android:background="@null"
164
+                    android:contentDescription="@string/record_button"
165
+                    app:layout_constraintBottom_toBottomOf="parent"
166
+                    app:layout_constraintEnd_toEndOf="parent"
167
+                    app:layout_constraintStart_toStartOf="parent"
168
+                    app:layout_constraintTop_toBottomOf="@+id/tv_timer"
169
+                    app:srcCompat="@drawable/ic_mic_not_recording" />
170
+
171
+            </androidx.constraintlayout.widget.ConstraintLayout>
172
+        </ScrollView>
173
+
174
+        <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
175
+            android:id="@+id/fab_save_note"
176
+            android:layout_width="wrap_content"
177
+            android:layout_height="wrap_content"
178
+            android:layout_marginEnd="@dimen/_16sdp"
179
+            android:layout_marginBottom="@dimen/_8sdp"
180
+            android:backgroundTint="@color/fab_background_tint"
181
+            android:text="@string/save"
182
+            android:textAllCaps="false"
183
+            android:textSize="@dimen/_14ssp"
184
+            app:icon="@drawable/ic_done_black_24dp"
185
+            app:iconSize="@dimen/_27sdp"
186
+            app:layout_constraintBottom_toBottomOf="@+id/scrollView2"
187
+            app:layout_constraintEnd_toEndOf="parent" />
188
+
189
+        <com.google.android.material.card.MaterialCardView
190
+            android:id="@+id/card_add_reminder"
191
+            android:layout_width="0dp"
192
+            android:layout_height="wrap_content"
193
+            android:elevation="@dimen/_4sdp"
194
+            app:cardBackgroundColor="@null"
195
+            app:layout_constraintBottom_toBottomOf="parent"
196
+            app:layout_constraintEnd_toEndOf="parent"
197
+            app:layout_constraintStart_toStartOf="parent">
198
+
199
+            <androidx.constraintlayout.widget.ConstraintLayout
200
+                android:id="@+id/parent_add_reminder"
201
+                android:layout_width="match_parent"
202
+                android:layout_height="match_parent"
203
+                android:background="@{note.color}"
204
+                android:backgroundTint="#27FFFFFF"
205
+                android:backgroundTintMode="screen"
206
+                android:paddingStart="@dimen/_8sdp"
207
+                android:paddingTop="@dimen/_4sdp"
208
+                android:paddingEnd="@dimen/_8sdp"
209
+                android:paddingBottom="@dimen/_4sdp">
210
+
211
+                <androidx.appcompat.widget.AppCompatImageButton
212
+                    android:id="@+id/appCompatImageView3"
213
+                    android:layout_width="wrap_content"
214
+                    android:layout_height="wrap_content"
215
+                    android:background="@null"
216
+                    android:padding="@dimen/_4sdp"
217
+                    android:src="@drawable/ic_alarm_on_black_24dp"
218
+                    android:tint="@color/black_day_white_night"
219
+                    app:layout_constraintBottom_toBottomOf="parent"
220
+                    app:layout_constraintStart_toStartOf="parent"
221
+                    app:layout_constraintTop_toTopOf="parent" />
222
+
223
+                <com.google.android.material.textview.MaterialTextView
224
+                    android:id="@+id/tv_reminder_date"
225
+                    android:layout_width="wrap_content"
226
+                    android:layout_height="wrap_content"
227
+                    android:layout_marginStart="@dimen/_16sdp"
228
+                    android:fontFamily="@font/open_sans_regular"
229
+                    android:padding="@dimen/_4sdp"
230
+                    android:text="@{UtilKt.formatReminderDate(note.reminder)}"
231
+                    android:textColor="@color/black_day_white_night"
232
+                    android:textSize="@dimen/_14ssp"
233
+                    app:layout_constraintBottom_toBottomOf="parent"
234
+                    app:layout_constraintStart_toEndOf="@+id/appCompatImageView3"
235
+                    app:layout_constraintTop_toTopOf="parent"
236
+                    app:strikeThrough="@{viewModel.reminderCompletionState == ReminderCompletionState.COMPLETED}"
237
+                    app:visible="@{viewModel.reminderAvailableState == ReminderAvailableState.HAS_REMINDER}" />
238
+
239
+                <com.google.android.material.textview.MaterialTextView
240
+                    android:layout_width="wrap_content"
241
+                    android:layout_height="wrap_content"
242
+                    android:layout_marginStart="@dimen/_16sdp"
243
+                    android:fontFamily="@font/open_sans_regular"
244
+                    android:text="@string/click_to_add_a_reminder_to_this_note"
245
+                    android:textSize="@dimen/_12ssp"
246
+                    app:layout_constraintBottom_toBottomOf="@+id/appCompatImageView3"
247
+                    app:layout_constraintStart_toEndOf="@+id/appCompatImageView3"
248
+                    app:layout_constraintTop_toTopOf="@+id/appCompatImageView3"
249
+                    app:visible="@{viewModel.reminderAvailableState == ReminderAvailableState.NO_REMINDER}" />
250
+
251
+            </androidx.constraintlayout.widget.ConstraintLayout>
252
+
253
+        </com.google.android.material.card.MaterialCardView>
254
+
255
+    </androidx.constraintlayout.widget.ConstraintLayout>
256
+</layout>
0 257
\ No newline at end of file