1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-1102 App | Enhancement | Design fixes, buttons typography (#3137)

* DROID-1102 fix letter spacing

* DROID-1102 xml buttons

* DROID-1102 compose buttons

* DROID-1102 fix buttons style
This commit is contained in:
Konstantin Ivanov 2023-04-29 13:21:59 +02:00 committed by uburoiubu
parent 7ae8be1947
commit 053705fe27
No known key found for this signature in database
GPG key ID: C8FB80E0A595FBB6
5 changed files with 64 additions and 42 deletions

View file

@ -176,7 +176,7 @@ fun Warning(
) {
ButtonSecondary(
onClick = onNegativeClick,
size = ButtonSize.Large,
size = ButtonSize.LargeSecondary,
text = cancelButtonText,
modifier = Modifier
.fillMaxWidth()
@ -248,7 +248,7 @@ fun Announcement(
ButtonSecondary(
text = stringResource(R.string.back),
onClick = onBackClicked,
size = ButtonSize.Large,
size = ButtonSize.LargeSecondary,
modifier = Modifier
.fillMaxWidth()
.weight(1.0f)

View file

@ -245,21 +245,42 @@ enum class ButtonSize(
contentPadding = PaddingValues(9.5.dp, 3.5.dp, 9.5.dp, 3.5.dp),
textStyle = Caption1Medium
),
XSmallSecondary(
cornerSize = 6.dp,
contentPadding = PaddingValues(9.5.dp, 3.5.dp, 9.5.dp, 3.5.dp),
textStyle = Caption1Regular
),
Small(
cornerSize = 8.dp,
contentPadding = PaddingValues(11.dp, 5.dp, 11.dp, 5.dp),
textStyle = BodyCalloutMedium
),
SmallSecondary(
cornerSize = 8.dp,
contentPadding = PaddingValues(11.dp, 5.dp, 11.dp, 5.dp),
textStyle = BodyCalloutRegular
),
Medium(
cornerSize = 10.dp,
contentPadding = PaddingValues(55.dp, 10.dp, 55.dp, 10.dp),
textStyle = ButtonMedium
),
MediumSecondary(
cornerSize = 10.dp,
contentPadding = PaddingValues(55.dp, 10.dp, 55.dp, 10.dp),
textStyle = UXBody
),
Large(
cornerSize = 12.dp,
contentPadding = PaddingValues(0.dp, 12.dp, 0.dp, 12.dp),
textStyle = ButtonMedium
),
LargeSecondary(
cornerSize = 12.dp,
contentPadding = PaddingValues(0.dp, 12.dp, 0.dp, 12.dp),
textStyle = ButtonRegular
)
}
object NoRippleTheme : RippleTheme {
@ -287,7 +308,7 @@ fun MyPrimaryButton() {
fun MySecondaryButton() {
ButtonSecondary(
onClick = {},
size = ButtonSize.Large,
size = ButtonSize.LargeSecondary,
text = "Cancel",
modifier = Modifier.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp)

View file

@ -6,6 +6,7 @@ import androidx.compose.ui.unit.sp
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.unit.em
import com.anytypeio.anytype.core_ui.R
val fontInterRegular = FontFamily(
@ -35,7 +36,7 @@ val HeadlineTitle =
fontWeight = FontWeight.W700,
fontSize = 28.sp,
lineHeight = 30.5.sp,
letterSpacing = (-0.017).sp
letterSpacing = (-0.017).em
)
//Content/Headlines/Heading
@ -45,7 +46,7 @@ val HeadlineHeading =
fontWeight = FontWeight.W700,
fontSize = 22.sp,
lineHeight = 26.sp,
letterSpacing = (-0.016).sp
letterSpacing = (-0.016).em
)
//Content/Headlines/Subheading
@ -55,7 +56,7 @@ val HeadlineSubheading =
fontWeight = FontWeight.W700,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.016).sp
letterSpacing = (-0.016).em
)
//Content/Body/Bold
@ -64,7 +65,7 @@ val BodyBold = TextStyle(
fontWeight = FontWeight.W600,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//Content/Body/Bold Italic
@ -74,7 +75,7 @@ val BodyBoldItalic = TextStyle(
fontStyle = FontStyle.Italic,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//Content/Body/Regular
@ -83,7 +84,7 @@ val BodyRegular = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//Content/Body/Italic
@ -93,7 +94,7 @@ val BodyItalic = TextStyle(
fontStyle = FontStyle.Italic,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//Content/Callout/Regular
@ -102,7 +103,7 @@ val BodyCallout = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 15.sp,
lineHeight = 22.sp,
letterSpacing = (-0.016).sp
letterSpacing = (-0.016).em
)
//Content/Preview Title 1/Medium
@ -111,7 +112,7 @@ val PreviewTitle1Medium = TextStyle(
fontWeight = FontWeight.W500,
fontSize = 17.sp,
lineHeight = 22.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//Content/Preview Title 1/Regular
@ -120,7 +121,7 @@ val PreviewTitle1Regular = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 17.sp,
lineHeight = 22.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//Content/Preview Title 2/Medium
@ -129,7 +130,7 @@ val PreviewTitle2Medium = TextStyle(
fontWeight = FontWeight.W500,
fontSize = 15.sp,
lineHeight = 20.sp,
letterSpacing = (-0.016).sp
letterSpacing = (-0.016).em
)
//Content/Preview Title 2/Regular
@ -138,7 +139,7 @@ val PreviewTitle2Regular = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 15.sp,
lineHeight = 20.sp,
letterSpacing = (-0.016).sp
letterSpacing = (-0.016).em
)
//Content/Relation 1/Regular
@ -147,7 +148,7 @@ val Relations1 = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 15.sp,
lineHeight = 20.sp,
letterSpacing = (-0.016).sp
letterSpacing = (-0.016).em
)
//Content/Relation 2/Regular
@ -156,7 +157,7 @@ val Relations2 = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 13.sp,
lineHeight = 18.sp,
letterSpacing = (-0.006).sp
letterSpacing = (-0.006).em
)
//Content/Relation 3/Regular
@ -173,7 +174,7 @@ val CodeBlock = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 15.sp,
lineHeight = 22.sp,
letterSpacing = (-0.016).sp
letterSpacing = (-0.016).em
)
//UX/Title 1/Semibold
@ -182,7 +183,7 @@ val Title1 = TextStyle(
fontWeight = FontWeight.W600,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//UX/Title 2/Medium
@ -191,7 +192,7 @@ val Title2 = TextStyle(
fontWeight = FontWeight.W500,
fontSize = 15.sp,
lineHeight = 20.sp,
letterSpacing = (-0.014).sp
letterSpacing = (-0.014).em
)
//UX/Title 2/Regular
@ -200,7 +201,7 @@ val Title3 = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 15.sp,
lineHeight = 20.sp,
letterSpacing = (-0.014).sp
letterSpacing = (-0.014).em
)
//UX/Body/Regular
@ -209,7 +210,7 @@ val UXBody = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//UX/Callout/Medium
@ -218,7 +219,7 @@ val BodyCalloutMedium = TextStyle(
fontWeight = FontWeight.W500,
fontSize = 15.sp,
lineHeight = 22.sp,
letterSpacing = (-0.014).sp
letterSpacing = (-0.014).em
)
//UX/Callout/Regular
@ -227,7 +228,7 @@ val BodyCalloutRegular = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 15.sp,
lineHeight = 22.sp,
letterSpacing = (-0.014).sp
letterSpacing = (-0.014).em
)
//UX/Caption 1/Medium
@ -236,7 +237,7 @@ val Caption1Medium = TextStyle(
fontWeight = FontWeight.W500,
fontSize = 13.sp,
lineHeight = 18.sp,
letterSpacing = (-0.006).sp
letterSpacing = (-0.006).em
)
//UX/Caption 1/Regular
@ -245,7 +246,7 @@ val Caption1Regular = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 13.sp,
lineHeight = 18.sp,
letterSpacing = (-0.006).sp
letterSpacing = (-0.006).em
)
//UX/Caption 2/Medium
@ -254,7 +255,7 @@ val Caption2Medium = TextStyle(
fontWeight = FontWeight.W500,
fontSize = 11.sp,
lineHeight = 14.sp,
letterSpacing = (-0.006).sp
letterSpacing = (-0.006).em
)
//UX/Caption 2/Regular
@ -263,7 +264,7 @@ val Caption2Regular = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 11.sp,
lineHeight = 14.sp,
letterSpacing = (-0.006).sp
letterSpacing = (-0.006).em
)
//UX/Button/Medium
@ -272,7 +273,7 @@ val ButtonMedium = TextStyle(
fontWeight = FontWeight.W500,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)
//UX/Button/Regular
@ -281,5 +282,5 @@ val ButtonRegular = TextStyle(
fontWeight = FontWeight.W400,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).sp
letterSpacing = (-0.024).em
)

