From b7b0f07ba8465f1779b22bee9bdf87f51996e3fe Mon Sep 17 00:00:00 2001 From: lynxnb Date: Mon, 11 Oct 2021 17:33:48 +0200 Subject: [PATCH] Update application branding - Logo is now displayed next to the app name - Remove search bar animation - New color accent - Improve visibility of controller binding setting's glyphs --- app/src/main/java/emu/skyline/MainActivity.kt | 4 - .../main/java/emu/skyline/MainViewModel.kt | 2 - .../java/emu/skyline/views/SearchBarView.kt | 14 --- app/src/main/res/layout/button_dialog.xml | 6 +- app/src/main/res/layout/main_activity.xml | 30 ++++-- app/src/main/res/layout/stick_dialog.xml | 8 +- app/src/main/res/layout/view_search_bar.xml | 22 ++--- app/src/main/res/values-night/colors.xml | 1 + app/src/main/res/values/colors.xml | 2 +- ..._search_bar_xml_constraintlayout_scene.xml | 92 ------------------- 10 files changed, 37 insertions(+), 144 deletions(-) delete mode 100644 app/src/main/res/xml/view_search_bar_xml_constraintlayout_scene.xml diff --git a/app/src/main/java/emu/skyline/MainActivity.kt b/app/src/main/java/emu/skyline/MainActivity.kt index f0f48cfb..18f83ee7 100644 --- a/app/src/main/java/emu/skyline/MainActivity.kt +++ b/app/src/main/java/emu/skyline/MainActivity.kt @@ -145,10 +145,6 @@ class MainActivity : AppCompatActivity() { addTextChangedListener(afterTextChanged = { editable -> editable?.let { text -> adapter.filter.filter(text.toString()) } }) - if (!viewModel.searchBarAnimated) { - viewModel.searchBarAnimated = true - post { startTitleAnimation() } - } } window.decorView.findViewById(android.R.id.content).viewTreeObserver.addOnTouchModeChangeListener { isInTouchMode -> diff --git a/app/src/main/java/emu/skyline/MainViewModel.kt b/app/src/main/java/emu/skyline/MainViewModel.kt index 985dc7d8..691c0598 100644 --- a/app/src/main/java/emu/skyline/MainViewModel.kt +++ b/app/src/main/java/emu/skyline/MainViewModel.kt @@ -36,8 +36,6 @@ class MainViewModel @Inject constructor(@ApplicationContext context : Context, p private val _stateData = MutableLiveData() val stateData : LiveData = _stateData - var searchBarAnimated = false - /** * This refreshes the contents of the adapter by either trying to load cached adapter data or searches for them to recreate a list * diff --git a/app/src/main/java/emu/skyline/views/SearchBarView.kt b/app/src/main/java/emu/skyline/views/SearchBarView.kt index 588c8cc5..788e88ae 100644 --- a/app/src/main/java/emu/skyline/views/SearchBarView.kt +++ b/app/src/main/java/emu/skyline/views/SearchBarView.kt @@ -20,20 +20,6 @@ class SearchBarView @JvmOverloads constructor(context : Context, attrs : Attribu get() = binding.searchField.text set(value) = binding.searchField.setText(value) - fun startTitleAnimation() { - binding.motionLayout.progress = 0f - binding.motionLayout.transitionToEnd() - binding.searchField.apply { - setOnFocusChangeListener { v, hasFocus -> - if (hasFocus) { - binding.motionLayout.progress = 1f - context.getSystemService(InputMethodManager::class.java).showSoftInput(v, InputMethodManager.SHOW_IMPLICIT) - onFocusChangeListener = null - } - } - } - } - fun addTextChangedListener( beforeTextChanged : ( text : CharSequence?, diff --git a/app/src/main/res/layout/button_dialog.xml b/app/src/main/res/layout/button_dialog.xml index 984bc26a..f7a387b8 100644 --- a/app/src/main/res/layout/button_dialog.xml +++ b/app/src/main/res/layout/button_dialog.xml @@ -1,6 +1,7 @@ + android:textSize="26sp" + tools:text="A" /> diff --git a/app/src/main/res/layout/main_activity.xml b/app/src/main/res/layout/main_activity.xml index b8834c37..119d9f27 100644 --- a/app/src/main/res/layout/main_activity.xml +++ b/app/src/main/res/layout/main_activity.xml @@ -77,31 +77,43 @@ app:tint="?android:attr/textColorSecondary" /> + + + app:srcCompat="@drawable/skyline_text" + app:tint="?android:attr/textColorPrimary" /> + android:textSize="26sp" + tools:text="R" /> diff --git a/app/src/main/res/layout/view_search_bar.xml b/app/src/main/res/layout/view_search_bar.xml index a365b995..f24e2d20 100644 --- a/app/src/main/res/layout/view_search_bar.xml +++ b/app/src/main/res/layout/view_search_bar.xml @@ -6,11 +6,10 @@ android:layout_height="wrap_content" tools:parentTag="com.google.android.material.card.MaterialCardView"> - @@ -19,13 +18,13 @@ android:layout_width="22dp" android:layout_height="22dp" android:layout_gravity="center_vertical" - android:layout_marginStart="16dp" android:contentDescription="@string/search" + app:srcCompat="@drawable/ic_search" + app:tint="?android:attr/textColorSecondary" + android:layout_marginStart="16dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:srcCompat="@drawable/ic_search" - app:tint="?android:attr/textColorSecondary" /> + app:layout_constraintTop_toTopOf="parent"/> - - - + \ 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 65d12df3..5d4e8f62 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -1,5 +1,6 @@ + #FF4285F4 #FF121212 #323232 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 0d5d55b4..3e238d9d 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,7 +1,7 @@ #121212 - #FFFF0000 + #FF1E58F0 @android:color/white #F8F8F8 diff --git a/app/src/main/res/xml/view_search_bar_xml_constraintlayout_scene.xml b/app/src/main/res/xml/view_search_bar_xml_constraintlayout_scene.xml deleted file mode 100644 index 9045703b..00000000 --- a/app/src/main/res/xml/view_search_bar_xml_constraintlayout_scene.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -