Skip to content

Commit

Permalink
feat: limit number of revisions displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Jul 5, 2024
1 parent 8a66124 commit f3b944f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ android {
testInstrumentationRunner "org.openobservatory.ooniprobe.TestAndroidJUnitRunner"
buildConfigField 'String', 'OONI_API_BASE_URL', '"https://api.ooni.io/"'
buildConfigField 'String', 'NOTIFICATION_SERVER', '"https://countly.ooni.io"'
buildConfigField 'String', 'OONI_RUN_DASHBOARD_URL', '"https://run.test.ooni.org"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe'
resValue "string", "APP_NAME", "OONI Probe"
buildConfigField 'String', 'SOFTWARE_NAME', 'BASE_SOFTWARE_NAME+IS_DEBUG'
Expand Down Expand Up @@ -51,7 +52,8 @@ android {
stable {
dimension 'testing'
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android"'
buildConfigField 'String', 'OONI_API_BASE_URL', '"https://api.dev.ooni.io"'
buildConfigField 'String', 'OONI_API_BASE_URL', '"https://api.prod.ooni.io/"'
buildConfigField 'String', 'OONI_RUN_DASHBOARD_URL', '"https://run-v2.ooni.org"'
}
dev {
dimension 'testing'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.gson.Gson
import org.openobservatory.engine.OONIRunRevisions
import org.openobservatory.ooniprobe.BuildConfig
import org.openobservatory.ooniprobe.R
import org.openobservatory.ooniprobe.databinding.FragmentRevisionsBinding
import org.openobservatory.ooniprobe.databinding.ItemTextBinding
Expand Down Expand Up @@ -63,14 +64,15 @@ class RevisionsFragment : Fragment() {

with(binding.list) {
layoutManager = LinearLayoutManager(context)
adapter = revisions?.revisions?.let {
adapter = revisions?.revisions?.take(5)?.let {
RevisionsRecyclerViewAdapter(it, object : OnItemClickListener {
override fun onItemClick(position: Int) {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(
"https://run.test.ooni.org/revisions/%s?revision=%s".format(
"%s/revisions/%s?revision=%s".format(
BuildConfig.OONI_RUN_DASHBOARD_URL,
runId,
it[position]
)
Expand Down

0 comments on commit f3b944f

Please sign in to comment.