From 5d34a64be00814b672e08d4bf8e0c0de78a13848 Mon Sep 17 00:00:00 2001 From: peterluo3131 Date: Tue, 13 Jun 2023 08:19:41 -0400 Subject: [PATCH] feature(#28): Update parsing module of Api Response --- app/build.gradle | 4 +- app/src/main/AndroidManifest.xml | 2 +- .../{database => data/local}/MyDatabase.kt | 10 ++-- .../local}/dao/ContactDao.kt | 5 +- .../{database => data/local}/dao/ImageDao.kt | 5 +- .../local}/entity/ContactEntity.kt | 2 +- .../local}/entity/ImageEntity.kt | 2 +- .../models/common}/ChatMessageModel.kt | 4 +- .../{ => data}/models/common/ContactModel.kt | 2 +- .../models/common/HelpCommandModel.kt | 2 +- .../models/common/HelpPromptModel.kt | 2 +- .../models/common/ImagePromptModel.kt | 2 +- .../models/requestmodels/RequestBodyModel.kt | 2 +- .../requestmodels/RequestTrainContactModel.kt | 4 +- .../remote/ApiClient.kt} | 14 +++--- .../chatgptwrapper/data/remote/ApiResponse.kt | 7 +++ .../services/api/HttpRisingInterface.kt | 7 --- .../{ => ui}/activites/HomeActivity.kt | 6 +-- .../{ => ui}/adapters/ChatAdapter.kt | 17 +++---- .../{ => ui}/dialogs/CommonConfirmDialog.kt | 2 +- .../{ => ui}/fragments/ChatFragment.kt | 46 +++++++++---------- .../{ => ui}/widgets/ChatToolItem.kt | 2 +- .../{ => ui}/widgets/ChatToolsWidget.kt | 2 +- .../{ => ui}/widgets/ContactDetailItem.kt | 4 +- .../{ => ui}/widgets/ContactDetailWidget.kt | 4 +- .../{ => ui}/widgets/HelpCommandEditText.kt | 8 ++-- .../{ => ui}/widgets/HelpPromptWidget.kt | 4 +- .../{ => ui}/widgets/SearchContactWidget.kt | 6 +-- .../{ => ui}/widgets/SmsEditorWidget.kt | 2 +- .../matthaigh27/chatgptwrapper/utils/Utils.kt | 13 ++---- .../viewmodels/ChatViewModel.kt | 6 +++ .../background_chat_widget_button.xml | 2 +- .../background_chat_widget_edittext.xml | 8 ++-- .../background_view_help_prompt_edittext.xml | 9 ---- app/src/main/res/layout/activity_home.xml | 2 +- app/src/main/res/layout/fragment_chat.xml | 2 +- .../layout/item_container_sent_message.xml | 1 + .../layout/item_help_prompt_dropdown_list.xml | 13 ------ app/src/main/res/values/colors.xml | 10 ++-- app/src/main/res/values/dimen.xml | 6 ++- .../chatgptwrapper/ModelUnitTest.kt | 4 +- 41 files changed, 117 insertions(+), 138 deletions(-) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{database => data/local}/MyDatabase.kt (75%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{database => data/local}/dao/ContactDao.kt (68%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{database => data/local}/dao/ImageDao.kt (67%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{database => data/local}/entity/ContactEntity.kt (79%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{database => data/local}/entity/ImageEntity.kt (78%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{models/viewmodels => data/models/common}/ChatMessageModel.kt (78%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => data}/models/common/ContactModel.kt (87%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => data}/models/common/HelpCommandModel.kt (76%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => data}/models/common/HelpPromptModel.kt (91%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => data}/models/common/ImagePromptModel.kt (75%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => data}/models/requestmodels/RequestBodyModel.kt (97%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => data}/models/requestmodels/RequestTrainContactModel.kt (93%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{services/api/HttpClient.kt => data/remote/ApiClient.kt} (90%) create mode 100644 app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiResponse.kt delete mode 100644 app/src/main/java/com/matthaigh27/chatgptwrapper/services/api/HttpRisingInterface.kt rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/activites/HomeActivity.kt (94%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/adapters/ChatAdapter.kt (95%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/dialogs/CommonConfirmDialog.kt (97%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/fragments/ChatFragment.kt (95%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/ChatToolItem.kt (97%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/ChatToolsWidget.kt (97%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/ContactDetailItem.kt (96%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/ContactDetailWidget.kt (95%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/HelpCommandEditText.kt (81%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/HelpPromptWidget.kt (95%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/SearchContactWidget.kt (91%) rename app/src/main/java/com/matthaigh27/chatgptwrapper/{ => ui}/widgets/SmsEditorWidget.kt (97%) create mode 100644 app/src/main/java/com/matthaigh27/chatgptwrapper/viewmodels/ChatViewModel.kt delete mode 100644 app/src/main/res/drawable/background_view_help_prompt_edittext.xml delete mode 100644 app/src/main/res/layout/item_help_prompt_dropdown_list.xml diff --git a/app/build.gradle b/app/build.gradle index 50089d9..40f484a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { applicationId "com.matthaigh27.chatgptwrapper" minSdk 28 targetSdk 33 - versionCode 7 - versionName "1.5" + versionCode 1 + versionName "1.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1084fe2..f19c4b4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,7 +29,7 @@ android:supportsRtl="true" android:theme="@style/Theme.Design.NoActionBar"> diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/MyDatabase.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/MyDatabase.kt similarity index 75% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/database/MyDatabase.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/MyDatabase.kt index 2476738..a5619ca 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/MyDatabase.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/MyDatabase.kt @@ -1,13 +1,13 @@ -package com.matthaigh27.chatgptwrapper.database +package com.matthaigh27.chatgptwrapper.data.local import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase -import com.matthaigh27.chatgptwrapper.database.dao.ContactDao -import com.matthaigh27.chatgptwrapper.database.dao.ImageDao -import com.matthaigh27.chatgptwrapper.database.entity.ContactEntity -import com.matthaigh27.chatgptwrapper.database.entity.ImageEntity +import com.matthaigh27.chatgptwrapper.data.local.dao.ContactDao +import com.matthaigh27.chatgptwrapper.data.local.dao.ImageDao +import com.matthaigh27.chatgptwrapper.data.local.entity.ContactEntity +import com.matthaigh27.chatgptwrapper.data.local.entity.ImageEntity @Database(entities = [ImageEntity::class, ContactEntity::class], version = 1, exportSchema = false) abstract class MyDatabase : RoomDatabase() { diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/dao/ContactDao.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ContactDao.kt similarity index 68% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/database/dao/ContactDao.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ContactDao.kt index 53d3f5a..164eacb 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/dao/ContactDao.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ContactDao.kt @@ -1,8 +1,7 @@ -package com.matthaigh27.chatgptwrapper.database.dao +package com.matthaigh27.chatgptwrapper.data.local.dao -import androidx.lifecycle.LiveData import androidx.room.* -import com.matthaigh27.chatgptwrapper.database.entity.ContactEntity +import com.matthaigh27.chatgptwrapper.data.local.entity.ContactEntity @Dao interface ContactDao { diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/dao/ImageDao.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ImageDao.kt similarity index 67% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/database/dao/ImageDao.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ImageDao.kt index eb20e16..be335d6 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/dao/ImageDao.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/dao/ImageDao.kt @@ -1,8 +1,7 @@ -package com.matthaigh27.chatgptwrapper.database.dao +package com.matthaigh27.chatgptwrapper.data.local.dao -import androidx.lifecycle.LiveData import androidx.room.* -import com.matthaigh27.chatgptwrapper.database.entity.ImageEntity +import com.matthaigh27.chatgptwrapper.data.local.entity.ImageEntity @Dao interface ImageDao { diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/entity/ContactEntity.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ContactEntity.kt similarity index 79% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/database/entity/ContactEntity.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ContactEntity.kt index be60097..4816598 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/entity/ContactEntity.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ContactEntity.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.database.entity +package com.matthaigh27.chatgptwrapper.data.local.entity import androidx.room.Entity import androidx.room.PrimaryKey diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/entity/ImageEntity.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ImageEntity.kt similarity index 78% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/database/entity/ImageEntity.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ImageEntity.kt index 8734569..323a2bd 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/database/entity/ImageEntity.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/local/entity/ImageEntity.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.database.entity +package com.matthaigh27.chatgptwrapper.data.local.entity import androidx.room.Entity import androidx.room.PrimaryKey diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/viewmodels/ChatMessageModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ChatMessageModel.kt similarity index 78% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/models/viewmodels/ChatMessageModel.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ChatMessageModel.kt index c6dd465..212c5c9 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/viewmodels/ChatMessageModel.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ChatMessageModel.kt @@ -1,11 +1,11 @@ -package com.matthaigh27.chatgptwrapper.models.viewmodels +package com.matthaigh27.chatgptwrapper.data.models.common import androidx.lifecycle.ViewModel /** * ChatModel for Chat RecyclerView */ -class ChatMessageModel: ViewModel() { +class ChatMessageModel { var message: String = "" var isMe: Boolean = true var image: ByteArray? = null diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/ContactModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ContactModel.kt similarity index 87% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/ContactModel.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ContactModel.kt index 25153bd..38cccb5 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/ContactModel.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ContactModel.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.models.common +package com.matthaigh27.chatgptwrapper.data.models.common class ContactModel { var id: String = "" diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/HelpCommandModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/HelpCommandModel.kt similarity index 76% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/HelpCommandModel.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/HelpCommandModel.kt index 3f1871a..92b07ca 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/HelpCommandModel.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/HelpCommandModel.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.models.common +package com.matthaigh27.chatgptwrapper.data.models.common class HelpCommandModel { var mainCommandName: String = "" diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/HelpPromptModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/HelpPromptModel.kt similarity index 91% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/HelpPromptModel.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/HelpPromptModel.kt index 891cce0..dd765dd 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/HelpPromptModel.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/HelpPromptModel.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.models.common +package com.matthaigh27.chatgptwrapper.data.models.common import com.google.gson.Gson import com.google.gson.GsonBuilder diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/ImagePromptModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ImagePromptModel.kt similarity index 75% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/ImagePromptModel.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ImagePromptModel.kt index 53c9e93..7b1e9bd 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/common/ImagePromptModel.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/common/ImagePromptModel.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.models.common +package com.matthaigh27.chatgptwrapper.data.models.common class ImagePromptModel { var id: String = "" diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/requestmodels/RequestBodyModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/requestmodels/RequestBodyModel.kt similarity index 97% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/models/requestmodels/RequestBodyModel.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/requestmodels/RequestBodyModel.kt index 7c5451d..d9d5625 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/requestmodels/RequestBodyModel.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/requestmodels/RequestBodyModel.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.models.requestmodels +package com.matthaigh27.chatgptwrapper.data.models.requestmodels import com.matthaigh27.chatgptwrapper.MyApplication import org.json.JSONException diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/requestmodels/RequestTrainContactModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/requestmodels/RequestTrainContactModel.kt similarity index 93% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/models/requestmodels/RequestTrainContactModel.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/requestmodels/RequestTrainContactModel.kt index 9056f6b..4fd2fba 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/models/requestmodels/RequestTrainContactModel.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/models/requestmodels/RequestTrainContactModel.kt @@ -1,7 +1,7 @@ -package com.matthaigh27.chatgptwrapper.models.requestmodels +package com.matthaigh27.chatgptwrapper.data.models.requestmodels import com.matthaigh27.chatgptwrapper.MyApplication -import com.matthaigh27.chatgptwrapper.models.common.ContactModel +import com.matthaigh27.chatgptwrapper.data.models.common.ContactModel import com.matthaigh27.chatgptwrapper.utils.Utils import org.json.JSONArray import org.json.JSONException diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/services/api/HttpClient.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiClient.kt similarity index 90% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/services/api/HttpClient.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiClient.kt index 35583f7..19cbe9d 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/services/api/HttpClient.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiClient.kt @@ -1,10 +1,10 @@ -package com.matthaigh27.chatgptwrapper.services.api +package com.matthaigh27.chatgptwrapper.data.remote import android.util.Log import com.matthaigh27.chatgptwrapper.BuildConfig -import com.matthaigh27.chatgptwrapper.models.common.ContactModel -import com.matthaigh27.chatgptwrapper.models.requestmodels.RequestBodyModel -import com.matthaigh27.chatgptwrapper.models.requestmodels.RequestTrainContactModel +import com.matthaigh27.chatgptwrapper.data.models.common.ContactModel +import com.matthaigh27.chatgptwrapper.data.models.requestmodels.RequestBodyModel +import com.matthaigh27.chatgptwrapper.data.models.requestmodels.RequestTrainContactModel import com.matthaigh27.chatgptwrapper.utils.Constants import com.matthaigh27.chatgptwrapper.utils.Constants.GET import com.matthaigh27.chatgptwrapper.utils.Constants.POST @@ -20,7 +20,7 @@ import org.json.JSONObject import java.io.IOException import java.util.concurrent.TimeUnit -class HttpClient { +class ApiClient { /* Server URL and Api Endpoints */ val SERVER_URL = BuildConfig.BASE_URL val SEND_NOTIFICATION_URL = SERVER_URL + "sendNotification" @@ -29,9 +29,9 @@ class HttpClient { val GET_ALL_HELP_COMMANDS = SERVER_URL + "commands" val TRAIN_CONTACTS = SERVER_URL + "train/contacts" - var mCallback: HttpRisingInterface + var mCallback: ApiResponse - constructor(callback: HttpRisingInterface) { + constructor(callback: ApiResponse) { mCallback = callback } diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiResponse.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiResponse.kt new file mode 100644 index 0000000..b88832e --- /dev/null +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/data/remote/ApiResponse.kt @@ -0,0 +1,7 @@ +package com.matthaigh27.chatgptwrapper.data.remote; + +interface ApiResponse { + fun onSuccessResult(msg: String) + + fun onFailureResult(msg: String) +} diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/services/api/HttpRisingInterface.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/services/api/HttpRisingInterface.kt deleted file mode 100644 index d01c29c..0000000 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/services/api/HttpRisingInterface.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.matthaigh27.chatgptwrapper.services.api; - -interface HttpRisingInterface { - fun onSuccessResult(msg: String) - - fun onFailureResult(msg: String) -} diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/activites/HomeActivity.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/activites/HomeActivity.kt similarity index 94% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/activites/HomeActivity.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/activites/HomeActivity.kt index 0a11074..20c5b8d 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/activites/HomeActivity.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/activites/HomeActivity.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.activites +package com.matthaigh27.chatgptwrapper.ui.activites import android.Manifest import android.annotation.SuppressLint @@ -10,8 +10,8 @@ import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity import com.google.android.material.tabs.TabLayout.TabGravity import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.dialogs.CommonConfirmDialog -import com.matthaigh27.chatgptwrapper.fragments.ChatFragment +import com.matthaigh27.chatgptwrapper.ui.dialogs.CommonConfirmDialog +import com.matthaigh27.chatgptwrapper.ui.fragments.ChatFragment import java.io.File diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/adapters/ChatAdapter.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/adapters/ChatAdapter.kt similarity index 95% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/adapters/ChatAdapter.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/adapters/ChatAdapter.kt index ee08db3..27c8fa0 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/adapters/ChatAdapter.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/adapters/ChatAdapter.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.adapters +package com.matthaigh27.chatgptwrapper.ui.adapters import android.annotation.SuppressLint import android.app.Dialog @@ -8,26 +8,23 @@ import android.graphics.BitmapFactory import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.FrameLayout import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import androidx.recyclerview.widget.RecyclerView import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.models.common.ContactModel -import com.matthaigh27.chatgptwrapper.models.common.HelpPromptModel -import com.matthaigh27.chatgptwrapper.models.viewmodels.ChatMessageModel +import com.matthaigh27.chatgptwrapper.data.models.common.HelpPromptModel +import com.matthaigh27.chatgptwrapper.data.models.common.ChatMessageModel import com.matthaigh27.chatgptwrapper.utils.Constants.MSG_WIDGET_TYPE_HELP_PRMOPT import com.matthaigh27.chatgptwrapper.utils.Constants.MSG_WIDGET_TYPE_SEARCH_CONTACT import com.matthaigh27.chatgptwrapper.utils.Constants.MSG_WIDGET_TYPE_SMS import com.matthaigh27.chatgptwrapper.utils.ImageHelper import com.matthaigh27.chatgptwrapper.utils.Utils -import com.matthaigh27.chatgptwrapper.widgets.ContactDetailItem -import com.matthaigh27.chatgptwrapper.widgets.ContactDetailWidget -import com.matthaigh27.chatgptwrapper.widgets.HelpPromptWidget -import com.matthaigh27.chatgptwrapper.widgets.SearchContactWidget -import com.matthaigh27.chatgptwrapper.widgets.SmsEditorWidget +import com.matthaigh27.chatgptwrapper.ui.widgets.ContactDetailItem +import com.matthaigh27.chatgptwrapper.ui.widgets.HelpPromptWidget +import com.matthaigh27.chatgptwrapper.ui.widgets.SearchContactWidget +import com.matthaigh27.chatgptwrapper.ui.widgets.SmsEditorWidget import org.json.JSONArray class ChatAdapter(list: ArrayList, context: Context) : diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/dialogs/CommonConfirmDialog.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/dialogs/CommonConfirmDialog.kt similarity index 97% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/dialogs/CommonConfirmDialog.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/dialogs/CommonConfirmDialog.kt index 5cea790..b85622f 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/dialogs/CommonConfirmDialog.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/dialogs/CommonConfirmDialog.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.dialogs +package com.matthaigh27.chatgptwrapper.ui.dialogs import android.app.Dialog import android.content.Context diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/fragments/ChatFragment.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/fragments/ChatFragment.kt similarity index 95% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/fragments/ChatFragment.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/fragments/ChatFragment.kt index 3d77a0b..0374277 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/fragments/ChatFragment.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/fragments/ChatFragment.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.fragments +package com.matthaigh27.chatgptwrapper.ui.fragments import android.os.Bundle import androidx.fragment.app.Fragment @@ -30,20 +30,20 @@ import androidx.recyclerview.widget.RecyclerView import com.google.firebase.storage.FirebaseStorage import com.matthaigh27.chatgptwrapper.MyApplication import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.adapters.ChatAdapter -import com.matthaigh27.chatgptwrapper.database.MyDatabase -import com.matthaigh27.chatgptwrapper.database.entity.ImageEntity -import com.matthaigh27.chatgptwrapper.widgets.ChatToolsWidget -import com.matthaigh27.chatgptwrapper.widgets.ChatToolsWidget.OnPositiveButtonClickListener -import com.matthaigh27.chatgptwrapper.models.* -import com.matthaigh27.chatgptwrapper.models.common.HelpCommandModel -import com.matthaigh27.chatgptwrapper.models.common.HelpPromptModel -import com.matthaigh27.chatgptwrapper.models.viewmodels.ChatMessageModel -import com.matthaigh27.chatgptwrapper.services.api.HttpClient -import com.matthaigh27.chatgptwrapper.services.api.HttpRisingInterface +import com.matthaigh27.chatgptwrapper.ui.adapters.ChatAdapter +import com.matthaigh27.chatgptwrapper.data.local.MyDatabase +import com.matthaigh27.chatgptwrapper.data.local.entity.ImageEntity +import com.matthaigh27.chatgptwrapper.ui.widgets.ChatToolsWidget +import com.matthaigh27.chatgptwrapper.ui.widgets.ChatToolsWidget.OnPositiveButtonClickListener +import com.matthaigh27.chatgptwrapper.data.models.* +import com.matthaigh27.chatgptwrapper.data.models.common.HelpCommandModel +import com.matthaigh27.chatgptwrapper.data.models.common.HelpPromptModel +import com.matthaigh27.chatgptwrapper.data.models.common.ChatMessageModel +import com.matthaigh27.chatgptwrapper.data.remote.ApiClient +import com.matthaigh27.chatgptwrapper.data.remote.ApiResponse import com.matthaigh27.chatgptwrapper.utils.Constants.* import com.matthaigh27.chatgptwrapper.utils.Utils -import com.matthaigh27.chatgptwrapper.widgets.ContactDetailItem +import com.matthaigh27.chatgptwrapper.ui.widgets.ContactDetailItem import com.qw.photo.CoCo import com.qw.photo.callback.CoCoAdapter import com.qw.photo.callback.CoCoCallBack @@ -60,7 +60,7 @@ import java.io.* import java.util.* import kotlin.collections.ArrayList -class ChatFragment : Fragment(), OnClickListener, HttpRisingInterface { +class ChatFragment : Fragment(), OnClickListener, ApiResponse { private lateinit var rootView: View private var mContext: Context? = null @@ -95,8 +95,8 @@ class ChatFragment : Fragment(), OnClickListener, HttpRisingInterface { private lateinit var mChatToolsWidget: ChatToolsWidget private var mImagePickerType: String = "" - /** HttpClient for restful apis */ - private lateinit var httpClient: HttpClient + /** apiClient for restful apis */ + private lateinit var apiClient: ApiClient /** list of help prompt commands */ private var mHelpPromptList: ArrayList? = null @@ -132,14 +132,14 @@ class ChatFragment : Fragment(), OnClickListener, HttpRisingInterface { initView() initDatabase() - trainImages() +// trainImages() getAllPromptCommands() } private fun getAllPromptCommands() { showLoading(true, "Loading Help Prompt Data") - httpClient.getALlHelpPromptCommands() + apiClient.getALlHelpPromptCommands() } @@ -151,7 +151,7 @@ class ChatFragment : Fragment(), OnClickListener, HttpRisingInterface { private fun initValues() { mContext = context - httpClient = HttpClient(this) + apiClient = ApiClient(this) rotate.duration = 3000 rotate.repeatCount = Animation.INFINITE @@ -494,9 +494,9 @@ class ChatFragment : Fragment(), OnClickListener, HttpRisingInterface { showLoading(visible = true, text = LOADING_ASKING_TO_GPT) if (msg.image != null) { - httpClient.callImageRelatedness(msg.imageName) + apiClient.callImageRelatedness(msg.imageName) } else { - httpClient.callSendNotification(message) + apiClient.callSendNotification(message) } } } @@ -652,7 +652,7 @@ class ChatFragment : Fragment(), OnClickListener, HttpRisingInterface { Log.d(TAG, "Success upload to firebase storage") showLoading(false) - httpClient.callImageUpload("$uuid") + apiClient.callImageUpload("$uuid") } } @@ -807,7 +807,7 @@ class ChatFragment : Fragment(), OnClickListener, HttpRisingInterface { val contacts = Utils.instance.getContacts(mContext!!) CoroutineScope(Dispatchers.Main).launch { val changedContacts = Utils.instance.getChangedContacts(contacts, mRoomDataHandler) - httpClient.trainContacts(changedContacts) + apiClient.trainContacts(changedContacts) } } diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ChatToolItem.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ChatToolItem.kt similarity index 97% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ChatToolItem.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ChatToolItem.kt index f01d254..c334bac 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ChatToolItem.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ChatToolItem.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ChatToolsWidget.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ChatToolsWidget.kt similarity index 97% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ChatToolsWidget.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ChatToolsWidget.kt index fc172ae..f068f72 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ChatToolsWidget.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ChatToolsWidget.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.content.Context import android.view.LayoutInflater diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ContactDetailItem.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ContactDetailItem.kt similarity index 96% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ContactDetailItem.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ContactDetailItem.kt index 0281c72..66caff7 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ContactDetailItem.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ContactDetailItem.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.content.ContentUris import android.content.Context @@ -14,7 +14,7 @@ import android.widget.ImageView import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.models.common.ContactModel +import com.matthaigh27.chatgptwrapper.data.models.common.ContactModel class ContactDetailItem( context: Context, attrs: AttributeSet? = null diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ContactDetailWidget.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ContactDetailWidget.kt similarity index 95% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ContactDetailWidget.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ContactDetailWidget.kt index 18e0afb..367f66f 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/ContactDetailWidget.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/ContactDetailWidget.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.content.ContentUris import android.content.Context @@ -14,7 +14,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.forEach import com.google.android.material.bottomsheet.BottomSheetDialog import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.models.common.ContactModel +import com.matthaigh27.chatgptwrapper.data.models.common.ContactModel import com.matthaigh27.chatgptwrapper.utils.Utils class ContactDetailWidget( diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/HelpCommandEditText.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/HelpCommandEditText.kt similarity index 81% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/HelpCommandEditText.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/HelpCommandEditText.kt index 0e97ebf..4d7ef63 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/HelpCommandEditText.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/HelpCommandEditText.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.annotation.SuppressLint import android.content.Context @@ -32,9 +32,9 @@ class HelpCommandEditText(context: Context) : EditText(context) { context.resources.getDimensionPixelSize(R.dimen.view_help_prompt_edittext_fontsize) .toFloat() ) - setTextColor(context.getColor(R.color.view_help_prompt_common_textcolor)) - setHintTextColor(context.getColor(R.color.view_help_prompt_edittext_hint_color)) - background = context.getDrawable(R.drawable.background_view_help_prompt_edittext) + setTextColor(context.getColor(R.color.chat_widget_edittext_text_color)) + setHintTextColor(context.getColor(R.color.chat_widget_edittext_hint_color)) + background = context.getDrawable(R.drawable.background_chat_widget_edittext) } fun initView(keyName: String) { diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/HelpPromptWidget.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/HelpPromptWidget.kt similarity index 95% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/HelpPromptWidget.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/HelpPromptWidget.kt index 7c62e41..39532d0 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/HelpPromptWidget.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/HelpPromptWidget.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.app.Dialog import android.content.Context @@ -16,7 +16,7 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.models.common.HelpPromptModel +import com.matthaigh27.chatgptwrapper.data.models.common.HelpPromptModel class HelpPromptWidget(context: Context, model: HelpPromptModel) : ConstraintLayout(context), View.OnClickListener { diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/SearchContactWidget.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/SearchContactWidget.kt similarity index 91% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/SearchContactWidget.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/SearchContactWidget.kt index 2d5edcc..6eeadcb 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/SearchContactWidget.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/SearchContactWidget.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.content.ContentUris import android.content.Context @@ -14,7 +14,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import com.bumptech.glide.Glide import com.google.android.material.bottomsheet.BottomSheetDialog import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.models.common.ContactModel +import com.matthaigh27.chatgptwrapper.data.models.common.ContactModel import com.matthaigh27.chatgptwrapper.utils.Utils import de.hdodenhof.circleimageview.CircleImageView @@ -28,7 +28,7 @@ class SearchContactWidget( private val civInfoAvatar: CircleImageView private val tvInfoName: TextView - private var mContact:ContactModel = cotactModel + private var mContact: ContactModel = cotactModel var mSMSOnClickListener: ContactDetailItem.OnSMSClickListener? = null init { diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/SmsEditorWidget.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/SmsEditorWidget.kt similarity index 97% rename from app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/SmsEditorWidget.kt rename to app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/SmsEditorWidget.kt index 04d57be..755789b 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/widgets/SmsEditorWidget.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/ui/widgets/SmsEditorWidget.kt @@ -1,4 +1,4 @@ -package com.matthaigh27.chatgptwrapper.widgets +package com.matthaigh27.chatgptwrapper.ui.widgets import android.content.Context import android.util.AttributeSet diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/Utils.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/Utils.kt index daed624..17d417c 100644 --- a/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/Utils.kt +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/utils/Utils.kt @@ -12,21 +12,18 @@ import android.os.Environment import android.provider.ContactsContract import android.provider.MediaStore import android.widget.ImageView -import androidx.room.RoomDatabase import com.bumptech.glide.Glide import com.matthaigh27.chatgptwrapper.MyApplication import com.matthaigh27.chatgptwrapper.R -import com.matthaigh27.chatgptwrapper.database.MyDatabase -import com.matthaigh27.chatgptwrapper.database.entity.ContactEntity -import com.matthaigh27.chatgptwrapper.models.common.ContactModel -import com.matthaigh27.chatgptwrapper.models.common.HelpCommandModel -import com.matthaigh27.chatgptwrapper.models.common.HelpPromptModel -import com.matthaigh27.chatgptwrapper.services.api.HttpClient +import com.matthaigh27.chatgptwrapper.data.local.MyDatabase +import com.matthaigh27.chatgptwrapper.data.local.entity.ContactEntity +import com.matthaigh27.chatgptwrapper.data.models.common.ContactModel +import com.matthaigh27.chatgptwrapper.data.models.common.HelpCommandModel +import com.matthaigh27.chatgptwrapper.data.models.common.HelpPromptModel import com.matthaigh27.chatgptwrapper.utils.Constants.* import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async -import kotlinx.coroutines.launch import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/com/matthaigh27/chatgptwrapper/viewmodels/ChatViewModel.kt b/app/src/main/java/com/matthaigh27/chatgptwrapper/viewmodels/ChatViewModel.kt new file mode 100644 index 0000000..74191aa --- /dev/null +++ b/app/src/main/java/com/matthaigh27/chatgptwrapper/viewmodels/ChatViewModel.kt @@ -0,0 +1,6 @@ +package com.matthaigh27.chatgptwrapper.viewmodels + +import androidx.lifecycle.ViewModel + +class ChatViewModel : ViewModel() { +} \ No newline at end of file diff --git a/app/src/main/res/drawable/background_chat_widget_button.xml b/app/src/main/res/drawable/background_chat_widget_button.xml index df5ae6f..8e0d0ea 100644 --- a/app/src/main/res/drawable/background_chat_widget_button.xml +++ b/app/src/main/res/drawable/background_chat_widget_button.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/background_chat_widget_edittext.xml b/app/src/main/res/drawable/background_chat_widget_edittext.xml index e51b997..36eb276 100644 --- a/app/src/main/res/drawable/background_chat_widget_edittext.xml +++ b/app/src/main/res/drawable/background_chat_widget_edittext.xml @@ -1,9 +1,9 @@ - + - + android:width="@dimen/chat_widget_edittext_stroke_width" + android:color="@color/chat_widget_edittext_stroke_color" /> + diff --git a/app/src/main/res/drawable/background_view_help_prompt_edittext.xml b/app/src/main/res/drawable/background_view_help_prompt_edittext.xml deleted file mode 100644 index bf22c3e..0000000 --- a/app/src/main/res/drawable/background_view_help_prompt_edittext.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index 78a06d2..ee56590 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:animateLayoutChanges="true" - tools:context=".activites.HomeActivity"> + tools:context=".ui.activites.HomeActivity"> + tools:context=".ui.activites.HomeActivity"> diff --git a/app/src/main/res/layout/item_container_sent_message.xml b/app/src/main/res/layout/item_container_sent_message.xml index 63a1117..9b98583 100644 --- a/app/src/main/res/layout/item_container_sent_message.xml +++ b/app/src/main/res/layout/item_container_sent_message.xml @@ -15,6 +15,7 @@ android:background="@drawable/background_sent_message" android:orientation="vertical" android:padding="@dimen/chat_message_item_padding" + android:gravity="right" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintWidth_max="wrap" diff --git a/app/src/main/res/layout/item_help_prompt_dropdown_list.xml b/app/src/main/res/layout/item_help_prompt_dropdown_list.xml deleted file mode 100644 index fef5c3c..0000000 --- a/app/src/main/res/layout/item_help_prompt_dropdown_list.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 1618173..6098b98 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -61,8 +61,6 @@ @color/grey_400 @color/grey_500 - @color/grey_300 - @color/primary @color/grey_500 @color/grey_200 @@ -101,11 +99,13 @@ @color/grey_200 @color/primary_light @color/white - @color/grey_1000 - @color/grey_1000 - @color/grey_900 @color/grey_500 + @color/grey_1000 + @color/grey_1000 + @color/grey_900 + @color/grey_500 + @color/white @color/primary diff --git a/app/src/main/res/values/dimen.xml b/app/src/main/res/values/dimen.xml index 3a16830..20e7506 100644 --- a/app/src/main/res/values/dimen.xml +++ b/app/src/main/res/values/dimen.xml @@ -146,14 +146,16 @@ 12sp 30dp 10dp - @dimen/radius_small - 1dp 10dp @dimen/font_normal 38dp 5dp 5dp + 20dp + @dimen/radius_small + 1dp + 5dp 10dp diff --git a/app/src/test/java/com/matthaigh27/chatgptwrapper/ModelUnitTest.kt b/app/src/test/java/com/matthaigh27/chatgptwrapper/ModelUnitTest.kt index 2ddb08d..ca4ce2c 100644 --- a/app/src/test/java/com/matthaigh27/chatgptwrapper/ModelUnitTest.kt +++ b/app/src/test/java/com/matthaigh27/chatgptwrapper/ModelUnitTest.kt @@ -1,7 +1,7 @@ package com.matthaigh27.chatgptwrapper -import com.matthaigh27.chatgptwrapper.models.viewmodels.ChatMessageModel -import com.matthaigh27.chatgptwrapper.models.common.ImagePromptModel +import com.matthaigh27.chatgptwrapper.data.models.common.ChatMessageModel +import com.matthaigh27.chatgptwrapper.data.models.common.ImagePromptModel import org.junit.Test import org.junit.Assert.*