1. Ayush Goyal
  2. Android wheel

Commits

Ayush Goyal  committed aa298e0

new colors

  • Participants
  • Parent commits 271e934
  • Branches master

Comments (0)

Files changed (8)

File .classpath

View file
 <?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 exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
 	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
 	<classpathentry kind="output" path="bin/classes"/>
 </classpath>

File .project

View file
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>wheel</name>
+	<name>AyushWheel</name>
 	<comment></comment>
 	<projects>
 	</projects>

File .settings/org.eclipse.jdt.core.prefs

View file
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6

File bin/ayushwheel.jar

Binary file added.

File bin/wheel.jar

Binary file removed.

File res/drawable/wheel_bg.xml

View file
 
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
 
-	<item>
-		<shape android:shape="rectangle" >
-			<gradient
-				android:angle="90"
-				android:centerColor="#DDD"
-				android:endColor="#333"
-				android:startColor="#333" />
+    <item>
+        <shape android:shape="rectangle" >
+            <gradient
+                android:angle="90"
+                android:centerColor="#f3f3f3"
+                android:endColor="#f3f3f3"
+                android:startColor="#f3f3f3" />
 
-			<stroke
-				android:width="1dp"
-				android:color="#FF333333" />
-		</shape>
-	</item>
-	<item
-		android:bottom="1dp"
-		android:left="4dp"
-		android:right="4dp"
-		android:top="1dp">
-		<shape android:shape="rectangle" >
-			<gradient
-				android:angle="90"
-				android:centerColor="#FFF"
-				android:endColor="#AAA"
-				android:startColor="#AAA" />
-		</shape>
-	</item>
+            <stroke
+                android:width="1dp"
+                android:color="#FFf3f3f3" />
+        </shape>
+    </item>
+    <item
+        android:bottom="1dp"
+        android:left="4dp"
+        android:right="4dp"
+        android:top="1dp">
+        <shape android:shape="rectangle" >
+            <gradient
+                android:angle="90"
+                android:centerColor="#f3f3f3"
+                android:endColor="#f3f3f3"
+                android:startColor="#f3f3f3" />
+        </shape>
+    </item>
 
 </layer-list>

File res/drawable/wheel_val.xml

View file
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-
 <shape xmlns:android="http://schemas.android.com/apk/res/android" >
 
-	<gradient
-		android:angle="90"
-		android:centerColor="#70222222"
-		android:endColor="#70EEEEEE"
-		android:startColor="#70222222" />
+    <gradient
+        android:angle="90"
+        android:centerColor="#3033b5e5"
+        android:endColor="#3033b5e5"
+        android:startColor="#3033b5e5" />
 
-	<stroke
-		android:width="1dp"
-		android:color="#70333333" />
+    <stroke
+        android:width="1dp"
+        android:color="#3033b5e5" />
 
 </shape>

File src/kankan/wheel/widget/WheelView.java

View file
 public class WheelView extends View {
 
 	/** Top and bottom shadows colors */
-	private static final int[] SHADOWS_COLORS = new int[]{0xFF111111,
-			0x00AAAAAA, 0x00AAAAAA};
+	private static final int[] SHADOWS_COLORS = new int[] { 0xFFf3f3f3,
+			0x00f3f3f3, 0x00f3f3f3 };
 
 	/** Top and bottom items offset (to hide that) */
 	private static final int ITEM_OFFSET_PERCENT = 10;
 		}
 
 		switch (event.getAction()) {
-			case MotionEvent.ACTION_MOVE :
-				if (getParent() != null) {
-					getParent().requestDisallowInterceptTouchEvent(true);
+		case MotionEvent.ACTION_MOVE:
+			if (getParent() != null) {
+				getParent().requestDisallowInterceptTouchEvent(true);
+			}
+			break;
+
+		case MotionEvent.ACTION_UP:
+			if (!isScrollingPerformed) {
+				int distance = (int) event.getY() - getHeight() / 2;
+				if (distance > 0) {
+					distance += getItemHeight() / 2;
+				} else {
+					distance -= getItemHeight() / 2;
 				}
-				break;
-
-			case MotionEvent.ACTION_UP :
-				if (!isScrollingPerformed) {
-					int distance = (int) event.getY() - getHeight() / 2;
-					if (distance > 0) {
-						distance += getItemHeight() / 2;
-					} else {
-						distance -= getItemHeight() / 2;
-					}
-					int items = distance / getItemHeight();
-					if (items != 0 && isValidItemIndex(currentItem + items)) {
-						notifyClickListenersAboutClick(currentItem + items);
-					}
+				int items = distance / getItemHeight();
+				if (items != 0 && isValidItemIndex(currentItem + items)) {
+					notifyClickListenersAboutClick(currentItem + items);
 				}
-				break;
+			}
+			break;
 		}
 
 		return scroller.onTouchEvent(event);