Make sure it also looks good

- Adjust colors / themes
- Adjust layout
- Expand it
This commit is contained in:
Finn M Glas 2020-06-21 21:22:59 +02:00
parent 02ae80be68
commit 53462d654b
No known key found for this signature in database
GPG key ID: 902A30146014DFBF
4 changed files with 32 additions and 20 deletions

View file

@ -176,7 +176,7 @@ class AppsRecyclerAdapter(val activity: Activity,
// Launch apps automatically if only one result is found
// TODO: Add option to disable this
if (appsListDisplayed.size == 1) {
if (appsListDisplayed.size == 1 && intention == "view") {
launch(appsListDisplayed[0].packageName.toString(), activity)
val inputMethodManager = activity.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager

View file

@ -1,12 +1,9 @@
package com.finnmglas.launcher.list.apps
import android.graphics.Color
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.SearchView
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.finnmglas.launcher.R
@ -38,10 +35,8 @@ class ListFragmentApps : Fragment(), UIObject {
override fun applyTheme() {
list_apps_container.setBackgroundColor(dominantColor)
val id: Int = list_apps_searchview.context.resources
.getIdentifier("android:id/search_src_text", null, null)
list_apps_searchview.findViewById<TextView>(id).setTextColor(Color.WHITE)
list_apps_searchview.setBackgroundColor(dominantColor)
list_apps_searchbar.setBackgroundColor(dominantColor)
}
override fun setOnClicks() { }
@ -58,7 +53,8 @@ class ListFragmentApps : Fragment(), UIObject {
adapter = appsRViewAdapter
}
list_apps_searchview.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
list_apps_searchview.setOnQueryTextListener(object :
androidx.appcompat.widget.SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String): Boolean {
appsRViewAdapter.filter(query);

View file

@ -7,27 +7,39 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/list_apps_searchbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.SearchView
android:id="@+id/list_apps_searchview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8sp"
android:iconifiedByDefault="false"
app:iconifiedByDefault="false"
app:queryHint="Search Applications"
app:searchHintIcon="@android:drawable/ic_menu_search"
app:searchIcon="@android:drawable/ic_menu_search" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_apps_rview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<SearchView
android:id="@+id/list_apps_searchview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@id/list_apps_searchbar" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -6,9 +6,13 @@
<item name="colorPrimaryDark">@color/finnmglasTheme_background_color</item>
<item name="android:colorBackground">@color/finnmglasTheme_background_color</item>
<item name="colorAccent">@color/finnmglasTheme_accent_color</item>
<item name="colorAccent">#888</item>
<item name="android:textColor">@color/finnmglasTheme_text_color</item>
<item name="android:textColorSecondary">@color/finnmglasTheme_text_color</item>
<item name="android:textColorPrimary">@color/finnmglasTheme_text_color</item>
<item name="android:textColorHint">#555</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
<item name="colorButtonNormal">@color/finnmglasTheme_accent_color</item>