mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Add Font Awesome
Using https://github.com/finnmglas/fontawesome-android
This commit is contained in:
parent
92e8cbd450
commit
7cd450f897
5 changed files with 102 additions and 0 deletions
BIN
app/src/main/assets/fontawesome/fa-brands-400.ttf
Normal file
BIN
app/src/main/assets/fontawesome/fa-brands-400.ttf
Normal file
Binary file not shown.
BIN
app/src/main/assets/fontawesome/fa-regular-400.ttf
Normal file
BIN
app/src/main/assets/fontawesome/fa-regular-400.ttf
Normal file
Binary file not shown.
BIN
app/src/main/assets/fontawesome/fa-solid-900.ttf
Normal file
BIN
app/src/main/assets/fontawesome/fa-solid-900.ttf
Normal file
Binary file not shown.
93
app/src/main/java/com/finnmglas/launcher/FontAwesome.kt
Normal file
93
app/src/main/java/com/finnmglas/launcher/FontAwesome.kt
Normal file
|
@ -0,0 +1,93 @@
|
|||
package com.finnmglas.launcher // replace with your package
|
||||
|
||||
// On GitHub: https://github.com/finnmglas/fontawesome-android
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Typeface
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
|
||||
|
||||
class FontAwesomeSolid : AppCompatTextView {
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
defStyle: Int
|
||||
) : super(context, attrs, defStyle) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(
|
||||
context,
|
||||
attrs
|
||||
) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context?) : super(context) {
|
||||
init()
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
typeface = Typeface.createFromAsset(
|
||||
context.assets,
|
||||
"fontawesome/fa-solid-900.ttf"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class FontAwesomeRegular : AppCompatTextView {
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
defStyle: Int
|
||||
) : super(context, attrs, defStyle) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(
|
||||
context,
|
||||
attrs
|
||||
) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context?) : super(context) {
|
||||
init()
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
typeface = Typeface.createFromAsset(
|
||||
context.assets,
|
||||
"fontawesome/fa-regular-400.ttf"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class FontAwesomeBrand : AppCompatTextView {
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
defStyle: Int
|
||||
) : super(context, attrs, defStyle) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(
|
||||
context,
|
||||
attrs
|
||||
) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context?) : super(context) {
|
||||
init()
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
typeface = Typeface.createFromAsset(
|
||||
context.assets,
|
||||
"fontawesome/fa-brands-400.ttf"
|
||||
)
|
||||
}
|
||||
}
|
9
app/src/main/res/values/icons.xml
Normal file
9
app/src/main/res/values/icons.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="fas_bars" translatable="false"></string>
|
||||
<string name="fas_home" translatable="false"></string>
|
||||
<string name="fas_globe" translatable="false"></string>
|
||||
<string name="fas_star" translatable="false"></string>
|
||||
|
||||
<string name="far_star" translatable="false"></string>
|
||||
</resources>
|
Loading…
Add table
Reference in a new issue