Skip to content

Commit 4e0e8bb

Browse files
committed
Minor fixes on example project
1 parent 3f67ae7 commit 4e0e8bb

6 files changed

Lines changed: 38 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<stroke
4+
android:width="2dp"
5+
android:color="#FA6185" />
6+
7+
<solid android:color="#FA6185" />
8+
<corners android:radius="5dp" />
9+
</shape>

MPChartExample/res/layout/list_item.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
android:layout_toStartOf="@+id/tvNew" />
2929

3030
<TextView
31+
android:padding="7dp"
3132
android:layout_width="wrap_content"
3233
android:layout_height="wrap_content"
3334
android:textAppearance="?android:attr/textAppearanceSmall"
3435
android:text="NEW"
35-
android:textColor="#FA6185"
36+
android:background="@drawable/new_background"
37+
android:textColor="@android:color/white"
3638
android:id="@+id/tvNew"
37-
android:textSize="12dp"
39+
android:textSize="11dp"
3840
android:layout_marginRight="5dp"
3941
android:layout_centerVertical="true"
4042
android:layout_alignParentRight="true"

MPChartExample/src/com/xxmassdeveloper/mpchartexample/notimportant/MainActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ protected void onCreate(Bundle savedInstanceState) {
5656
WindowManager.LayoutParams.FLAG_FULLSCREEN);
5757
setContentView(R.layout.activity_main);
5858

59+
setTitle("MPAndroidChart Example");
60+
5961
// initialize the utilities
6062
Utils.init(this);
6163

MPChartExample/src/com/xxmassdeveloper/mpchartexample/notimportant/MyAdapter.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.xxmassdeveloper.mpchartexample.notimportant;
22

33
import android.content.Context;
4+
import android.graphics.Typeface;
45
import android.view.LayoutInflater;
56
import android.view.View;
67
import android.view.ViewGroup;
@@ -12,12 +13,18 @@
1213
import java.util.List;
1314

1415
/**
15-
* Created by philipp on 07/12/15.
16+
* Created by Philipp Jahoda on 07/12/15.
1617
*/
1718
public class MyAdapter extends ArrayAdapter<ContentItem> {
1819

20+
private Typeface mTypeFaceLight;
21+
private Typeface mTypeFaceRegular;
22+
1923
public MyAdapter(Context context, List<ContentItem> objects) {
2024
super(context, 0, objects);
25+
26+
mTypeFaceLight = Typeface.createFromAsset(context.getAssets(), "OpenSans-Light.ttf");
27+
mTypeFaceRegular = Typeface.createFromAsset(context.getAssets(), "OpenSans-Regular.ttf");
2128
}
2229

2330
@Override
@@ -42,6 +49,10 @@ public View getView(int position, View convertView, ViewGroup parent) {
4249
holder = (ViewHolder) convertView.getTag();
4350
}
4451

52+
holder.tvNew.setTypeface(mTypeFaceRegular);
53+
holder.tvName.setTypeface(mTypeFaceLight);
54+
holder.tvDesc.setTypeface(mTypeFaceLight);
55+
4556
holder.tvName.setText(c.name);
4657
holder.tvDesc.setText(c.desc);
4758

MPChartExample/src/com/xxmassdeveloper/mpchartexample/realm/RealmBaseActivity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.graphics.Color;
44
import android.graphics.Typeface;
5+
import android.os.Bundle;
56

67
import com.github.mikephil.charting.charts.BarLineChartBase;
78
import com.github.mikephil.charting.charts.Chart;
@@ -27,6 +28,12 @@ public abstract class RealmBaseActivity extends DemoBase {
2728

2829
protected Typeface mTf;
2930

31+
@Override
32+
protected void onCreate(Bundle savedInstanceState) {
33+
super.onCreate(savedInstanceState);
34+
setTitle("Realm.io Examples");
35+
}
36+
3037
protected void setup(Chart<?> chart) {
3138

3239
mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

MPChartExample/src/com/xxmassdeveloper/mpchartexample/realm/RealmMainActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ protected void onCreate(Bundle savedInstanceState) {
2929
WindowManager.LayoutParams.FLAG_FULLSCREEN);
3030
setContentView(R.layout.activity_main);
3131

32+
setTitle("Realm.io Examples");
33+
3234
ArrayList<ContentItem> objects = new ArrayList<ContentItem>();
3335

3436
objects.add(new ContentItem("Line Chart", "Creating a LineChart with Realm.io database"));
@@ -95,6 +97,8 @@ public void onItemClick(AdapterView<?> av, View v, int pos, long arg3) {
9597
startActivity(i);
9698
break;
9799
}
100+
101+
overridePendingTransition(R.anim.move_right_in_activity, R.anim.move_left_out_activity);
98102
}
99103

100104
@Override

0 commit comments

Comments
 (0)