Skip to content

Commit

Permalink
Add "Ivy Wallet is open-source!" card in HomeMoreMenu.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliyan Germanov committed Nov 5, 2021
1 parent ba78b3f commit db599bf
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 61 additions & 4 deletions app/src/main/java/com/ivy/wallet/ui/home/HomeMoreMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ package com.ivy.wallet.ui.home
import androidx.annotation.DrawableRes
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.layout
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -22,20 +26,19 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import com.google.accompanist.insets.navigationBarsPadding
import com.google.accompanist.insets.statusBarsPadding
import com.ivy.wallet.Constants
import com.ivy.wallet.R
import com.ivy.wallet.base.*
import com.ivy.wallet.ui.IvyActivity
import com.ivy.wallet.ui.IvyAppPreview
import com.ivy.wallet.ui.LocalIvyContext
import com.ivy.wallet.ui.Screen
import com.ivy.wallet.ui.theme.IvyTheme
import com.ivy.wallet.ui.theme.Theme
import com.ivy.wallet.ui.theme.Typo
import com.ivy.wallet.ui.theme.*
import com.ivy.wallet.ui.theme.components.BufferBattery
import com.ivy.wallet.ui.theme.components.CircleButtonFilled
import com.ivy.wallet.ui.theme.components.IvyButton
import com.ivy.wallet.ui.theme.components.IvyIcon
import com.ivy.wallet.ui.theme.modal.AddModalBackHandling
import com.ivy.wallet.ui.theme.style
import com.ivy.wallet.ui.theme.wallet.AmountCurrencyB1
import java.util.*
import kotlin.math.roundToInt
Expand Down Expand Up @@ -193,6 +196,10 @@ private fun ColumnScope.Content(
onBufferClick = onBufferClick
)

Spacer(Modifier.height(16.dp))

OpenSource()

Spacer(Modifier.weight(1f))

IvyButton(
Expand All @@ -206,6 +213,56 @@ private fun ColumnScope.Content(
Spacer(Modifier.height(40.dp))
}

@Composable
private fun ColumnScope.OpenSource() {
val uriHandler = LocalUriHandler.current
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.clip(Shapes.rounded16)
.background(IvyTheme.colors.pure)
.padding(vertical = 12.dp)
.clickable {
openUrl(
uriHandler = uriHandler,
url = Constants.URL_IVY_WALLET_REPO
)
},
verticalAlignment = Alignment.CenterVertically,
) {
Spacer(Modifier.width(16.dp))

IvyIcon(
icon = R.drawable.github_logo
)

Column(
modifier = Modifier
.fillMaxWidth()
.padding(start = 16.dp, end = 24.dp)
) {
Text(
text = "Ivy Wallet is open-source!",
style = Typo.body2.style(
fontWeight = FontWeight.ExtraBold
)
)

Spacer(Modifier.height(4.dp))

Text(
text = Constants.URL_IVY_WALLET_REPO,
style = Typo.caption.style(
fontWeight = FontWeight.ExtraBold,
color = Blue
)
)
}

}
}

@Composable
private fun ColumnScope.Buffer(
buffer: Double,
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/github_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector android:height="32dp"
android:viewportHeight="24"
android:viewportWidth="24"
android:width="32dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="M12,0c-6.626,0 -12,5.373 -12,12 0,5.302 3.438,9.8 8.207,11.387 0.599,0.111 0.793,-0.261 0.793,-0.577v-2.234c-3.338,0.726 -4.033,-1.416 -4.033,-1.416 -0.546,-1.387 -1.333,-1.756 -1.333,-1.756 -1.089,-0.745 0.083,-0.729 0.083,-0.729 1.205,0.084 1.839,1.237 1.839,1.237 1.07,1.834 2.807,1.304 3.492,0.997 0.107,-0.775 0.418,-1.305 0.762,-1.604 -2.665,-0.305 -5.467,-1.334 -5.467,-5.931 0,-1.311 0.469,-2.381 1.236,-3.221 -0.124,-0.303 -0.535,-1.524 0.117,-3.176 0,0 1.008,-0.322 3.301,1.23 0.957,-0.266 1.983,-0.399 3.003,-0.404 1.02,0.005 2.047,0.138 3.006,0.404 2.291,-1.552 3.297,-1.23 3.297,-1.23 0.653,1.653 0.242,2.874 0.118,3.176 0.77,0.84 1.235,1.911 1.235,3.221 0,4.609 -2.807,5.624 -5.479,5.921 0.43,0.372 0.823,1.102 0.823,2.222v3.293c0,0.319 0.192,0.694 0.801,0.576 4.765,-1.589 8.199,-6.086 8.199,-11.386 0,-6.627 -5.373,-12 -12,-12z" />
</vector>

0 comments on commit db599bf

Please sign in to comment.