Skip to content

simonpoole/OpeningHoursFragment

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

build status Quality Gate Status Coverage sonarcloud bugs sonarcould maintainability sonarcloud security sonarcloud reliability

OpeningHoursFragment

This is a re-usable UI element for editing opening hour values that covers the complete specification, it is suitable for non-destructive editing (it will not overwrite or destroy valid opening hours values).

Screenshot

Please see the end user documentation for more information.

Usage

From a FragmentActivity

    FragmentManager fm = getSupportFragmentManager();
    ...
	OpeningHoursFragment openingHoursDialog = OpeningHoursFragment.newInstance(key,finalValue, R.style.Theme_AppCompat_Light_Dialog_Alert, -1, true);
	openingHoursDialog.show(fm, "fragment_opening_hours");

The calling activity needs to implement ch.poole.openinghoursfragement.OnSaveListener which will be used when the user saves a OH value. Have a look at the test app for a working trivial example.

From a Fragment

    FragmentManager fm = getChildFragmentManager();
    ...
	OpeningHoursFragment openingHoursDialog = OpeningHoursFragment.newInstanceForFragment(key,finalValue, R.style.Theme_AppCompat_Light_Dialog_Alert, -1, true);
	openingHoursDialog.show(fm, "fragment_opening_hours");

The calling Fragment needs to implement ch.poole.openinghoursfragement.OnSaveListener which will be used when the user saves a OH value. Have a look at the test app for a working trivial example.

For other variants please see the javadoc.

If you are overriding onActivityResult in the Activity calling the Fragment, you need to check that you calling through to super, or else loading and saving templates will fail silently.

Including in your project

Add the following to your build.gradle file(s):

repositories {
    maven {
    	mavenCentral()
    }
}
dependencies {
    compile "ch.poole:OpeningHoursFragment:0.13.2"
}

About

Android UI element for displaying and editing an opening hours value

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages