GithubHelp home page GithubHelp logo

berserkertdl / styleabledatetimepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from artkoenig/styleabledatetimepicker

0.0 2.0 0.0 2.47 MB

A stylable version of the date/time picker for Android 4.0+ with embedding support (using as normal fragment)

License: MIT License

Makefile 0.46% Java 99.54%

styleabledatetimepicker's Introduction

StylableDateTimePicker

A styleable version of the date/time picker for Android 4.0+ with embedding support (using as normal fragment)

Styled DatePicker

Declare your style:

<style name="DateTimePicker">
    <item name="headerBackgroundColor">...</item>
    <item name="hightlightedTextColor">...</item>
    <item name="buttonBackground">...</item>
    <item name="buttonTextColor">...</item>
    <item name="circleHighlightColor">...</item>
    <item name="defaultTextColor">...</item>
    <item name="selectedDayTextSize">...</item>
    <item name="selectedMonthTextSize">...</item>
    <item name="selectedYearTextSize">...</item>
</style>

Create the DatePicker/TimePicker with

DatePickerDialog dialog = DatePickerDialog.newInstance(callBack, year, monthOfYear, dayOfMonth, R.style.DateTimePicker);

You can also add the pickers as content in your view hierarchy:

DatePickerDialog picker = DatePickerDialog.newInstance(...);
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.add(R.id.picker_wrapper, picker);
ft.commit();

Installation

At the moment you have to install the library "by hand" (I will release it for using with gradle soon):

copy the library to your "libs" folder. Then include the following line in your "settings.gradle":

include ':libs:datetimepicker'

then add the following lines to your "build.gradle":

repositories {
    mavenCentral()
    flatDir {            <--- add this
        dirs 'libs'      <---
    }                    <---
}

dependencies {
    compile project(':libs:datetimepicker')  <-- add this line
...

License

Copyright 2014 Artjom König

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.

styleabledatetimepicker's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.