From 3d0ef096cabd2cd205d7de6ea01ac1680264c90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrik=20Laur=C3=A9n?= Date: Fri, 10 Dec 2021 12:21:31 +0100 Subject: [PATCH] Move fonts into a separate assets folder --- .../assets/{ => fonts}/BarcelonaITCStd-Bold.otf | Bin .../{ => fonts}/BarcelonaITCStd-BoldItalic.otf | Bin .../assets/{ => fonts}/BarcelonaITCStd-Book.otf | Bin .../{ => fonts}/BarcelonaITCStd-BookItalic.otf | Bin .../assets/{ => fonts}/BarcelonaITCStd-Medium.otf | Bin app/src/main/assets/{ => fonts}/Becker.ttf | Bin .../ruinmasterstables/DisplayResultFragment.kt | 6 +++--- .../com/example/ruinmasterstables/MainActivity.kt | 10 +++------- 8 files changed, 6 insertions(+), 10 deletions(-) rename app/src/main/assets/{ => fonts}/BarcelonaITCStd-Bold.otf (100%) rename app/src/main/assets/{ => fonts}/BarcelonaITCStd-BoldItalic.otf (100%) rename app/src/main/assets/{ => fonts}/BarcelonaITCStd-Book.otf (100%) rename app/src/main/assets/{ => fonts}/BarcelonaITCStd-BookItalic.otf (100%) rename app/src/main/assets/{ => fonts}/BarcelonaITCStd-Medium.otf (100%) rename app/src/main/assets/{ => fonts}/Becker.ttf (100%) diff --git a/app/src/main/assets/BarcelonaITCStd-Bold.otf b/app/src/main/assets/fonts/BarcelonaITCStd-Bold.otf similarity index 100% rename from app/src/main/assets/BarcelonaITCStd-Bold.otf rename to app/src/main/assets/fonts/BarcelonaITCStd-Bold.otf diff --git a/app/src/main/assets/BarcelonaITCStd-BoldItalic.otf b/app/src/main/assets/fonts/BarcelonaITCStd-BoldItalic.otf similarity index 100% rename from app/src/main/assets/BarcelonaITCStd-BoldItalic.otf rename to app/src/main/assets/fonts/BarcelonaITCStd-BoldItalic.otf diff --git a/app/src/main/assets/BarcelonaITCStd-Book.otf b/app/src/main/assets/fonts/BarcelonaITCStd-Book.otf similarity index 100% rename from app/src/main/assets/BarcelonaITCStd-Book.otf rename to app/src/main/assets/fonts/BarcelonaITCStd-Book.otf diff --git a/app/src/main/assets/BarcelonaITCStd-BookItalic.otf b/app/src/main/assets/fonts/BarcelonaITCStd-BookItalic.otf similarity index 100% rename from app/src/main/assets/BarcelonaITCStd-BookItalic.otf rename to app/src/main/assets/fonts/BarcelonaITCStd-BookItalic.otf diff --git a/app/src/main/assets/BarcelonaITCStd-Medium.otf b/app/src/main/assets/fonts/BarcelonaITCStd-Medium.otf similarity index 100% rename from app/src/main/assets/BarcelonaITCStd-Medium.otf rename to app/src/main/assets/fonts/BarcelonaITCStd-Medium.otf diff --git a/app/src/main/assets/Becker.ttf b/app/src/main/assets/fonts/Becker.ttf similarity index 100% rename from app/src/main/assets/Becker.ttf rename to app/src/main/assets/fonts/Becker.ttf diff --git a/app/src/main/java/com/example/ruinmasterstables/DisplayResultFragment.kt b/app/src/main/java/com/example/ruinmasterstables/DisplayResultFragment.kt index a7bec6a..fde9b55 100644 --- a/app/src/main/java/com/example/ruinmasterstables/DisplayResultFragment.kt +++ b/app/src/main/java/com/example/ruinmasterstables/DisplayResultFragment.kt @@ -42,9 +42,9 @@ class DisplayResultFragment : DialogFragment() { ): View { // Inflate the layout for this fragment val v: View = inflater.inflate(R.layout.fragment_display_result, container, false) - val headlineFont = Typeface.createFromAsset(this.requireContext().assets, "BarcelonaITCStd-Bold.otf") - val textFont = Typeface.createFromAsset(this.requireContext().assets, "BarcelonaITCStd-Book.otf") - val buttonFont = Typeface.createFromAsset(this.requireContext().assets, "BarcelonaITCStd-Medium.otf") + val headlineFont = Typeface.createFromAsset(this.requireContext().assets, "fonts/BarcelonaITCStd-Bold.otf") + val textFont = Typeface.createFromAsset(this.requireContext().assets, "fonts/BarcelonaITCStd-Book.otf") + val buttonFont = Typeface.createFromAsset(this.requireContext().assets, "fonts/BarcelonaITCStd-Medium.otf") val header = v.findViewById(R.id.tvHeaderText) val terrain = v.findViewById(R.id.tvTerrainText) val encounter = v.findViewById(R.id.tvEncounterText) diff --git a/app/src/main/java/com/example/ruinmasterstables/MainActivity.kt b/app/src/main/java/com/example/ruinmasterstables/MainActivity.kt index ec32df0..f4d0f3e 100644 --- a/app/src/main/java/com/example/ruinmasterstables/MainActivity.kt +++ b/app/src/main/java/com/example/ruinmasterstables/MainActivity.kt @@ -4,9 +4,6 @@ package com.example.ruinmasterstables -import android.content.res.Resources -import android.graphics.ColorFilter -import android.graphics.PorterDuff import android.graphics.Typeface import androidx.appcompat.app.AppCompatActivity import android.os.Bundle @@ -17,7 +14,6 @@ import com.fasterxml.jackson.module.kotlin.* import android.view.View import android.widget.LinearLayout import android.widget.TextView -import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat import com.fasterxml.jackson.core.type.TypeReference import com.fasterxml.jackson.databind.ObjectMapper @@ -64,8 +60,8 @@ class MainActivity : AppCompatActivity(), View.OnClickListener { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - (findViewById(R.id.custom_title)).typeface = Typeface.createFromAsset(assets, "Becker.ttf") - (findViewById(R.id.tvIntro)).typeface = Typeface.createFromAsset(assets, "BarcelonaITCStd-Book.otf") + (findViewById(R.id.custom_title)).typeface = Typeface.createFromAsset(assets, "fonts/Becker.ttf") + (findViewById(R.id.tvIntro)).typeface = Typeface.createFromAsset(assets, "fonts/BarcelonaITCStd-Book.otf") val files = assets.list("data") if (files != null) { @@ -209,7 +205,7 @@ class MainActivity : AppCompatActivity(), View.OnClickListener { dynamicButton.minimumWidth = 700 dynamicButton.setPadding(0, 40, 0, 40) dynamicButton.textSize = 20.0F - dynamicButton.typeface = Typeface.createFromAsset(assets, "BarcelonaITCStd-Medium.otf") + dynamicButton.typeface = Typeface.createFromAsset(assets, "fonts/BarcelonaITCStd-Medium.otf") dynamicButton.backgroundTintList = ContextCompat.getColorStateList(this, R.color.rm_table_dark) dynamicButton.setOnClickListener(this) linearLayout.addView(dynamicButton)