Skip to content

Commit

Permalink
Release/1.7.5 #205
Browse files Browse the repository at this point in the history
  • Loading branch information
kelianClerc authored Apr 7, 2023
2 parents 7e39ad7 + cfce637 commit 6bb36a5
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publishSampleOnAppDistrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
echo "Downloading keystore..."
sudo curl -H "Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" -o ${{ github.workspace }}/sample/spendesk-grapes.keystore -L ${{ secrets.KEYSTORE_URL }}
ls -l config/keystores
ls -l ${{ github.workspace }}/sample
- name: Deploy sample to app distrib
env:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
buildscript {

ext {
grapes_version = '1.7.4'
grapes_version = '1.7.5'

kotlin_version = '1.7.10'
firebase_app_distribution_version = '2.1.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ fun GrapesMicrosoftButton(
)
}

@Composable
fun GrapesSamlButton(
label: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
state: GrapesButtonState = GrapesButtonState.Enabled,
) {
val style = GrapesButtonStyleDefaults.saml

GrapesButtonIcon(
text = label,
leadingIcon = { BrandLeadingIcon(style, R.drawable.ic_saml_logo) },
buttonStyle = style,
state = state,
onClick = onClick,
modifier = modifier
)
}

private val BrandLogoSize = 20.dp
private val BrandLogoContainerBorderRadius = 6.dp

Expand Down Expand Up @@ -95,6 +114,7 @@ private fun GrapesButtonBrandPreview() {
) {
GrapesGoogleButton(label = "Register to Google", onClick = { /*TODO*/ })
GrapesMicrosoftButton(label = "Register to Microsoft", onClick = { /*TODO*/ })
GrapesSamlButton(label = "Register to with SAML SSO", onClick = { /*TODO*/ })
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,24 @@ object GrapesButtonStyleDefaults {
borderStroke = GrapesButtonDefaults.BorderStroke.secondary,
isFillMaxWidthWithContent = true,
)

val saml: GrapesButtonStyle
@Composable
@ReadOnlyComposable
get() = GrapesButtonStyle(
textStyle = GrapesTheme.typography.titleM,
minSize = Size(
width = GrapesButtonDefaults.MinWidthSmall.value,
height = GrapesButtonDefaults.MinHeightSmall.value
),
iconSize = 40.dp,
shape = GrapesTheme.shapes.small,
rippleColor = GrapesTheme.colors.mainNeutralLighter,
colors = ButtonColorDefaults.secondary,
contentPadding = GrapesButtonDefaults.PaddingValuesBrand,
borderStroke = GrapesButtonDefaults.BorderStroke.secondary,
isFillMaxWidthWithContent = true,
)
}

@Immutable
Expand Down
10 changes: 10 additions & 0 deletions library-compose/src/main/res/drawable/ic_saml_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:pathData="M10.667,7.111H5.333V4.444C5.333,2.974 6.53,1.778 8,1.778C9.47,1.778 10.667,2.974 10.667,4.444V7.111ZM8,12.889C7.264,12.889 6.667,12.292 6.667,11.556C6.667,10.82 7.264,10.222 8,10.222C8.736,10.222 9.333,10.82 9.333,11.556C9.333,12.292 8.736,12.889 8,12.889ZM12.889,7.111H12.444V4.444C12.444,1.994 10.451,0 8,0C5.549,0 3.556,1.994 3.556,4.444V7.111H3.111C2.376,7.111 1.778,7.709 1.778,8.444V14.667C1.778,15.402 2.376,16 3.111,16H12.889C13.624,16 14.222,15.402 14.222,14.667V8.444C14.222,7.709 13.624,7.111 12.889,7.111Z"
android:fillColor="#301C6B"
android:fillType="evenOdd"/>
</vector>

0 comments on commit 6bb36a5

Please sign in to comment.