Skip to content

Commit b158301

Browse files
committed
chore: remove XML font resources
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 940d506 commit b158301

4 files changed

Lines changed: 7 additions & 35 deletions

File tree

app/src/main/java/com/getcode/theme/Type.kt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ import androidx.compose.ui.text.style.TextAlign
1313
import androidx.compose.ui.unit.sp
1414
import com.getcode.R
1515

16-
@OptIn(ExperimentalTextApi::class)
1716
private val Avenir = FontFamily(
1817
Font(R.font.avenir_next_regular, FontWeight.Thin),
1918
Font(R.font.avenir_next_regular, FontWeight.ExtraLight),
2019
Font(R.font.avenir_next_regular, FontWeight.Light),
2120
Font(R.font.avenir_next_regular, FontWeight.Normal),
2221
Font(R.font.avenir_next_medium, FontWeight.Medium),
23-
Font(
24-
resId = R.font.avenir_next_demi,
25-
weight = FontWeight.SemiBold,
26-
),
22+
Font(R.font.avenir_next_demi, FontWeight.SemiBold),
2723
Font(R.font.avenir_next_demi, FontWeight.Bold),
2824
Font(R.font.avenir_next_demi, FontWeight.ExtraBold),
2925
Font(R.font.avenir_next_demi, FontWeight.Black)
@@ -131,14 +127,4 @@ val Typography.displayLarge: TextStyle
131127
@Composable get() = h1.copy(fontSize = 55.sp)
132128

133129
fun TextStyle.withRobotoMono(weight: FontWeight? = this.fontWeight) = with(RobotoMono, weight)
134-
fun TextStyle.with(fontFamily: FontFamily, weight: FontWeight? = this.fontWeight): TextStyle = copy(fontFamily = fontFamily, fontWeight = weight)
135-
136-
fun ascenderHeight(ascenderHeight: Float): FontVariation.Setting {
137-
require(ascenderHeight in 649f..854f) { "'Ascender Height' must be in 649f..854f" }
138-
return FontVariation.Setting("YTAS", ascenderHeight)
139-
}
140-
141-
fun counterWidth(counterWidth: Int): FontVariation.Setting {
142-
require(counterWidth in 323..603) { "'Counter width' must be in 323..603" }
143-
return FontVariation.Setting("XTRA", counterWidth.toFloat())
144-
}
130+
fun TextStyle.with(fontFamily: FontFamily, weight: FontWeight? = this.fontWeight): TextStyle = copy(fontFamily = fontFamily, fontWeight = weight)

app/src/main/java/com/getcode/view/login/BaseAccessKeyViewModel.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ abstract class BaseAccessKeyViewModel(private val resources: ResourceHelper) :
217217
return imageOut
218218
}
219219

220-
internal fun getQrCode(entropyB64: String): Bitmap? {
220+
private fun getQrCode(entropyB64: String): Bitmap? {
221221
val base58 = Base58.encode(entropyB64.decodeBase64())
222222
val url = "${resources.getString(R.string.root_url_app)}/login?data=$base58"
223223

@@ -239,7 +239,7 @@ abstract class BaseAccessKeyViewModel(private val resources: ResourceHelper) :
239239
textPaint.color = color
240240
textPaint.textSize = sizePx.toFloat()
241241
textPaint.typeface = Typeface.create(
242-
resources.getFont(R.font.avenir),
242+
resources.getFont(R.font.avenir_next_demi),
243243
Typeface.BOLD
244244
)
245245

@@ -249,17 +249,17 @@ abstract class BaseAccessKeyViewModel(private val resources: ResourceHelper) :
249249
canvas.drawText(text, xV.toFloat(), y.toFloat(), textPaint)
250250
}
251251

252-
internal fun getAccessKeySaveError() = TopBarManager.TopBarMessage(
252+
private fun getAccessKeySaveError() = TopBarManager.TopBarMessage(
253253
resources.getString(R.string.error_title_failedToSave),
254254
resources.getString(R.string.error_description_failedToSave),
255255
)
256256

257-
internal fun getDeniedError() = TopBarManager.TopBarMessage(
257+
private fun getDeniedError() = TopBarManager.TopBarMessage(
258258
resources.getString(R.string.error_title_tooManyAccounts),
259259
resources.getString(R.string.error_description_tooManyAccounts)
260260
)
261261

262-
internal fun getGenericError() = TopBarManager.TopBarMessage(
262+
private fun getGenericError() = TopBarManager.TopBarMessage(
263263
resources.getString(R.string.error_title_failedToVerifyPhone),
264264
resources.getString(R.string.error_description_failedToVerifyPhone),
265265
)

app/src/main/res/font/avenir.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/src/main/res/font/roboto_mono.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)