Android-Iconics-String-Generator

Introduction: Icons fields generator for Android-Iconics Library https://github.com/mikepenz/Android-Iconics
More: Author   ReportBugs   
Tags:

Icons fields generator for Android-Iconics Library

Download

Install

testImplementation 'junit:junit:4.12' // required
testImplementation 'ru.ztrap.iconics:string-generator:1.0.5'

Usage

  1. Create some test-class in test directory
@RunWith(JUnit4::class)
class TestStringGenerator
  1. Make it extends from IconicsStringGenerator
@RunWith(JUnit4::class)
class TestStringGenerator : IconicsStringGenerator
  1. Override field for definition file creation strategy
@RunWith(JUnit4::class)
class TestStringGenerator : IconicsStringGenerator {
    override val fileCreationStrategy: FileCreationStrategy 
        get() = FileCreationStrategy.SAVE_ONLY_CURRENT // or FileCreationStrategy.SAVE_OLD
}
  1. Create @Test-method which will generate fields from your font
@RunWith(JUnit4::class)
class TestStringGenerator : IconicsStringGenerator {

    @Test fun generateGoogleMaterial() {
        generateIconsFrom(GoogleMaterial())
    }

    override val fileCreationStrategy: FileCreationStrategy 
        get() = FileCreationStrategy.SAVE_ONLY_CURRENT
}
  1. Run test

Optional settings

You can override this fields as you need:

/** @return modifier for mark file as current-version file */
protected open val modifierCurrent: String get() =  "_current_"

/** @return directory path for generated .xml file */
protected open val outputDirectory: String
    get() = "src${File.separator}main${File.separator}res${File.separator}values"

Developed By

License

   Copyright 2018-2019 zTrap

   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.
Support Me
Apps
About Me
Google+: Trinea trinea
GitHub: Trinea