Permalink
Browse files

android library

  • Loading branch information...
1 parent d321ad2 commit bb8bf4ed506016a090962548e87f5ff857a3555e Jonas Gehring committed Jul 4, 2011
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
View
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>GraphView</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>
View
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.jjoe64.graphview"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+
+
+ </application>
+</manifest>
View
@@ -0,0 +1,12 @@
+# 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-7
+android.library=true
View
@@ -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 *;
+}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,12 @@
+<?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"
+ >
+<TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello"
+ />
+</LinearLayout>
View
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="hello">Hello World!</string>
+ <string name="app_name">GraphView</string>
+</resources>
@@ -1,4 +1,4 @@
-package arnodenhond.graphviewdemo;
+package com.jjoe64.graphview;
import android.content.Context;
import android.graphics.Canvas;
@@ -8,21 +8,21 @@
import android.view.View;
/**
- * GraphView creates a scaled line or bar graph with x and y axis labels.
- * @author Arno den Hond
+ * GraphView creates a scaled line or bar graph with x and y axis labels.
+ * @author originally: Arno den Hond
*
*/
public class GraphView extends View {
public static boolean BAR = true;
public static boolean LINE = false;
- private Paint paint;
+ private final Paint paint;
private float[] values;
private String[] horlabels;
private String[] verlabels;
private String title;
- private boolean type;
+ private final boolean type;
public GraphView(Context context, float[] values, String title, String[] horlabels, String[] verlabels, boolean type) {
super(context);
@@ -46,6 +46,22 @@ public GraphView(Context context, float[] values, String title, String[] horlabe
paint = new Paint();
}
+ private float getMax() {
+ float largest = Integer.MIN_VALUE;
+ for (int i = 0; i < values.length; i++)
+ if (values[i] > largest)
+ largest = values[i];
+ return largest;
+ }
+
+ private float getMin() {
+ float smallest = Integer.MAX_VALUE;
+ for (int i = 0; i < values.length; i++)
+ if (values[i] < smallest)
+ smallest = values[i];
+ return smallest;
+ }
+
@Override
protected void onDraw(Canvas canvas) {
float border = 20;
@@ -112,20 +128,4 @@ protected void onDraw(Canvas canvas) {
}
}
- private float getMax() {
- float largest = Integer.MIN_VALUE;
- for (int i = 0; i < values.length; i++)
- if (values[i] > largest)
- largest = values[i];
- return largest;
- }
-
- private float getMin() {
- float smallest = Integer.MAX_VALUE;
- for (int i = 0; i < values.length; i++)
- if (values[i] < smallest)
- smallest = values[i];
- return smallest;
- }
-
}
@@ -1,11 +1,11 @@
-package arnodenhond.graphviewdemo;
+package com.jjoe64.graphview;
import android.app.Activity;
import android.os.Bundle;
/**
* GraphViewDemo creates some dummy data to demonstrate the GraphView component.
- * @author Arno den Hond
+ * @author originally: Arno den Hond
*
*/
public class GraphViewDemo extends Activity {

0 comments on commit bb8bf4e

Please sign in to comment.