Merge pull request #4018 from RobertZagorski/feature/remove-redundant-findViewById-casts

[Enhancement] Remove redundant findViewById casts in example application
This commit is contained in:
Mick A 2018-05-12 21:28:06 -06:00 committed by GitHub
commit fe7a0f8bc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 130 additions and 130 deletions

View file

@ -36,16 +36,16 @@ public class AnotherBarActivity extends DemoBase implements OnSeekBarChangeListe
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_barchart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.getDescription().setEnabled(false);

View file

@ -56,13 +56,13 @@ public class BarChartActivity extends DemoBase implements OnSeekBarChangeListene
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_barchart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawBarShadow(false);

View file

@ -44,17 +44,17 @@ public class BarChartActivityMultiDataset extends DemoBase implements OnSeekBarC
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_barchart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvX = findViewById(R.id.tvXMax);
tvX.setTextSize(10);
tvY = (TextView) findViewById(R.id.tvYMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.getDescription().setEnabled(false);

View file

@ -44,11 +44,11 @@ public class BarChartActivitySinus extends DemoBase implements OnSeekBarChangeLi
mSinusData = FileUtils.loadBarEntriesFromAssets(getAssets(), "othersine.txt");
tvX = (TextView) findViewById(R.id.tvValueCount);
tvX = findViewById(R.id.tvValueCount);
mSeekBarX = (SeekBar) findViewById(R.id.seekbarValues);
mSeekBarX = findViewById(R.id.seekbarValues);
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setDrawBarShadow(false);
mChart.setDrawValueAboveBar(true);

View file

@ -37,7 +37,7 @@ public class BarChartPositiveNegative extends DemoBase {
setContentView(R.layout.activity_barchart_noseekbar);
mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setBackgroundColor(Color.WHITE);
mChart.setExtraTopOffset(-30f);
mChart.setExtraBottomOffset(10f);

View file

@ -44,16 +44,16 @@ public class BubbleChartActivity extends DemoBase implements OnSeekBarChangeList
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_bubblechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (BubbleChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.getDescription().setEnabled(false);
mChart.setOnChartValueSelectedListener(this);

View file

@ -39,16 +39,16 @@ public class CandleStickChartActivity extends DemoBase implements OnSeekBarChang
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_candlechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (CandleStickChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setBackgroundColor(Color.WHITE);
mChart.getDescription().setEnabled(false);

View file

@ -48,7 +48,7 @@ public class CombinedChartActivity extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_combined);
mChart = (CombinedChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.getDescription().setEnabled(false);
mChart.setBackgroundColor(Color.WHITE);
mChart.setDrawGridBackground(false);

View file

@ -39,11 +39,11 @@ public class CubicLineChartActivity extends DemoBase implements OnSeekBarChangeL
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarX.setProgress(45);
mSeekBarY.setProgress(100);
@ -51,7 +51,7 @@ public class CubicLineChartActivity extends DemoBase implements OnSeekBarChangeL
mSeekBarY.setOnSeekBarChangeListener(this);
mSeekBarX.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setViewPortOffsets(0, 0, 0, 0);
mChart.setBackgroundColor(Color.rgb(104, 241, 175));

View file

@ -43,7 +43,7 @@ public class DrawChartActivity extends DemoBase implements OnChartValueSelectedL
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_draw_chart);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
// listener for selecting and drawing
mChart.setOnChartValueSelectedListener(this);

View file

@ -32,7 +32,7 @@ public class DynamicalAddingActivity extends DemoBase implements OnChartValueSel
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart_noseekbar);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawGridBackground(false);
mChart.getDescription().setEnabled(false);

View file

@ -31,7 +31,7 @@ public class FilledLineActivity extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart_noseekbar);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setBackgroundColor(Color.WHITE);
mChart.setGridBackgroundColor(mFillColor);
mChart.setDrawGridBackground(true);

View file

@ -37,7 +37,7 @@ public class HalfPieChartActivity extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_piechart_half);
mChart = (PieChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setBackgroundColor(Color.WHITE);
moveOffScreen();

View file

@ -46,13 +46,13 @@ public class HorizontalBarChartActivity extends DemoBase implements OnSeekBarCha
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_horizontalbarchart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mChart = (HorizontalBarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
// mChart.setHighlightEnabled(false);

View file

@ -44,11 +44,11 @@ public class InvertedLineChartActivity extends DemoBase implements OnSeekBarChan
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarX.setProgress(45);
mSeekBarY.setProgress(100);
@ -56,7 +56,7 @@ public class InvertedLineChartActivity extends DemoBase implements OnSeekBarChan
mSeekBarY.setOnSeekBarChangeListener(this);
mSeekBarX.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawGridBackground(false);

View file

@ -54,11 +54,11 @@ public class LineChartActivity1 extends DemoBase implements OnSeekBarChangeListe
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarX.setProgress(45);
mSeekBarY.setProgress(100);
@ -66,7 +66,7 @@ public class LineChartActivity1 extends DemoBase implements OnSeekBarChangeListe
mSeekBarY.setOnSeekBarChangeListener(this);
mSeekBarX.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartGestureListener(this);
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawGridBackground(false);

View file

@ -44,10 +44,10 @@ public class LineChartActivity2 extends DemoBase implements OnSeekBarChangeListe
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarX.setProgress(45);
mSeekBarY.setProgress(100);
@ -55,7 +55,7 @@ public class LineChartActivity2 extends DemoBase implements OnSeekBarChangeListe
mSeekBarY.setOnSeekBarChangeListener(this);
mSeekBarX.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
// no description text

View file

@ -27,10 +27,10 @@ public class LineChartActivityColored extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_colored_lines);
mCharts[0] = (LineChart) findViewById(R.id.chart1);
mCharts[1] = (LineChart) findViewById(R.id.chart2);
mCharts[2] = (LineChart) findViewById(R.id.chart3);
mCharts[3] = (LineChart) findViewById(R.id.chart4);
mCharts[0] = findViewById(R.id.chart1);
mCharts[1] = findViewById(R.id.chart2);
mCharts[2] = findViewById(R.id.chart3);
mCharts[3] = findViewById(R.id.chart4);
mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Bold.ttf");

View file

@ -45,14 +45,14 @@ public class LineChartTime extends DemoBase implements OnSeekBarChangeListener {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart_time);
tvX = (TextView) findViewById(R.id.tvXMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
tvX = findViewById(R.id.tvXMax);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setProgress(100);
tvX.setText("100");
mSeekBarX.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
// no description text
mChart.getDescription().setEnabled(false);

View file

@ -41,7 +41,7 @@ public class ListViewBarChartActivity extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_listview_chart);
ListView lv = (ListView) findViewById(R.id.listView1);
ListView lv = findViewById(R.id.listView1);
ArrayList<BarData> list = new ArrayList<BarData>();
@ -73,7 +73,7 @@ public class ListViewBarChartActivity extends DemoBase {
convertView = LayoutInflater.from(getContext()).inflate(
R.layout.list_item_barchart, null);
holder.chart = (BarChart) convertView.findViewById(R.id.chart);
holder.chart = convertView.findViewById(R.id.chart);
convertView.setTag(holder);

View file

@ -45,7 +45,7 @@ public class ListViewMultiChartActivity extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_listview_chart);
ListView lv = (ListView) findViewById(R.id.listView1);
ListView lv = findViewById(R.id.listView1);
ArrayList<ChartItem> list = new ArrayList<ChartItem>();

View file

@ -39,16 +39,16 @@ public class MultiLineChartActivity extends DemoBase implements OnSeekBarChangeL
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawGridBackground(false);

View file

@ -30,15 +30,15 @@ public class PerformanceLineChart extends DemoBase implements OnSeekBarChangeLis
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_performance_linechart);
mTvCount = (TextView) findViewById(R.id.tvValueCount);
mSeekBarValues = (SeekBar) findViewById(R.id.seekbarValues);
mTvCount = findViewById(R.id.tvValueCount);
mSeekBarValues = findViewById(R.id.seekbarValues);
mTvCount.setText("500");
mSeekBarValues.setProgress(500);
mSeekBarValues.setOnSeekBarChangeListener(this);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setDrawGridBackground(false);
// no description text