View file

@ -307,7 +307,7 @@
<item name="android:insetBottom">7dp</item>
</style>
<style name="Button.Secondary.XSmall" parent="TextView.UXStyle.Captions.1.Medium">
<style name="Button.Secondary.XSmall" parent="TextView.UXStyle.Captions.1.Regular">
<item name="android:background">@drawable/button_secondary_xsmall_selector</item>
<item name="android:textColor">@color/text_color_button_secondary_selector</item>
<item name="android:gravity">center</item>
@ -319,7 +319,7 @@
<item name="android:paddingBottom">5dp</item>
</style>
<style name="Button.Secondary.Small" parent="TextView.UXStyle.Body.Callout.Medium">
<style name="Button.Secondary.Small" parent="TextView.UXStyle.Body.Callout.Regular">
<item name="android:background">@drawable/button_secondary_small_selector</item>
<item name="android:textColor">@color/text_color_button_secondary_selector</item>
<item name="android:gravity">center</item>
@ -331,7 +331,7 @@
<item name="android:paddingBottom">7dp</item>
</style>
<style name="Button.Secondary.Medium" parent="TextView.UXStyle.Buttons.Medium">
<style name="Button.Secondary.Medium" parent="TextView.UXStyle.Body">
<item name="android:background">@drawable/button_secondary_medium_selector</item>
<item name="android:textColor">@color/text_color_button_secondary_selector</item>
<item name="android:gravity">center</item>
@ -343,7 +343,7 @@
<item name="android:paddingBottom">10dp</item>
</style>
<style name="Button.Secondary.Large" parent="TextView.UXStyle.Buttons.Medium">
<style name="Button.Secondary.Large" parent="TextView.UXStyle.Buttons.Regular">
<item name="android:background">@drawable/button_secondary_large_selector</item>
<item name="android:textColor">@color/text_color_button_secondary_selector</item>
<item name="android:gravity">center</item>

