-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dashpay' into hadia/1499
# Conflicts: # wallet/res/values/strings.xml
- Loading branch information
Showing
18 changed files
with
1,274 additions
and
33 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
common/src/main/java/org/dash/wallet/common/util/FlowExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.dash.wallet.common.util | ||
|
||
import androidx.lifecycle.Lifecycle | ||
import androidx.lifecycle.LifecycleOwner | ||
import androidx.lifecycle.lifecycleScope | ||
import androidx.lifecycle.repeatOnLifecycle | ||
import kotlinx.coroutines.FlowPreview | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.flow.AbstractFlow | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.FlowCollector | ||
import kotlinx.coroutines.launch | ||
import kotlin.time.Duration | ||
import kotlin.time.ExperimentalTime | ||
|
||
/** | ||
* @author Joffrey Bion | ||
* https://stackoverflow.com/a/54828055/2279177 | ||
*/ | ||
@OptIn(FlowPreview::class) | ||
class TickerFlow( | ||
private val period: Duration, | ||
private val initialDelay: Duration = Duration.ZERO | ||
): AbstractFlow<Unit>() { | ||
override suspend fun collectSafely(collector: FlowCollector<Unit>) { | ||
delay(initialDelay) | ||
while (true) { | ||
collector.emit(Unit) | ||
delay(period) | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @author Tobias Preuss @johnjohndoe | ||
* https://github.com/EventFahrplan/EventFahrplan/blob/master/commons/src/main/java/info/metadude/android/eventfahrplan/commons/flow/FlowExtensions.kt | ||
*/ | ||
fun <T> Flow<T>.observe(lifecycleOwner: LifecycleOwner, collector: FlowCollector<T>) { | ||
lifecycleOwner.lifecycleScope.launch { | ||
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { | ||
collect(collector) | ||
} | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
common/src/main/java/org/dash/wallet/common/util/TickerFlow.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!-- | ||
~ Copyright 2023 Dash Core Group. | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="52dp" | ||
android:height="53dp" | ||
android:viewportWidth="52" | ||
android:viewportHeight="53"> | ||
<path | ||
android:pathData="M26,0.5L26,0.5A26,26 0,0 1,52 26.5L52,26.5A26,26 0,0 1,26 52.5L26,52.5A26,26 0,0 1,0 26.5L0,26.5A26,26 0,0 1,26 0.5z"> | ||
<aapt:attr name="android:fillColor"> | ||
<gradient | ||
android:startX="26" | ||
android:startY="0.5" | ||
android:endX="26" | ||
android:endY="52.5" | ||
android:type="linear"> | ||
<item android:offset="0" android:color="#FF78C4F5"/> | ||
<item android:offset="1" android:color="#FF31A3EF"/> | ||
</gradient> | ||
</aapt:attr> | ||
</path> | ||
<path | ||
android:pathData="M17.113,20.623H27.596C27.955,20.623 28.255,20.494 28.496,20.234C28.737,19.974 28.858,19.674 28.858,19.334C28.858,18.975 28.737,18.669 28.496,18.416C28.261,18.162 27.961,18.035 27.596,18.035H17.113C16.754,18.035 16.454,18.165 16.213,18.425C15.972,18.678 15.851,18.981 15.851,19.334C15.851,19.668 15.972,19.968 16.213,20.234C16.461,20.494 16.76,20.623 17.113,20.623ZM31.687,20.623H35.138C35.491,20.623 35.788,20.494 36.029,20.234C36.276,19.974 36.4,19.674 36.4,19.334C36.4,18.975 36.279,18.669 36.038,18.416C35.797,18.162 35.497,18.035 35.138,18.035H31.687C31.341,18.035 31.044,18.165 30.797,18.425C30.556,18.678 30.435,18.981 30.435,19.334C30.435,19.668 30.559,19.968 30.806,20.234C31.053,20.494 31.347,20.623 31.687,20.623ZM17.113,25.494H18.254C18.607,25.494 18.903,25.364 19.145,25.104C19.386,24.838 19.507,24.535 19.507,24.195C19.507,23.836 19.386,23.53 19.145,23.277C18.91,23.023 18.613,22.896 18.254,22.896H17.113C16.76,22.896 16.461,23.026 16.213,23.286C15.972,23.546 15.851,23.849 15.851,24.195C15.851,24.529 15.972,24.829 16.213,25.095C16.461,25.361 16.76,25.494 17.113,25.494ZM22.345,25.494H26.696C27.049,25.494 27.346,25.364 27.587,25.104C27.834,24.838 27.958,24.535 27.958,24.195C27.958,23.836 27.837,23.53 27.596,23.277C27.355,23.023 27.055,22.896 26.696,22.896H22.345C21.993,22.896 21.696,23.026 21.455,23.286C21.213,23.546 21.093,23.849 21.093,24.195C21.093,24.529 21.213,24.829 21.455,25.095C21.702,25.361 21.999,25.494 22.345,25.494ZM30.787,25.494H35.138C35.497,25.494 35.797,25.364 36.038,25.104C36.279,24.838 36.4,24.535 36.4,24.195C36.4,23.836 36.279,23.53 36.038,23.277C35.797,23.023 35.497,22.896 35.138,22.896H30.787C30.435,22.896 30.138,23.026 29.897,23.286C29.656,23.546 29.535,23.849 29.535,24.195C29.535,24.529 29.656,24.829 29.897,25.095C30.144,25.361 30.441,25.494 30.787,25.494ZM17.113,30.364H20.564C20.904,30.364 21.198,30.231 21.445,29.965C21.693,29.699 21.816,29.399 21.816,29.066C21.816,28.719 21.693,28.419 21.445,28.166C21.204,27.906 20.91,27.776 20.564,27.776H17.113C16.754,27.776 16.454,27.903 16.213,28.156C15.972,28.41 15.851,28.713 15.851,29.066C15.851,29.412 15.972,29.715 16.213,29.975C16.461,30.235 16.76,30.364 17.113,30.364ZM24.655,30.364H35.138C35.491,30.364 35.788,30.231 36.029,29.965C36.276,29.699 36.4,29.399 36.4,29.066C36.4,28.719 36.279,28.419 36.038,28.166C35.797,27.906 35.497,27.776 35.138,27.776H24.655C24.297,27.776 23.997,27.903 23.755,28.156C23.514,28.41 23.394,28.713 23.394,29.066C23.394,29.412 23.514,29.715 23.755,29.975C23.997,30.235 24.297,30.364 24.655,30.364ZM17.113,35.225H26.381C26.733,35.225 27.03,35.096 27.271,34.836C27.519,34.576 27.642,34.276 27.642,33.936C27.642,33.577 27.519,33.271 27.271,33.018C27.03,32.758 26.733,32.628 26.381,32.628H17.113C16.754,32.628 16.454,32.758 16.213,33.018C15.972,33.277 15.851,33.583 15.851,33.936C15.851,34.27 15.972,34.567 16.213,34.827C16.461,35.092 16.76,35.225 17.113,35.225Z" | ||
android:strokeAlpha="0.25" | ||
android:fillAlpha="0.25" | ||
android:fillColor="#FFFFFF"> | ||
</path> | ||
<path | ||
android:pathData="M17.113,20.623H27.596C27.955,20.623 28.255,20.494 28.496,20.234C28.737,19.974 28.858,19.674 28.858,19.334C28.858,18.975 28.737,18.669 28.496,18.416C28.261,18.162 27.961,18.035 27.596,18.035H17.113C16.754,18.035 16.454,18.165 16.213,18.425C15.972,18.678 15.851,18.981 15.851,19.334C15.851,19.668 15.972,19.968 16.213,20.234C16.461,20.494 16.76,20.623 17.113,20.623ZM30.787,25.494H35.138C35.497,25.494 35.797,25.364 36.038,25.104C36.279,24.838 36.4,24.535 36.4,24.195C36.4,23.836 36.279,23.53 36.038,23.277C35.797,23.023 35.497,22.896 35.138,22.896H30.787C30.435,22.896 30.138,23.026 29.897,23.286C29.656,23.546 29.535,23.849 29.535,24.195C29.535,24.529 29.656,24.829 29.897,25.095C30.144,25.361 30.441,25.494 30.787,25.494ZM17.113,30.364H20.564C20.904,30.364 21.198,30.231 21.445,29.965C21.693,29.699 21.816,29.399 21.816,29.066C21.816,28.719 21.693,28.419 21.445,28.166C21.204,27.906 20.91,27.776 20.564,27.776H17.113C16.754,27.776 16.454,27.903 16.213,28.156C15.972,28.41 15.851,28.713 15.851,29.066C15.851,29.412 15.972,29.715 16.213,29.975C16.461,30.235 16.76,30.364 17.113,30.364ZM17.113,35.225H26.381C26.733,35.225 27.03,35.096 27.271,34.836C27.519,34.576 27.642,34.276 27.642,33.936C27.642,33.577 27.519,33.271 27.271,33.018C27.03,32.758 26.733,32.628 26.381,32.628H17.113C16.754,32.628 16.454,32.758 16.213,33.018C15.972,33.277 15.851,33.583 15.851,33.936C15.851,34.27 15.972,34.567 16.213,34.827C16.461,35.092 16.76,35.225 17.113,35.225Z" | ||
android:strokeAlpha="0.15" | ||
android:fillAlpha="0.15" | ||
android:fillColor="#FFFFFF"> | ||
</path> | ||
<path | ||
android:pathData="M16.649,38.85H35.071C35.804,38.85 36.376,38.686 36.788,38.356C37.21,38.035 37.42,37.591 37.42,37.023C37.42,36.144 37.15,35.215 36.61,34.235C36.078,33.255 35.309,32.339 34.302,31.487C33.304,30.626 32.09,29.93 30.661,29.399C29.242,28.859 27.639,28.588 25.853,28.588C24.076,28.588 22.474,28.859 21.045,29.399C19.626,29.93 18.412,30.626 17.405,31.487C16.397,32.339 15.628,33.255 15.097,34.235C14.566,35.215 14.3,36.144 14.3,37.023C14.3,37.591 14.506,38.035 14.918,38.356C15.34,38.686 15.916,38.85 16.649,38.85ZM25.867,26.129C26.847,26.129 27.754,25.864 28.587,25.333C29.42,24.792 30.089,24.064 30.593,23.148C31.105,22.233 31.362,21.202 31.362,20.058C31.362,18.931 31.105,17.924 30.593,17.035C30.089,16.138 29.42,15.433 28.587,14.92C27.754,14.407 26.847,14.15 25.867,14.15C24.887,14.15 23.98,14.411 23.147,14.933C22.313,15.455 21.64,16.165 21.128,17.063C20.624,17.96 20.372,18.968 20.372,20.085C20.372,21.221 20.624,22.246 21.128,23.162C21.64,24.069 22.313,24.792 23.147,25.333C23.98,25.864 24.887,26.129 25.867,26.129Z" | ||
android:fillColor="#ffffff"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright 2023 Dash Core Group. | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/background_primary"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
app:navigationIcon="@drawable/ic_arrow_back_primary" | ||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/header" | ||
style="@style/Headline3" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="15dp" | ||
android:text="@string/username_voting" | ||
app:layout_constraintTop_toBottomOf="@id/toolbar" /> | ||
|
||
<TextView | ||
android:id="@+id/subtitle" | ||
style="@style/Body2.Secondary" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="15dp" | ||
android:layout_marginTop="2dp" | ||
android:text="@string/username_voting_subtitle" | ||
app:layout_constraintTop_toBottomOf="@id/header" /> | ||
|
||
|
||
<TextView | ||
style="@style/Body2.Secondary" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:textAlignment="gravity" | ||
android:text="Not implemented" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent"/> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright 2023 Dash Core Group. | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
|
||
<navigation xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/nav_voting" | ||
app:startDestination="@id/usernameRequestsFragment"> | ||
|
||
<fragment | ||
android:id="@+id/usernameRequestsFragment" | ||
android:name="de.schildbach.wallet.ui.username.UsernameRequestsFragment" | ||
android:label="UsernameRequestsFragment" | ||
tools:layout="@layout/fragment_username_requests"> | ||
</fragment> | ||
</navigation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.