AMOLED-friendly theme added

This commit is contained in:
serso 2016-04-16 20:51:18 +02:00
parent 28a573c777
commit ba7207d0e6
18 changed files with 447 additions and 45 deletions

View File

@ -33,8 +33,6 @@ import android.support.annotation.*;
import android.support.v7.view.ContextThemeWrapper; import android.support.v7.view.ContextThemeWrapper;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.SparseArray; import android.util.SparseArray;
import jscl.AngleUnit;
import jscl.NumeralBase;
import org.solovyev.android.Check; import org.solovyev.android.Check;
import org.solovyev.android.calculator.about.AboutActivity; import org.solovyev.android.calculator.about.AboutActivity;
import org.solovyev.android.calculator.functions.FunctionsActivity; import org.solovyev.android.calculator.functions.FunctionsActivity;
@ -42,6 +40,7 @@ import org.solovyev.android.calculator.history.HistoryActivity;
import org.solovyev.android.calculator.language.Languages; import org.solovyev.android.calculator.language.Languages;
import org.solovyev.android.calculator.math.MathType; import org.solovyev.android.calculator.math.MathType;
import org.solovyev.android.calculator.operators.OperatorsActivity; import org.solovyev.android.calculator.operators.OperatorsActivity;
import org.solovyev.android.calculator.preferences.PreferenceEntry;
import org.solovyev.android.calculator.preferences.PreferencesActivity; import org.solovyev.android.calculator.preferences.PreferencesActivity;
import org.solovyev.android.calculator.variables.VariablesActivity; import org.solovyev.android.calculator.variables.VariablesActivity;
import org.solovyev.android.calculator.wizard.WizardActivity; import org.solovyev.android.calculator.wizard.WizardActivity;
@ -285,7 +284,7 @@ public final class Preferences {
return mode.getPreferenceNoError(preferences); return mode.getPreferenceNoError(preferences);
} }
public enum Theme { public enum Theme implements PreferenceEntry {
default_theme(R.style.Cpp_Theme_Gray), default_theme(R.style.Cpp_Theme_Gray),
violet_theme(R.style.Cpp_Theme_Violet), violet_theme(R.style.Cpp_Theme_Violet),
@ -294,12 +293,19 @@ public final class Preferences {
metro_purple_theme(R.string.p_metro_purple_theme, R.style.Cpp_Theme_Metro_Purple, R.style.Cpp_Theme_Metro_Purple_Calculator, R.style.Cpp_Theme_Wizard, R.style.Cpp_Theme_Metro_Purple_Dialog, R.style.Cpp_Theme_Material_Dialog_Alert), metro_purple_theme(R.string.p_metro_purple_theme, R.style.Cpp_Theme_Metro_Purple, R.style.Cpp_Theme_Metro_Purple_Calculator, R.style.Cpp_Theme_Wizard, R.style.Cpp_Theme_Metro_Purple_Dialog, R.style.Cpp_Theme_Material_Dialog_Alert),
metro_green_theme(R.string.p_metro_green_theme, R.style.Cpp_Theme_Metro_Green, R.style.Cpp_Theme_Metro_Green_Calculator, R.style.Cpp_Theme_Wizard, R.style.Cpp_Theme_Metro_Green_Dialog, R.style.Cpp_Theme_Material_Dialog_Alert), metro_green_theme(R.string.p_metro_green_theme, R.style.Cpp_Theme_Metro_Green, R.style.Cpp_Theme_Metro_Green_Calculator, R.style.Cpp_Theme_Wizard, R.style.Cpp_Theme_Metro_Green_Dialog, R.style.Cpp_Theme_Material_Dialog_Alert),
material_theme(R.string.cpp_theme_dark, R.style.Cpp_Theme_Material, R.style.Cpp_Theme_Material_Calculator), material_theme(R.string.cpp_theme_dark, R.style.Cpp_Theme_Material, R.style.Cpp_Theme_Material_Calculator),
material_black_theme(R.string.cpp_theme_black, R.style.Cpp_Theme_Material_Black, R.style.Cpp_Theme_Material_Black_Calculator) {
@NonNull
@Override
public String getName(@NonNull Context context) {
return context.getString(name, material_theme.getName(context));
}
},
material_light_theme(R.string.cpp_theme_light, R.style.Cpp_Theme_Material_Light, R.style.Cpp_Theme_Material_Light_Calculator, R.style.Cpp_Theme_Wizard_Light, R.style.Cpp_Theme_Material_Light_Dialog, R.style.Cpp_Theme_Material_Light_Dialog_Alert); material_light_theme(R.string.cpp_theme_light, R.style.Cpp_Theme_Material_Light, R.style.Cpp_Theme_Material_Light_Calculator, R.style.Cpp_Theme_Wizard_Light, R.style.Cpp_Theme_Material_Light_Dialog, R.style.Cpp_Theme_Material_Light_Dialog_Alert);
private static final SparseArray<TextColor> textColors = new SparseArray<>(); private static final SparseArray<TextColor> textColors = new SparseArray<>();
@StringRes @StringRes
public final int name; protected final int name;
@StyleRes @StyleRes
public final int theme; public final int theme;
@StyleRes @StyleRes
@ -373,6 +379,18 @@ public final class Preferences {
} }
return textColor; return textColor;
} }
@Override
@NonNull
public String getName(@NonNull Context context) {
return context.getString(name);
}
@NonNull
@Override
public CharSequence getId() {
return name();
}
} }
public enum Mode { public enum Mode {

View File

@ -1,15 +1,15 @@
package org.solovyev.android.calculator.language; package org.solovyev.android.calculator.language;
import android.content.Context; import android.content.Context;
import android.support.annotation.NonNull;
import android.text.TextUtils; import android.text.TextUtils;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.preferences.PreferenceEntry;
import java.util.Locale;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.Locale;
public final class Language { public final class Language implements PreferenceEntry{
@Nonnull @Nonnull
public final String code; public final String code;
@ -39,6 +39,7 @@ public final class Language {
return locale.getDisplayName(locale); return locale.getDisplayName(locale);
} }
@Override
@Nonnull @Nonnull
public String getName(@Nonnull Context context) { public String getName(@Nonnull Context context) {
if (!isSystem()) { if (!isSystem()) {
@ -48,6 +49,12 @@ public final class Language {
} }
} }
@NonNull
@Override
public CharSequence getId() {
return code;
}
public boolean isSystem() { public boolean isSystem() {
return code.equals(Languages.SYSTEM_LANGUAGE_CODE); return code.equals(Languages.SYSTEM_LANGUAGE_CODE);
} }

View File

@ -0,0 +1,12 @@
package org.solovyev.android.calculator.preferences;
import android.content.Context;
import android.support.annotation.NonNull;
public interface PreferenceEntry {
@NonNull
CharSequence getName(@NonNull Context context);
@NonNull
CharSequence getId();
}

View File

@ -1,5 +1,6 @@
package org.solovyev.android.calculator.preferences; package org.solovyev.android.calculator.preferences;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
@ -13,6 +14,7 @@ import android.widget.ListView;
import org.solovyev.android.calculator.AdView; import org.solovyev.android.calculator.AdView;
import org.solovyev.android.calculator.Engine; import org.solovyev.android.calculator.Engine;
import org.solovyev.android.calculator.Preferences; import org.solovyev.android.calculator.Preferences;
import org.solovyev.android.calculator.Preferences.Gui.Theme;
import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.R;
import org.solovyev.android.calculator.language.Language; import org.solovyev.android.calculator.language.Language;
import org.solovyev.android.calculator.language.Languages; import org.solovyev.android.calculator.language.Languages;
@ -25,6 +27,7 @@ import org.solovyev.android.wizard.Wizards;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.inject.Inject; import javax.inject.Inject;
import java.util.Arrays;
import java.util.List; import java.util.List;
import static org.solovyev.android.calculator.App.cast; import static org.solovyev.android.calculator.App.cast;
@ -154,32 +157,50 @@ public class PreferencesFragment extends org.solovyev.android.material.preferenc
return; return;
} }
final ListPreference theme = (ListPreference) preferenceManager.findPreference(Preferences.Gui.theme.getKey()); final ListPreference theme = (ListPreference) preferenceManager.findPreference(Preferences.Gui.theme.getKey());
theme.setSummary(Preferences.Gui.getTheme(preferences).name); final FragmentActivity context = getActivity();
populate(theme,
Theme.material_theme,
Theme.material_black_theme,
Theme.material_light_theme,
Theme.metro_blue_theme,
Theme.metro_green_theme,
Theme.metro_purple_theme);
theme.setSummary(Preferences.Gui.getTheme(preferences).getName(context));
theme.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { theme.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object newValue) {
theme.setSummary(Preferences.Gui.Theme.valueOf((String) newValue).name); final Theme newTheme = Theme.valueOf((String) newValue);
theme.setSummary(newTheme.getName(context));
return true; return true;
} }
}); });
} }
private static void populate(@Nonnull ListPreference preference, @Nonnull PreferenceEntry... entries) {
populate(preference, Arrays.asList(entries));
}
private static void populate(@Nonnull ListPreference preference, @Nonnull List<? extends PreferenceEntry> entries) {
final int size = entries.size();
final CharSequence[] e = new CharSequence[size];
final CharSequence[] v = new CharSequence[size];
final Context context = preference.getContext();
for (int i = 0; i < size; i++) {
final PreferenceEntry entry = entries.get(i);
e[i] = entry.getName(context);
v[i] = entry.getId();
}
preference.setEntries(e);
preference.setEntryValues(v);
}
private void prepareLanguagePreference(int preference) { private void prepareLanguagePreference(int preference) {
if (preference != R.xml.preferences_appearance) { if (preference != R.xml.preferences_appearance) {
return; return;
} }
final ListPreference language = (ListPreference) preferenceManager.findPreference(Preferences.Gui.language.getKey()); final ListPreference language = (ListPreference) preferenceManager.findPreference(Preferences.Gui.language.getKey());
final List<Language> languagesList = languages.getList(); populate(language, languages.getList());
final CharSequence[] entries = new CharSequence[languagesList.size()];
final CharSequence[] entryValues = new CharSequence[languagesList.size()];
for (int i = 0; i < languagesList.size(); i++) {
final Language l = languagesList.get(i);
entries[i] = l.getName(getActivity());
entryValues[i] = l.code;
}
language.setEntries(entries);
language.setEntryValues(entryValues);
language.setSummary(languages.getCurrent().getName(getActivity())); language.setSummary(languages.getCurrent().getName(getActivity()));
language.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { language.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override @Override

View File

@ -23,7 +23,6 @@
package org.solovyev.android.calculator.wizard; package org.solovyev.android.calculator.wizard;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.StringRes;
import android.support.v7.view.ContextThemeWrapper; import android.support.v7.view.ContextThemeWrapper;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -58,11 +57,12 @@ public class ChooseThemeWizardStep extends WizardFragment implements AdapterView
final Preferences.Gui.Theme theme = Preferences.Gui.getTheme(preferences); final Preferences.Gui.Theme theme = Preferences.Gui.getTheme(preferences);
final Spinner spinner = (Spinner) root.findViewById(R.id.wizard_theme_spinner); final Spinner spinner = (Spinner) root.findViewById(R.id.wizard_theme_spinner);
themes.clear(); themes.clear();
themes.add(new ThemeUi(Preferences.Gui.Theme.material_theme, R.string.cpp_theme_dark)); themes.add(new ThemeUi(Preferences.Gui.Theme.material_theme));
themes.add(new ThemeUi(Preferences.Gui.Theme.material_light_theme, R.string.cpp_theme_light)); themes.add(new ThemeUi(Preferences.Gui.Theme.material_black_theme));
themes.add(new ThemeUi(Preferences.Gui.Theme.metro_blue_theme, R.string.p_metro_blue_theme)); themes.add(new ThemeUi(Preferences.Gui.Theme.material_light_theme));
themes.add(new ThemeUi(Preferences.Gui.Theme.metro_green_theme, R.string.p_metro_green_theme)); themes.add(new ThemeUi(Preferences.Gui.Theme.metro_blue_theme));
themes.add(new ThemeUi(Preferences.Gui.Theme.metro_purple_theme, R.string.p_metro_purple_theme)); themes.add(new ThemeUi(Preferences.Gui.Theme.metro_green_theme));
themes.add(new ThemeUi(Preferences.Gui.Theme.metro_purple_theme));
adapter = new WizardArrayAdapter<>(getActivity(), themes); adapter = new WizardArrayAdapter<>(getActivity(), themes);
spinner.setAdapter(adapter); spinner.setAdapter(adapter);
spinner.setSelection(findPosition(theme)); spinner.setSelection(findPosition(theme));
@ -111,9 +111,9 @@ public class ChooseThemeWizardStep extends WizardFragment implements AdapterView
@Nonnull @Nonnull
final String name; final String name;
public ThemeUi(@Nonnull Preferences.Gui.Theme theme, @StringRes int name) { public ThemeUi(@Nonnull Preferences.Gui.Theme theme) {
this.theme = theme; this.theme = theme;
this.name = getString(name); this.name = theme.getName(getActivity());
} }
@Override @Override

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<ripple xmlns:a="http://schemas.android.com/apk/res/android"
a:color="@color/cpp_ripple_material_dark">
<item>
<shape>
<solid a:color="@color/grey_950" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<ripple xmlns:a="http://schemas.android.com/apk/res/android"
a:color="@color/cpp_ripple_material_dark">
<item>
<shape>
<solid a:color="@color/grey_900" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<ripple xmlns:a="http://schemas.android.com/apk/res/android"
a:color="@color/cpp_ripple_material_dark">
<item>
<shape>
<solid a:color="@color/deep_blue_900" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<ripple xmlns:a="http://schemas.android.com/apk/res/android"
a:color="@color/cpp_ripple_material_dark">
<item>
<shape>
<solid a:color="@color/deep_blue_850" />
</shape>
</item>
</ripple>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<selector xmlns:a="http://schemas.android.com/apk/res/android">
<item a:drawable="@drawable/material_button_pressed" a:state_pressed="true" />
<item>
<shape>
<solid a:color="@color/grey_950" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<selector xmlns:a="http://schemas.android.com/apk/res/android">
<item a:drawable="@drawable/material_button_pressed" a:state_pressed="true" />
<item>
<shape>
<solid a:color="@color/grey_900" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<selector xmlns:a="http://schemas.android.com/apk/res/android">
<item a:state_pressed="true">
<shape>
<solid a:color="@color/deep_blue_850" />
</shape>
</item>
<item>
<shape>
<solid a:color="@color/deep_blue_900" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2013 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
-->
<selector xmlns:a="http://schemas.android.com/apk/res/android">
<item a:state_pressed="true">
<shape>
<solid a:color="@color/deep_blue_800" />
</shape>
</item>
<item>
<shape>
<solid a:color="@color/deep_blue_850" />
</shape>
</item>
</selector>

View File

@ -21,21 +21,6 @@
--> -->
<resources> <resources>
<string-array name="p_theme_names">
<item>@string/cpp_theme_dark</item>
<item>@string/cpp_theme_light</item>
<item>@string/p_metro_blue_theme</item>
<item>@string/p_metro_green_theme</item>
<item>@string/p_metro_purple_theme</item>
</string-array>
<string-array name="p_theme_values" translatable="false">
<item>material_theme</item>
<item>material_light_theme</item>
<item>metro_blue_theme</item>
<item>metro_green_theme</item>
<item>metro_purple_theme</item>
</string-array>
<string-array name="p_simple_theme_names"> <string-array name="p_simple_theme_names">
<item>@string/p_use_app_theme</item> <item>@string/p_use_app_theme</item>
<item>@string/cpp_theme_dark</item> <item>@string/cpp_theme_dark</item>

View File

@ -47,6 +47,11 @@
<color name="grey_850">#313131</color> <color name="grey_850">#313131</color>
<color name="grey_900">#212121</color> <color name="grey_900">#212121</color>
<color name="grey_950">#101010</color> <color name="grey_950">#101010</color>
<color name="grey_965">#0a0a0a</color>
<color name="deep_blue_900">#06224d</color>
<color name="deep_blue_850">#082a5e</color>
<color name="deep_blue_800">#0a3980</color>
<color name="blue_900">#0D47A1</color> <color name="blue_900">#0D47A1</color>
<color name="blue_800">#1565C0</color> <color name="blue_800">#1565C0</color>

View File

@ -16,6 +16,7 @@
<string name="cpp_function_body" translatable="false">f(x, y)</string> <string name="cpp_function_body" translatable="false">f(x, y)</string>
<string name="cpp_show_greek_keyboard" translatable="false">αβγ</string> <string name="cpp_show_greek_keyboard" translatable="false">αβγ</string>
<string name="cpp_exponent" translatable="false">E</string> <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"> <string-array name="cpp_prefs_precisions" translatable="false">
<item>0</item> <item>0</item>
<item>1</item> <item>1</item>

View File

@ -0,0 +1,79 @@
<!--
~ Copyright 2013 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
-->
<resources>
<style name="CppKeyboardButton.Material.Black.Digit" parent="CppKeyboardButton">
<item name="android:background">@drawable/material_button_black</item>
</style>
<style name="CppKeyboardButton.Material.Black.Digit.Highlighted" parent="CppKeyboardButton.Material.Black.Digit">
<item name="android:background">@drawable/material_button_black_lighter</item>
</style>
<style name="CppKeyboardButton.Material.Black.Operation" parent="CppKeyboardButton.Material.Digit">
<item name="android:background">@drawable/material_button_deep_blue</item>
<item name="directionTextAlpha">0.7</item>
</style>
<style name="CppKeyboardButton.Material.Black.Operation.Highlighted" parent="CppKeyboardButton.Material.Black.Operation">
<item name="android:background">@drawable/material_button_deep_blue_lighter</item>
</style>
<style name="CppKeyboardButton.Material.Black.Control" parent="CppKeyboardButton.Material.Black.Digit" />
<style name="Cpp.Theme.Material.Black" parent="Cpp.Theme">
<item name="android:windowBackground">@color/grey_965</item>
<item name="cpp_editor_bg">@color/grey_965</item>
<item name="cpp_fab_bg">@color/deep_blue_900</item>
<item name="cpp_button_style_digit">@style/CppKeyboardButton.Material.Black.Digit</item>
<item name="cpp_button_style_control">@style/CppKeyboardButton.Material.Black.Digit</item>
<item name="cpp_button_style_control_highlighted">@style/CppKeyboardButton.Material.Black.Digit.Highlighted</item>
<item name="cpp_button_style_operation">@style/CppKeyboardButton.Material.Black.Operation</item>
<item name="cpp_button_style_operation_highlighted">@style/CppKeyboardButton.Material.Black.Operation.Highlighted</item>
</style>
<style name="Cpp.Theme.Material.Black.Dialog" parent="Cpp.Theme.Dialog">
<item name="cpp_editor_bg">@color/grey_965</item>
<item name="cpp_fab_bg">@color/deep_blue_900</item>
<item name="cpp_button_style_digit">@style/CppKeyboardButton.Material.Black.Digit</item>
<item name="cpp_button_style_control">@style/CppKeyboardButton.Material.Black.Digit</item>
<item name="cpp_button_style_control_highlighted">@style/CppKeyboardButton.Material.Black.Digit.Highlighted</item>
<item name="cpp_button_style_operation">@style/CppKeyboardButton.Material.Black.Operation</item>
<item name="cpp_button_style_operation_highlighted">@style/CppKeyboardButton.Material.Black.Operation.Highlighted</item>
</style>
<style name="Cpp.Theme.Material.Black.Dialog.Alert" parent="Cpp.Theme.Dialog.Alert">
<item name="cpp_editor_bg">@color/grey_965</item>
<item name="cpp_fab_bg">@color/deep_blue_900</item>
<item name="cpp_button_style_digit">@style/CppKeyboardButton.Material.Black.Digit</item>
<item name="cpp_button_style_control">@style/CppKeyboardButton.Material.Black.Digit</item>
<item name="cpp_button_style_control_highlighted">@style/CppKeyboardButton.Material.Black.Digit.Highlighted</item>
<item name="cpp_button_style_operation">@style/CppKeyboardButton.Material.Black.Operation</item>
<item name="cpp_button_style_operation_highlighted">@style/CppKeyboardButton.Material.Black.Operation.Highlighted</item>
</style>
<style name="Cpp.Theme.Material.Black.Calculator" parent="Cpp.Theme.Material.Black">
<item name="android:windowAnimationStyle">@null</item>
</style>
</resources>

View File

@ -35,8 +35,6 @@
a:title="@string/cpp_prefs_vibrate_on_keypress" /> a:title="@string/cpp_prefs_vibrate_on_keypress" />
<ListPreference <ListPreference
a:entries="@array/p_theme_names"
a:entryValues="@array/p_theme_values"
a:key="gui.theme" a:key="gui.theme"
a:title="@string/cpp_theme" /> a:title="@string/cpp_theme" />