Add navlib-font

This commit is contained in:
Kuba Szczodrzyński 2021-03-21 13:19:28 +01:00
parent 28cdab3414
commit 642d297cd0
8 changed files with 204 additions and 0 deletions

44
navlib-font/build.gradle Normal file
View File

@ -0,0 +1,44 @@
/*
* Copyright 2019 Mike Penz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion setup.compileSdk
defaultConfig {
minSdkVersion setup.minSdk
targetSdkVersion setup.targetSdk
consumerProguardFiles 'consumer-proguard-rules.pro'
versionCode 10
versionName "1.0"
resValue "string", "NavLibFont_version", "${versionName}"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation "com.mikepenz:iconics-core:5.2.8"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}

View File

@ -0,0 +1 @@
-keep class com.mikepenz.iconics.typeface.library.navlibfont.NavLibFont { *; }

View File

@ -0,0 +1,18 @@
#
# Copyright 2019 Mike Penz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
POM_NAME=Android-Iconics NavLibFont Typeface Library
POM_ARTIFACT_ID=navlibfont-typeface
POM_PACKAGING=aar

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2019 Mike Penz
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest package="com.mikepenz.iconics.typeface.library.navlibfont" />

View File

@ -0,0 +1,72 @@
/*
* Copyright 2019 Mike Penz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mikepenz.iconics.typeface.library.navlibfont
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.iconics.typeface.ITypeface
import java.util.LinkedList
@Suppress("EnumEntryName")
object NavLibFont : ITypeface {
override val fontRes: Int
get() = R.font.navlibfont_font_v1_0
override val characters: Map<String, Char> by lazy {
Icon.values().associate { it.name to it.character }
}
override val mappingPrefix: String
get() = "nav"
override val fontName: String
get() = "NavLibFont"
override val version: String
get() = "1.0"
override val iconCount: Int
get() = characters.size
override val icons: List<String>
get() = characters.keys.toCollection(LinkedList())
override val author: String
get() = "Kuba Szczodrzyński"
override val url: String
get() = "https://github.com/kuba2k2/NavLib"
override val description: String
get() = ""
override val license: String
get() = ""
override val licenseUrl: String
get() = ""
override fun getIcon(key: String): IIcon = Icon.valueOf(key)
enum class Icon constructor(override val character: Char) : IIcon {
nav_dots_vertical('\ue801'),
nav_menu('\ue800'),
nav_sort_ascending('\ue803'),
nav_sort_descending('\ue802');
override val typeface: ITypeface by lazy { NavLibFont }
}
}

Binary file not shown.

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2019 Mike Penz
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="define_font_NavLibFont">com.mikepenz.iconics.typeface.library.navlibfont.NavLibFont</string>
</resources>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2019 Mike Penz
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<string name="define_FontAwesome">year;author;libraryName;libraryWebsite</string>
<string name="library_FontAwesome_author">Kuba Szczodrzyński</string>
<string name="library_FontAwesome_authorWebsite">https://github.com/kuba2k2/NavLib</string>
<string name="library_FontAwesome_libraryName">NavLibFont</string>
<string name="library_FontAwesome_libraryDescription"></string>
<string name="library_FontAwesome_libraryWebsite">https://github.com/kuba2k2/NavLib</string>
<string name="library_FontAwesome_libraryVersion">@string/NavLibFont_version</string>
<string name="library_FontAwesome_licenseId"></string>
<string name="library_FontAwesome_isOpenSource">true</string>
<string name="library_FontAwesome_repositoryLink">https://github.com/kuba2k2/NavLib</string>
<!-- Custom variables section -->
<string name="library_FontAwesome_year">2018</string>
</resources>