Add translations for three dot menu

And adjust variable names
This commit is contained in:
Finn M Glas 2020-05-30 00:58:33 +02:00
parent f40cee392e
commit 2399f35cc1
No known key found for this signature in database
GPG key ID: 25037A2E81AB459C
6 changed files with 19 additions and 10 deletions

View file

@ -27,7 +27,7 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
View.OnClickListener {
var textView: TextView = itemView.findViewById(R.id.choose_row_app_name)
var img: ImageView = itemView.findViewById(R.id.choose_row_app_icon) as ImageView
var delete: FontAwesome = itemView.findViewById(R.id.choose_row_app_delete)
var menuDots: FontAwesome = itemView.findViewById(R.id.choose_row_app_menu)
override fun onClick(v: View) {
val pos = adapterPosition
@ -62,9 +62,9 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
viewHolder.textView.text = appLabel
viewHolder.img.setImageDrawable(appIcon)
viewHolder.delete.setOnClickListener{ //creating a popup menu
viewHolder.menuDots.setOnClickListener{ //creating a popup menu
val popup = PopupMenu(activity, viewHolder.delete)
val popup = PopupMenu(activity, viewHolder.menuDots)
popup.inflate(R.menu.menu_app)
popup.setOnMenuItemClickListener {
@ -88,7 +88,7 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
popup.show()
}
viewHolder.delete.visibility = if(isSystemApp || action == "pick") View.INVISIBLE else View.VISIBLE
viewHolder.menuDots.visibility = if(isSystemApp || action == "pick") View.INVISIBLE else View.VISIBLE
}
override fun getItemCount(): Int { return appsList.size }

View file

@ -27,12 +27,12 @@
android:text=""
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/choose_row_app_delete"
app:layout_constraintEnd_toStartOf="@+id/choose_row_app_menu"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.extern.FontAwesome
android:id="@+id/choose_row_app_delete"
android:id="@+id/choose_row_app_menu"
android:layout_width="20sp"
android:layout_height="wrap_content"
android:gravity="center"

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/app_menu_delete"
android:title="Delete" />
android:title="@string/app_menu_delete_text" />
<item android:id="@+id/app_menu_info"
android:title="Info" />
android:title="@string/app_menu_info_text" />
</menu>

View file

@ -23,8 +23,11 @@
<string name="settings_choose_vol_down">Lautstärke -</string>
<string name="settings_choose_double_click">Doppelklick</string>
<string name="settings_choose_long_click">Langer Klick</string>
<string name="settings_choose_btn">App wählen</string>
<string name="app_menu_delete_text">Deinstallieren</string>
<string name="app_menu_info_text">App Info</string>
<string name="settings_select_launcher">Launcher wählen</string>
<string name="settings_reset">Zurücksetzen</string>
<string name="settings_reset_message">All deine Einstellungen gehen verloren. Weitermachen?</string>

View file

@ -23,8 +23,11 @@
<string name="settings_choose_vol_down">Baisser volume</string>
<string name="settings_choose_double_click">Double clic</string>
<string name="settings_choose_long_click">Clic long</string>
<string name="settings_choose_btn">Choisir App</string>
<string name="app_menu_delete_text">Désinstaller</string>
<string name="app_menu_info_text">Informations</string>
<string name="settings_select_launcher">Choisir Launcher</string>
<string name="settings_reset">Réinitialiser</string>
<string name="settings_reset_message">Vous allez supprimer toutes vos préférences. Continuer?</string>

View file

@ -33,6 +33,9 @@
<string name="settings_choose_long_click">Long Click</string>
<string name="settings_choose_btn">Choose App</string>
<string name="app_menu_delete_text">Uninstall</string>
<string name="app_menu_info_text">App Info</string>
<string name="settings_select_launcher">Select Launcher</string>
<string name="settings_reset">Reset Settings</string>
<string name="settings_reset_message">You are going to discard all your preferences. Continue?</string>