From 208e14d76d871f018d2117aa516ea31a004e0573 Mon Sep 17 00:00:00 2001 From: AndraxDev Date: Fri, 5 Jan 2024 20:34:23 +0100 Subject: [PATCH] 2.36 2.37 2.38 --- app/build.gradle | 12 +- .../assistant/ui/activities/AboutActivity.kt | 30 +++ .../assistant/ui/activities/ChatActivity.kt | 8 +- .../ui/activities/SettingsActivity.kt | 4 +- .../assistant/ui/adapters/VoiceListAdapter.kt | 2 +- .../dialogs/AdvancedSettingsDialogFragment.kt | 170 +++++++------ .../dialogs/LanguageSelectorDialogFragment.kt | 2 +- .../ui/fragments/tabs/PromptsFragment.kt | 136 ++++++++-- app/src/main/res/drawable/btn_accent_24.xml | 10 + app/src/main/res/drawable/btn_accent_50p.xml | 10 + .../main/res/drawable/btn_accent_tonal_v5.xml | 10 + app/src/main/res/drawable/btn_tip2.xml | 2 +- app/src/main/res/drawable/cat_all_active.xml | 11 + app/src/main/res/drawable/cat_art.xml | 2 +- app/src/main/res/drawable/cat_art_active.xml | 11 + app/src/main/res/drawable/cat_business.xml | 2 +- .../main/res/drawable/cat_business_active.xml | 11 + app/src/main/res/drawable/cat_culture.xml | 2 +- .../main/res/drawable/cat_culture_active.xml | 11 + app/src/main/res/drawable/cat_development.xml | 2 +- .../res/drawable/cat_development_active.xml | 11 + app/src/main/res/drawable/cat_education.xml | 2 +- .../res/drawable/cat_education_active.xml | 11 + .../main/res/drawable/cat_entertainment.xml | 2 +- .../res/drawable/cat_entertainment_active.xml | 11 + app/src/main/res/drawable/cat_food.xml | 2 +- app/src/main/res/drawable/cat_food_active.xml | 11 + app/src/main/res/drawable/cat_gaming.xml | 2 +- .../main/res/drawable/cat_gaming_active.xml | 11 + app/src/main/res/drawable/cat_health.xml | 2 +- .../main/res/drawable/cat_health_active.xml | 11 + app/src/main/res/drawable/cat_history.xml | 2 +- .../main/res/drawable/cat_history_active.xml | 11 + app/src/main/res/drawable/cat_music.xml | 2 +- .../main/res/drawable/cat_music_active.xml | 11 + .../main/res/drawable/cat_productivity.xml | 2 +- .../res/drawable/cat_productivity_active.xml | 11 + app/src/main/res/drawable/cat_sport.xml | 2 +- .../main/res/drawable/cat_sport_active.xml | 11 + app/src/main/res/drawable/cat_tools.xml | 2 +- .../main/res/drawable/cat_tools_active.xml | 11 + app/src/main/res/drawable/cat_tourism.xml | 2 +- .../main/res/drawable/cat_tourism_active.xml | 11 + app/src/main/res/drawable/ic_github.xml | 10 + .../t_menu_bottom_item_background.xml | 2 +- .../drawable/t_menu_top_item_background.xml | 2 +- app/src/main/res/layout/activity_about.xml | 233 +++++++++++++----- .../main/res/layout/activity_activation.xml | 5 +- app/src/main/res/layout/activity_chat.xml | 18 +- app/src/main/res/layout/activity_settings.xml | 11 +- app/src/main/res/layout/activity_terms.xml | 5 +- .../main/res/layout/activity_view_prompt.xml | 174 ++++++++----- app/src/main/res/layout/activity_welcome.xml | 5 +- app/src/main/res/layout/fragment_add_chat.xml | 2 +- .../res/layout/fragment_advanced_settings.xml | 22 +- .../main/res/layout/fragment_assistant.xml | 3 +- .../main/res/layout/fragment_post_prompt.xml | 21 +- app/src/main/res/layout/fragment_prompts.xml | 2 +- app/src/main/res/values-en/strings.xml | 4 +- app/src/main/res/values-night-v31/colors.xml | 3 +- app/src/main/res/values-night-v31/themes.xml | 2 +- app/src/main/res/values-night/colors.xml | 22 ++ app/src/main/res/values-night/themes.xml | 2 +- app/src/main/res/values-v31/colors.xml | 1 + app/src/main/res/values-v31/themes.xml | 2 +- app/src/main/res/values/colors.xml | 22 ++ app/src/main/res/values/strings.xml | 6 +- build.gradle | 6 +- 68 files changed, 882 insertions(+), 305 deletions(-) create mode 100644 app/src/main/res/drawable/btn_accent_24.xml create mode 100644 app/src/main/res/drawable/btn_accent_50p.xml create mode 100644 app/src/main/res/drawable/btn_accent_tonal_v5.xml create mode 100644 app/src/main/res/drawable/cat_all_active.xml create mode 100644 app/src/main/res/drawable/cat_art_active.xml create mode 100644 app/src/main/res/drawable/cat_business_active.xml create mode 100644 app/src/main/res/drawable/cat_culture_active.xml create mode 100644 app/src/main/res/drawable/cat_development_active.xml create mode 100644 app/src/main/res/drawable/cat_education_active.xml create mode 100644 app/src/main/res/drawable/cat_entertainment_active.xml create mode 100644 app/src/main/res/drawable/cat_food_active.xml create mode 100644 app/src/main/res/drawable/cat_gaming_active.xml create mode 100644 app/src/main/res/drawable/cat_health_active.xml create mode 100644 app/src/main/res/drawable/cat_history_active.xml create mode 100644 app/src/main/res/drawable/cat_music_active.xml create mode 100644 app/src/main/res/drawable/cat_productivity_active.xml create mode 100644 app/src/main/res/drawable/cat_sport_active.xml create mode 100644 app/src/main/res/drawable/cat_tools_active.xml create mode 100644 app/src/main/res/drawable/cat_tourism_active.xml create mode 100644 app/src/main/res/drawable/ic_github.xml diff --git a/app/build.gradle b/app/build.gradle index fa4460c..32af6d5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId "org.teslasoft.assistant" minSdk 26 targetSdk 34 - versionCode 236 - versionName "2.36" + versionCode 238 + versionName "2.38" externalNativeBuild { cmake { cppFlags '' @@ -58,10 +58,10 @@ android { dependencies { implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.10.0' + implementation 'com.google.android.material:material:1.11.0' implementation 'com.google.code.gson:gson:2.10.1' - implementation 'com.aallam.openai:openai-client:3.6.1' - implementation 'io.ktor:ktor-client-android:2.3.6' + implementation 'com.aallam.openai:openai-client:3.6.2' + implementation 'io.ktor:ktor-client-android:2.3.7' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' implementation 'org.teslasoft.core.auth:teslasoft-id:1.3.0' @@ -75,7 +75,7 @@ dependencies { implementation 'io.noties.markwon:ext-strikethrough:4.6.2' implementation 'io.noties.markwon:ext-tables:4.6.2' implementation 'io.noties.markwon:ext-tasklist:4.6.2' - implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11' + implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.12' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha06' implementation 'com.google.mlkit:language-id:17.0.4' diff --git a/app/src/main/java/org/teslasoft/assistant/ui/activities/AboutActivity.kt b/app/src/main/java/org/teslasoft/assistant/ui/activities/AboutActivity.kt index 737d700..7b7c459 100644 --- a/app/src/main/java/org/teslasoft/assistant/ui/activities/AboutActivity.kt +++ b/app/src/main/java/org/teslasoft/assistant/ui/activities/AboutActivity.kt @@ -21,9 +21,12 @@ import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.net.Uri import android.os.Bundle +import android.os.Handler +import android.os.Looper import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView +import android.widget.Toast import androidx.fragment.app.FragmentActivity @@ -40,6 +43,9 @@ class AboutActivity : FragmentActivity() { private var btnFeedback: MaterialButton? = null private var appVer: TextView? = null private var btnDonate: LinearLayout? = null + private var btnGithub: LinearLayout? = null + + private var activateEasterEggCounter: Int = 0 override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -53,9 +59,26 @@ class AboutActivity : FragmentActivity() { btnFeedback = findViewById(R.id.btn_feedback) appVer = findViewById(R.id.app_ver) btnDonate = findViewById(R.id.btn_donate) + btnGithub = findViewById(R.id.btn_github) appIcon?.setImageResource(R.drawable.assistant) + appVer?.setOnClickListener { + if (activateEasterEggCounter == 0) { + Handler(Looper.getMainLooper()).postDelayed({ + activateEasterEggCounter = 0 + }, 1500) + } + + if (activateEasterEggCounter == 4) { + activateEasterEggCounter = 0 + Toast.makeText(this, "Easter egg found!", Toast.LENGTH_SHORT).show() + /* TODO: Open easter egg */ + } + + activateEasterEggCounter++ + } + try { val pInfo: PackageInfo = if (android.os.Build.VERSION.SDK_INT >= 33) { packageManager.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(0)) @@ -104,5 +127,12 @@ class AboutActivity : FragmentActivity() { i.action = Intent.ACTION_VIEW startActivity(i) } + + btnGithub?.setOnClickListener { + val i = Intent() + i.data = Uri.parse("https://github.com/AndraxDev/speak-gpt") + i.action = Intent.ACTION_VIEW + startActivity(i) + } } } diff --git a/app/src/main/java/org/teslasoft/assistant/ui/activities/ChatActivity.kt b/app/src/main/java/org/teslasoft/assistant/ui/activities/ChatActivity.kt index b60948f..b6c86b0 100644 --- a/app/src/main/java/org/teslasoft/assistant/ui/activities/ChatActivity.kt +++ b/app/src/main/java/org/teslasoft/assistant/ui/activities/ChatActivity.kt @@ -1093,7 +1093,7 @@ class ChatActivity : FragmentActivity() { } else if (e.stackTraceToString().contains("You exceeded your current quota")) { "You exceeded your current quota. If you had free trial usage please add payment info. Also please check your usage limits. You can change your limits in Account settings." } else { - e.stackTraceToString() + e.stackTraceToString() + "\n\n" + e.message } putMessage(response, true) @@ -1169,16 +1169,18 @@ class ChatActivity : FragmentActivity() { btnMicro?.isEnabled = false btnSend?.isEnabled = false progress?.visibility = View.GONE + val m = msgs + m.add( ChatMessage( - role = ChatRole.User, + role = ChatRole.System, content = "Create a short name for this chat according to the messages provided. Enter just short name and nothing else. Don't add word 'chat' or 'bot' to the name." ) ) val chatCompletionRequest2 = ChatCompletionRequest( - model = ModelId("gpt-3.5-turbo"), + model = ModelId("gpt-3.5-turbo-1106"), maxTokens = 5, messages = m ) diff --git a/app/src/main/java/org/teslasoft/assistant/ui/activities/SettingsActivity.kt b/app/src/main/java/org/teslasoft/assistant/ui/activities/SettingsActivity.kt index 8182796..1a8a240 100644 --- a/app/src/main/java/org/teslasoft/assistant/ui/activities/SettingsActivity.kt +++ b/app/src/main/java/org/teslasoft/assistant/ui/activities/SettingsActivity.kt @@ -529,7 +529,7 @@ class SettingsActivity : FragmentActivity() { chatId = extras.getString("chatId", "") if (chatId == "") { - btnClearChat?.visibility = View.GONE + btnClearChat?.isEnabled = false activitySettingsTitle?.text = getString(R.string.global_settings_title) globalSettingsTip?.visibility = View.VISIBLE } else { @@ -537,7 +537,7 @@ class SettingsActivity : FragmentActivity() { globalSettingsTip?.visibility = View.GONE } } else { - btnClearChat?.visibility = View.GONE + btnClearChat?.isEnabled = false activitySettingsTitle?.text = getString(R.string.global_settings_title) globalSettingsTip?.visibility = View.VISIBLE } diff --git a/app/src/main/java/org/teslasoft/assistant/ui/adapters/VoiceListAdapter.kt b/app/src/main/java/org/teslasoft/assistant/ui/adapters/VoiceListAdapter.kt index 311ad80..514ba80 100644 --- a/app/src/main/java/org/teslasoft/assistant/ui/adapters/VoiceListAdapter.kt +++ b/app/src/main/java/org/teslasoft/assistant/ui/adapters/VoiceListAdapter.kt @@ -95,7 +95,7 @@ class VoiceListAdapter(private val context: Context, private val items: ArrayLis } private fun getSurfaceColor(context: Context) : Int { - return SurfaceColors.SURFACE_3.getColor(context) + return context.getColor(android.R.color.transparent) } private fun getSurfaceColorV2(context: Context) : Int { diff --git a/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/AdvancedSettingsDialogFragment.kt b/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/AdvancedSettingsDialogFragment.kt index 6cc1feb..d569a14 100644 --- a/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/AdvancedSettingsDialogFragment.kt +++ b/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/AdvancedSettingsDialogFragment.kt @@ -60,7 +60,7 @@ class AdvancedSettingsDialogFragment : DialogFragment() { private var gpt_35_turbo: RadioButton? = null private var gpt_35_turbo_0301: RadioButton? = null - private var gpt_35_turbo_0613: RadioButton? = null + private var gpt_35_turbo_1106: RadioButton? = null private var gpt_4: RadioButton? = null private var gpt_4_turbo: RadioButton? = null private var gpt_4_0314: RadioButton? = null @@ -101,23 +101,23 @@ class AdvancedSettingsDialogFragment : DialogFragment() { val view: View = this.layoutInflater.inflate(R.layout.fragment_advanced_settings, null) gpt_35_turbo = view.findViewById(R.id.gpt_35_turbo) - gpt_35_turbo_0301 = view.findViewById(R.id.gpt_35_turbo_0301) - gpt_35_turbo_0613 = view.findViewById(R.id.gpt_35_turbo_0613) + // gpt_35_turbo_0301 = view.findViewById(R.id.gpt_35_turbo_0301) + gpt_35_turbo_1106 = view.findViewById(R.id.gpt_35_turbo_1106) gpt_4 = view.findViewById(R.id.gpt_4) gpt_4_turbo = view.findViewById(R.id.gpt_4_turbo) - gpt_4_0314 = view.findViewById(R.id.gpt_4_0314) - gpt_4_0613 = view.findViewById(R.id.gpt_4_0613) + // gpt_4_0314 = view.findViewById(R.id.gpt_4_0314) + // gpt_4_0613 = view.findViewById(R.id.gpt_4_0613) gpt_4_32k = view.findViewById(R.id.gpt_4_32k) - gpt_4_32k_0314 = view.findViewById(R.id.gpt_4_32k_0314) - text_davinci_003 = view.findViewById(R.id.text_davinci_003) - text_davinci_002 = view.findViewById(R.id.text_davinci_002) - text_curie_001 = view.findViewById(R.id.text_curie_001) - text_babbage_001 = view.findViewById(R.id.text_babbage_001) - text_ada_001 = view.findViewById(R.id.text_ada_001) - davinci = view.findViewById(R.id.davinci) - curie = view.findViewById(R.id.curie) - babbage = view.findViewById(R.id.babbage) - ada = view.findViewById(R.id.ada) + // gpt_4_32k_0314 = view.findViewById(R.id.gpt_4_32k_0314) + // text_davinci_003 = view.findViewById(R.id.text_davinci_003) + // text_davinci_002 = view.findViewById(R.id.text_davinci_002) + // text_curie_001 = view.findViewById(R.id.text_curie_001) + // text_babbage_001 = view.findViewById(R.id.text_babbage_001) + // text_ada_001 = view.findViewById(R.id.text_ada_001) + // davinci = view.findViewById(R.id.davinci) + // curie = view.findViewById(R.id.curie) + // babbage = view.findViewById(R.id.babbage) + // ada = view.findViewById(R.id.ada) ft = view.findViewById(R.id.ft) ftInput = view.findViewById(R.id.ft_input) maxTokens = view.findViewById(R.id.max_tokens) @@ -136,6 +136,8 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } + /* DEPRECATED */ + /* gpt_35_turbo_0301?.setOnClickListener { model = "gpt-3.5-turbo-0301" clearSelection() @@ -144,11 +146,12 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } - gpt_35_turbo_0613?.setOnClickListener { - model = "gpt-3.5-turbo-16k-0613" + */ + gpt_35_turbo_1106?.setOnClickListener { + model = "gpt-3.5-turbo-1106" clearSelection() - gpt_35_turbo_0613?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.window_background)) - gpt_35_turbo_0613?.background = getDarkAccentDrawableV2( + gpt_35_turbo_1106?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.window_background)) + gpt_35_turbo_1106?.background = getDarkAccentDrawableV2( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } @@ -168,6 +171,8 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } + /* DEPRECATED */ + /* gpt_4_0314?.setOnClickListener { model = "gpt-4-0314" clearSelection() @@ -176,6 +181,9 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } + */ + /* DEPRECATED */ + /* gpt_4_0613?.setOnClickListener { model = "gpt-4-0613" clearSelection() @@ -184,6 +192,7 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } + */ gpt_4_32k?.setOnClickListener { model = "gpt-4-32k" clearSelection() @@ -192,6 +201,8 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } + /* DEPRECATED */ + /* gpt_4_32k_0314?.setOnClickListener { model = "gpt-4-32k-0314" clearSelection() @@ -271,7 +282,7 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ada?.background = getDarkAccentDrawableV2( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE - } + }*/ ft?.setOnClickListener { model = ftInput?.text.toString() clearSelection() @@ -311,11 +322,11 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } - "gpt-3.5-turbo-16k-0613" -> { - gpt_35_turbo_0613?.isChecked = true + "gpt-3.5-turbo-1106" -> { + gpt_35_turbo_1106?.isChecked = true clearSelection() - gpt_35_turbo_0613?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.window_background)) - gpt_35_turbo_0613?.background = getDarkAccentDrawableV2( + gpt_35_turbo_1106?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.window_background)) + gpt_35_turbo_1106?.background = getDarkAccentDrawableV2( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } @@ -344,7 +355,8 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } - "gpt-4-0613" -> { + /* DEPRECATED */ + /* "gpt-4-0613" -> { gpt_4_0613?.isChecked = true clearSelection() gpt_4_0613?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.window_background)) @@ -352,6 +364,7 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } + */ /* DEPRECATED */ /*"gpt-4-0314" -> { gpt_4_0314?.isChecked = true @@ -378,6 +391,8 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE }*/ + + /* THESE MODELS HAS BEEN SHUT DOWN ON Jan 1 2024 "text-davinci-003" -> { text_davinci_003?.isChecked = true clearSelection() @@ -418,6 +433,7 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v4)!!) ftInput?.visibility = View.GONE } + */ /* DEPRECATED */ /*"davinci" -> { davinci?.isChecked = true @@ -470,69 +486,73 @@ class AdvancedSettingsDialogFragment : DialogFragment() { ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) gpt_35_turbo?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - gpt_35_turbo_0301?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - gpt_35_turbo_0301?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// gpt_35_turbo_0301?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// gpt_35_turbo_0301?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - gpt_35_turbo_0613?.background = getDarkAccentDrawable( + gpt_35_turbo_1106?.background = getDarkAccentDrawable( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - gpt_35_turbo_0613?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) + gpt_35_turbo_1106?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) gpt_4?.background = getDarkAccentDrawable( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) gpt_4?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - gpt_4_0314?.background = getDarkAccentDrawable( + gpt_4_turbo?.background = getDarkAccentDrawable( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - gpt_4_0314?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) + gpt_4_turbo?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - gpt_4_0613?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - gpt_4_0613?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// gpt_4_0314?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// gpt_4_0314?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// gpt_4_0613?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// gpt_4_0613?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) gpt_4_32k?.background = getDarkAccentDrawable( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) gpt_4_32k?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - gpt_4_32k_0314?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - gpt_4_32k_0314?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - text_davinci_003?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - text_davinci_003?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - text_davinci_002?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - text_davinci_002?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - text_curie_001?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - text_curie_001?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - text_babbage_001?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - text_babbage_001?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - text_ada_001?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - text_ada_001?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - davinci?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - davinci?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - curie?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - curie?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - babbage?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - babbage?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) - - ada?.background = getDarkAccentDrawable( - ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) - ada?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// gpt_4_32k_0314?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// gpt_4_32k_0314?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// text_davinci_003?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// text_davinci_003?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// text_davinci_002?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// text_davinci_002?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// text_curie_001?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// text_curie_001?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// text_babbage_001?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// text_babbage_001?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// text_ada_001?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// text_ada_001?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// davinci?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// davinci?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// curie?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// curie?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// babbage?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// babbage?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) +// +// ada?.background = getDarkAccentDrawable( +// ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) +// ada?.setTextColor(ContextCompat.getColor(requireActivity(), R.color.neutral_200)) ft?.background = getDarkAccentDrawable( ContextCompat.getDrawable(requireActivity(), R.drawable.btn_accent_tonal_selector_v3)!!, requireActivity()) @@ -550,7 +570,7 @@ class AdvancedSettingsDialogFragment : DialogFragment() { } private fun getSurfaceColor(context: Context) : Int { - return SurfaceColors.SURFACE_3.getColor(context) + return context.getColor(android.R.color.transparent) } private fun getSurfaceColorV2() : Int { diff --git a/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/LanguageSelectorDialogFragment.kt b/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/LanguageSelectorDialogFragment.kt index 5dbc719..d45f91a 100644 --- a/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/LanguageSelectorDialogFragment.kt +++ b/app/src/main/java/org/teslasoft/assistant/ui/fragments/dialogs/LanguageSelectorDialogFragment.kt @@ -349,7 +349,7 @@ class LanguageSelectorDialogFragment : DialogFragment() { } private fun getSurfaceColor(context: Context) : Int { - return SurfaceColors.SURFACE_3.getColor(context) + return context.getColor(android.R.color.transparent) } private fun getSurfaceColorV2(context: Context) : Int { diff --git a/app/src/main/java/org/teslasoft/assistant/ui/fragments/tabs/PromptsFragment.kt b/app/src/main/java/org/teslasoft/assistant/ui/fragments/tabs/PromptsFragment.kt index 4613371..9e1763b 100644 --- a/app/src/main/java/org/teslasoft/assistant/ui/fragments/tabs/PromptsFragment.kt +++ b/app/src/main/java/org/teslasoft/assistant/ui/fragments/tabs/PromptsFragment.kt @@ -336,31 +336,121 @@ class PromptsFragment : Fragment(), SwipeRefreshLayout.OnRefreshListener { } private fun initializeCat() { - catAll?.setOnClickListener { selectedCategory = "all";filter(prompts) } - catDevelopment?.setOnClickListener { selectedCategory = "development";filter(prompts) } - catMusic?.setOnClickListener { selectedCategory = "music";filter(prompts) } - catArt?.setOnClickListener { selectedCategory = "art";filter(prompts) } - catCulture?.setOnClickListener { selectedCategory = "culture";filter(prompts) } - catBusiness?.setOnClickListener { selectedCategory = "business";filter(prompts) } - catGaming?.setOnClickListener { selectedCategory = "gaming";filter(prompts) } - catEducation?.setOnClickListener { selectedCategory = "education";filter(prompts) } - catHistory?.setOnClickListener { selectedCategory = "history";filter(prompts) } - catFood?.setOnClickListener { selectedCategory = "food";filter(prompts) } - catTourism?.setOnClickListener { selectedCategory = "tourism";filter(prompts) } - catProductivity?.setOnClickListener { selectedCategory = "productivity";filter(prompts) } - catTools?.setOnClickListener { selectedCategory = "tools";filter(prompts) } - catEntertainment?.setOnClickListener { selectedCategory = "entertainment";filter(prompts) } - catSport?.setOnClickListener { selectedCategory = "sport";filter(prompts) } - catHealth?.setOnClickListener { selectedCategory = "health";filter(prompts) } - } - - private fun getDarkAccentDrawable(drawable: Drawable, context: Context) : Drawable { - DrawableCompat.setTint(DrawableCompat.wrap(drawable), getSurfaceColor(context)) - return drawable + catAll?.setOnClickListener { + clearSelection() + catAll?.setBackgroundResource(R.drawable.cat_all_active) + selectedCategory = "all" + filter(prompts) + } + catDevelopment?.setOnClickListener { + clearSelection() + catDevelopment?.setBackgroundResource(R.drawable.cat_development_active) + selectedCategory = "development" + filter(prompts) + } + catMusic?.setOnClickListener { + clearSelection() + catMusic?.setBackgroundResource(R.drawable.cat_music_active) + selectedCategory = "music" + filter(prompts) + } + catArt?.setOnClickListener { + clearSelection() + catArt?.setBackgroundResource(R.drawable.cat_art_active) + selectedCategory = "art" + filter(prompts) + } + catCulture?.setOnClickListener { + clearSelection() + catCulture?.setBackgroundResource(R.drawable.cat_culture_active) + selectedCategory = "culture" + filter(prompts) + } + catBusiness?.setOnClickListener { + clearSelection() + catBusiness?.setBackgroundResource(R.drawable.cat_business_active) + selectedCategory = "business" + filter(prompts) + } + catGaming?.setOnClickListener { + clearSelection() + catGaming?.setBackgroundResource(R.drawable.cat_gaming_active) + selectedCategory = "gaming" + filter(prompts) + } + catEducation?.setOnClickListener { + clearSelection() + catEducation?.setBackgroundResource(R.drawable.cat_education_active) + selectedCategory = "education" + filter(prompts) + } + catHistory?.setOnClickListener { + clearSelection() + catHistory?.setBackgroundResource(R.drawable.cat_history_active) + selectedCategory = "history" + filter(prompts) + } + catFood?.setOnClickListener { + clearSelection() + catFood?.setBackgroundResource(R.drawable.cat_food_active) + selectedCategory = "food" + filter(prompts) + } + catTourism?.setOnClickListener { + clearSelection() + catTourism?.setBackgroundResource(R.drawable.cat_tourism_active) + selectedCategory = "tourism" + filter(prompts) + } + catProductivity?.setOnClickListener { + clearSelection() + catProductivity?.setBackgroundResource(R.drawable.cat_productivity_active) + selectedCategory = "productivity" + filter(prompts) + } + catTools?.setOnClickListener { + clearSelection() + catTools?.setBackgroundResource(R.drawable.cat_tools_active) + selectedCategory = "tools" + filter(prompts) + } + catEntertainment?.setOnClickListener { + clearSelection() + catEntertainment?.setBackgroundResource(R.drawable.cat_entertainment_active) + selectedCategory = "entertainment" + filter(prompts) + } + catSport?.setOnClickListener { + clearSelection() + catSport?.setBackgroundResource(R.drawable.cat_sport_active) + selectedCategory = "sport" + filter(prompts) + } + catHealth?.setOnClickListener { + clearSelection() + catHealth?.setBackgroundResource(R.drawable.cat_health_active) + selectedCategory = "health" + filter(prompts) + } } - private fun getSurfaceColor(context: Context) : Int { - return SurfaceColors.SURFACE_2.getColor(context) + private fun clearSelection () { + catAll?.setBackgroundResource(R.drawable.cat_all) + catDevelopment?.setBackgroundResource(R.drawable.cat_development) + catMusic?.setBackgroundResource(R.drawable.cat_music) + catArt?.setBackgroundResource(R.drawable.cat_art) + catCulture?.setBackgroundResource(R.drawable.cat_culture) + catBusiness?.setBackgroundResource(R.drawable.cat_business) + catGaming?.setBackgroundResource(R.drawable.cat_gaming) + catEducation?.setBackgroundResource(R.drawable.cat_education) + catHistory?.setBackgroundResource(R.drawable.cat_history) + catFood?.setBackgroundResource(R.drawable.cat_food) + catTourism?.setBackgroundResource(R.drawable.cat_tourism) + catProductivity?.setBackgroundResource(R.drawable.cat_productivity) + catTools?.setBackgroundResource(R.drawable.cat_tools) + catEntertainment?.setBackgroundResource(R.drawable.cat_entertainment) + catSport?.setBackgroundResource(R.drawable.cat_sport) + catHealth?.setBackgroundResource(R.drawable.cat_health) } private fun loadData() { diff --git a/app/src/main/res/drawable/btn_accent_24.xml b/app/src/main/res/drawable/btn_accent_24.xml new file mode 100644 index 0000000..8ddf9a7 --- /dev/null +++ b/app/src/main/res/drawable/btn_accent_24.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/app/src/main/res/drawable/btn_accent_50p.xml b/app/src/main/res/drawable/btn_accent_50p.xml new file mode 100644 index 0000000..ffed27e --- /dev/null +++ b/app/src/main/res/drawable/btn_accent_50p.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_accent_tonal_v5.xml b/app/src/main/res/drawable/btn_accent_tonal_v5.xml new file mode 100644 index 0000000..596f3a0 --- /dev/null +++ b/app/src/main/res/drawable/btn_accent_tonal_v5.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_tip2.xml b/app/src/main/res/drawable/btn_tip2.xml index e5a8d2e..46e5359 100644 --- a/app/src/main/res/drawable/btn_tip2.xml +++ b/app/src/main/res/drawable/btn_tip2.xml @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - + diff --git a/app/src/main/res/drawable/cat_all_active.xml b/app/src/main/res/drawable/cat_all_active.xml new file mode 100644 index 0000000..e88333f --- /dev/null +++ b/app/src/main/res/drawable/cat_all_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_art.xml b/app/src/main/res/drawable/cat_art.xml index 45f40ad..8b1f4de 100644 --- a/app/src/main/res/drawable/cat_art.xml +++ b/app/src/main/res/drawable/cat_art.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_art_active.xml b/app/src/main/res/drawable/cat_art_active.xml new file mode 100644 index 0000000..363d578 --- /dev/null +++ b/app/src/main/res/drawable/cat_art_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_business.xml b/app/src/main/res/drawable/cat_business.xml index c09e473..07b3648 100644 --- a/app/src/main/res/drawable/cat_business.xml +++ b/app/src/main/res/drawable/cat_business.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_business_active.xml b/app/src/main/res/drawable/cat_business_active.xml new file mode 100644 index 0000000..476849b --- /dev/null +++ b/app/src/main/res/drawable/cat_business_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_culture.xml b/app/src/main/res/drawable/cat_culture.xml index a70e91d..a11f499 100644 --- a/app/src/main/res/drawable/cat_culture.xml +++ b/app/src/main/res/drawable/cat_culture.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_culture_active.xml b/app/src/main/res/drawable/cat_culture_active.xml new file mode 100644 index 0000000..fb184a3 --- /dev/null +++ b/app/src/main/res/drawable/cat_culture_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_development.xml b/app/src/main/res/drawable/cat_development.xml index 1968869..3a3bdad 100644 --- a/app/src/main/res/drawable/cat_development.xml +++ b/app/src/main/res/drawable/cat_development.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_development_active.xml b/app/src/main/res/drawable/cat_development_active.xml new file mode 100644 index 0000000..a717438 --- /dev/null +++ b/app/src/main/res/drawable/cat_development_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_education.xml b/app/src/main/res/drawable/cat_education.xml index 00a993c..8bd1578 100644 --- a/app/src/main/res/drawable/cat_education.xml +++ b/app/src/main/res/drawable/cat_education.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_education_active.xml b/app/src/main/res/drawable/cat_education_active.xml new file mode 100644 index 0000000..2357de8 --- /dev/null +++ b/app/src/main/res/drawable/cat_education_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_entertainment.xml b/app/src/main/res/drawable/cat_entertainment.xml index 8bde176..093fab4 100644 --- a/app/src/main/res/drawable/cat_entertainment.xml +++ b/app/src/main/res/drawable/cat_entertainment.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_entertainment_active.xml b/app/src/main/res/drawable/cat_entertainment_active.xml new file mode 100644 index 0000000..71f1607 --- /dev/null +++ b/app/src/main/res/drawable/cat_entertainment_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_food.xml b/app/src/main/res/drawable/cat_food.xml index 73e66e8..938d092 100644 --- a/app/src/main/res/drawable/cat_food.xml +++ b/app/src/main/res/drawable/cat_food.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_food_active.xml b/app/src/main/res/drawable/cat_food_active.xml new file mode 100644 index 0000000..b1895ed --- /dev/null +++ b/app/src/main/res/drawable/cat_food_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_gaming.xml b/app/src/main/res/drawable/cat_gaming.xml index 38a96bb..267c812 100644 --- a/app/src/main/res/drawable/cat_gaming.xml +++ b/app/src/main/res/drawable/cat_gaming.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_gaming_active.xml b/app/src/main/res/drawable/cat_gaming_active.xml new file mode 100644 index 0000000..2cdc42d --- /dev/null +++ b/app/src/main/res/drawable/cat_gaming_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_health.xml b/app/src/main/res/drawable/cat_health.xml index 047175e..cabb8ba 100644 --- a/app/src/main/res/drawable/cat_health.xml +++ b/app/src/main/res/drawable/cat_health.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_health_active.xml b/app/src/main/res/drawable/cat_health_active.xml new file mode 100644 index 0000000..ac42fb9 --- /dev/null +++ b/app/src/main/res/drawable/cat_health_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_history.xml b/app/src/main/res/drawable/cat_history.xml index 06e55f6..ede34c5 100644 --- a/app/src/main/res/drawable/cat_history.xml +++ b/app/src/main/res/drawable/cat_history.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_history_active.xml b/app/src/main/res/drawable/cat_history_active.xml new file mode 100644 index 0000000..ce0dd5d --- /dev/null +++ b/app/src/main/res/drawable/cat_history_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_music.xml b/app/src/main/res/drawable/cat_music.xml index 6afefb9..d9b8be3 100644 --- a/app/src/main/res/drawable/cat_music.xml +++ b/app/src/main/res/drawable/cat_music.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_music_active.xml b/app/src/main/res/drawable/cat_music_active.xml new file mode 100644 index 0000000..e329f2b --- /dev/null +++ b/app/src/main/res/drawable/cat_music_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_productivity.xml b/app/src/main/res/drawable/cat_productivity.xml index 503f3c8..d8c6b0c 100644 --- a/app/src/main/res/drawable/cat_productivity.xml +++ b/app/src/main/res/drawable/cat_productivity.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_productivity_active.xml b/app/src/main/res/drawable/cat_productivity_active.xml new file mode 100644 index 0000000..862f2ce --- /dev/null +++ b/app/src/main/res/drawable/cat_productivity_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_sport.xml b/app/src/main/res/drawable/cat_sport.xml index c792bdc..c5e6b62 100644 --- a/app/src/main/res/drawable/cat_sport.xml +++ b/app/src/main/res/drawable/cat_sport.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_sport_active.xml b/app/src/main/res/drawable/cat_sport_active.xml new file mode 100644 index 0000000..42c7df2 --- /dev/null +++ b/app/src/main/res/drawable/cat_sport_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_tools.xml b/app/src/main/res/drawable/cat_tools.xml index c4cc227..752fd5e 100644 --- a/app/src/main/res/drawable/cat_tools.xml +++ b/app/src/main/res/drawable/cat_tools.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_tools_active.xml b/app/src/main/res/drawable/cat_tools_active.xml new file mode 100644 index 0000000..e0efdcd --- /dev/null +++ b/app/src/main/res/drawable/cat_tools_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cat_tourism.xml b/app/src/main/res/drawable/cat_tourism.xml index e28c14f..968d209 100644 --- a/app/src/main/res/drawable/cat_tourism.xml +++ b/app/src/main/res/drawable/cat_tourism.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/cat_tourism_active.xml b/app/src/main/res/drawable/cat_tourism_active.xml new file mode 100644 index 0000000..48ea029 --- /dev/null +++ b/app/src/main/res/drawable/cat_tourism_active.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_github.xml b/app/src/main/res/drawable/ic_github.xml new file mode 100644 index 0000000..8391c7a --- /dev/null +++ b/app/src/main/res/drawable/ic_github.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/t_menu_bottom_item_background.xml b/app/src/main/res/drawable/t_menu_bottom_item_background.xml index 333d290..07fa96f 100644 --- a/app/src/main/res/drawable/t_menu_bottom_item_background.xml +++ b/app/src/main/res/drawable/t_menu_bottom_item_background.xml @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - + diff --git a/app/src/main/res/drawable/t_menu_top_item_background.xml b/app/src/main/res/drawable/t_menu_top_item_background.xml index fceda33..c724dbe 100644 --- a/app/src/main/res/drawable/t_menu_top_item_background.xml +++ b/app/src/main/res/drawable/t_menu_top_item_background.xml @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - + diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 55e2cc1..0399462 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,6 +1,7 @@ @@ -21,11 +22,13 @@ android:layout_width="120dp" android:layout_height="120dp" android:layout_marginTop="36dp" + android:background="@drawable/btn_accent_50p" + android:contentDescription="@string/app_name" + android:padding="12dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:srcCompat="@drawable/assistant" - android:contentDescription="@string/app_name" /> + app:srcCompat="@drawable/assistant" /> - + app:layout_constraintTop_toBottomOf="@+id/textView7"> - + - + - + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/constraintLayout6"> + + + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/constraintLayout3"> - - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/textView8" /> - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_activation.xml b/app/src/main/res/layout/activity_activation.xml index 513e07a..b819804 100644 --- a/app/src/main/res/layout/activity_activation.xml +++ b/app/src/main/res/layout/activity_activation.xml @@ -56,9 +56,10 @@ @@ -40,12 +40,12 @@ android:layout_marginStart="16dp" android:layout_marginTop="16dp" android:layout_marginEnd="76dp" - android:layout_marginBottom="8dp" + android:layout_marginBottom="16dp" android:autofillHints="message" android:background="@drawable/btn_accent_tonal_selector_v5" android:ems="10" android:hint="@string/hint_message" - android:inputType="text|textMultiLine" + android:inputType="text|textMultiLine|textCapSentences" android:isScrollContainer="true" android:maxHeight="120dp" android:paddingLeft="12dp" @@ -66,8 +66,8 @@ android:layout_height="48dp" android:layout_marginTop="16dp" android:layout_marginEnd="16dp" - android:layout_marginBottom="8dp" - android:background="@drawable/btn_accent_tonal_v2" + android:layout_marginBottom="16dp" + android:background="@drawable/btn_accent_tonal_v5" android:elevation="0.02dip" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -79,8 +79,8 @@ android:layout_height="48dp" android:layout_marginTop="16dp" android:layout_marginEnd="16dp" - android:layout_marginBottom="8dp" - android:background="@drawable/btn_accent_tonal_v2" + android:layout_marginBottom="16dp" + android:background="@drawable/btn_accent_tonal_v5" android:clickable="true" android:contentDescription="@string/btn_speak" android:elevation="0.01dip" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index e90c181..8a517f8 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1990,10 +1990,13 @@ @@ -85,51 +86,34 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - - - - + app:layout_constraintTop_toBottomOf="@+id/constraintLayout4"> - + - + app:layout_constraintTop_toTopOf="parent"> - + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_welcome.xml b/app/src/main/res/layout/activity_welcome.xml index dad03e0..e41cd7a 100644 --- a/app/src/main/res/layout/activity_welcome.xml +++ b/app/src/main/res/layout/activity_welcome.xml @@ -59,10 +59,11 @@ + android:textSize="16sp" + android:visibility="gone" /> + android:textSize="16sp" + android:visibility="gone" /> + android:textSize="16sp" + android:visibility="gone" /> + android:textSize="16sp" + android:visibility="gone" /> + android:textSize="16sp" + android:visibility="gone" /> + android:textSize="16sp" + android:visibility="gone" /> diff --git a/app/src/main/res/layout/fragment_prompts.xml b/app/src/main/res/layout/fragment_prompts.xml index bcaaaca..fcf84c3 100644 --- a/app/src/main/res/layout/fragment_prompts.xml +++ b/app/src/main/res/layout/fragment_prompts.xml @@ -151,7 +151,7 @@ android:id="@+id/cat_all" android:layout_width="56dp" android:layout_height="56dp" - android:background="@drawable/cat_all" + android:background="@drawable/cat_all_active" android:clickable="true" android:contentDescription="@string/cat_all" android:orientation="vertical" diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 63606dd..a41b597 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -10,7 +10,7 @@ Send feedback Terms Privacy - Activation + API setup To use this software you need to provide your OpenAI API key. SpeakGPT uses paid OpenAI models. Let\'s begin API usage is significantly cheaper than fixed subscription. @@ -116,7 +116,7 @@ Sport Sport Category: %s - Follow OpenAI\'s safety principles. Do not post any inappropriate or sensitive information. All prompts is being moderated. Inappropriate prompts will be removed without further notice. + Follow OpenAI safety principles. Do not post any inappropriate or sensitive information. All prompts is being moderated. Inappropriate prompts will be removed without further notice. Post your prompt Prompts store Search diff --git a/app/src/main/res/values-night-v31/colors.xml b/app/src/main/res/values-night-v31/colors.xml index 5826367..457d925 100644 --- a/app/src/main/res/values-night-v31/colors.xml +++ b/app/src/main/res/values-night-v31/colors.xml @@ -1,6 +1,7 @@ - @android:color/system_neutral2_800 + @android:color/system_neutral1_800 + @android:color/system_accent2_800 @android:color/system_neutral2_700 @android:color/system_accent2_700 @android:color/system_accent1_300 diff --git a/app/src/main/res/values-night-v31/themes.xml b/app/src/main/res/values-night-v31/themes.xml index c0ab895..8212181 100644 --- a/app/src/main/res/values-night-v31/themes.xml +++ b/app/src/main/res/values-night-v31/themes.xml @@ -15,4 +15,4 @@ 1200 @color/accent_100 - \ No newline at end of file + diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index a927c0b..cf29442 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -1,5 +1,6 @@ + #26262A #302f36 #424250 #424250 @@ -61,6 +62,22 @@ #25CCFFE5 #25d4d4d4 + #50ffddad + #50ffadad + #50b5c1ff + #50b9fac1 + #50e0c3fa + #50daffcc + #50caf9fc + #50cafce2 + #50fccaf1 + #50FFD6E3 + #50faffcc + #50ccddff + #50ffe6cc + #50d5ffcc + #50CCFFE5 + #40824444 #CCB4B4 @@ -72,4 +89,9 @@ #405F71A7 #B4B6CC + + #40855FA7 + #C2B4CC + + #38FFFFFF diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 7195663..d69a26a 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -11,4 +11,4 @@ @color/window_background @color/window_background - \ No newline at end of file + diff --git a/app/src/main/res/values-v31/colors.xml b/app/src/main/res/values-v31/colors.xml index 950c8c4..e44f422 100644 --- a/app/src/main/res/values-v31/colors.xml +++ b/app/src/main/res/values-v31/colors.xml @@ -1,5 +1,6 @@ + @android:color/system_neutral2_50 @android:color/system_neutral2_100 @android:color/system_neutral2_200 @android:color/system_accent2_100 diff --git a/app/src/main/res/values-v31/themes.xml b/app/src/main/res/values-v31/themes.xml index 30edf09..0636bcd 100644 --- a/app/src/main/res/values-v31/themes.xml +++ b/app/src/main/res/values-v31/themes.xml @@ -15,4 +15,4 @@ 1200 @color/accent_100 - \ No newline at end of file + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 10073bd..f627ac6 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -16,6 +16,7 @@ #ffffffff #ffff3d00 + #F0EDF6 #e3dfec #c7c4cf #e4d9ff @@ -79,6 +80,22 @@ #25005329 #25494949 + #50974E00 + #50730000 + #50000E55 + #5000530A + #5038006A + #501C6500 + #50005D63 + #5000602E + #5060004B + #50460016 + #50505900 + #50001E5A + #50532A00 + #500C4700 + #50005329 + #25730000 #730000 @@ -90,4 +107,9 @@ #250B0073 #220073 + + #25540073 + #5A0073 + + #33000000 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 58a14eb..1452083 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -10,7 +10,7 @@ Send feedback Terms Privacy - Activation + API setup To use this software you need to provide your OpenAI API key. SpeakGPT uses paid OpenAI models. Let\'s begin API usage is significantly cheaper than fixed subscription. @@ -97,7 +97,7 @@ Prompt title Brief description Prompt - Prompt for + AI Model Category Development Music @@ -116,7 +116,7 @@ Sport Sport Category: %s - Follow OpenAI\'s safety principles. Do not post any inappropriate or sensitive information. All prompts is being moderated. Inappropriate prompts will be removed without further notice. + Follow OpenAI safety principles. Do not post any inappropriate or sensitive information. All prompts is being moderated. Inappropriate prompts will be removed without further notice. Post your prompt Prompts store Search diff --git a/build.gradle b/build.gradle index 2f7c244..cca2a3f 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.0-alpha17' + classpath 'com.android.tools.build:gradle:8.4.0-alpha02' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -15,8 +15,8 @@ buildscript { // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '8.3.0-alpha17' apply false - id 'com.android.library' version '8.3.0-alpha17' apply false + id 'com.android.application' version '8.4.0-alpha02' apply false + id 'com.android.library' version '8.4.0-alpha02' apply false id 'org.jetbrains.kotlin.android' version '1.9.0' apply false id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.21' }