From 6e896f805cac499b777c98755149f07ccd7ba5c3 Mon Sep 17 00:00:00 2001 From: Sam Blitzstein Date: Fri, 15 Feb 2013 16:46:06 -0800 Subject: Adding new timepicker library. Timepicker is a radial, animated selector. Change-Id: Ib6a6deebf7673dcb14561261314a0e082d4a3ffc --- .classpath | 8 + .project | 33 ++ Android.mk | 32 ++ AndroidManifest.xml | 22 + libs/android-support-v4.jar | 1 + proguard.flags | 7 + project.properties | 15 + res/layout-land/time_picker_dialog.xml | 112 +++++ res/layout-sw600dp/time_picker_dialog.xml | 105 ++++ res/layout/time_picker_dialog.xml | 105 ++++ res/values-land/dimens.xml | 28 ++ res/values-sw600dp-land/dimens.xml | 31 ++ res/values-sw600dp/dimens.xml | 31 ++ res/values-v11/styles.xml | 11 + res/values-v14/styles.xml | 11 + res/values-v16/styles.xml | 22 + res/values-v17/styles.xml | 22 + res/values/arrays.xml | 62 +++ res/values/colors.xml | 24 + res/values/dimens.xml | 43 ++ res/values/ids.xml | 19 + res/values/strings.xml | 26 + res/values/styles.xml | 51 ++ .../android/datetimepicker/AmPmCirclesView.java | 178 +++++++ src/com/android/datetimepicker/CircleView.java | 111 +++++ .../android/datetimepicker/RadialSelectorView.java | 345 ++++++++++++++ .../android/datetimepicker/RadialTextsView.java | 315 ++++++++++++ src/com/android/datetimepicker/TimePicker.java | 527 +++++++++++++++++++++ .../android/datetimepicker/TimePickerDialog.java | 301 ++++++++++++ 29 files changed, 2598 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 Android.mk create mode 100644 AndroidManifest.xml create mode 120000 libs/android-support-v4.jar create mode 100644 proguard.flags create mode 100644 project.properties create mode 100644 res/layout-land/time_picker_dialog.xml create mode 100644 res/layout-sw600dp/time_picker_dialog.xml create mode 100644 res/layout/time_picker_dialog.xml create mode 100644 res/values-land/dimens.xml create mode 100644 res/values-sw600dp-land/dimens.xml create mode 100644 res/values-sw600dp/dimens.xml create mode 100644 res/values-v11/styles.xml create mode 100644 res/values-v14/styles.xml create mode 100644 res/values-v16/styles.xml create mode 100644 res/values-v17/styles.xml create mode 100644 res/values/arrays.xml create mode 100644 res/values/colors.xml create mode 100644 res/values/dimens.xml create mode 100644 res/values/ids.xml create mode 100644 res/values/strings.xml create mode 100644 res/values/styles.xml create mode 100644 src/com/android/datetimepicker/AmPmCirclesView.java create mode 100644 src/com/android/datetimepicker/CircleView.java create mode 100644 src/com/android/datetimepicker/RadialSelectorView.java create mode 100644 src/com/android/datetimepicker/RadialTextsView.java create mode 100644 src/com/android/datetimepicker/TimePicker.java create mode 100644 src/com/android/datetimepicker/TimePickerDialog.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..3f9691c --- /dev/null +++ b/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..4d3f8e9 --- /dev/null +++ b/.project @@ -0,0 +1,33 @@ + + + datetimepicker + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..71027e5 --- /dev/null +++ b/Android.mk @@ -0,0 +1,32 @@ +# Copyright (C) 2013 The Android Open Source Project +# +# 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. + +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := android-opt-datetimepicker + +LOCAL_SDK_VERSION := 17 + +LOCAL_SRC_FILES := \ + $(call all-java-files-under, src) \ + $(call all-logtags-files-under, src) + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 + +LOCAL_PROGUARD_FLAG_FILES := proguard.flags + +include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 0000000..1b4672e --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar new file mode 120000 index 0000000..d36be8f --- /dev/null +++ b/libs/android-support-v4.jar @@ -0,0 +1 @@ +../../../../out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/javalib.jar \ No newline at end of file diff --git a/proguard.flags b/proguard.flags new file mode 100644 index 0000000..807160f --- /dev/null +++ b/proguard.flags @@ -0,0 +1,7 @@ +-keepclassmembers class com.android.datetimepicker.RadialSelectorView { + *** setAnimationRadiusMultiplier(...); +} + +-keepclassmembers class com.android.datetimepicker.RadialTextsView { + *** setAnimationRadiusMultiplier(...); +} diff --git a/project.properties b/project.properties new file mode 100644 index 0000000..484dab0 --- /dev/null +++ b/project.properties @@ -0,0 +1,15 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-17 +android.library=true diff --git a/res/layout-land/time_picker_dialog.xml b/res/layout-land/time_picker_dialog.xml new file mode 100644 index 0000000..7409c6e --- /dev/null +++ b/res/layout-land/time_picker_dialog.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + +