Add Gradle compilation support

- Removed obsolete proguard flags.
- Added {min,target}SdkVersion info to manifest.

Change-Id: Id482b58d16d4c38833d50da557a16a959ec9ff12
diff --git a/Android.mk b/Android.mk
index 60ecb55..3947dcf 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,24 +1,16 @@
-LOCAL_PATH:= $(call my-dir)
+LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_TAGS := optional
+LOCAL_SDK_VERSION := current
 
-LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
-LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
+LOCAL_PACKAGE_NAME := DeskClock
+LOCAL_OVERRIDES_PACKAGES := AlarmClock
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := DeskClock
-
-LOCAL_OVERRIDES_PACKAGES := AlarmClock
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-v13
 
 LOCAL_AAPT_FLAGS := --auto-add-overlay
 
 include $(BUILD_PACKAGE)
-
-# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 81a13ba..ff26102 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,3 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2015 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.
+  -->
+
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.android.deskclock"
         android:versionCode="303" android:versionName="3.0.3">
@@ -5,6 +22,8 @@
     <original-package android:name="com.android.alarmclock" />
     <original-package android:name="com.android.deskclock" />
 
+    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="22" />
+
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
     <uses-permission android:name="android.permission.WAKE_LOCK"/>
     <uses-permission android:name="android.permission.VIBRATE"/>
@@ -242,4 +261,3 @@
         </service>
     </application>
 </manifest>
-
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..8e90ddd
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,37 @@
+/*
+* Copyright (C) 2015 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.
+*/
+
+apply plugin: "com.android.application"
+
+android {
+    sourceSets {
+        main {
+            manifest.srcFile "AndroidManifest.xml"
+            java.srcDir "src"
+            res.srcDir "res"
+            assets.srcDir "assets"
+        }
+    }
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_7
+        targetCompatibility JavaVersion.VERSION_1_7
+    }
+
+    dependencies {
+        compile project(":support-v13")
+    }
+}
diff --git a/proguard.flags b/proguard.flags
deleted file mode 100644
index 81f1190..0000000
--- a/proguard.flags
+++ /dev/null
@@ -1,10 +0,0 @@
--keepclassmembers class com.android.deskclock.DeskClock {
-  *** clockButtonsOnClick(...);
-}
--keep class com.android.deskclock.timer.TimerListItem {
-  *** setAnimatedHeight(...);
-}
-
--keep class com.android.deskclock.widget.multiwaveview.* {
-  *;
-}
diff --git a/src/com/android/deskclock/timer/TimerListItem.java b/src/com/android/deskclock/timer/TimerListItem.java
index b9cce22..07587a8 100644
--- a/src/com/android/deskclock/timer/TimerListItem.java
+++ b/src/com/android/deskclock/timer/TimerListItem.java
@@ -39,12 +39,6 @@
         this(context, null);
     }
 
-//    public void TimerListItem newInstance(Context context) {
-//        final LayoutInflater layoutInflater =
-//                (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-//        layoutInflater.inflate(R.layout.timer_list_item, this);
-//    }
-
     public TimerListItem(Context context, AttributeSet attrs) {
         super(context, attrs);
     }
@@ -137,15 +131,4 @@
         }
         mTimerText.setTime(time, false, forceUpdate);
     }
-
-    // Used by animator to animate the size of a timer
-    @SuppressWarnings("unused")
-    public void setAnimatedHeight(int height) {
-        ViewGroup.LayoutParams layoutParams = getLayoutParams();
-        if (layoutParams != null) {
-            layoutParams.height = height;
-            requestLayout();
-        }
-    }
-
 }