diff --git a/app/build.gradle b/app/build.gradle index 2944804d3b..e4c5317f39 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2208 - versionName "0.22.8" + versionCode 2209 + versionName "0.22.9" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt index 1eb4515e97..ee713c4d8c 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/community/ServicesFragment.kt @@ -50,11 +50,19 @@ class ServicesFragment : BaseTeamFragment() { if (links?.size == 0) { fragmentServicesBinding.llServices.visibility = View.GONE + fragmentServicesBinding.tvNoLinks.visibility = View.VISIBLE + } else { + fragmentServicesBinding.llServices.visibility = View.VISIBLE } val description = team?.description ?: "" - fragmentServicesBinding.llServices.visibility = View.VISIBLE - fragmentServicesBinding.tvDescription.visibility = View.VISIBLE + if (description.isEmpty()) { + fragmentServicesBinding.tvDescription.visibility = View.GONE + fragmentServicesBinding.tvNoDescription.visibility = View.VISIBLE + } else { + fragmentServicesBinding.tvDescription.visibility = View.VISIBLE + fragmentServicesBinding.tvNoDescription.visibility = View.GONE + } val markdownContentWithLocalPaths = CourseStepFragment.prependBaseUrlToImages(description, "file://${MainApplication.context.getExternalFilesDir(null)}/ole/") setMarkdownText(fragmentServicesBinding.tvDescription, markdownContentWithLocalPaths) setRecyclerView(links) @@ -75,25 +83,27 @@ class ServicesFragment : BaseTeamFragment() { private fun setRecyclerView(links: RealmResults?) { fragmentServicesBinding.llServices.removeAllViews() - links?.forEach { team -> - val b: TextView = LayoutInflater.from(activity).inflate(R.layout.button_single, fragmentServicesBinding.llServices, false) as TextView - b.setPadding(8, 8, 8, 8) - b.text = team.title - b.setOnClickListener { - val route = team.route?.split("/") - if (route != null) { - if (route.size >= 3) { - val f = TeamDetailFragment() - val c = Bundle() - val teamObject = mRealm.where(RealmMyTeam::class.java)?.equalTo("_id", route[3])?.findFirst() - c.putString("id", route[3]) - teamObject?.isMyTeam(user?.id, mRealm)?.let { it1 -> c.putBoolean("isMyTeam", it1) } - f.arguments = c - (context as OnHomeItemClickListener).openCallFragment(f) + if (links != null) { + links.forEach { team -> + val b: TextView = LayoutInflater.from(activity).inflate(R.layout.button_single, fragmentServicesBinding.llServices, false) as TextView + b.setPadding(8, 8, 8, 8) + b.text = team.title + b.setOnClickListener { + val route = team.route?.split("/") + if (route != null) { + if (route.size >= 3) { + val f = TeamDetailFragment() + val c = Bundle() + val teamObject = mRealm.where(RealmMyTeam::class.java)?.equalTo("_id", route[3])?.findFirst() + c.putString("id", route[3]) + teamObject?.isMyTeam(user?.id, mRealm)?.let { it1 -> c.putBoolean("isMyTeam", it1) } + f.arguments = c + (context as OnHomeItemClickListener).openCallFragment(f) + } } } + fragmentServicesBinding.llServices.addView(b) } - fragmentServicesBinding.llServices.addView(b) } } } diff --git a/app/src/main/res/layout/button_single.xml b/app/src/main/res/layout/button_single.xml index 423410903a..5064753145 100644 --- a/app/src/main/res/layout/button_single.xml +++ b/app/src/main/res/layout/button_single.xml @@ -6,7 +6,6 @@ android:background="@drawable/border" android:orientation="vertical" android:padding="@dimen/padding_large" - android:textColor="@color/md_black_1000" + android:textColor="@color/daynight_textColor" android:textSize="18sp"> - - \ No newline at end of file + diff --git a/app/src/main/res/layout/fragment_services.xml b/app/src/main/res/layout/fragment_services.xml index 373a7cd6fb..57b4d1d7e4 100644 --- a/app/src/main/res/layout/fragment_services.xml +++ b/app/src/main/res/layout/fragment_services.xml @@ -8,29 +8,63 @@ + android:layout_height="match_parent"> + android:layout_height="match_parent"> + + + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvNoLinks"/> @@ -39,6 +73,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" - android:padding="16dp" + android:layout_margin="16dp" android:src="@drawable/ic_add" />