diff --git a/app/build.gradle b/app/build.gradle index 33178eea3d..beb39e5dab 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2196 - versionName "0.21.96" + versionCode 2199 + versionName "0.21.99" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.kt b/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.kt index c710a93d61..cfb3ceb2e3 100644 --- a/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.kt +++ b/app/src/main/java/org/ole/planet/myplanet/datamanager/Service.kt @@ -55,7 +55,6 @@ import kotlin.math.min class Service(private val context: Context) { private val preferences: SharedPreferences = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) private val retrofitInterface: ApiInterface? = ApiClient.client?.create(ApiInterface::class.java) - private val serviceScope = CoroutineScope(SupervisorJob() + Dispatchers.Main) fun healthAccess(listener: SuccessListener) { @@ -387,6 +386,8 @@ class Service(private val context: Context) { val id = firstRow.getAsJsonPrimitive("id").asString val doc = firstRow.getAsJsonObject("doc") val code = doc.getAsJsonPrimitive("code").asString + val parentCode = doc.getAsJsonPrimitive("parentCode").asString + preferences.edit().putString("parentCode", parentCode).apply() return@async UrlCheckResult.Success(id, code, currentUrl) } } diff --git a/app/src/main/java/org/ole/planet/myplanet/model/RealmUserModel.kt b/app/src/main/java/org/ole/planet/myplanet/model/RealmUserModel.kt index abba9b236d..68b3d432ef 100644 --- a/app/src/main/java/org/ole/planet/myplanet/model/RealmUserModel.kt +++ b/app/src/main/java/org/ole/planet/myplanet/model/RealmUserModel.kt @@ -224,9 +224,6 @@ open class RealmUserModel : RealmObject() { if (!TextUtils.isEmpty(JsonUtils.getString("planetCode", jsonDoc))) { settings.edit().putString("planetCode", JsonUtils.getString("planetCode", jsonDoc)).apply() } - if (!TextUtils.isEmpty(JsonUtils.getString("parentCode", jsonDoc))) { - settings.edit().putString("parentCode", JsonUtils.getString("parentCode", jsonDoc)).apply() - } val csvRow = arrayOf( user.userAdmin.toString(), diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/community/CommunityPagerAdapter.kt b/app/src/main/java/org/ole/planet/myplanet/ui/community/CommunityPagerAdapter.kt index 34ef687f7f..0d02040782 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/community/CommunityPagerAdapter.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/community/CommunityPagerAdapter.kt @@ -8,11 +8,12 @@ import org.ole.planet.myplanet.MainApplication.Companion.context import org.ole.planet.myplanet.R import org.ole.planet.myplanet.ui.enterprises.EnterpriseCalendarFragment import org.ole.planet.myplanet.ui.enterprises.FinanceFragment +import org.ole.planet.myplanet.ui.enterprises.ReportsFragment import org.ole.planet.myplanet.ui.news.NewsFragment class CommunityPagerAdapter(fm: FragmentActivity, private val id: String, private var fromLogin: Boolean) : FragmentStateAdapter(fm) { private var titles = arrayOf(context.getString(R.string.our_voices), context.getString(R.string.community_leaders), context.getString(R.string.calendar), context.getString( - R.string.services), context.getString(R.string.finances)) + R.string.services), context.getString(R.string.finances), context.getString(R.string.reports)) private var titlesLogin = arrayOf(context.getString(R.string.our_voices), context.getString(R.string.community_leaders), context.getString(R.string.calendar)) override fun createFragment(position: Int): Fragment { val fragment: Fragment = when (position) { @@ -22,14 +23,17 @@ class CommunityPagerAdapter(fm: FragmentActivity, private val id: String, privat 1 -> { LeadersFragment() } + 2 -> { + EnterpriseCalendarFragment() + } 3 -> { ServicesFragment() } - 2 -> { - EnterpriseCalendarFragment() + 4 -> { + FinanceFragment() } else -> { - FinanceFragment() + ReportsFragment() } } val b = Bundle() diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/team/BaseTeamFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/team/BaseTeamFragment.kt index cff58141dd..8abb70f247 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/team/BaseTeamFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/team/BaseTeamFragment.kt @@ -29,10 +29,12 @@ abstract class BaseTeamFragment : BaseNewsFragment() { mRealm.where(RealmMyTeam::class.java).equalTo("_id", teamId).findFirst() ?: throw IllegalArgumentException("Team not found for ID: $teamId") } catch (e: IllegalArgumentException) { + e.printStackTrace() try { mRealm.where(RealmMyTeam::class.java).equalTo("teamId", teamId).findFirst() ?: throw IllegalArgumentException("Team not found for ID: $teamId") } catch (e: IllegalArgumentException) { + e.printStackTrace() return } } diff --git a/app/src/main/res/layout/fragment_my_course.xml b/app/src/main/res/layout/fragment_my_course.xml index f241ee8f55..8462224d2c 100644 --- a/app/src/main/res/layout/fragment_my_course.xml +++ b/app/src/main/res/layout/fragment_my_course.xml @@ -102,11 +102,12 @@ @color/md_white_1000 - @color/colorPrimaryDark + @color/mainColor @color/colorPrimary diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 95facb8bd1..2a9313e6f1 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -94,7 +94,7 @@