Permalink
Browse files

add DrumPicker Project

  • Loading branch information...
sys1yagi committed Apr 25, 2011
1 parent 0d5ec6f commit b2c4b8a056015154e579204753db0d53d9df7413
Showing with 1,124 additions and 0 deletions.
  1. +8 −0 DrumPicker/trunk/.classpath
  2. +33 −0 DrumPicker/trunk/.project
  3. +18 −0 DrumPicker/trunk/AndroidManifest.xml
  4. BIN DrumPicker/trunk/bin/DrumPickerActivity.apk
  5. BIN DrumPicker/trunk/bin/classes.dex
  6. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/DrumPickerActivity$1.class
  7. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/DrumPickerActivity$2.class
  8. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/DrumPickerActivity$3.class
  9. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/DrumPickerActivity$4.class
  10. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/DrumPickerActivity.class
  11. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/R$attr.class
  12. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/R$drawable.class
  13. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/R$id.class
  14. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/R$layout.class
  15. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/R$string.class
  16. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/R$style.class
  17. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/R.class
  18. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/TestDateDrumPicker.class
  19. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DateDrumPicker$1.class
  20. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DateDrumPicker$2.class
  21. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DateDrumPicker.class
  22. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPicker$1.class
  23. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPicker$2.class
  24. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPicker$3.class
  25. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPicker$IsGoneListener.class
  26. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPicker$OnPositionChangedListener.class
  27. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPicker.class
  28. BIN ...trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPickerScrollView$OnPositionChangedListener.class
  29. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPickerScrollView.class
  30. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPickerScroller.class
  31. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/DrumPickerScroller2_3.class
  32. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/IDrumPickerScroller.class
  33. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/ScrollerFactory.class
  34. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/TimeDrumPicker$1.class
  35. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/TimeDrumPicker.class
  36. BIN DrumPicker/trunk/bin/jp/dip/sys1/android/drumpicker/lib/Util.class
  37. BIN DrumPicker/trunk/bin/resources.ap_
  38. +11 −0 DrumPicker/trunk/default.properties
  39. +40 −0 DrumPicker/trunk/gen/jp/dip/sys1/android/drumpicker/R.java
  40. +36 −0 DrumPicker/trunk/proguard.cfg
  41. BIN DrumPicker/trunk/res/drawable-hdpi/icon.png
  42. BIN DrumPicker/trunk/res/drawable-ldpi/icon.png
  43. BIN DrumPicker/trunk/res/drawable-mdpi/icon.png
  44. +38 −0 DrumPicker/trunk/res/layout-land/main.xml
  45. +30 −0 DrumPicker/trunk/res/layout/main.xml
  46. +11 −0 DrumPicker/trunk/res/values-ja/strings.xml
  47. +12 −0 DrumPicker/trunk/res/values/strings.xml
  48. +9 −0 DrumPicker/trunk/res/values/styles.xml
  49. +86 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/DrumPickerActivity.java
  50. +194 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/DateDrumPicker.java
  51. +271 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/DrumPicker.java
  52. +144 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/DrumPickerScrollView.java
  53. +14 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/DrumPickerScroller.java
  54. +14 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/DrumPickerScroller2_3.java
  55. +5 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/IDrumPickerScroller.java
  56. +51 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/ScrollerFactory.java
  57. +77 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/TimeDrumPicker.java
  58. +15 −0 DrumPicker/trunk/src/jp/dip/sys1/android/drumpicker/lib/Util.java
  59. +7 −0 DrumPicker/trunk/tests/jp/dip/sys1/android/drumpicker/TestDateDrumPicker.java
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="src" path="tests"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>DrumPicker</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="jp.dip.sys1.android.drumpicker" android:versionCode="1"
+ android:versionName="1.0">
+ <uses-sdk android:minSdkVersion="4" />
+
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:name=".DrumPickerActivity" android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <uses-library android:name="android.test.runner" />
+ </application>
+ <instrumentation android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="jp.dip.sys1.android.drumpicker" android:label="Tests for DrumPicker" />
+</manifest>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
+# 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 use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-10
@@ -0,0 +1,40 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package jp.dip.sys1.android.drumpicker;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int icon=0x7f020000;
+ }
+ public static final class id {
+ public static final int button=0x7f060004;
+ public static final int button2=0x7f060005;
+ public static final int date=0x7f060000;
+ public static final int datepicker=0x7f060001;
+ public static final int time=0x7f060002;
+ public static final int timepicker=0x7f060003;
+ }
+ public static final class layout {
+ public static final int main=0x7f030000;
+ }
+ public static final class string {
+ public static final int app_name=0x7f040000;
+ public static final int day=0x7f040003;
+ public static final int hour=0x7f040004;
+ public static final int init=0x7f040007;
+ public static final int minitue=0x7f040005;
+ public static final int month=0x7f040002;
+ public static final int plusone=0x7f040006;
+ public static final int year=0x7f040001;
+ }
+ public static final class style {
+ public static final int Text=0x7f050000;
+ }
+}
@@ -0,0 +1,36 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native <methods>;
+}
+
+-keepclasseswithmembernames class * {
+ public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembernames class * {
+ public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="fill_parent" android:gravity="center">
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:gravity="center">
+ <TextView android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/date"
+ android:gravity="center" android:textColor="#ffffffff"
+ android:textSize="30dp" android:layout_weight="1"></TextView>
+ <TextView android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/time"
+ android:gravity="center" android:textColor="#ffffffff"
+ android:textSize="30dp" android:layout_weight="2"></TextView>
+ </LinearLayout>
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="fill_parent" android:layout_height="wrap_content"
+ android:gravity="center">
+ <jp.dip.sys1.android.drumpicker.lib.DateDrumPicker
+ android:id="@+id/datepicker" android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:layout_weight="1" />
+ <jp.dip.sys1.android.drumpicker.lib.TimeDrumPicker
+ android:id="@+id/timepicker" android:layout_width="wrap_content"
+ android:layout_height="wrap_content" android:layout_weight="2" />
+ </LinearLayout>
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <Button android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/button"
+ android:layout_weight="1" android:text="@string/plusone" />
+ <Button android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/button2"
+ android:layout_weight="1" android:text="@string/init" />
+ </LinearLayout>
+</LinearLayout>
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="fill_parent" android:gravity="center">
+ <TextView android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/date"
+ android:gravity="center" android:textColor="#ffffffff"
+ android:textSize="30dp"></TextView>
+ <jp.dip.sys1.android.drumpicker.lib.DateDrumPicker
+ android:id="@+id/datepicker" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <TextView android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/time"
+ android:gravity="center" android:textColor="#ffffffff"
+ android:textSize="30dp"></TextView>
+ <jp.dip.sys1.android.drumpicker.lib.TimeDrumPicker
+ android:id="@+id/timepicker" android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <Button android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/button"
+ android:layout_weight="1" android:text="@string/plusone" />
+ <Button android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:id="@+id/button2"
+ android:layout_weight="1" android:text="@string/init" />
+ </LinearLayout>
+</LinearLayout>
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="year">年</string>
+ <string name="month">月</string>
+ <string name="day">日</string>
+ <string name="hour">時</string>
+ <string name="minitue">分</string>
+
+ <string name="plusone">+1 minute</string>
+ <string name="init">初期化</string>
+</resources>
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">DrumPicker</string>
+ <string name="year">/</string>
+ <string name="month">/</string>
+ <string name="day">/</string>
+ <string name="hour">:</string>
+ <string name="minitue"></string>
+
+ <string name="plusone">+1 minute</string>
+ <string name="init">initizlize</string>
+</resources>
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources >
+ <style name="Text" parent="android:style/Widget.TextView">
+ <item name="android:shadowColor">#FF000000</item>
+ <item name="android:shadowDx">1.0</item>
+ <item name="android:shadowDy">1.0</item>
+ <item name="android:shadowRadius">0.5</item>
+ </style>
+</resources>
@@ -0,0 +1,86 @@
+package jp.dip.sys1.android.drumpicker;
+
+import java.util.Calendar;
+
+import jp.dip.sys1.android.drumpicker.lib.DateDrumPicker;
+import jp.dip.sys1.android.drumpicker.lib.TimeDrumPicker;
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.DatePicker;
+import android.widget.DatePicker.OnDateChangedListener;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.TimePicker.OnTimeChangedListener;
+
+public class DrumPickerActivity extends Activity {
+ private final static String TAG = DrumPickerActivity.class.getSimpleName();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ final String TIME_FORMAT = "%02d" + getString(R.string.hour) + "%02d"
+ + getString(R.string.minitue);
+ final String DATE_FORMAT = "%04d"
+ +getString(R.string.year)
+ +"%02d"
+ +getString(R.string.month)
+ +"%02d"
+ +getString(R.string.day)
+ ;
+
+ Calendar calendar = Calendar.getInstance();
+ final int year = calendar.get(Calendar.YEAR);
+ final int month = calendar.get(Calendar.MONDAY);
+ final int day = calendar.get(Calendar.DAY_OF_MONTH);
+ final int hour = calendar.get(Calendar.HOUR_OF_DAY);
+ final int minitue = calendar.get(Calendar.MINUTE);
+ setContentView(R.layout.main);
+ final TextView time = (TextView) findViewById(R.id.time);
+ time.setText(String.format(TIME_FORMAT, hour, minitue));
+ final TimeDrumPicker tPicker = (TimeDrumPicker) findViewById(R.id.timepicker);
+ tPicker.setHour(hour);
+ tPicker.setMinitue(minitue);
+ tPicker.setOnTimeChangedListener(new OnTimeChangedListener() {
+ @Override
+ public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
+ time.setText(String.format(TIME_FORMAT, hourOfDay, minute));
+ }
+ });
+
+ final TextView date = (TextView) findViewById(R.id.date);
+ date.setText(String.format(DATE_FORMAT, year, month, day));
+ final DateDrumPicker dPicker = (DateDrumPicker) findViewById(R.id.datepicker);
+
+ dPicker.setOnDateChangedListener(new OnDateChangedListener() {
+ @Override
+ public void onDateChanged(DatePicker view, int year,
+ int monthOfYear, int dayOfMonth) {
+ date.setText(String.format(DATE_FORMAT, year, monthOfYear,
+ dayOfMonth));
+ }
+ });
+
+ findViewById(R.id.button).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ tPicker.setMinitue(tPicker.getMinitue() + 1);
+ }
+ });
+ findViewById(R.id.button2).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ dPicker.setYear(year);
+ dPicker.setMonth(month);
+ dPicker.setDay(day);
+
+ tPicker.setHour(hour);
+ tPicker.setMinitue(minitue);
+
+ }
+ });
+ }
+}
Oops, something went wrong.

0 comments on commit b2c4b8a

Please sign in to comment.