Skip to content

Commit

Permalink
Merge pull request #598 from ooni/update/update-experimental-item-row…
Browse files Browse the repository at this point in the history
…-with-measurement-count

Updates experimental item in test results to include test count
  • Loading branch information
aanorbel authored Oct 13, 2023
2 parents 7072e5a + d576ef5 commit f952115
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public ExperimentalItem(Result extra, View.OnClickListener onClickListener, View
viewHolder.itemView.setOnClickListener(onClickListener);
viewHolder.itemView.setOnLongClickListener(onLongClickListener);
viewHolder.itemView.setBackgroundColor(ContextCompat.getColor(viewHolder.itemView.getContext(), extra.is_viewed ? android.R.color.transparent : R.color.color_yellow0));
viewHolder.binding.totalMeasurements.setText(String.format("%d measured", extra.countTotalMeasurements()));
viewHolder.binding.asnName.setText(Network.toString(viewHolder.binding.asnName.getContext(), extra.network));
viewHolder.binding.startTime.setText(DateFormat.format(DateFormat.getBestDateTimePattern(Locale.getDefault(), "yMdHm"), extra.start_time));
boolean allUploaded = true;
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/layout/item_experimental.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,19 @@
android:textColor="@color/color_gray7" />
</LinearLayout>

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_weight="2"
android:orientation="vertical">

<TextView
android:id="@+id/totalMeasurements"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/tab_test_results"
android:drawablePadding="8dp"
android:gravity="center_vertical"/>
</LinearLayout>
</LinearLayout>

0 comments on commit f952115

Please sign in to comment.