Number format preferences screen

This commit is contained in:
serso
2016-05-04 23:39:46 +02:00
parent 49ab48a44c
commit eb1c733153
15 changed files with 358 additions and 239 deletions

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/cpp_dialog_spacing">
<TextView
style="@style/CppLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Notation"/>
<Spinner
android:id="@+id/nf_notation_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
style="@style/CppLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Precision"/>
<org.solovyev.android.views.DiscreteSeekBar
android:id="@+id/nf_precision_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:labelsColor="?android:attr/textColorSecondary"
app:labelsSize="12sp"
app:values="@array/cpp_prefs_precisions"/>
<TextView
style="@style/CppLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Separator"/>
<Spinner
android:id="@+id/nf_separator_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<org.solovyev.android.views.DiscreteSeekBar android:id="@+id/precision_seekbar"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/cpp_dialog_spacing"
app:labelsColor="?android:attr/textColorSecondary"
app:labelsSize="12sp"
app:values="@array/cpp_prefs_precisions" />

View File

@@ -18,7 +18,6 @@
<string name="cpp_exponent" translatable="false">E</string>
<string name="cpp_theme_black" translatable="false">%1$s (AMOLED)</string>
<string-array name="cpp_prefs_precisions" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>

View File

@@ -35,6 +35,10 @@
a:key="restart_wizard"
a:title="@string/cpp_restart_wizard" />
<Preference
a:key="screen-number-format"
a:title="Number format" />
<Preference
a:key="screen-calculations"
a:title="@string/c_prefs_calculations_category" />

View File

@@ -24,30 +24,6 @@
<PreferenceScreen xmlns:a="http://schemas.android.com/apk/res/android">
<org.solovyev.android.calculator.preferences.NumberFormatPreference
a:key="engine.output.numberFormat"
a:title="Number format" />
<ListPreference
a:entries="@array/cpp_prefs_precisions"
a:entryValues="@array/cpp_prefs_precisions"
a:key="engine.output.precision"
a:summary="@string/c_calc_result_precision_summary"
a:title="@string/p_calc_result_precision_title" />
<android.preference.CheckBoxPreference
a:defaultValue="false"
a:key="engine.output.scientificNotation"
a:summary="@string/c_calc_science_notation_summary"
a:title="@string/c_calc_science_notation_title" />
<ListPreference
a:entries="@array/p_grouping_separator_names"
a:entryValues="@array/p_grouping_separator_values"
a:key="engine.groupingSeparator"
a:summary="@string/c_calc_grouping_separator_summary"
a:title="@string/c_calc_grouping_separator" />
<ListPreference
a:entries="@array/p_angle_units_names"
a:entryValues="@array/p_angle_units"

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 serso aka se.solovyev
~
~ 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.
~
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Contact details
~
~ Email: se.solovyev@gmail.com
~ Site: http://se.solovyev.org
-->
<PreferenceScreen xmlns:a="http://schemas.android.com/apk/res/android"
xmlns:m="http://schemas.android.com/apk/res-auto">
<org.solovyev.android.material.preferences.ListPreference
a:key="engine.output.notation"
a:title="Notation"
m:materialColor="@color/material_text_selector" />
<org.solovyev.android.calculator.preferences.PrecisionPreference
a:key="engine.output.precision"
a:title="@string/p_calc_result_precision_title" />
<org.solovyev.android.material.preferences.ListPreference
a:entries="@array/p_grouping_separator_names"
a:entryValues="@array/p_grouping_separator_values"
a:key="engine.output.separator"
a:title="@string/c_calc_grouping_separator"
m:materialColor="@color/material_text_selector" />
<org.solovyev.android.calculator.preferences.NumberFormatExamplesPreference
a:key="numberFormat.examples"
a:selectable="false"
a:title="Examples" />
</PreferenceScreen>