a ia esta com erro 429 mas esta a funcionar (segundo o anti gravity)
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,6 +8,7 @@ import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -38,16 +39,20 @@ public final class FragmentScheduleAppointmentBinding implements ViewBinding {
|
||||
@NonNull
|
||||
public final AutoCompleteTextView spinnerDoctor;
|
||||
|
||||
@NonNull
|
||||
public final TextView textDoctorSchedule;
|
||||
|
||||
private FragmentScheduleAppointmentBinding(@NonNull LinearLayout rootView,
|
||||
@NonNull Button btnConfirmAppointment, @NonNull DatePicker datePicker,
|
||||
@NonNull TextInputEditText editReason, @NonNull RecyclerView recyclerTimeSlots,
|
||||
@NonNull AutoCompleteTextView spinnerDoctor) {
|
||||
@NonNull AutoCompleteTextView spinnerDoctor, @NonNull TextView textDoctorSchedule) {
|
||||
this.rootView = rootView;
|
||||
this.btnConfirmAppointment = btnConfirmAppointment;
|
||||
this.datePicker = datePicker;
|
||||
this.editReason = editReason;
|
||||
this.recyclerTimeSlots = recyclerTimeSlots;
|
||||
this.spinnerDoctor = spinnerDoctor;
|
||||
this.textDoctorSchedule = textDoctorSchedule;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,8 +112,14 @@ public final class FragmentScheduleAppointmentBinding implements ViewBinding {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
id = R.id.text_doctor_schedule;
|
||||
TextView textDoctorSchedule = ViewBindings.findChildViewById(rootView, id);
|
||||
if (textDoctorSchedule == null) {
|
||||
break missingId;
|
||||
}
|
||||
|
||||
return new FragmentScheduleAppointmentBinding((LinearLayout) rootView, btnConfirmAppointment,
|
||||
datePicker, editReason, recyclerTimeSlots, spinnerDoctor);
|
||||
datePicker, editReason, recyclerTimeSlots, spinnerDoctor, textDoctorSchedule);
|
||||
}
|
||||
String missingId = rootView.getResources().getResourceName(id);
|
||||
throw new NullPointerException("Missing required view with ID: ".concat(missingId));
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><Layout layout="fragment_schedule_appointment" modulePackage="com.example.cuida" filePath="app/src/main/res/layout/fragment_schedule_appointment.xml" directory="layout" isMerge="false" isBindingData="false" rootNodeType="android.widget.LinearLayout"><Targets><Target tag="layout/fragment_schedule_appointment_0" view="LinearLayout"><Expressions/><location startLine="1" startOffset="0" endLine="93" endOffset="14"/></Target><Target id="@+id/datePicker" view="DatePicker"><Expressions/><location startLine="24" startOffset="4" endLine="31" endOffset="43"/></Target><Target id="@+id/recycler_time_slots" view="androidx.recyclerview.widget.RecyclerView"><Expressions/><location startLine="41" startOffset="4" endLine="46" endOffset="43"/></Target><Target id="@+id/spinner_doctor" view="AutoCompleteTextView"><Expressions/><location startLine="63" startOffset="8" endLine="67" endOffset="38"/></Target><Target id="@+id/edit_reason" view="com.google.android.material.textfield.TextInputEditText"><Expressions/><location startLine="76" startOffset="8" endLine="84" endOffset="33"/></Target><Target id="@+id/btn_confirm_appointment" view="Button"><Expressions/><location startLine="87" startOffset="4" endLine="91" endOffset="45"/></Target></Targets></Layout>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><Layout layout="fragment_schedule_appointment" modulePackage="com.example.cuida" filePath="app/src/main/res/layout/fragment_schedule_appointment.xml" directory="layout" isMerge="false" isBindingData="false" rootNodeType="android.widget.LinearLayout"><Targets><Target tag="layout/fragment_schedule_appointment_0" view="LinearLayout"><Expressions/><location startLine="1" startOffset="0" endLine="107" endOffset="14"/></Target><Target id="@+id/datePicker" view="DatePicker"><Expressions/><location startLine="25" startOffset="4" endLine="32" endOffset="43"/></Target><Target id="@+id/spinner_doctor" view="AutoCompleteTextView"><Expressions/><location startLine="50" startOffset="8" endLine="54" endOffset="38"/></Target><Target id="@+id/text_doctor_schedule" view="TextView"><Expressions/><location startLine="57" startOffset="4" endLine="65" endOffset="35"/></Target><Target id="@+id/recycler_time_slots" view="androidx.recyclerview.widget.RecyclerView"><Expressions/><location startLine="76" startOffset="4" endLine="81" endOffset="43"/></Target><Target id="@+id/edit_reason" view="com.google.android.material.textfield.TextInputEditText"><Expressions/><location startLine="90" startOffset="8" endLine="98" endOffset="33"/></Target><Target id="@+id/btn_confirm_appointment" view="Button"><Expressions/><location startLine="101" startOffset="4" endLine="105" endOffset="45"/></Target></Targets></Layout>
|
||||
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><Layout layout="fragment_schedule_appointment" modulePackage="com.example.cuida" filePath="app/src/main/res/layout/fragment_schedule_appointment.xml" directory="layout" isMerge="false" isBindingData="false" rootNodeType="android.widget.LinearLayout"><Targets><Target tag="layout/fragment_schedule_appointment_0" view="LinearLayout"><Expressions/><location startLine="1" startOffset="0" endLine="93" endOffset="14"/></Target><Target id="@+id/datePicker" view="DatePicker"><Expressions/><location startLine="24" startOffset="4" endLine="31" endOffset="43"/></Target><Target id="@+id/recycler_time_slots" view="androidx.recyclerview.widget.RecyclerView"><Expressions/><location startLine="41" startOffset="4" endLine="46" endOffset="43"/></Target><Target id="@+id/spinner_doctor" view="AutoCompleteTextView"><Expressions/><location startLine="63" startOffset="8" endLine="67" endOffset="38"/></Target><Target id="@+id/edit_reason" view="com.google.android.material.textfield.TextInputEditText"><Expressions/><location startLine="76" startOffset="8" endLine="84" endOffset="33"/></Target><Target id="@+id/btn_confirm_appointment" view="Button"><Expressions/><location startLine="87" startOffset="4" endLine="91" endOffset="45"/></Target></Targets></Layout>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><Layout layout="fragment_schedule_appointment" modulePackage="com.example.cuida" filePath="app/src/main/res/layout/fragment_schedule_appointment.xml" directory="layout" isMerge="false" isBindingData="false" rootNodeType="android.widget.LinearLayout"><Targets><Target tag="layout/fragment_schedule_appointment_0" view="LinearLayout"><Expressions/><location startLine="1" startOffset="0" endLine="107" endOffset="14"/></Target><Target id="@+id/datePicker" view="DatePicker"><Expressions/><location startLine="25" startOffset="4" endLine="32" endOffset="43"/></Target><Target id="@+id/spinner_doctor" view="AutoCompleteTextView"><Expressions/><location startLine="50" startOffset="8" endLine="54" endOffset="38"/></Target><Target id="@+id/text_doctor_schedule" view="TextView"><Expressions/><location startLine="57" startOffset="4" endLine="65" endOffset="35"/></Target><Target id="@+id/recycler_time_slots" view="androidx.recyclerview.widget.RecyclerView"><Expressions/><location startLine="76" startOffset="4" endLine="81" endOffset="43"/></Target><Target id="@+id/edit_reason" view="com.google.android.material.textfield.TextInputEditText"><Expressions/><location startLine="90" startOffset="8" endLine="98" endOffset="33"/></Target><Target id="@+id/btn_confirm_appointment" view="Button"><Expressions/><location startLine="101" startOffset="4" endLine="105" endOffset="45"/></Target></Targets></Layout>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
#Thu Apr 23 16:05:04 WEST 2026
|
||||
#Mon Apr 27 14:41:50 WEST 2026
|
||||
com.example.cuida.app-main-56\:/drawable-v26/ic_launcher_final.xml=/Users/230405/Desktop/papcuida/app/build/intermediates/merged_res/debug/mergeDebugResources/drawable-v26_ic_launcher_final.xml.flat
|
||||
com.example.cuida.app-main-56\:/drawable/bg_gradient_header.xml=/Users/230405/Desktop/papcuida/app/build/intermediates/merged_res/debug/mergeDebugResources/drawable_bg_gradient_header.xml.flat
|
||||
com.example.cuida.app-main-56\:/drawable/bg_search_results.xml=/Users/230405/Desktop/papcuida/app/build/intermediates/merged_res/debug/mergeDebugResources/drawable_bg_search_results.xml.flat
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Agendar Consulta"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<!-- 1. Selecionar Data -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Data"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<DatePicker
|
||||
android:id="@+id/datePicker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:calendarViewShown="false"
|
||||
android:datePickerMode="spinner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<!-- 2. Selecionar Médico/Especialidade -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Médico/Especialidade"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:hint="Escolha o médico">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/spinner_doctor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_doctor_schedule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Horário: --"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:textStyle="italic"/>
|
||||
|
||||
<!-- 3. Selecionar Horário -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Horário"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_time_slots"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<!-- 4. Motivo -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edit_reason"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Motivo da Consulta"
|
||||
android:inputType="text"
|
||||
android:imeOptions="actionDone"
|
||||
android:minLines="2"
|
||||
android:maxLines="4"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm_appointment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Confirmar Agendamento"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,4 +1,4 @@
|
||||
#Thu Apr 23 16:05:04 WEST 2026
|
||||
#Mon Apr 27 14:41:50 WEST 2026
|
||||
com.example.cuida.app-main-6\:/drawable-v26/ic_launcher_final.xml=/Users/230405/Desktop/papcuida/app/build/intermediates/packaged_res/debug/packageDebugResources/drawable-v26/ic_launcher_final.xml
|
||||
com.example.cuida.app-main-6\:/drawable/bg_gradient_header.xml=/Users/230405/Desktop/papcuida/app/build/intermediates/packaged_res/debug/packageDebugResources/drawable/bg_gradient_header.xml
|
||||
com.example.cuida.app-main-6\:/drawable/bg_search_results.xml=/Users/230405/Desktop/papcuida/app/build/intermediates/packaged_res/debug/packageDebugResources/drawable/bg_search_results.xml
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Agendar Consulta"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<!-- 1. Selecionar Data -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Data"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<DatePicker
|
||||
android:id="@+id/datePicker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:calendarViewShown="false"
|
||||
android:datePickerMode="spinner"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<!-- 2. Selecionar Médico/Especialidade -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Médico/Especialidade"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:hint="Escolha o médico">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/spinner_doctor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_doctor_schedule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Horário: --"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:textStyle="italic"/>
|
||||
|
||||
<!-- 3. Selecionar Horário -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Horário"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_time_slots"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<!-- 4. Motivo -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edit_reason"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Motivo da Consulta"
|
||||
android:inputType="text"
|
||||
android:imeOptions="actionDone"
|
||||
android:minLines="2"
|
||||
android:maxLines="4"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_confirm_appointment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Confirmar Agendamento"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,4 +1,4 @@
|
||||
#Thu Apr 23 16:05:05 WEST 2026
|
||||
#Mon Apr 27 14:46:42 WEST 2026
|
||||
base.0=/Users/230405/Desktop/papcuida/app/build/intermediates/dex/debug/mergeExtDexDebug/classes.dex
|
||||
base.1=/Users/230405/Desktop/papcuida/app/build/intermediates/dex/debug/mergeProjectDexDebug/0/classes.dex
|
||||
base.10=/Users/230405/Desktop/papcuida/app/build/intermediates/global_synthetics_dex/debug/generateDebugGlobalSynthetics/classes.dex
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -106,6 +106,7 @@ id save_new_password_button
|
||||
id spinner_doctor
|
||||
id text_ai_result
|
||||
id text_date
|
||||
id text_doctor_schedule
|
||||
id text_empty_medications
|
||||
id text_greeting
|
||||
id text_med_dosage
|
||||
|
||||
Binary file not shown.
@@ -15,10 +15,6 @@
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/activity_main.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/activity_main.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-mergeDebugResources-53:/layout/activity_login.xml",
|
||||
"source": "com.example.cuida.app-main-56:/layout/activity_login.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/fragment_schedule_appointment.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_schedule_appointment.xml"
|
||||
@@ -55,34 +51,22 @@
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/fragment_profile.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_profile.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-mergeDebugResources-53:/layout/activity_forgot_password.xml",
|
||||
"source": "com.example.cuida.app-main-56:/layout/activity_forgot_password.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-mergeDebugResources-53:/layout/fragment_schedule_appointment.xml",
|
||||
"source": "com.example.cuida.app-main-56:/layout/fragment_schedule_appointment.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-mergeDebugResources-53:/layout/fragment_sns24.xml",
|
||||
"source": "com.example.cuida.app-main-56:/layout/fragment_sns24.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/item_appointment.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/item_appointment.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-mergeDebugResources-53:/layout/dialog_add_medication.xml",
|
||||
"source": "com.example.cuida.app-main-56:/layout/dialog_add_medication.xml"
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/fragment_sns24.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_sns24.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/item_medication.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/item_medication.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/fragment_sns24.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_sns24.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-mergeDebugResources-53:/layout/fragment_medication.xml",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_medication.xml"
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/layout_item_medication.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/item_medication.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-debug-54:/layout_activity_login.xml.flat",
|
||||
"source": "com.example.cuida.app-main-56:/layout/activity_login.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/menu_bottom_nav_menu.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/menu/bottom_nav_menu.xml"
|
||||
@@ -35,10 +31,6 @@
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/layout_item_comprimido_search.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/item_comprimido_search.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-debug-54:/layout_dialog_add_medication.xml.flat",
|
||||
"source": "com.example.cuida.app-main-56:/layout/dialog_add_medication.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/layout_fragment_home.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_home.xml"
|
||||
@@ -59,10 +51,6 @@
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/layout_fragment_schedule_appointment.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_schedule_appointment.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-debug-54:/layout_fragment_sns24.xml.flat",
|
||||
"source": "com.example.cuida.app-main-56:/layout/fragment_sns24.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/drawable_ic_logo_scaled.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/drawable/ic_logo_scaled.xml"
|
||||
@@ -87,10 +75,6 @@
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/layout_activity_reset_password.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/activity_reset_password.xml"
|
||||
},
|
||||
{
|
||||
"merged": "com.example.cuida.app-debug-54:/layout_activity_forgot_password.xml.flat",
|
||||
"source": "com.example.cuida.app-main-56:/layout/activity_forgot_password.xml"
|
||||
},
|
||||
{
|
||||
"merged": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-debug-54:/layout_fragment_sns24.xml.flat",
|
||||
"source": "/Users/230405/.gradle/daemon/9.4.1/com.example.cuida.app-main-56:/layout/fragment_sns24.xml"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<!-- 1. Selecionar Data -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -31,6 +32,40 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<!-- 2. Selecionar Médico/Especialidade -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Médico/Especialidade"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:hint="Escolha o médico">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/spinner_doctor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_doctor_schedule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Horário: --"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:textStyle="italic"/>
|
||||
|
||||
<!-- 3. Selecionar Horário -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -46,28 +81,7 @@
|
||||
android:layout_weight="1"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Médico/Especialidade"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="Escolha o médico">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/spinner_doctor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 4. Motivo -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3753,6 +3753,7 @@ int id textStart 0x7f090222
|
||||
int id textTop 0x7f090223
|
||||
int id text_ai_result 0x7f090224
|
||||
int id text_date 0x7f090225
|
||||
int id text_doctor_schedule 0x7f090264
|
||||
int id text_empty_medications 0x7f090226
|
||||
int id text_greeting 0x7f090227
|
||||
int id text_input_end_icon 0x7f090228
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3754,6 +3754,7 @@ id textStart
|
||||
id textTop
|
||||
id text_ai_result
|
||||
id text_date
|
||||
id text_doctor_schedule
|
||||
id text_empty_medications
|
||||
id text_greeting
|
||||
id text_input_end_icon
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,8 +17,8 @@ import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class Gemini {
|
||||
private static final String API_KEY = "AIzaSyBmLgn-SHaTDvAeDWsw2iTZRR9gahhOu7k";
|
||||
private static final String MODEL_NAME = "gemini-1.5-flash";
|
||||
private static final String API_KEY = "AIzaSyBYar6Yv0rhrZX8cIQQxd77TLERHRsjAtY";
|
||||
private static final String MODEL_NAME = "gemini-2.0-flash";
|
||||
private static final String API_URL = "https://generativelanguage.googleapis.com/v1beta/models/" + MODEL_NAME + ":generateContent?key=" + API_KEY;
|
||||
private final OkHttpClient client;
|
||||
private final Handler mainHandler;
|
||||
|
||||
@@ -196,5 +196,12 @@ public class ScheduleAppointmentFragment extends Fragment {
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
||||
scheduleViewModel.getSelectedDoctorSchedule().observe(getViewLifecycleOwner(), schedule -> {
|
||||
android.widget.TextView textSchedule = getView().findViewById(R.id.text_doctor_schedule);
|
||||
if (textSchedule != null) {
|
||||
textSchedule.setText(schedule);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,11 @@ public class ScheduleViewModel extends AndroidViewModel {
|
||||
private final MutableLiveData<String> selectedTime = new MutableLiveData<>();
|
||||
private final MutableLiveData<String> selectedDoctor = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<TimeSlot>> timeSlots = new MutableLiveData<>();
|
||||
private final MutableLiveData<String> selectedDoctorSchedule = new MutableLiveData<>();
|
||||
private final MutableLiveData<Boolean> saveSuccess = new MutableLiveData<>();
|
||||
private final MutableLiveData<String> saveError = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<String>> doctorsList = new MutableLiveData<>(new ArrayList<>());
|
||||
private final java.util.Map<String, String> doctorSchedules = new java.util.HashMap<>();
|
||||
|
||||
private ListenerRegistration snapshotListener;
|
||||
|
||||
@@ -46,6 +48,7 @@ public class ScheduleViewModel extends AndroidViewModel {
|
||||
.addOnCompleteListener(task -> {
|
||||
if (task.isSuccessful() && task.getResult() != null) {
|
||||
List<String> docs = new ArrayList<>();
|
||||
doctorSchedules.clear();
|
||||
for (QueryDocumentSnapshot document : task.getResult()) {
|
||||
String name = document.getString("nome");
|
||||
if (name == null) name = document.getString("nome_completo");
|
||||
@@ -53,6 +56,7 @@ public class ScheduleViewModel extends AndroidViewModel {
|
||||
|
||||
String specialty = document.getString("especialidade");
|
||||
String gender = document.getString("genero");
|
||||
String horario = document.getString("horario");
|
||||
|
||||
if (name != null && !name.trim().isEmpty()) {
|
||||
String displayName = name;
|
||||
@@ -67,6 +71,9 @@ public class ScheduleViewModel extends AndroidViewModel {
|
||||
}
|
||||
}
|
||||
docs.add(displayName);
|
||||
if (horario != null) {
|
||||
doctorSchedules.put(displayName, horario);
|
||||
}
|
||||
}
|
||||
}
|
||||
doctorsList.postValue(docs);
|
||||
@@ -84,12 +91,18 @@ public class ScheduleViewModel extends AndroidViewModel {
|
||||
|
||||
public void setSelectedDoctor(String doctor) {
|
||||
selectedDoctor.setValue(doctor);
|
||||
String schedule = doctorSchedules.get(doctor);
|
||||
selectedDoctorSchedule.setValue(schedule != null ? "Horário: " + schedule : "Horário: 08:00 - 19:00");
|
||||
String date = selectedDate.getValue();
|
||||
if (date != null) {
|
||||
loadTimeSlots(date);
|
||||
}
|
||||
}
|
||||
|
||||
public LiveData<String> getSelectedDoctorSchedule() {
|
||||
return selectedDoctorSchedule;
|
||||
}
|
||||
|
||||
public LiveData<String> getSelectedDate() {
|
||||
return selectedDate;
|
||||
}
|
||||
@@ -179,6 +192,25 @@ public class ScheduleViewModel extends AndroidViewModel {
|
||||
List<TimeSlot> slots = new ArrayList<>();
|
||||
int startHour = 8;
|
||||
int endHour = 19;
|
||||
int startMinute = 0;
|
||||
int endMinute = 0;
|
||||
|
||||
String doctor = selectedDoctor.getValue();
|
||||
String schedule = doctorSchedules.get(doctor);
|
||||
|
||||
if (schedule != null && schedule.contains(" - ")) {
|
||||
try {
|
||||
String[] parts = schedule.split(" - ");
|
||||
String[] startParts = parts[0].split(":");
|
||||
String[] endParts = parts[1].split(":");
|
||||
startHour = Integer.parseInt(startParts[0]);
|
||||
startMinute = Integer.parseInt(startParts[1]);
|
||||
endHour = Integer.parseInt(endParts[0]);
|
||||
endMinute = Integer.parseInt(endParts[1]);
|
||||
} catch (Exception e) {
|
||||
Log.e("ScheduleViewModel", "Error parsing schedule: " + schedule);
|
||||
}
|
||||
}
|
||||
|
||||
Calendar now = Calendar.getInstance();
|
||||
boolean isToday = false;
|
||||
@@ -196,16 +228,30 @@ public class ScheduleViewModel extends AndroidViewModel {
|
||||
int currentHour = now.get(Calendar.HOUR_OF_DAY);
|
||||
int currentMinute = now.get(Calendar.MINUTE);
|
||||
|
||||
for (int hour = startHour; hour <= endHour; hour++) {
|
||||
if (!isToday || hour > currentHour || (hour == currentHour && 0 > currentMinute)) {
|
||||
addSlot(slots, String.format("%02d:00", hour), bookedTimes);
|
||||
}
|
||||
if (hour != endHour) {
|
||||
if (!isToday || hour > currentHour || (hour == currentHour && 30 > currentMinute)) {
|
||||
addSlot(slots, String.format("%02d:30", hour), bookedTimes);
|
||||
}
|
||||
Calendar cursor = Calendar.getInstance();
|
||||
cursor.set(Calendar.HOUR_OF_DAY, startHour);
|
||||
cursor.set(Calendar.MINUTE, startMinute);
|
||||
cursor.set(Calendar.SECOND, 0);
|
||||
cursor.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
Calendar endLimit = Calendar.getInstance();
|
||||
endLimit.set(Calendar.HOUR_OF_DAY, endHour);
|
||||
endLimit.set(Calendar.MINUTE, endMinute);
|
||||
endLimit.set(Calendar.SECOND, 0);
|
||||
endLimit.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
while (cursor.before(endLimit)) {
|
||||
int h = cursor.get(Calendar.HOUR_OF_DAY);
|
||||
int m = cursor.get(Calendar.MINUTE);
|
||||
String timeStr = String.format("%02d:%02d", h, m);
|
||||
|
||||
if (!isToday || h > currentHour || (h == currentHour && m > currentMinute)) {
|
||||
addSlot(slots, timeStr, bookedTimes);
|
||||
}
|
||||
|
||||
cursor.add(Calendar.MINUTE, 20);
|
||||
}
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
<!-- 1. Selecionar Data -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -31,6 +32,40 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<!-- 2. Selecionar Médico/Especialidade -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Médico/Especialidade"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:hint="Escolha o médico">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/spinner_doctor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_doctor_schedule"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Horário: --"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:textStyle="italic"/>
|
||||
|
||||
<!-- 3. Selecionar Horário -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -46,28 +81,7 @@
|
||||
android:layout_weight="1"
|
||||
android:layout_marginBottom="16dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Selecionar Médico/Especialidade"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="Escolha o médico">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/spinner_doctor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- 4. Motivo -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user