Skip to content

Commit

Permalink
feat: update the more menu, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Aug 19, 2024
1 parent 164c216 commit b60f06e
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 173 deletions.
83 changes: 47 additions & 36 deletions wallet/res/layout/fragment_more.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,43 +89,7 @@

</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/requested_username_container"
android:visibility="gone"
tools:visibility="visible"
style="@style/MenuRow">

<ImageView
android:id="@+id/requested_username_icon"
style="@style/MenuRowIcon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_avatar_blue" />

<TextView
android:id="@+id/requested_username_title"
style="@style/MenuRowTitle"
app:layout_constraintStart_toEndOf="@+id/requested_username_icon"
app:layout_constraintTop_toTopOf="@+id/requested_username_icon"
tools:text="@string/menu_invite_title" />

<TextView
android:id="@+id/requested_username_subtitle"
style="@style/MenuRowSubTitle"
android:text="@string/requested_voting_duration"
app:layout_constraintStart_toStartOf="@+id/requested_username_title"
app:layout_constraintTop_toBottomOf="@+id/requested_username_title" />

<ImageView
android:id="@+id/requested_username_arrow"
style="@style/MenuRowArrow"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_menu_row_arrow" />

</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

<ViewFlipper
Expand Down Expand Up @@ -215,6 +179,53 @@

</ViewFlipper>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/requested_username_container"
android:visibility="gone"
tools:visibility="visible"
android:layout_height="110dp"
style="@style/MenuRow">

<ImageView
android:id="@+id/requested_username_icon"
style="@style/MenuRowIcon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_avatar_blue" />

<TextView
android:id="@+id/requested_username_title"
style="@style/MenuRowTitle"
app:layout_constraintStart_toEndOf="@+id/requested_username_icon"
app:layout_constraintTop_toTopOf="@+id/requested_username_icon"
tools:text="@string/shortcut_action_join_dashpay" />

<TextView
android:id="@+id/requested_username_subtitle"
style="@style/MenuRowSubTitle"
android:text="@string/requested_username_has_been"
app:layout_constraintStart_toStartOf="@+id/requested_username_title"
app:layout_constraintTop_toBottomOf="@+id/requested_username_title" />


<TextView
android:id="@+id/requested_username_subtitle_two"
style="@style/MenuRowSubTitle"
android:text="@string/requested_voting_duration"
app:layout_constraintStart_toStartOf="@+id/requested_username_subtitle"
app:layout_constraintTop_toBottomOf="@+id/requested_username_subtitle" />

<ImageView
android:id="@+id/requested_username_arrow"
style="@style/MenuRowArrow"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_menu_row_arrow" />

</androidx.constraintlayout.widget.ConstraintLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import kotlinx.coroutines.flow.Flow

@Dao
interface UserAlertDao {
@Insert(onConflict = OnConflictStrategy.ABORT)
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(userAlert: UserAlert)

@Query("UPDATE user_alerts SET dismissed = 1 WHERE stringResId = :id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ interface PlatformSyncService {
fun removeContactsUpdatedListener(listener: OnContactsUpdated?)
fun fireContactsUpdatedListeners()

suspend fun triggerPreBlockDownloadComplete()

fun addPreBlockProgressListener(listener: OnPreBlockProgressListener)
fun removePreBlockProgressListener(listener: OnPreBlockProgressListener)

Expand Down Expand Up @@ -1017,6 +1019,10 @@ class PlatformSynchronizationService @Inject constructor(
log.info("publishing updates to tx metadata items complete")
}

override suspend fun triggerPreBlockDownloadComplete() {
finishPreBlockDownload()
}

private suspend fun finishPreBlockDownload() {
log.info("PreDownloadBlocks: complete")
if (config.areNotificationsDisabled()) {
Expand Down Expand Up @@ -1068,7 +1074,7 @@ class PlatformSynchronizationService @Inject constructor(
preDownloadBlocks.set(true)
lastPreBlockStage = PreBlockStage.None
preDownloadBlocksFuture = future
log.info("PreDownloadBlocks: starting")
log.info("preBlockDownload: starting")
if (Constants.DASHPAY_DISABLED) {
finishPreBlockDownload()
return@launch
Expand All @@ -1078,13 +1084,13 @@ class PlatformSynchronizationService @Inject constructor(
// or if the previous restore is incomplete
val identityData = blockchainIdentityDataDao.load()
if (identityData == null || identityData.restoring) {
log.info("PreDownloadBlocks: checking for existing associated identity")
log.info("preBlockDownload: checking for existing associated identity")

val identity = platformRepo.getIdentityFromPublicKeyId()
platformRepo.onIdentityResolved?.invoke(identity)

if (identity != null) {
log.info("PreDownloadBlocks: initiate recovery of existing identity ${identity.id}")
log.info("preBlockDownload: initiate recovery of existing identity ${identity.id}")
ContextCompat.startForegroundService(
walletApplication,
CreateIdentityService.createIntentForRestore(
Expand All @@ -1094,7 +1100,7 @@ class PlatformSynchronizationService @Inject constructor(
)
return@launch
} else {
log.info("PreDownloadBlocks: no existing identity found")
log.info("preBlockDownload: no existing identity found")
// resume Sync process, since there is no Platform data to sync
finishPreBlockDownload()
}
Expand Down
Loading

0 comments on commit b60f06e

Please sign in to comment.