View file

@ -48,15 +48,15 @@ public class PieChartActivity extends DemoBase implements OnSeekBarChangeListene
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_piechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarX.setProgress(4);
mSeekBarY.setProgress(10);
mChart = (PieChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setUsePercentValues(true);
mChart.getDescription().setEnabled(false);
mChart.setExtraOffsets(5, 10, 5, 5);

View file

@ -48,18 +48,18 @@ public class PiePolylineChartActivity extends DemoBase implements OnSeekBarChang
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_piechart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setProgress(10);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (PieChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setUsePercentValues(true);
mChart.getDescription().setEnabled(false);
mChart.setExtraOffsets(5, 10, 5, 5);

View file

@ -38,12 +38,12 @@ public class RadarChartActivity extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_radarchart_noseekbar);
TextView tv = (TextView) findViewById(R.id.textView);
TextView tv = findViewById(R.id.textView);
tv.setTypeface(mTfLight);
tv.setTextColor(Color.WHITE);
tv.setBackgroundColor(Color.rgb(60, 65, 82));
mChart = (RadarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setBackgroundColor(Color.rgb(60, 65, 82));
mChart.getDescription().setEnabled(false);

View file

@ -36,7 +36,7 @@ public class RealtimeLineChartActivity extends DemoBase implements
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_realtime_linechart);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
// enable description text

View file

@ -42,16 +42,16 @@ public class ScatterChartActivity extends DemoBase implements OnSeekBarChangeLis
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_scatterchart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (ScatterChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.getDescription().setEnabled(false);
mChart.setOnChartValueSelectedListener(this);

View file

@ -26,7 +26,7 @@ public class ScrollViewActivity extends DemoBase {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_scrollview);
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.getDescription().setEnabled(false);

View file

@ -44,16 +44,16 @@ public class StackedBarActivity extends DemoBase implements OnSeekBarChangeListe
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_barchart);
tvX = (TextView) findViewById(R.id.tvXMax);
tvY = (TextView) findViewById(R.id.tvYMax);
tvX = findViewById(R.id.tvXMax);
tvY = findViewById(R.id.tvYMax);
mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
mSeekBarX = findViewById(R.id.seekBar1);
mSeekBarX.setOnSeekBarChangeListener(this);
mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
mSeekBarY = findViewById(R.id.seekBar2);
mSeekBarY.setOnSeekBarChangeListener(this);
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.getDescription().setEnabled(false);

View file

@ -46,7 +46,7 @@ public class StackedBarActivityNegative extends DemoBase implements
setTitle("Age Distribution Austria");
mChart = (HorizontalBarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
mChart.setOnChartValueSelectedListener(this);
mChart.setDrawGridBackground(false);
mChart.getDescription().setEnabled(false);

View file

@ -24,7 +24,7 @@ public class MyMarkerView extends MarkerView {
public MyMarkerView(Context context, int layoutResource) {
super(context, layoutResource);
tvContent = (TextView) findViewById(R.id.tvContent);
tvContent = findViewById(R.id.tvContent);
}
// callbacks everytime the MarkerView is redrawn, can be used to update the

View file

@ -28,7 +28,7 @@ public class RadarMarkerView extends MarkerView {
public RadarMarkerView(Context context, int layoutResource) {
super(context, layoutResource);
tvContent = (TextView) findViewById(R.id.tvContent);
tvContent = findViewById(R.id.tvContent);
tvContent.setTypeface(Typeface.createFromAsset(context.getAssets(), "OpenSans-Light.ttf"));
}

View file

@ -24,7 +24,7 @@ public class StackedBarsMarkerView extends MarkerView {
public StackedBarsMarkerView(Context context, int layoutResource) {
super(context, layoutResource);
tvContent = (TextView) findViewById(R.id.tvContent);
tvContent = findViewById(R.id.tvContent);
}
// callbacks everytime the MarkerView is redrawn, can be used to update the

View file

@ -29,7 +29,7 @@ public class XYMarkerView extends MarkerView {
super(context, R.layout.custom_marker_view);
this.xAxisValueFormatter = xAxisValueFormatter;
tvContent = (TextView) findViewById(R.id.tvContent);
tvContent = findViewById(R.id.tvContent);
format = new DecimalFormat("###.0");
}

View file

@ -60,7 +60,7 @@ public class BarChartFrag extends SimpleFragment implements OnChartGestureListen
xAxis.setEnabled(false);
// programatically add the chart
FrameLayout parent = (FrameLayout) v.findViewById(R.id.parentLayout);
FrameLayout parent = v.findViewById(R.id.parentLayout);
parent.addView(mChart);
return v;

View file

@ -25,7 +25,7 @@ public class ComplexityFragment extends SimpleFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.frag_simple_line, container, false);
mChart = (LineChart) v.findViewById(R.id.lineChart1);
mChart = v.findViewById(R.id.lineChart1);
mChart.getDescription().setEnabled(false);

View file

@ -28,7 +28,7 @@ public class PieChartFrag extends SimpleFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.frag_simple_pie, container, false);
mChart = (PieChart) v.findViewById(R.id.pieChart1);
mChart = v.findViewById(R.id.pieChart1);
mChart.getDescription().setEnabled(false);
Typeface tf = Typeface.createFromAsset(getActivity().getAssets(), "OpenSans-Light.ttf");

View file

@ -28,7 +28,7 @@ public class ScatterChartFrag extends SimpleFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.frag_simple_scatter, container, false);
mChart = (ScatterChart) v.findViewById(R.id.scatterChart1);
mChart = v.findViewById(R.id.scatterChart1);
mChart.getDescription().setEnabled(false);
Typeface tf = Typeface.createFromAsset(getActivity().getAssets(),"OpenSans-Light.ttf");

View file

@ -29,7 +29,7 @@ public class SimpleChartDemo extends DemoBase {
setContentView(R.layout.activity_awesomedesign);
ViewPager pager = (ViewPager) findViewById(R.id.pager);
ViewPager pager = findViewById(R.id.pager);
pager.setOffscreenPageLimit(3);
PageAdapter a = new PageAdapter(getSupportFragmentManager());

View file

@ -25,7 +25,7 @@ public class SineCosineFragment extends SimpleFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.frag_simple_line, container, false);
mChart = (LineChart) v.findViewById(R.id.lineChart1);
mChart = v.findViewById(R.id.lineChart1);
mChart.getDescription().setEnabled(false);

View file

@ -39,7 +39,7 @@ public class BarChartItem extends ChartItem {
convertView = LayoutInflater.from(c).inflate(
R.layout.list_item_barchart, null);
holder.chart = (BarChart) convertView.findViewById(R.id.chart);
holder.chart = convertView.findViewById(R.id.chart);
convertView.setTag(holder);

View file

@ -40,7 +40,7 @@ public class LineChartItem extends ChartItem {
convertView = LayoutInflater.from(c).inflate(
R.layout.list_item_linechart, null);
holder.chart = (LineChart) convertView.findViewById(R.id.chart);
holder.chart = convertView.findViewById(R.id.chart);
convertView.setTag(holder);

View file

@ -47,7 +47,7 @@ public class PieChartItem extends ChartItem {
convertView = LayoutInflater.from(c).inflate(
R.layout.list_item_piechart, null);
holder.chart = (PieChart) convertView.findViewById(R.id.chart);
holder.chart = convertView.findViewById(R.id.chart);
convertView.setTag(holder);

View file

@ -149,7 +149,7 @@ public class MainActivity extends Activity implements OnItemClickListener {
MyAdapter adapter = new MyAdapter(this, objects);
ListView lv = (ListView) findViewById(R.id.listView1);
ListView lv = findViewById(R.id.listView1);
lv.setAdapter(adapter);
lv.setOnItemClickListener(this);

View file

@ -39,9 +39,9 @@ public class MyAdapter extends ArrayAdapter<ContentItem> {
holder = new ViewHolder();
convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item, null);
holder.tvName = (TextView) convertView.findViewById(R.id.tvName);
holder.tvDesc = (TextView) convertView.findViewById(R.id.tvDesc);
holder.tvNew = (TextView) convertView.findViewById(R.id.tvNew);
holder.tvName = convertView.findViewById(R.id.tvName);
holder.tvDesc = convertView.findViewById(R.id.tvDesc);
holder.tvNew = convertView.findViewById(R.id.tvNew);
convertView.setTag(holder);

View file

@ -30,7 +30,7 @@ public class RealmDatabaseActivityBar extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_barchart_noseekbar);
mChart = (BarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
}

View file

@ -30,7 +30,7 @@ public class RealmDatabaseActivityBubble extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_bubblechart_noseekbar);
mChart = (BubbleChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
mChart.getXAxis().setDrawGridLines(false);

View file

@ -31,7 +31,7 @@ public class RealmDatabaseActivityCandle extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_candlechart_noseekbar);
mChart = (CandleStickChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
mChart.getAxisLeft().setDrawGridLines(false);

View file

@ -31,7 +31,7 @@ public class RealmDatabaseActivityHorizontalBar extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_horizontalbarchart_noseekbar);
mChart = (HorizontalBarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
mChart.getAxisLeft().setAxisMinimum(0f);

View file

@ -31,7 +31,7 @@ public class RealmDatabaseActivityLine extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_linechart_noseekbar);
mChart = (LineChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
mChart.getAxisLeft().setAxisMaximum(150f);

View file

@ -32,7 +32,7 @@ public class RealmDatabaseActivityPie extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_piechart_noseekbar);
mChart = (PieChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
mChart.setCenterText(generateCenterSpannableText());

View file

@ -30,7 +30,7 @@ public class RealmDatabaseActivityRadar extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_radarchart_noseekbar);
mChart = (RadarChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
mChart.getYAxis().setEnabled(false);

View file

@ -30,7 +30,7 @@ public class RealmDatabaseActivityScatter extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_scatterchart_noseekbar);
mChart = (ScatterChart) findViewById(R.id.chart1);
mChart = findViewById(R.id.chart1);
setup(mChart);
mChart.getAxisLeft().setDrawGridLines(false);

View file

@ -51,7 +51,7 @@ public class RealmMainActivity extends DemoBase implements AdapterView.OnItemCli
MyAdapter adapter = new MyAdapter(this, objects);
ListView lv = (ListView) findViewById(R.id.listView1);
ListView lv = findViewById(R.id.listView1);
lv.setAdapter(adapter);
lv.setOnItemClickListener(this);

View file

@ -37,8 +37,8 @@ public class RealmWikiExample extends RealmBaseActivity {
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_realm_wiki);
lineChart = (LineChart) findViewById(R.id.lineChart);
barChart = (BarChart) findViewById(R.id.barChart);
lineChart = findViewById(R.id.lineChart);
barChart = findViewById(R.id.barChart);
setup(lineChart);
setup(barChart);