Skip to content

Custom components library used across my Android projects

License

Notifications You must be signed in to change notification settings

oorjalabs/CustomComponents

Repository files navigation

CustomComponents

Custom components used across my Android projects

Adding to project

Add jitpack repository in project build.gradle at the end of list of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency to module build.gradle

dependencies {
    implementation 'io.github.adityabhaskar:CustomComponents:<version>'
}

See badge above for current version number.

Other usage notes

Custom Preferences

If using custom preferences, ideally extend settings fragment from CustomSettingsFragment. The custom fragment handles onDisplayPreferenceDialog to show the custom preference dialogs.

Otherwise, use CustomPreferenceUtils.displayPreferenceDialog method to let the library handle displaying dialogs. Sample usage:

    override fun onDisplayPreferenceDialog(preference: Preference?) {
        val fm = parentFragment?.childFragmentManager
        
        if(CustomPreferenceUtils.displayPreferenceDialog(preference, fm, this))
            return
        
        // Do any other preference dialog handling here, if needed.
        
        super.onDisplayPreferenceDialog(preference)
    }

Customisable resource values and attributes

Update notes fragment

Details on how to use are here.

Confirmation dialog

Details on how to use are here.

Apps using this library