From 36f9a51bc0dc27abc35007f2c1a292bb61f36b6e Mon Sep 17 00:00:00 2001 From: rlam20 <52076121+rlam20@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:04:58 -0400 Subject: [PATCH] actions: less warnings is more (fixes #3699) (#3703) Co-authored-by: Gideon Okuro Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../myplanet/ui/team/MyTeamsDetailFragment.kt | 14 +++++++++----- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-ne/strings.xml | 1 + app/src/main/res/values-so/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 39c736ec40..15a602428d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1647 - versionName "0.16.47" + versionCode 1648 + versionName "0.16.48" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/team/MyTeamsDetailFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/team/MyTeamsDetailFragment.kt index 2fbc315fb3..593171b39b 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/team/MyTeamsDetailFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/team/MyTeamsDetailFragment.kt @@ -1,6 +1,7 @@ package org.ole.planet.myplanet.ui.team import android.content.DialogInterface +import android.os.Build import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -10,6 +11,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.ListView import android.widget.TextView +import androidx.annotation.RequiresApi import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment import androidx.recyclerview.widget.LinearLayoutManager @@ -43,6 +45,7 @@ import org.ole.planet.myplanet.utilities.Utilities import java.util.Date import java.util.UUID +@RequiresApi(Build.VERSION_CODES.O) class MyTeamsDetailFragment : BaseNewsFragment() { private lateinit var fragmentMyTeamsDetailBinding: FragmentMyTeamsDetailBinding lateinit var tvDescription: TextView @@ -50,7 +53,7 @@ class MyTeamsDetailFragment : BaseNewsFragment() { var teamId: String? = null var team: RealmMyTeam? = null lateinit var listContent: ListView - lateinit var tabLayout: TabLayout + private lateinit var tabLayout: TabLayout lateinit var dbService: DatabaseService private lateinit var rvDiscussion: RecyclerView lateinit var llRv: LinearLayout @@ -113,7 +116,7 @@ class MyTeamsDetailFragment : BaseNewsFragment() { map["messageType"] = team?.teamType!! map["messagePlanetCode"] = team?.teamPlanetCode!! createNews(map, mRealm, user, imageList) - rvDiscussion.adapter?.notifyDataSetChanged() + rvDiscussion.adapter?.notifyItemInserted(0) }.setNegativeButton(R.string.cancel, null).show() } @@ -233,14 +236,15 @@ class MyTeamsDetailFragment : BaseNewsFragment() { llRv.visibility = View.GONE tab.setText(s) listContent.adapter = object : ArrayAdapter(requireActivity(), android.R.layout.simple_list_item_1, data) { - override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { - var convertView = convertView + override fun getView(position: Int, viewConverted: View?, parent: ViewGroup): View { + var convertView = viewConverted if (convertView == null) { convertView = LayoutInflater.from(activity) .inflate(android.R.layout.simple_list_item_1, parent, false) } val tv = convertView!!.findViewById(android.R.id.text1) - tv.text = getItem(position)?.name + " (" + getVisitCount(mRealm, getItem(position)?.name, teamId) + getString(R.string.visits) + ")" + val formattedText = getString(R.string.visit_count, getItem(position)?.name ?: "", getVisitCount(mRealm, getItem(position)?.name, teamId), getString(R.string.visits)) + tv.text = formattedText return convertView } } diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 8ba1172472..2a813cee63 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -1046,6 +1046,7 @@ جارٍ فحص الخادم إصدار Apk أقل من المسموح. يرجى تحديث التطبيق إلى أحدث إصدار. إضافة ملاحظة (اختياري) + %s (%d %s) الفرق غير متوفرة كوكب %s التقديمات غير متاحة diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e113de955d..fabf3b6219 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -1046,6 +1046,7 @@ verificando el servidor la versión de la aplicación está por debajo de la permitida. Actualice la aplicación a la última versión. Agregar una nota (opcional) + %s (%d %s) equipos no disponibles %s Planeta envíos no disponibles diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 44c2fe74f3..1dbbcabaec 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1046,6 +1046,7 @@ vérification du serveur la version de l\'app est inférieure à celle autorisée. veuillez mettre à jour l\'application vers la dernière version. Ajouter une note (optionnel) + %s (%d %s) équipes non disponibles %s planète soumissions non disponibles diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 4afa29909d..f71b84ba06 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -1046,6 +1046,7 @@ सर्भर जाँच गर्दै एप संस्करण अनुमत संस्करणभन्दा कम छ। कृपया अनुप्रयोगलाई नवीनतम संस्करणमा अद्यावधिक गर्नुहोस्। नोट थप्नुहोस् (वैकल्पिक) + %s (%d %s) टोलीहरू उपलब्ध छैनन् %s ग्रह पेशाहरू उपलब्ध छैनन् diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index 5a31b31005..d682020cd4 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -1046,6 +1046,7 @@ hubinta server-ka nooca app-ga waa ka hooseeyaa kan la oggol yahay. fadlan cusbooneysii app-ka nooca ugu dambeeya. Ku dar falanqeey (ixtiyaacsi ah) + %s (%d %s) kooxaha aan la heli karin %s Meerah soo gudbin lama heli karo diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7844aec845..f2db6b44ee 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1046,6 +1046,7 @@ checking server app is below allowed version. please update the app to the latest version. add a note (optional) + %s (%d %s) teams not available %s\'s Planet submissions not available