Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class lineChartView extends View implements WeatherMan.weatherReceiver {
- public lineChartView(Context ctx, String selector) {
- super(ctx);
- this.context = ctx;
- this.selector = selector;
- this.setBackgroundColor(Color.RED);
- init(null, 0);
- }
- ViewGroup page = (ViewGroup) inflater.inflate(R.layout.view_history, null);
- lineChartView temperature = new lineChartView(this.getApplicationContext(),"temperature_f");
- page.addView(temperature);
- public lineChartWrapper(Context ctx, String selector) {
- super(ctx);
- this.context = ctx;
- this.selector = selector;
- this.setWillNotDraw(false);
- LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- inflater.inflate(R.layout.view_line_chart, this, true);
- this.lineChart = new lineChartView(this.context, this.selector);
- this.addView(lineChart);
- }
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- this.lineChart.draw(canvas);
- }
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="100dp"
- tools:context="com.blah.deblah.lineChartWrapper">
- <TextView
- android:id="@+id/chart_title"
- android:text="Title"
- android:textColor="#cccccc"
- android:textStyle="normal"
- android:textSize="36dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement