All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.likethesalad.placeholder.data.helpers.wrappers.ApplicationVariantWrapper.kt Maven / Gradle / Ivy

Go to download

This is a Gradle plugin for Android applications which resolves XML string references in other XML strings.

There is a newer version: 1.3.0
Show newest version
package com.likethesalad.placeholder.data.helpers.wrappers

class ApplicationVariantWrapper(private val applicationVariant: Any) {

    private val clazz = applicationVariant.javaClass
    private val getNameMethod by lazy { clazz.getMethod("getName") }
    private val getFlavorNameMethod by lazy { clazz.getMethod("getFlavorName") }

    fun getName(): String {
        return getNameMethod.invoke(applicationVariant) as String
    }

    fun getFlavorName(): String {
        return getFlavorNameMethod.invoke(applicationVariant) as String
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy