diff --git a/navlib-font/build.gradle b/navlib-font/build.gradle new file mode 100644 index 0000000..0a5a9cb --- /dev/null +++ b/navlib-font/build.gradle @@ -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" +} diff --git a/navlib-font/consumer-proguard-rules.pro b/navlib-font/consumer-proguard-rules.pro new file mode 100644 index 0000000..ef3e42a --- /dev/null +++ b/navlib-font/consumer-proguard-rules.pro @@ -0,0 +1 @@ +-keep class com.mikepenz.iconics.typeface.library.navlibfont.NavLibFont { *; } diff --git a/navlib-font/gradle.properties b/navlib-font/gradle.properties new file mode 100644 index 0000000..163aa9f --- /dev/null +++ b/navlib-font/gradle.properties @@ -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 diff --git a/navlib-font/src/main/AndroidManifest.xml b/navlib-font/src/main/AndroidManifest.xml new file mode 100644 index 0000000..edcc980 --- /dev/null +++ b/navlib-font/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/navlib-font/src/main/java/com/mikepenz/iconics/typeface/library/navlibfont/NavLibFont.kt b/navlib-font/src/main/java/com/mikepenz/iconics/typeface/library/navlibfont/NavLibFont.kt new file mode 100644 index 0000000..822fde5 --- /dev/null +++ b/navlib-font/src/main/java/com/mikepenz/iconics/typeface/library/navlibfont/NavLibFont.kt @@ -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 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 + 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 } + } +} \ No newline at end of file diff --git a/navlib-font/src/main/res/font/navlibfont_font_v1_0.ttf b/navlib-font/src/main/res/font/navlibfont_font_v1_0.ttf new file mode 100644 index 0000000..f0da011 Binary files /dev/null and b/navlib-font/src/main/res/font/navlibfont_font_v1_0.ttf differ diff --git a/navlib-font/src/main/res/values/font_addon.xml b/navlib-font/src/main/res/values/font_addon.xml new file mode 100644 index 0000000..1d094be --- /dev/null +++ b/navlib-font/src/main/res/values/font_addon.xml @@ -0,0 +1,20 @@ + + + + + com.mikepenz.iconics.typeface.library.navlibfont.NavLibFont + diff --git a/navlib-font/src/main/res/values/font_description.xml b/navlib-font/src/main/res/values/font_description.xml new file mode 100644 index 0000000..1421308 --- /dev/null +++ b/navlib-font/src/main/res/values/font_description.xml @@ -0,0 +1,31 @@ + + + + + year;author;libraryName;libraryWebsite + Kuba SzczodrzyƄski + https://github.com/kuba2k2/NavLib + NavLibFont + + https://github.com/kuba2k2/NavLib + @string/NavLibFont_version + + true + https://github.com/kuba2k2/NavLib + + 2018 +