Skip to content

Commit

Permalink
community: smoother reports (fixes #5008) (#5011)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Jan 14, 2025
1 parent 158d2af commit 6945416
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2198
versionName "0.21.98"
versionCode 2199
versionName "0.21.99"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 6945416

Please sign in to comment.