-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
161 additions
and
57 deletions.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
common/src/main/java/jp/co/soramitsu/common/presentation/compose/components/SoraCardImage.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,95 @@ | ||
/* | ||
This file is part of the SORA network and Polkaswap app. | ||
Copyright (c) 2020, 2021, Polka Biome Ltd. All rights reserved. | ||
SPDX-License-Identifier: BSD-4-Clause | ||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
Redistributions of source code must retain the above copyright notice, this list | ||
of conditions and the following disclaimer. | ||
Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or other | ||
materials provided with the distribution. | ||
All advertising materials mentioning features or use of this software must display | ||
the following acknowledgement: This product includes software developed by Polka Biome | ||
Ltd., SORA, and Polkaswap. | ||
Neither the name of the Polka Biome Ltd. nor the names of its contributors may be used | ||
to endorse or promote products derived from this software without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY Polka Biome Ltd. AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Polka Biome Ltd. BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
package jp.co.soramitsu.common.presentation.compose.components | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.wrapContentHeight | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.layout.ContentScale | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import jp.co.soramitsu.common.R | ||
import jp.co.soramitsu.ui_core.resources.Dimens | ||
|
||
@Composable | ||
fun SoraCardImage( | ||
modifier: Modifier = Modifier, | ||
) { | ||
Box( | ||
modifier = modifier, | ||
) { | ||
Image( | ||
modifier = Modifier.fillMaxWidth(), | ||
painter = painterResource(id = R.drawable.sora_card), | ||
contentDescription = "", | ||
contentScale = ContentScale.FillWidth, | ||
) | ||
Image( | ||
modifier = Modifier | ||
.padding(start = Dimens.x2, top = Dimens.x2) | ||
.wrapContentSize(), | ||
painter = painterResource(id = R.drawable.ic_sora_on_card), | ||
contentDescription = "", | ||
contentScale = ContentScale.Fit, | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview(locale = "en") | ||
private fun PreviewSoraCardImage1() { | ||
SoraCardImage( | ||
modifier = Modifier.fillMaxWidth().wrapContentHeight() | ||
) | ||
} | ||
|
||
@Composable | ||
@Preview(locale = "ar") | ||
private fun PreviewSoraCardImage2() { | ||
SoraCardImage( | ||
modifier = Modifier.fillMaxWidth().wrapContentHeight() | ||
) | ||
} | ||
|
||
@Composable | ||
@Preview(locale = "he") | ||
private fun PreviewSoraCardImage3() { | ||
SoraCardImage( | ||
modifier = Modifier.fillMaxWidth().wrapContentHeight() | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,24 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="89dp" | ||
android:height="18dp" | ||
android:viewportWidth="89" | ||
android:viewportHeight="18"> | ||
<path | ||
android:pathData="M71.189,9.184L72.456,8.623C73.027,9.857 73.562,11.092 74.061,12.314L72.765,12.831C72.331,11.784 71.802,10.568 71.189,9.184ZM79.228,8.61C79.18,10.437 78.936,11.909 78.491,13.018C78.051,14.128 77.373,14.97 76.457,15.55C75.542,16.129 74.311,16.516 72.759,16.728L72.509,15.431C73.52,15.275 74.346,15.057 74.995,14.777C75.637,14.496 76.172,14.085 76.606,13.542C77.034,13 77.349,12.333 77.551,11.541C77.741,10.749 77.848,9.745 77.884,8.536L79.228,8.61Z" | ||
android:fillColor="#ffffff"/> | ||
<path | ||
android:pathData="M80.43,11.315L88.349,11.315L88.349,11.564C88.349,13.242 87.832,14.532 86.797,15.424C85.763,16.315 84.175,16.82 82.035,16.939L81.833,15.673C83.307,15.592 84.467,15.305 85.311,14.819C86.155,14.333 86.678,13.591 86.881,12.587L80.43,12.587L80.43,11.321L80.43,11.315ZM81.167,9.837L81.167,8.572L87.743,8.572L87.743,9.837L81.167,9.837Z" | ||
android:fillColor="#ffffff"/> | ||
<path | ||
android:pathData="M0,12.009L2.735,12.009C2.735,13.405 3.704,14.827 6.374,14.827C8.805,14.827 9.947,13.63 9.947,12.164C9.947,10.949 8.954,10.157 6.932,9.951L5.446,9.814C2.497,9.564 0.606,7.806 0.606,5.1C0.606,2.008 2.842,0 6.267,0C9.691,0 11.968,2.052 11.968,5.238L9.233,5.238C9.233,3.86 8.288,2.55 6.267,2.55C4.245,2.55 3.318,3.748 3.318,5.1C3.318,6.185 4.073,7.083 5.684,7.22L7.17,7.357C10.482,7.675 12.682,9.321 12.682,12.164C12.682,15.257 10.208,17.376 6.38,17.376C2.289,17.376 0.012,15.12 0.012,12.009L0,12.009Z" | ||
android:fillColor="#ffffff"/> | ||
<path | ||
android:pathData="M15.163,8.916L15.163,8.417C15.163,4.42 17.898,-0 23.404,-0C28.909,-0 31.644,4.42 31.644,8.417L31.644,8.916C31.644,12.569 29.04,17.376 23.404,17.376C17.743,17.376 15.163,12.569 15.163,8.916ZM28.826,8.691C28.826,5.306 26.739,2.712 23.404,2.712C20.068,2.712 17.958,5.306 17.958,8.691C17.958,11.896 20.044,14.67 23.404,14.67C26.763,14.67 28.826,11.896 28.826,8.691Z" | ||
android:fillColor="#ffffff"/> | ||
<path | ||
android:pathData="M45.211,16.945L41.358,11.302L38.367,11.302L38.367,16.945L35.591,16.945L35.591,0.36L41.209,0.36C44.89,0.36 47.232,2.05 47.232,5.666L47.232,6.028C47.232,8.534 46.091,10.111 44.176,10.835L48.481,16.951L45.211,16.951L45.211,16.945ZM38.367,8.889L41.554,8.889C43.32,8.889 44.438,7.674 44.438,5.891C44.438,4.107 43.32,2.867 41.554,2.867L38.367,2.867L38.367,8.889Z" | ||
android:fillColor="#ffffff"/> | ||
<path | ||
android:pathData="M61.044,12.413L54.028,12.413L52.566,16.952L49.789,16.952L55.235,0.48L59.795,0.48L65.408,16.952L62.548,16.952L61.044,12.413ZM60.206,9.932L57.881,2.961L57.084,2.961L54.825,9.932L60.206,9.932Z" | ||
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