Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

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

README.md

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.

Including in your project

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

repositories {
    maven {
    	jcenter()
    }
}
dependencies {
    compile "ch.poole:OpeningHoursFragment:0.8.3"
}

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.

About

Android UI element for displaying and editing an opening hours value

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.