Author: Adam <git@apiote.xyz>
change search bar to Material
%!v(PANIC=String method: strings: negative Repeat count)
diff --git a/app/build.gradle b/app/build.gradle index a5c962e92d42b8c52310b3a31d7763c63cd07160..9571baf25a6b7870e3402b5dec6228a446cdc78b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -50,7 +50,6 @@ implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3' implementation 'androidx.navigation:navigation-ui-ktx:2.5.3' - implementation 'com.github.mancj:MaterialSearchBar:0.8.5' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.core:core-splashscreen:1.0.1' implementation 'com.google.openlocationcode:openlocationcode:1.0.4' diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt index d9948e433a7a53bcfc8b905ad9771c7e84603820..64ff4d6313c66b393f81b3b3cef4238b498227f3 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt @@ -6,6 +6,7 @@ import android.content.pm.PackageManager import android.os.Bundle import android.view.View import android.widget.Toast +import androidx.activity.OnBackPressedCallback import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AppCompatActivity @@ -13,6 +14,7 @@ import androidx.core.content.ContextCompat import androidx.core.content.edit import androidx.core.view.WindowCompat import androidx.core.view.get +import androidx.drawerlayout.widget.DrawerLayout.DrawerListener import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks @@ -20,14 +22,10 @@ import androidx.navigation.fragment.NavHostFragment import androidx.navigation.ui.setupWithNavController import com.google.android.material.bottomnavigation.BottomNavigationView import xyz.apiote.bimba.czwek.R -import xyz.apiote.bimba.czwek.api.Line -import xyz.apiote.bimba.czwek.api.QueryableV1 -import xyz.apiote.bimba.czwek.api.StopV1 import xyz.apiote.bimba.czwek.dashboard.ui.home.HomeFragment import xyz.apiote.bimba.czwek.dashboard.ui.map.MapFragment import xyz.apiote.bimba.czwek.dashboard.ui.voyage.VoyageFragment import xyz.apiote.bimba.czwek.databinding.ActivityMainBinding -import xyz.apiote.bimba.czwek.departures.DeparturesActivity import xyz.apiote.bimba.czwek.search.ResultsActivity import xyz.apiote.bimba.czwek.settings.ServerChooserActivity import xyz.apiote.bimba.czwek.settings.feeds.FeedChooserActivity @@ -59,11 +57,33 @@ } }, true ) + val onBackPressedCallback = object : OnBackPressedCallback(binding.container.isDrawerOpen(binding.navigationDrawer)) { + override fun handleOnBackPressed() { + binding.container.closeDrawer(binding.navigationDrawer) + } + } + onBackPressedDispatcher.addCallback(onBackPressedCallback) + + binding.container.addDrawerListener(object : DrawerListener { + override fun onDrawerSlide(drawerView: View, slideOffset: Float) {} + + override fun onDrawerOpened(drawerView: View) { + onBackPressedCallback.isEnabled = true + } + + override fun onDrawerClosed(drawerView: View) { + onBackPressedCallback.isEnabled = false + } + + override fun onDrawerStateChanged(newState: Int) {} + }) + binding.navigationDrawer.setNavigationItemSelectedListener { when (it.itemId) { R.id.drawer_servers -> { startActivity(Intent(this, ServerChooserActivity::class.java)) } + R.id.drawer_cities -> { startActivity(Intent(this, FeedChooserActivity::class.java)) } @@ -88,11 +108,13 @@ when (permissionAsker) { is HomeFragment -> { showResults(ResultsActivity.Mode.MODE_LOCATION) } + is MapFragment -> { (permissionAsker as MapFragment).showLocation() } } } + else -> { // todo(ux,ui) dialog Toast.makeText(this, "No location access given", Toast.LENGTH_SHORT).show() @@ -101,18 +123,6 @@ } } } - @Suppress( - "OVERRIDE_DEPRECATION", - "DEPRECATION" - ) // fixme later https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher - override fun onBackPressed() { - if (binding.container.isDrawerOpen(binding.navigationDrawer)) { - binding.container.closeDrawer(binding.navigationDrawer) - } else { - super.onBackPressed() - } - } - fun onNavigationClicked() { if (binding.container.isDrawerOpen(binding.navigationDrawer)) { binding.container.closeDrawer(binding.navigationDrawer) @@ -131,11 +141,13 @@ when (fragment) { is HomeFragment -> { showResults(ResultsActivity.Mode.MODE_LOCATION) } + is MapFragment -> { fragment.showLocation() } } } + else -> { permissionAsker = fragment locationPermissionRequest.launch( @@ -148,21 +160,6 @@ } } } - fun onSuggestionClicked(queryable: QueryableV1) { - when (queryable) { - is StopV1 -> { - val intent = Intent(this, DeparturesActivity::class.java).apply { - putExtra("code", queryable.code) - putExtra("name", queryable.name) - } - startActivity(intent) - } - is Line -> { - TODO("[3.1] start line graph activity") - } - } - } - fun onSearchClicked(text: CharSequence?) { showResults(ResultsActivity.Mode.MODE_SEARCH, text.toString()) } @@ -188,12 +185,15 @@ when (f) { is HomeFragment -> { binding.bottomNavigation.menu[1].setIcon(R.drawable.home_black) } + is VoyageFragment -> { binding.bottomNavigation.menu[2].setIcon(R.drawable.voyage_black) } + is MapFragment -> { binding.bottomNavigation.menu[0].setIcon(R.drawable.map_black) } + else -> { binding.bottomNavigation.menu[1].setIcon(R.drawable.home_black) } diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeFragment.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeFragment.kt index 816339a9a11fdffc30fa1df3a6b2de20c054aefc..a945d9e2fb2bb306325e15874d424a612701b808 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeFragment.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeFragment.kt @@ -1,30 +1,34 @@ package xyz.apiote.bimba.czwek.dashboard.ui.home import android.content.Context +import android.content.Intent import android.net.ConnectivityManager import android.os.Bundle +import android.view.KeyEvent import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.FrameLayout +import android.widget.TextView +import androidx.activity.OnBackPressedCallback import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.mancj.materialsearchbar.MaterialSearchBar -import com.mancj.materialsearchbar.MaterialSearchBar.BUTTON_NAVIGATION -import xyz.apiote.bimba.czwek.api.QueryableV1 +import androidx.recyclerview.widget.LinearLayoutManager +import com.google.android.material.search.SearchView +import xyz.apiote.bimba.czwek.api.Line +import xyz.apiote.bimba.czwek.api.StopV1 import xyz.apiote.bimba.czwek.dashboard.MainActivity import xyz.apiote.bimba.czwek.databinding.FragmentHomeBinding -import xyz.apiote.bimba.czwek.search.BimbaSuggestionsAdapter - -// todo [3.1] search: https://github.com/material-components/material-components-android/blob/master/docs/components/Search.md +import xyz.apiote.bimba.czwek.departures.DeparturesActivity +import xyz.apiote.bimba.czwek.search.BimbaResultsAdapter class HomeFragment : Fragment() { private var _binding: FragmentHomeBinding? = null private val binding get() = _binding!! - private var lastSuggestions = listOf<QueryableV1>() + private lateinit var adapter: BimbaResultsAdapter override fun onCreateView( inflater: LayoutInflater, @@ -36,7 +40,7 @@ val homeViewModel = ViewModelProvider(this)[HomeViewModel::class.java] homeViewModel.queryables.observe(viewLifecycleOwner) { - binding.searchBar.updateLastSuggestions(it) + adapter.update(it) } val root = binding.root @@ -48,39 +52,67 @@ } WindowInsetsCompat.CONSUMED } - binding.searchBar.lastSuggestions = lastSuggestions - val cm = requireContext().getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager - binding.searchBar.addTextChangeListener( - homeViewModel.SearchBarWatcher(requireContext(), cm) - ) - binding.searchBar.setOnSearchActionListener(object : MaterialSearchBar.OnSearchActionListener { - override fun onButtonClicked(buttonCode: Int) { - when (buttonCode) { - BUTTON_NAVIGATION -> { - (context as MainActivity).onNavigationClicked() + val onBackPressedCallback = object : + OnBackPressedCallback(binding.searchView.currentTransitionState == SearchView.TransitionState.SHOWN) { + override fun handleOnBackPressed() { + binding.searchView.hide() + } + } + activity?.onBackPressedDispatcher?.addCallback(onBackPressedCallback) + binding.searchView.addTransitionListener { _, _, newState -> + onBackPressedCallback.isEnabled = when (newState) { + SearchView.TransitionState.SHOWN -> true + SearchView.TransitionState.HIDDEN -> false + else -> false + } + } + + binding.searchBar.setNavigationOnClickListener { + (context as MainActivity).onNavigationClicked() + } + binding.suggestionsRecycler.layoutManager = LinearLayoutManager(activity) + adapter = BimbaResultsAdapter(layoutInflater, activity, listOf()) { + when (it) { + is StopV1 -> { + val intent = Intent(activity, DeparturesActivity::class.java).apply { + putExtra("code", it.code) + putExtra("name", it.name) } + startActivity(intent) + } + + is Line -> { + TODO("[3.1] start line graph activity") } } + } + binding.suggestionsRecycler.adapter = adapter - override fun onSearchStateChanged(enabled: Boolean) { - } + val cm = requireContext().getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager + binding.searchView.editText.addTextChangedListener( + homeViewModel.SearchBarWatcher( + requireContext(), + cm + ) + ) + binding.searchView.editText.setOnKeyListener { v, keyCode, event -> + when (keyCode) { + KeyEvent.KEYCODE_ENTER -> { + if (event.action == KeyEvent.ACTION_UP) { + (context as MainActivity).onSearchClicked((v as TextView).text) + true + } else { + false + } + } - override fun onSearchConfirmed(text: CharSequence?) { - binding.searchBar.clearSuggestions() - (context as MainActivity).onSearchClicked(text) + else -> false } - }) - binding.searchBar.setCardViewElevation(0) - binding.searchBar.setCustomSuggestionAdapter(BimbaSuggestionsAdapter(layoutInflater, context) { - binding.searchBar.clearSuggestions() - (context as MainActivity).onSuggestionClicked(it) - }) + } binding.floatingActionButton.setOnClickListener { - binding.searchBar.clearSuggestions() (context as MainActivity).onGpsClicked(this) } - // todo [3.1] (ux,low) on searchbar focus && if != '' -> populate suggestions return binding.root } diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt index 443ebc8e2c12439df37017e014c15e9e8be758bb..e787df190a83d292dcc5616c2ad47d3d3f010b28 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/home/HomeViewModel.kt @@ -26,7 +26,7 @@ val queryables: LiveData> = mutableQueryables fun getQueryables(cm: ConnectivityManager, server: Server, query: String) { viewModelScope.launch { - val result = queryQueryables(cm, server, query, limit = 6) + val result = queryQueryables(cm, server, query, limit = 12) if (result.error != null) { // xxx intentionally no error showing in suggestions if (result.stream != null) { diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt b/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt index 81cc5bbe9e2f9f1759cfbb9c76c7c70a185049b4..0bbafad5fb4881f1844e67c1235381172636e8cc 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/search/Results.kt @@ -8,7 +8,6 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.mancj.materialsearchbar.adapter.SuggestionsAdapter import xyz.apiote.bimba.czwek.R import xyz.apiote.bimba.czwek.api.Line import xyz.apiote.bimba.czwek.api.QueryableV1 @@ -112,22 +111,5 @@ @SuppressLint("NotifyDataSetChanged") // todo [3.1] DiffUtil fun update(queryables: List<QueryableV1>) { this.queryables = queryables notifyDataSetChanged() - } -} - -class BimbaSuggestionsAdapter( - inflater: LayoutInflater, - private val context: Context?, - private val onClickListener: ((QueryableV1) -> Unit) -) : - SuggestionsAdapter<QueryableV1, BimbaViewHolder>(inflater), Adapter { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BimbaViewHolder { - return createViewHolder(layoutInflater, R.layout.suggestion, parent) - } - - override fun getSingleViewHeight(): Int = 72 - - override fun onBindSuggestionHolder(queryable: QueryableV1, holder: BimbaViewHolder?, pos: Int) { - bindSuggestionHolder(queryable, holder, context, onClickListener) } } \ No newline at end of file diff --git a/app/src/main/res/drawable/menu.xml b/app/src/main/res/drawable/menu.xml new file mode 100644 index 0000000000000000000000000000000000000000..280437da21f84c3375d9439288a62f3b6fe69729 --- /dev/null +++ b/app/src/main/res/drawable/menu.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="?attr/colorOnSurface" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/> +</vector> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 6ace86db683233a7d0443fe2e126f2cb19cbe25b..1897809f4f065b72823e7082a3c31f7fb796f2ed 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tool="http://schemas.android.com/tools" android:layout_width="match_parent" @@ -7,46 +7,71 @@ android:layout_height="match_parent" android:tag="@string/title_home" tool:context="xyz.apiote.bimba.czwek.dashboard.ui.home.HomeFragment"> - <com.mancj.materialsearchbar.MaterialSearchBar - android:id="@+id/search_bar" - style="@style/Theme.Bimba.SearchBar" + <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="8dp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:mt_hint="" - app:mt_navIconEnabled="true" - app:mt_placeholder="@string/search_placeholder" - app:mt_roundedSearchBarEnabled="true" /> + android:layout_height="wrap_content"> + + <com.google.android.material.search.SearchBar + android:id="@+id/search_bar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:contentDescription="@string/search_placeholder" + android:hint="@string/search_placeholder" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:navigationIcon="@drawable/menu" + app:useDrawerArrowDrawable="true" + tool:ignore="ContentDescription" /> + </com.google.android.material.appbar.AppBarLayout> + + <com.google.android.material.search.SearchView + android:id="@+id/search_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:hint="@string/search_placeholder" + app:layout_anchor="@id/search_bar"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/suggestions_recycler" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> + </com.google.android.material.search.SearchView> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <ImageView + android:id="@+id/inari" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginStart="16dp" + android:layout_marginTop="64dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="16dp" + android:alpha="0.25" + android:src="@drawable/inari" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tool:ignore="ContentDescription" /> + + </androidx.constraintlayout.widget.ConstraintLayout> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/floating_action_button" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_gravity="bottom|end" android:layout_margin="16dp" android:contentDescription="@string/home_fab_description" android:src="@drawable/gps_black" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /> - - <ImageView - android:id="@+id/inari" - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_marginStart="16dp" - android:layout_marginTop="16dp" - android:layout_marginEnd="16dp" - android:layout_marginBottom="16dp" - android:alpha="0.25" - android:src="@drawable/inari" - app:layout_constraintBottom_toTopOf="@+id/floating_action_button" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/search_bar" - tool:ignore="ContentDescription" /> - -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file +</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/suggestion.xml b/app/src/main/res/layout/suggestion.xml deleted file mode 100644 index 1d681d33fae944bf52f8243a589aab9b1aefdcce..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/suggestion.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tool="http://schemas.android.com/tools" - android:id="@+id/suggestion" - android:layout_width="match_parent" - android:layout_height="72dp"> - - <ImageView - android:id="@+id/suggestion_image" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:layout_marginBottom="8dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - tool:ignore="ContentDescription" /> - - <com.google.android.material.textview.MaterialTextView - android:id="@+id/suggestion_title" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="8dp" - android:text="" - android:textAppearance="@style/Theme.Bimba.SearchResult.Title" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toEndOf="@+id/suggestion_image" - app:layout_constraintTop_toTopOf="parent" /> - - <com.google.android.material.textview.MaterialTextView - android:id="@+id/suggestion_description" - style="@style/Theme.Bimba.SearchResult.Description" - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_marginEnd="8dp" - android:ellipsize="end" - android:maxLines="4" - android:text="" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="@+id/suggestion_title" - app:layout_constraintTop_toBottomOf="@+id/suggestion_title" /> - -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index dc24f789c068396350617f6166ef162d6478a0bc..bc797d1c790a9c8b4aa51b453030446c50ec0292 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -39,18 +39,6 @@
<attr name="lightStatusBar" format="boolean" /> </declare-styleable> - <style name="Theme.Bimba.SearchBar" parent="MaterialSearchBarLight"> - <item name="mt_searchBarColor">@color/md_theme_light_surfaceVariant</item> - <item name="mt_textColor">@color/md_theme_light_onSurfaceVariant</item> - <item name="mt_placeholderColor">@color/md_theme_light_onSurfaceVariant - </item> <!-- todo(ui) grey out --> - <item name="mt_backIconTint">@color/md_theme_light_onSurfaceVariant</item> - <item name="mt_navIconTint">@color/md_theme_light_onSurfaceVariant</item> - <item name="mt_searchIconTint">@color/md_theme_light_onSurfaceVariant</item> - <item name="mt_menuIconTint">@color/md_theme_light_onSurfaceVariant</item> - <item name="mt_clearIconTint">@color/md_theme_light_onSurfaceVariant</item> - </style> - <style name="Theme.Bimba.SearchResult.Title" parent="Theme.Bimba"> <item name="android:textColor">@color/md_theme_light_onSurfaceVariant</item> <item name="android:textSize">16sp</item> diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 64131505cc055ae8432e5e6f350e280e352cd614..0046dd5dedb33232082fc69a08344bdf33bf86af 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -39,24 +39,14 @@ <attr name="lightStatusBar" format="boolean" /> </declare-styleable> - <style name="Theme.Bimba.SearchBar" parent="MaterialSearchBarLight"> - <item name="mt_searchBarColor">@color/md_theme_dark_surfaceVariant</item> - <item name="mt_textColor">@color/md_theme_dark_onSurfaceVariant</item> - <item name="mt_placeholderColor">@color/md_theme_dark_onSurfaceVariant</item> <!-- todo(ui) grey out --> - <item name="mt_backIconTint">@color/md_theme_dark_onSurfaceVariant</item> - <item name="mt_navIconTint">@color/md_theme_dark_onSurfaceVariant</item> - <item name="mt_searchIconTint">@color/md_theme_dark_onSurfaceVariant</item> - <item name="mt_menuIconTint">@color/md_theme_dark_onSurfaceVariant</item> - <item name="mt_clearIconTint">@color/md_theme_dark_onSurfaceVariant</item> - </style> - <style name="Theme.Bimba.SearchResult.Title" parent="Theme.Bimba"> <item name="android:textColor">@color/md_theme_dark_onSurfaceVariant</item> <item name="android:textSize">16sp</item> </style> <style name="Theme.Bimba.SearchResult.Description" parent="Theme.Bimba"> - <item name="android:textColor">@color/md_theme_dark_onSurfaceVariant</item> <!-- todo(ui) grey out --> + <item name="android:textColor">@color/md_theme_dark_onSurfaceVariant + </item> <!-- todo(ui) grey out --> <item name="android:textSize">9sp</item> </style> </resources> \ No newline at end of file diff --git a/app/src/main/res/values-night-v31/themes.xml b/app/src/main/res/values-night-v31/themes.xml index 380366918a7f79c50f17ef7209a60b9909af3747..654d4f18cd156cbe5fd60f4fac011c85e0ec53c8 100644 --- a/app/src/main/res/values-night-v31/themes.xml +++ b/app/src/main/res/values-night-v31/themes.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> + <style name="Theme.Bimba" parent="Theme.Material3.Dark.NoActionBar"> <item name="android:fontFamily">@font/yellowcircle8</item> <item name="colorPrimary">@android:color/system_accent1_300</item> @@ -42,24 +43,14 @@ <attr name="lightStatusBar" format="boolean" /> </declare-styleable> - <style name="Theme.Bimba.SearchBar" parent="MaterialSearchBarLight"> - <item name="mt_searchBarColor">@android:color/system_neutral2_600</item> - <item name="mt_textColor">@android:color/system_neutral2_100</item> - <item name="mt_placeholderColor">@android:color/system_neutral2_100</item> <!-- todo(ui) grey out --> - <item name="mt_backIconTint">@android:color/system_neutral2_100</item> - <item name="mt_navIconTint">@android:color/system_neutral2_100</item> - <item name="mt_searchIconTint">@android:color/system_neutral2_100</item> - <item name="mt_menuIconTint">@android:color/system_neutral2_100</item> - <item name="mt_clearIconTint">@android:color/system_neutral2_100</item> - </style> - <style name="Theme.Bimba.SearchResult.Title" parent="Theme.Bimba"> <item name="android:textColor">@android:color/system_neutral2_100</item> <item name="android:textSize">16sp</item> </style> <style name="Theme.Bimba.SearchResult.Description" parent="Theme.Bimba"> - <item name="android:textColor">@android:color/system_neutral2_100</item> <!-- todo(ui) grey out --> + <item name="android:textColor">@android:color/system_neutral2_100 + </item> <!-- todo(ui) grey out --> <item name="android:textSize">9sp</item> </style> </resources> \ No newline at end of file diff --git a/app/src/main/res/values-v31/themes.xml b/app/src/main/res/values-v31/themes.xml index 8407d13464594bea8dcd026c209a63136d51283f..5676ddc5483befb9cda766fd59ff7af6c3023f62 100644 --- a/app/src/main/res/values-v31/themes.xml +++ b/app/src/main/res/values-v31/themes.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> + <style name="Theme.Bimba" parent="Theme.Material3.Light.NoActionBar"> <item name="android:fontFamily">@font/yellowcircle8</item> <item name="colorPrimary">@android:color/system_accent1_600</item> @@ -36,18 +37,6 @@ - @android:color/transparent
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:enforceStatusBarContrast">false</item> <item name="lightStatusBar">true</item> - </style> - - <style name="Theme.Bimba.SearchBar" parent="MaterialSearchBarLight"> - <item name="mt_searchBarColor">@android:color/system_neutral2_100</item> - <item name="mt_textColor">@android:color/system_neutral2_700</item> - <item name="mt_placeholderColor">@android:color/system_neutral2_700 - </item> <!-- todo(ui) grey out --> - <item name="mt_backIconTint">@android:color/system_neutral2_700</item> - <item name="mt_navIconTint">@android:color/system_neutral2_700</item> - <item name="mt_searchIconTint">@android:color/system_neutral2_700</item> - <item name="mt_menuIconTint">@android:color/system_neutral2_700</item> - <item name="mt_clearIconTint">@android:color/system_neutral2_700</item> </style> <style name="Theme.Bimba.SearchResult.Title" parent="Theme.Bimba">