Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.os.LocaleListCompat
Expand Down Expand Up @@ -141,11 +142,14 @@ class LanguagePreferenceAdapter(

if (!isSelected) {
holder.selectedIcon.setImageDrawable(null)
} else {
holder.optionItem.setBackgroundResource(R.color.secondaryContainer)
}
}
}

class LanguagePreferenceViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val optionItem: LinearLayout = view.findViewById(R.id.option_language_item)
val localName: TextView = view.findViewById(R.id.option_local_name)
val translatedName: TextView = view.findViewById(R.id.option_translated_name)
val selectedIcon: ImageView = view.findViewById(R.id.icon_selected)
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/item_option_language.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/option_language_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
Expand Down Expand Up @@ -41,6 +43,5 @@
android:layout_height="fill_parent"
android:padding="5dp"
android:src="@drawable/ic_baseline_done_24"
app:tint="@color/colorWhite"
tools:tint="@color/colorAccent"/>
app:tint="@color/textColorPrimary" />
</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
<color name="textColorPrimary">@android:color/white</color>
<color name="textColorSecondary">@color/colorAccent</color>
<color name="backgroundColorPrimary">@color/background_material_dark</color>
<color name="secondaryContainer">#4A4458</color>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
<color name="textColorPrimary">@android:color/black</color>
<color name="textColorSecondary">@color/colorPrimary</color>
<color name="backgroundColorPrimary">@color/background_material_light</color>
<color name="secondaryContainer">#E8DEF8</color>
</resources>