Skip to content

Commit

Permalink
feat: add see more to revisions view (#779)
Browse files Browse the repository at this point in the history
Fixes  ooni/probe#2756 (comment)

## Proposed Changes

  - Add see more button when revisions are more than 5

|.|.|.|
|-|-|-|
|
![Screenshot_20240712_140730](https://github.com/user-attachments/assets/225d7a72-0a6c-4d57-b076-cbddffedfb4b)
|
![Screenshot_20240712_140840](https://github.com/user-attachments/assets/1db3d447-c9f2-4cf4-b179-50a09cac9fd5)
|
![Screenshot_20240712_140851](https://github.com/user-attachments/assets/3a29df1f-508d-4354-90bb-9434c9682510)
|
  • Loading branch information
aanorbel authored Jul 15, 2024
1 parent d7c9ab5 commit 9b59c20
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ class RevisionsFragment : Fragment() {
})
}
}
if ((revisions?.revisions?.size ?: 0) > 5) {
binding.seeMore.apply {
visibility = View.VISIBLE
setOnClickListener {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(
"%s/revisions/%s".format(
BuildConfig.OONI_RUN_DASHBOARD_URL,
runId
)
)
)
)
}
}
}

return binding.root
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/fragment_revisions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,14 @@
android:layout_height="match_parent"
app:layoutManager="LinearLayoutManager"
tools:listitem="@layout/item_text" />

<TextView
android:id="@+id/see_more"
style="?attr/textAppearanceBody2"
android:visibility="gone"
android:text="See More"
android:textColor="@color/color_blue6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/item_padding_small"/>
</LinearLayout>

0 comments on commit 9b59c20

Please sign in to comment.