Skip to content

Commit

Permalink
Move fonts into a separate assets folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrikL committed Dec 10, 2021
1 parent 2cdb736 commit 3d0ef09
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 10 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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<TextView>(R.id.tvHeaderText)
val terrain = v.findViewById<TextView>(R.id.tvTerrainText)
val encounter = v.findViewById<TextView>(R.id.tvEncounterText)
Expand Down
10 changes: 3 additions & 7 deletions app/src/main/java/com/example/ruinmasterstables/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -64,8 +60,8 @@ class MainActivity : AppCompatActivity(), View.OnClickListener {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

(findViewById<TextView>(R.id.custom_title)).typeface = Typeface.createFromAsset(assets, "Becker.ttf")
(findViewById<TextView>(R.id.tvIntro)).typeface = Typeface.createFromAsset(assets, "BarcelonaITCStd-Book.otf")
(findViewById<TextView>(R.id.custom_title)).typeface = Typeface.createFromAsset(assets, "fonts/Becker.ttf")
(findViewById<TextView>(R.id.tvIntro)).typeface = Typeface.createFromAsset(assets, "fonts/BarcelonaITCStd-Book.otf")

val files = assets.list("data")
if (files != null) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3d0ef09

Please sign in to comment.