Skip to content

Commit

Permalink
Improvements in the example project.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilJay committed Aug 1, 2014
1 parent 34fe3c5 commit f179354
Show file tree
Hide file tree
Showing 20 changed files with 294 additions and 228 deletions.
6 changes: 3 additions & 3 deletions MPChartExample/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxmassdeveloper.mpchartexample"
android:versionCode="2"
android:versionName="1.0.2" >
android:versionCode="4"
android:versionName="1.0.4" >

<uses-sdk
android:minSdkVersion="9"
Expand All @@ -15,7 +15,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.xxmassdeveloper.mpchartexample.MainActivity"
android:name="com.xxmassdeveloper.mpchartexample.notimportant.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
7 changes: 7 additions & 0 deletions MPChartExample/res/anim/move_left_in_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="-100%p"
android:toXDelta="0%p">
</translate>
7 changes: 7 additions & 0 deletions MPChartExample/res/anim/move_left_out_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0%p"
android:toXDelta="-100%p">
</translate>
7 changes: 7 additions & 0 deletions MPChartExample/res/anim/move_right_in_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="100%p"
android:toXDelta="0%p">
</translate>
7 changes: 7 additions & 0 deletions MPChartExample/res/anim/move_right_out_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromXDelta="0%p"
android:toXDelta="100%p">
</translate>
75 changes: 3 additions & 72 deletions MPChartExample/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,76 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp" >

<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="LineChart" />

<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="BarChart" />

<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="PieChart" />

<Button
android:id="@+id/button6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="ScatterChart" />

<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="LineChart (more datasets)" />

<Button
android:id="@+id/button5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="BarChart (more datasets)" />

<Button
android:id="@+id/button7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="Draw Chart" />

<Button
android:id="@+id/button8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:text="AWESOME DESIGN" />

</LinearLayout>
</ScrollView>

</RelativeLayout>
</ListView>
27 changes: 27 additions & 0 deletions MPChartExample/res/layout/list_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp" >

<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="4dp"
android:text="Medium Text"
android:textSize="16dp"/>

<TextView
android:id="@+id/tvDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tvName"
android:layout_below="@+id/tvName"
android:layout_marginTop="3dp"
android:text="Small Text"
android:textSize="12dp" />

</RelativeLayout>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

package com.xxmassdeveloper.mpchartexample;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -23,10 +22,11 @@
import com.github.mikephil.charting.utils.XLabels.XLabelPosition;
import com.github.mikephil.charting.utils.YLabels;
import com.github.mikephil.charting.utils.YLabels.YLabelPosition;
import com.xxmassdeveloper.mpchartexample.notimportant.DemoBase;

import java.util.ArrayList;

public class BarChartActivity extends Activity implements OnSeekBarChangeListener {
public class BarChartActivity extends DemoBase implements OnSeekBarChangeListener {

private BarChart mChart;
private SeekBar mSeekBarX, mSeekBarY;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

package com.xxmassdeveloper.mpchartexample;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -16,15 +15,13 @@
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.utils.ColorTemplate;
import com.github.mikephil.charting.utils.Legend;
import com.github.mikephil.charting.utils.XLabels;
import com.github.mikephil.charting.utils.Legend.LegendPosition;
import com.github.mikephil.charting.utils.XLabels.XLabelPosition;
import com.github.mikephil.charting.utils.YLabels.YLabelPosition;
import com.github.mikephil.charting.utils.YLabels;
import com.github.mikephil.charting.utils.XLabels;
import com.xxmassdeveloper.mpchartexample.notimportant.DemoBase;

import java.util.ArrayList;

public class BarChartActivityMultiDataset extends Activity implements OnSeekBarChangeListener {
public class BarChartActivityMultiDataset extends DemoBase implements OnSeekBarChangeListener {

private BarChart mChart;
private SeekBar mSeekBarX, mSeekBarY;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

package com.xxmassdeveloper.mpchartexample;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
Expand All @@ -18,6 +17,7 @@
import com.github.mikephil.charting.utils.ColorTemplate;
import com.github.mikephil.charting.utils.Highlight;
import com.github.mikephil.charting.utils.XLabels;
import com.xxmassdeveloper.mpchartexample.notimportant.DemoBase;

import java.util.ArrayList;

Expand All @@ -27,7 +27,7 @@
*
* @author Philipp Jahoda
*/
public class DrawChartActivity extends Activity implements OnChartValueSelectedListener,
public class DrawChartActivity extends DemoBase implements OnChartValueSelectedListener,
OnDrawListener {

private LineChart mChart;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

package com.xxmassdeveloper.mpchartexample;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
Expand All @@ -22,12 +21,13 @@
import com.github.mikephil.charting.utils.ColorTemplate;
import com.github.mikephil.charting.utils.Highlight;
import com.github.mikephil.charting.utils.Legend;
import com.github.mikephil.charting.utils.XLabels;
import com.github.mikephil.charting.utils.Legend.LegendForm;
import com.github.mikephil.charting.utils.XLabels;
import com.xxmassdeveloper.mpchartexample.notimportant.DemoBase;

import java.util.ArrayList;

public class LineChartActivity extends Activity implements OnSeekBarChangeListener,
public class LineChartActivity extends DemoBase implements OnSeekBarChangeListener,
OnChartValueSelectedListener {

private LineChart mChart;
Expand Down Expand Up @@ -127,11 +127,11 @@ protected void onCreate(Bundle savedInstanceState) {
// add data
setData(45, 100);

// restrain the maximum scale-out factor
mChart.setScaleMinima(3f, 3f);

// center the view to a specific position inside the chart
mChart.centerViewPort(10, 50);
// // restrain the maximum scale-out factor
// mChart.setScaleMinima(3f, 3f);
//
// // center the view to a specific position inside the chart
// mChart.centerViewPort(10, 50);

// get the legend (only possible after setting data)
Legend l = mChart.getLegend();
Expand Down

This file was deleted.

Loading

0 comments on commit f179354

Please sign in to comment.