Skip to content

Commit 7a7c6f9

Browse files
committed
Merge branch 'main'
2 parents 87d5c9d + 1ccc013 commit 7a7c6f9

File tree

369 files changed

+14398
-1177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+14398
-1177
lines changed

configs/dependencies.gradle

+9-11
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ ext {
2121
coroutinesVersion = '1.6.4'
2222

2323
// Plugins versions
24-
gradleVersion = '7.4.1'
24+
gradleVersion = '7.4.2'
2525
googleServiceVersion = '4.3.10'
26-
kotlinGradlePluginVersion = '1.7.20'
27-
kotlinStdlibVersion = '1.7.20'
26+
kotlinGradlePluginVersion = '1.8.10'
27+
kotlinStdlibVersion = '1.8.10'
2828
pagingVersion = "3.1.1"
2929

3030
hiltVersion = "2.44.2"
@@ -38,14 +38,12 @@ ext {
3838

3939
navVersion = "2.5.3"
4040

41-
compose = "1.3.1"
42-
4341
MAJOR_VERSION = 1
4442
MINOR_VERSION = 9
45-
PATCH_VERSION = 28
43+
PATCH_VERSION = 29
4644
TASK_LABEL = "UAT"
4745

48-
VERSION_CODE = 201
46+
VERSION_CODE = 203
4947

5048
androidConfig = [
5149
applicationId : "com.nunchuk.android",
@@ -216,10 +214,10 @@ ext {
216214
]
217215

218216
composeDeps = [
219-
'composeUi' : "androidx.compose.ui:ui:$compose",
220-
'composeUiTool' : "androidx.compose.ui:ui-tooling:$compose",
221-
'composeFoundation' : "androidx.compose.foundation:foundation:$compose",
222-
'composeMaterial' : "androidx.compose.material:material:$compose",
217+
'composeUi' : "androidx.compose.ui:ui:1.4.1",
218+
'composeUiTool' : "androidx.compose.ui:ui-tooling:1.4.1",
219+
'composeFoundation' : "androidx.compose.foundation:foundation:1.4.1",
220+
'composeMaterial' : "androidx.compose.material:material:1.4.1",
223221
'composeActivity' : "androidx.activity:activity-compose:1.6.1",
224222
'composeViewModel' : "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1",
225223
'composeSystemUi' : "com.google.accompanist:accompanist-systemuicontroller:0.17.0",

configs/submodule-config.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ android {
2020
compose = true
2121
}
2222

23+
kotlin {
24+
jvmToolchain(11)
25+
}
26+
2327
compileOptions {
2428
sourceCompatibility JavaVersion.VERSION_11
2529
targetCompatibility JavaVersion.VERSION_11
@@ -30,7 +34,7 @@ android {
3034
}
3135

3236
composeOptions {
33-
kotlinCompilerExtensionVersion '1.3.2'
37+
kotlinCompilerExtensionVersion '1.4.4'
3438
}
3539

3640
packagingOptions {
@@ -65,6 +69,7 @@ dependencies {
6569

6670
implementation imageLoaderDeps.glide
6771
implementation imageLoaderDeps.compose
72+
implementation platform('androidx.compose:compose-bom:2023.01.00')
6873
implementation composeDeps.values()
6974
kapt imageLoaderDeps.processor
7075
}

gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ org.gradle.configureondemand=false
66
android.useAndroidX=true
77
android.enableJetifier=true
88
kotlin.code.style=official
9+
android.nonTransitiveRClass=false
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

nunchuk-app/build.gradle

+10-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ android {
1313
buildToolsVersion androidConfig.buildToolsVersion
1414

1515
buildFeatures {
16-
viewBinding true
17-
compose true
16+
viewBinding = true
17+
compose = true
18+
buildConfig = true
1819
}
1920

2021
defaultConfig {
@@ -118,8 +119,12 @@ android {
118119
jvmTarget = '11'
119120
}
120121

122+
kotlin {
123+
jvmToolchain(11)
124+
}
125+
121126
composeOptions {
122-
kotlinCompilerExtensionVersion '1.3.2'
127+
kotlinCompilerExtensionVersion '1.4.4'
123128
}
124129

125130
packagingOptions {
@@ -133,6 +138,7 @@ android {
133138
exclude 'META-INF/ASL2.0'
134139
exclude 'META-INF/versions/9/module-info.class'
135140
}
141+
namespace 'com.nunchuk.android'
136142
}
137143

138144
dependencies {
@@ -175,6 +181,7 @@ dependencies {
175181
implementation hiltDeps.hilt
176182

177183
implementation networkDeps.values()
184+
implementation platform('androidx.compose:compose-bom:2023.01.00')
178185
implementation composeDeps.values()
179186

180187
implementation androidxDeps.values()

nunchuk-app/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.nunchuk.android">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
76
<uses-permission android:name="android.permission.CAMERA" />

nunchuk-app/src/main/java/com/nunchuk/android/app/nav/NunchukNavigatorImpl.kt

+36
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ import com.nunchuk.android.messages.nav.MessageNavigatorDelegate
4444
import com.nunchuk.android.model.Inheritance
4545
import com.nunchuk.android.model.KeyPolicy
4646
import com.nunchuk.android.model.MembershipStage
47+
import com.nunchuk.android.model.UnspentOutput
4748
import com.nunchuk.android.nav.AppNavigator
4849
import com.nunchuk.android.nav.NunchukNavigator
4950
import com.nunchuk.android.settings.nav.SettingNavigatorDelegate
5051
import com.nunchuk.android.signer.nav.NfcNavigatorDelegate
5152
import com.nunchuk.android.signer.nav.SignerNavigatorDelegate
5253
import com.nunchuk.android.transaction.nav.TransactionNavigatorDelegate
54+
import com.nunchuk.android.wallet.components.coin.CoinActivity
5355
import com.nunchuk.android.wallet.nav.WalletNavigatorDelegate
5456
import javax.inject.Inject
5557

@@ -102,6 +104,40 @@ internal class NunchukNavigatorImpl @Inject constructor(
102104
fragment.findNavController()
103105
.navigate(QuickWalletNavigationDirections.showCreateNewSeedFragment(isQuickWallet))
104106
}
107+
108+
override fun openCoinList(
109+
launcher: ActivityResultLauncher<Intent>?,
110+
context: Context,
111+
walletId: String,
112+
txId: String,
113+
inputs: List<UnspentOutput>,
114+
amount: Double
115+
) {
116+
val intent = CoinActivity.buildIntent(
117+
context = context,
118+
walletId = walletId,
119+
txId = txId,
120+
inputs = inputs,
121+
amount = amount
122+
)
123+
launcher?.launch(intent) ?: context.startActivity(intent)
124+
}
125+
126+
override fun openCoinDetail(
127+
launcher: ActivityResultLauncher<Intent>?,
128+
context: Context,
129+
walletId: String,
130+
txId: String,
131+
vout: Int
132+
) {
133+
val intent = CoinActivity.buildIntent(
134+
context = context,
135+
walletId = walletId,
136+
txId = txId,
137+
vout = vout
138+
)
139+
launcher?.launch(intent) ?: context.startActivity(intent)
140+
}
105141
}
106142

107143
interface AppNavigatorDelegate : AppNavigator {

nunchuk-arch/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
apply from: '../configs/dependencies.gradle'
22
apply from: '../configs/submodule-config.gradle'
33

4+
android {
5+
namespace 'com.nunchuk.android.arch'
6+
}
7+
48
dependencies {
59
implementation project(':nunchuk-utils')
610
implementation lifecycleDeps.values()
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="com.nunchuk.android.arch" />
2+
<manifest />

nunchuk-auth/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apply from: '../configs/dependencies.gradle'
22
apply from: '../configs/submodule-config.gradle'
33
apply plugin: 'dagger.hilt.android.plugin'
44

5+
android {
6+
namespace 'com.nunchuk.android.auth'
7+
}
8+
59
dependencies {
610
implementation project(':nunchuk-arch')
711
implementation project(':nunchuk-core')

nunchuk-auth/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.nunchuk.android.auth">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application>
65
<activity

nunchuk-auth/src/main/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@
3939
<string name="nc_text_signup_primary_key">Create account using Primary Key</string>
4040
<string name="nc_text_signin_primary_key">Sign in with Primary Key</string>
4141
<string name="nc_text_change_your_password_info">We’ve sent a temporary password to %1$s. Please change your password.</string>
42+
<string name="nc_error_unconfirmed_coin_can_not_locked">Unconfirmed coins cannot be locked</string>
4243
</resources>

nunchuk-contact/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ apply from: '../configs/submodule-config.gradle'
33
apply plugin: 'kotlin-parcelize'
44
apply plugin: 'dagger.hilt.android.plugin'
55

6+
android {
7+
namespace 'com.nunchuk.android.contact'
8+
}
9+
610
dependencies {
711

812
implementation project(':nunchuk-arch')
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="com.nunchuk.android.contact" />
2+
<manifest />

nunchuk-core/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ apply from: '../configs/submodule-config.gradle'
33
apply plugin: 'dagger.hilt.android.plugin'
44
apply plugin: 'kotlin-parcelize'
55

6+
android {
7+
namespace 'com.nunchuk.android.core'
8+
9+
buildFeatures {
10+
buildConfig = true
11+
}
12+
}
13+
614
dependencies {
715

816
implementation project(':nunchuk-arch')

nunchuk-core/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.nunchuk.android.core">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
65
<application>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package com.nunchuk.android.compose
2+
3+
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.clickable
5+
import androidx.compose.foundation.layout.Arrangement
6+
import androidx.compose.foundation.layout.Box
7+
import androidx.compose.foundation.layout.Column
8+
import androidx.compose.foundation.layout.fillMaxWidth
9+
import androidx.compose.foundation.layout.padding
10+
import androidx.compose.foundation.layout.size
11+
import androidx.compose.foundation.layout.width
12+
import androidx.compose.foundation.shape.CircleShape
13+
import androidx.compose.material.Text
14+
import androidx.compose.runtime.Composable
15+
import androidx.compose.ui.Alignment
16+
import androidx.compose.ui.Modifier
17+
import androidx.compose.ui.draw.clip
18+
import androidx.compose.ui.text.TextStyle
19+
import androidx.compose.ui.text.style.TextAlign
20+
import androidx.compose.ui.text.style.TextOverflow
21+
import androidx.compose.ui.tooling.preview.Preview
22+
import androidx.compose.ui.unit.dp
23+
import com.nunchuk.android.core.util.shorten
24+
import com.nunchuk.android.model.CoinCollection
25+
26+
@Composable
27+
fun CoinCollectionView(
28+
modifier: Modifier = Modifier,
29+
textStyle: TextStyle = NunchukTheme.typography.body,
30+
collection: CoinCollection,
31+
clickable: Boolean = false,
32+
onClick: () -> Unit = {}
33+
) {
34+
Column(
35+
modifier
36+
.width(80.dp)
37+
.clickable(enabled = clickable, onClick = onClick),
38+
verticalArrangement = Arrangement.Center,
39+
horizontalAlignment = Alignment.CenterHorizontally
40+
) {
41+
Box(
42+
modifier = Modifier
43+
.size(60.dp, 60.dp)
44+
.clip(CircleShape)
45+
.background(color = NcColor.beeswaxLight),
46+
contentAlignment = Alignment.Center
47+
) {
48+
Text(text = collection.name.shorten())
49+
}
50+
Text(
51+
modifier = Modifier
52+
.padding(top = 12.dp)
53+
.fillMaxWidth(),
54+
text = collection.name,
55+
maxLines = 2,
56+
overflow = TextOverflow.Ellipsis,
57+
style = textStyle,
58+
textAlign = TextAlign.Center
59+
)
60+
}
61+
}
62+
63+
@Preview(showBackground = true)
64+
@Composable
65+
fun CoinCollectionViewPreview() {
66+
NunchukTheme {
67+
CoinCollectionView(
68+
collection = CoinCollection(
69+
id = 1, name = "Unfiltered coins"
70+
)
71+
)
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.nunchuk.android.compose
2+
3+
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.layout.padding
5+
import androidx.compose.foundation.shape.RoundedCornerShape
6+
import androidx.compose.material.Text
7+
import androidx.compose.runtime.Composable
8+
import androidx.compose.ui.Modifier
9+
import androidx.compose.ui.graphics.Color
10+
import androidx.compose.ui.platform.LocalContext
11+
import androidx.compose.ui.unit.dp
12+
import androidx.compose.ui.unit.sp
13+
import com.nunchuk.android.core.util.toColor
14+
import com.nunchuk.android.core.util.toName
15+
import com.nunchuk.android.model.UnspentOutput
16+
17+
@Composable
18+
fun CoinStatusBadge(output: UnspentOutput) {
19+
val name = output.status.toName(LocalContext.current)
20+
if (name.isNotEmpty()) {
21+
Text(
22+
modifier = Modifier
23+
.padding(start = 4.dp)
24+
.background(
25+
Color(output.status.toColor(LocalContext.current)),
26+
shape = RoundedCornerShape(20.dp)
27+
)
28+
.padding(horizontal = 8.dp),
29+
text = name,
30+
style = NunchukTheme.typography.caption.copy(fontSize = 10.sp),
31+
)
32+
}
33+
}

0 commit comments

Comments
 (0)