View file

@ -94,7 +94,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.wrapContentHeight()
.align(CenterHorizontally),
text = "Button",
size = ButtonSize.XSmall
size = ButtonSize.XSmallSecondary
)
ButtonSecondary(
onClick = {},
@ -103,7 +103,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.align(CenterHorizontally),
text = "Button",
enabled = false,
size = ButtonSize.XSmall
size = ButtonSize.XSmallSecondary
)
ButtonWarning(
onClick = {},
@ -144,7 +144,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.wrapContentHeight()
.align(CenterHorizontally),
text = "Button",
size = ButtonSize.Small
size = ButtonSize.SmallSecondary
)
ButtonSecondary(
onClick = {},
@ -153,7 +153,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.align(CenterHorizontally),
text = "Button",
enabled = false,
size = ButtonSize.Small
size = ButtonSize.SmallSecondary
)
ButtonWarning(
onClick = {},
@ -197,7 +197,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.padding(horizontal = 16.dp, vertical = 8.dp)
.align(CenterHorizontally),
text = "Button",
size = ButtonSize.Medium
size = ButtonSize.MediumSecondary
)
ButtonSecondary(
onClick = {},
@ -207,7 +207,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.align(CenterHorizontally),
text = "Button",
enabled = false,
size = ButtonSize.Medium
size = ButtonSize.MediumSecondary
)
ButtonWarning(
onClick = {},
@ -255,7 +255,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.padding(horizontal = 16.dp, vertical = 8.dp)
.align(CenterHorizontally),
text = "Button",
size = ButtonSize.Large
size = ButtonSize.LargeSecondary
)
ButtonSecondary(
onClick = {},
@ -266,7 +266,7 @@ class ComposeButtonsPrimaryFragment : BaseComposeFragment() {
.align(CenterHorizontally),
text = "Button",
enabled = false,
size = ButtonSize.Large
size = ButtonSize.LargeSecondary
)
ButtonWarning(
onClick = {},