mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 17:43:06 +02:00
Update the chart settings dialog based on ICS style guide.
This commit is contained in:
@@ -14,93 +14,88 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<TableLayout
|
||||
android:layout_width="fill_parent" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:shrinkColumns="0"
|
||||
android:stretchColumns="0">
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp" >
|
||||
|
||||
<TextView
|
||||
android:background="@drawable/list_bar"
|
||||
android:drawableLeft="@drawable/x_axis"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="bottom"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="@string/menu_chart_view_chart_settings"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"/>
|
||||
</TableLayout>
|
||||
<ScrollView
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Large"
|
||||
android:text="@string/chart_settings_x_axis" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/chart_settings_x"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
<!-- X axis -->
|
||||
<TextView
|
||||
android:drawableLeft="@drawable/x_axis"
|
||||
android:drawablePadding="10dp"
|
||||
android:text="@string/chart_settings_x_axis"
|
||||
style="@style/ChartSettingsAxisText"/>
|
||||
<RadioGroup
|
||||
android:id="@+id/chart_settings_x"
|
||||
android:layout_width="wrap_content" >
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/chart_settings_by_distance"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
<RadioButton
|
||||
android:id="@+id/chart_settings_by_distance"
|
||||
android:text="@string/chart_settings_by_distance"
|
||||
style="@style/ChartSettingsRadioButton"/>
|
||||
<RadioButton
|
||||
android:id="@+id/chart_settings_by_time"
|
||||
android:text="@string/chart_settings_by_time"
|
||||
style="@style/ChartSettingsRadioButton"/>
|
||||
</RadioGroup>
|
||||
<!-- Y axis -->
|
||||
<TextView
|
||||
android:drawableLeft="@drawable/y_axis"
|
||||
android:drawablePadding="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:text="@string/chart_settings_y_axis"
|
||||
style="@style/ChartSettingsAxisText"/>
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_elevation"
|
||||
android:text="@string/stat_elevation"
|
||||
style="@style/ChartSettingsCheckbox"/>
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_speed"
|
||||
android:text="@string/stat_speed"
|
||||
style="@style/ChartSettingsCheckbox"/>
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_power"
|
||||
android:text="@string/sensor_state_power"
|
||||
style="@style/ChartSettingsCheckbox"/>
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_cadence"
|
||||
android:text="@string/sensor_state_cadence"
|
||||
style="@style/ChartSettingsCheckbox"/>
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_heart_rate"
|
||||
android:text="@string/sensor_state_heart_rate"
|
||||
style="@style/ChartSettingsCheckbox"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<LinearLayout style="@style/ButtonLayout">
|
||||
<LinearLayout style="@style/ButtonSpacer"/>
|
||||
<Button
|
||||
android:id="@+id/chart_settings_ok"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/generic_ok"
|
||||
style="@style/Button"/>
|
||||
<Button
|
||||
android:id="@+id/chart_settings_cancel"
|
||||
android:layout_gravity="right"
|
||||
android:text="@string/generic_cancel"
|
||||
style="@style/Button"/>
|
||||
<LinearLayout style="@style/ButtonSpacer"/>
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="@string/chart_settings_by_distance" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/chart_settings_by_time"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="@string/chart_settings_by_time" />
|
||||
</RadioGroup>
|
||||
|
||||
<TextView
|
||||
android:drawableLeft="@drawable/y_axis"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="bottom"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Large"
|
||||
android:text="@string/chart_settings_y_axis" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_elevation"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="@string/stat_elevation" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_speed"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="@string/stat_speed" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_power"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="@string/sensor_state_power" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_cadence"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="@string/sensor_state_cadence" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_heart_rate"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
style="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="@string/sensor_state_heart_rate" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -74,27 +74,6 @@ limitations under the License.
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
|
||||
<!-- Chart settings axis text -->
|
||||
<style name="ChartSettingsAxisText">
|
||||
<item name="android:gravity">bottom</item>
|
||||
<item name="android:layout_height">fill_parent</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Chart settings checkbox -->
|
||||
<style name="ChartSettingsCheckbox">
|
||||
<item name="android:checked">true</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<!-- Chart settings radio button -->
|
||||
<style name="ChartSettingsRadioButton">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<!-- Send Google CheckBox -->
|
||||
<style name="SendGoogleCheckBox">
|
||||
<item name="android:checked">true</item>
|
||||
|
||||
@@ -35,9 +35,9 @@ import com.google.android.maps.mytracks.R;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.speech.tts.TextToSpeech;
|
||||
@@ -45,7 +45,9 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.ZoomControls;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -59,7 +61,7 @@ import java.util.EnumSet;
|
||||
*/
|
||||
public class ChartActivity extends Activity implements TrackDataListener {
|
||||
|
||||
public static final int CHART_SETTINGS_DIALOG = 1;
|
||||
private static final int DIALOG_CHART_SETTINGS_ID = 0;
|
||||
|
||||
private final DoubleBuffer elevationBuffer =
|
||||
new DoubleBuffer(Constants.ELEVATION_SMOOTHING_FACTOR);
|
||||
@@ -185,43 +187,60 @@ public class ChartActivity extends Activity implements TrackDataListener {
|
||||
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
if (id == CHART_SETTINGS_DIALOG) {
|
||||
final ChartSettingsDialog settingsDialog = new ChartSettingsDialog(this);
|
||||
settingsDialog.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int which) {
|
||||
if (which != DialogInterface.BUTTON_POSITIVE) {
|
||||
return;
|
||||
}
|
||||
switch (id) {
|
||||
case DIALOG_CHART_SETTINGS_ID:
|
||||
View view = getLayoutInflater().inflate(R.layout.chart_settings, null);
|
||||
final RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.chart_settings_x);
|
||||
radioGroup.check(chartView.getMode() == Mode.BY_DISTANCE
|
||||
? R.id.chart_settings_by_distance : R.id.chart_settings_by_time);
|
||||
|
||||
for (int i = 0; i < ChartView.NUM_SERIES; i++) {
|
||||
chartView.setChartValueSeriesEnabled(i, settingsDialog.isSeriesEnabled(i));
|
||||
}
|
||||
setMode(settingsDialog.getMode());
|
||||
chartView.postInvalidate();
|
||||
final CheckBox[] checkBoxes = new CheckBox[ChartView.NUM_SERIES];
|
||||
checkBoxes[ChartView.ELEVATION_SERIES] = (CheckBox) view.findViewById(
|
||||
R.id.chart_settings_elevation);
|
||||
checkBoxes[ChartView.SPEED_SERIES] = (CheckBox) view.findViewById(
|
||||
R.id.chart_settings_speed);
|
||||
checkBoxes[ChartView.POWER_SERIES] = (CheckBox) view.findViewById(
|
||||
R.id.chart_settings_power);
|
||||
checkBoxes[ChartView.CADENCE_SERIES] = (CheckBox) view.findViewById(
|
||||
R.id.chart_settings_cadence);
|
||||
checkBoxes[ChartView.HEART_RATE_SERIES] = (CheckBox) view.findViewById(
|
||||
R.id.chart_settings_heart_rate);
|
||||
|
||||
// set checkboxes values
|
||||
for (int i = 0; i < ChartView.NUM_SERIES; i++) {
|
||||
checkBoxes[i].setChecked(chartView.isChartValueSeriesEnabled(i));
|
||||
}
|
||||
});
|
||||
return settingsDialog;
|
||||
}
|
||||
|
||||
return super.onCreateDialog(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPrepareDialog(int id, Dialog dialog) {
|
||||
super.onPrepareDialog(id, dialog);
|
||||
|
||||
if (id == CHART_SETTINGS_DIALOG) {
|
||||
prepareSettingsDialog((ChartSettingsDialog) dialog);
|
||||
checkBoxes[ChartView.SPEED_SERIES]
|
||||
.setText(reportSpeed ? R.string.stat_speed : R.string.stat_pace);
|
||||
|
||||
return new AlertDialog.Builder(this)
|
||||
.setCancelable(true)
|
||||
.setNegativeButton(R.string.generic_cancel, null)
|
||||
.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
setMode(radioGroup.getCheckedRadioButtonId() == R.id.chart_settings_by_distance
|
||||
? Mode.BY_DISTANCE
|
||||
: Mode.BY_TIME);
|
||||
for (int i = 0; i < ChartView.NUM_SERIES; i++) {
|
||||
chartView.setChartValueSeriesEnabled(i, checkBoxes[i].isChecked());
|
||||
}
|
||||
chartView.postInvalidate();
|
||||
}
|
||||
})
|
||||
.setTitle(R.string.menu_chart_view_chart_settings)
|
||||
.setView(view)
|
||||
.create();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void prepareSettingsDialog(ChartSettingsDialog settingsDialog) {
|
||||
settingsDialog.setMode(chartView.getMode());
|
||||
settingsDialog.setDisplaySpeed(reportSpeed);
|
||||
for (int i = 0; i < ChartView.NUM_SERIES; i++) {
|
||||
settingsDialog.setSeriesEnabled(i, chartView.isChartValueSeriesEnabled(i));
|
||||
}
|
||||
/**
|
||||
* Shows the chart settings dialog
|
||||
*/
|
||||
public void showChartSettingsDialog() {
|
||||
showDialog(DIALOG_CHART_SETTINGS_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
package com.google.android.apps.mytracks;
|
||||
|
||||
import com.google.android.apps.mytracks.ChartView.Mode;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
/**
|
||||
* An activity that allows the user to set the chart settings.
|
||||
*
|
||||
* @author Sandor Dornbush
|
||||
*/
|
||||
public class ChartSettingsDialog extends Dialog {
|
||||
private RadioButton distance;
|
||||
private CheckBox[] series;
|
||||
private OnClickListener clickListener;
|
||||
|
||||
public ChartSettingsDialog(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.chart_settings);
|
||||
Button cancel = (Button) findViewById(R.id.chart_settings_cancel);
|
||||
cancel.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
if (clickListener != null) {
|
||||
clickListener.onClick(ChartSettingsDialog.this, BUTTON_NEGATIVE);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
Button okButton = (Button) findViewById(R.id.chart_settings_ok);
|
||||
okButton.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
if (clickListener != null) {
|
||||
clickListener.onClick(ChartSettingsDialog.this, BUTTON_POSITIVE);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
distance = (RadioButton) findViewById(R.id.chart_settings_by_distance);
|
||||
|
||||
series = new CheckBox[ChartView.NUM_SERIES];
|
||||
series[ChartView.ELEVATION_SERIES] =
|
||||
(CheckBox) findViewById(R.id.chart_settings_elevation);
|
||||
series[ChartView.SPEED_SERIES] =
|
||||
(CheckBox) findViewById(R.id.chart_settings_speed);
|
||||
series[ChartView.POWER_SERIES] =
|
||||
(CheckBox) findViewById(R.id.chart_settings_power);
|
||||
series[ChartView.CADENCE_SERIES] =
|
||||
(CheckBox) findViewById(R.id.chart_settings_cadence);
|
||||
series[ChartView.HEART_RATE_SERIES] =
|
||||
(CheckBox) findViewById(R.id.chart_settings_heart_rate);
|
||||
}
|
||||
|
||||
public void setMode(Mode mode) {
|
||||
RadioGroup rd = (RadioGroup) findViewById(R.id.chart_settings_x);
|
||||
rd.check(mode == Mode.BY_DISTANCE
|
||||
? R.id.chart_settings_by_distance
|
||||
: R.id.chart_settings_by_time);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether to display speed or pace.
|
||||
*
|
||||
* @param displaySpeed true to display speed
|
||||
*/
|
||||
public void setDisplaySpeed(boolean displaySpeed) {
|
||||
series[ChartView.SPEED_SERIES].setText(displaySpeed ? R.string.stat_speed : R.string.stat_pace);
|
||||
}
|
||||
|
||||
public void setSeriesEnabled(int seriesIdx, boolean enabled) {
|
||||
series[seriesIdx].setChecked(enabled);
|
||||
}
|
||||
|
||||
public Mode getMode() {
|
||||
if (distance == null) return Mode.BY_DISTANCE;
|
||||
|
||||
return distance.isChecked() ? Mode.BY_DISTANCE : Mode.BY_TIME;
|
||||
}
|
||||
|
||||
public boolean isSeriesEnabled(int seriesIdx) {
|
||||
if (series == null) return true;
|
||||
|
||||
return series[seriesIdx].isChecked();
|
||||
}
|
||||
|
||||
public void setOnClickListener(OnClickListener clickListener) {
|
||||
this.clickListener = clickListener;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
CheckBox[] getSeries() {
|
||||
return series;
|
||||
}
|
||||
}
|
||||
@@ -540,7 +540,7 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
public void showChartSettings() {
|
||||
ChartActivity chart = getChartTab();
|
||||
if (chart != null) {
|
||||
chart.showDialog(ChartActivity.CHART_SETTINGS_DIALOG);
|
||||
chart.showChartSettingsDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
package com.google.android.apps.mytracks;
|
||||
|
||||
import com.google.android.apps.mytracks.ChartView.Mode;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
||||
/**
|
||||
* Tests the {@link ChartSettingsDialog}.
|
||||
*
|
||||
* @author Youtao Liu
|
||||
*/
|
||||
public class ChartSettingsDialogTest extends ActivityInstrumentationTestCase2<ChartActivity> {
|
||||
|
||||
private ChartSettingsDialog chartSettingsDialog;
|
||||
|
||||
public ChartSettingsDialogTest() {
|
||||
super(ChartActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
chartSettingsDialog = new ChartSettingsDialog(getActivity());
|
||||
chartSettingsDialog.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the {@link ChartSettingsDialog#setMode} and check the result by
|
||||
* {@link ChartSettingsDialog#getMode}. Gets all modes of Mode, then set and
|
||||
* get each mode.
|
||||
*/
|
||||
public void testSetMode() {
|
||||
Mode[] modes = Mode.values();
|
||||
for (Mode mode : modes) {
|
||||
chartSettingsDialog.setMode(mode);
|
||||
assertEquals(mode, chartSettingsDialog.getMode());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the {@link ChartSettingsDialog#setDisplaySpeed}.
|
||||
*/
|
||||
public void testSetDisplaySpeed() {
|
||||
chartSettingsDialog.setDisplaySpeed(true);
|
||||
assertEquals(getActivity().getString(R.string.stat_speed),
|
||||
chartSettingsDialog.getSeries()[ChartView.SPEED_SERIES].getText());
|
||||
chartSettingsDialog.setDisplaySpeed(false);
|
||||
assertEquals(getActivity().getString(R.string.stat_pace),
|
||||
chartSettingsDialog.getSeries()[ChartView.SPEED_SERIES].getText());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the {@link ChartSettingsDialog#setSeriesEnabled} and check the result
|
||||
* by {@link ChartSettingsDialog#isSeriesEnabled}.
|
||||
*/
|
||||
public void testSetSeriesEnabled() {
|
||||
for (int i = 0; i < ChartView.NUM_SERIES; i++) {
|
||||
chartSettingsDialog.setSeriesEnabled(i, true);
|
||||
assertEquals(true, chartSettingsDialog.getSeries()[i].isChecked());
|
||||
assertEquals(true, chartSettingsDialog.isSeriesEnabled(i));
|
||||
chartSettingsDialog.setSeriesEnabled(i, false);
|
||||
assertEquals(false, chartSettingsDialog.getSeries()[i].isChecked());
|
||||
assertEquals(false, chartSettingsDialog.isSeriesEnabled(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user