From b202ca4bacb82668b33a584499052a0396179419 Mon Sep 17 00:00:00 2001 From: Kaz Date: Wed, 26 Jun 2024 23:29:39 +0200 Subject: [PATCH 1/3] added copy button in RollCall QR Token fragment + tests --- .../ui/lao/event/rollcall/RollCallFragment.kt | 8 ++++- .../main/res/layout/roll_call_fragment.xml | 30 +++++++++++++++---- .../rollcall/RollCallFragmentPageObject.java | 4 +++ .../event/rollcall/RollCallFragmentTest.kt | 20 +++++++++++++ 4 files changed, 56 insertions(+), 6 deletions(-) diff --git a/fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/event/rollcall/RollCallFragment.kt b/fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/event/rollcall/RollCallFragment.kt index e23865a64f..1889a07c5b 100644 --- a/fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/event/rollcall/RollCallFragment.kt +++ b/fe2-android/app/src/main/java/com/github/dedis/popstellar/ui/lao/event/rollcall/RollCallFragment.kt @@ -30,6 +30,7 @@ import com.github.dedis.popstellar.utility.ActivityUtils.getQRCodeColor import com.github.dedis.popstellar.utility.ActivityUtils.handleExpandArrow import com.github.dedis.popstellar.utility.Constants.ID_NULL import com.github.dedis.popstellar.utility.Constants.ROLL_CALL_ID +import com.github.dedis.popstellar.utility.UIUtils import com.github.dedis.popstellar.utility.error.ErrorUtils.logAndShow import com.github.dedis.popstellar.utility.error.UnknownLaoException import com.github.dedis.popstellar.utility.error.UnknownRollCallException @@ -55,6 +56,8 @@ class RollCallFragment : AbstractEventFragment { private val deAnonymizationWarned = MutableLiveData(false) + private lateinit var clipboardManager: UIUtils.ClipboardUtil + constructor() override fun onCreateView( @@ -67,7 +70,7 @@ class RollCallFragment : AbstractEventFragment { laoViewModel = obtainViewModel(requireActivity()) rollCallViewModel = obtainRollCallViewModel(requireActivity(), laoViewModel.laoId) - + clipboardManager = UIUtils.ClipboardUtil(requireActivity()) rollCall = try { rollCallRepo.getRollCallWithPersistentId( @@ -147,6 +150,9 @@ class RollCallFragment : AbstractEventFragment { handleBackNav(TAG) + clipboardManager.setupCopyButton( + binding.rollCallPopTokenTextCopyButton, binding.rollCallPopTokenText, "PoP Token Hash") + return binding.root } diff --git a/fe2-android/app/src/main/res/layout/roll_call_fragment.xml b/fe2-android/app/src/main/res/layout/roll_call_fragment.xml index b6e6afe9a1..abe0cb3ecd 100644 --- a/fe2-android/app/src/main/res/layout/roll_call_fragment.xml +++ b/fe2-android/app/src/main/res/layout/roll_call_fragment.xml @@ -74,13 +74,33 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/roll_call_end_time" /> - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@id/roll_call_pk_qr_code"> + + + + + + Date: Wed, 26 Jun 2024 21:36:43 +0000 Subject: [PATCH 2/3] auto-format action fixes --- docs/messageData.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/messageData.md b/docs/messageData.md index 47b11c274d..a1be6f5d58 100644 --- a/docs/messageData.md +++ b/docs/messageData.md @@ -3364,6 +3364,7 @@ This message is sent by both organizers to their servers to be broadcast. The me ```json5 // ../protocol/examples/messageData/federation_tokens_exchange/federation_tokens_exchange.json + { "object": "federation", "action": "tokens_exchange", @@ -3372,11 +3373,13 @@ This message is sent by both organizers to their servers to be broadcast. The me "tokens": ["M5ZychEi5rwm22FjwjNuljL1qMJWD2sE7oX9fcHNMDU="], "timestamp": 1712854874 } + ``` ```json5 // ../protocol/query/method/message/data/dataFederationTokensExchange.json + { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/dedis/popstellar/master/protocol/query/method/message/data/dataFederationTokensExchange.json", From 3f9599d226e64fe307da8bb88e85397bf1f92e4c Mon Sep 17 00:00:00 2001 From: Kaz Date: Thu, 27 Jun 2024 13:15:37 +0200 Subject: [PATCH 3/3] merged master --- fe2-android/app/src/main/res/layout/roll_call_fragment.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fe2-android/app/src/main/res/layout/roll_call_fragment.xml b/fe2-android/app/src/main/res/layout/roll_call_fragment.xml index 7ace087902..1c5985144e 100644 --- a/fe2-android/app/src/main/res/layout/roll_call_fragment.xml +++ b/fe2-android/app/src/main/res/layout/roll_call_fragment.xml @@ -90,14 +90,14 @@ android:orientation="horizontal" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@id/roll_call_pk_qr_code"> + app:layout_constraintTop_toBottomOf="@id/roll_call_pop_token_username"> + app:layout_constraintTop_toBottomOf="@+id/roll_call_pop_token_username" />