AMOLED-friendly theme added
This commit is contained in:
		| @@ -33,8 +33,6 @@ import android.support.annotation.*; | ||||
| import android.support.v7.view.ContextThemeWrapper; | ||||
| import android.text.TextUtils; | ||||
| import android.util.SparseArray; | ||||
| import jscl.AngleUnit; | ||||
| import jscl.NumeralBase; | ||||
| import org.solovyev.android.Check; | ||||
| import org.solovyev.android.calculator.about.AboutActivity; | ||||
| 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.math.MathType; | ||||
| 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.variables.VariablesActivity; | ||||
| import org.solovyev.android.calculator.wizard.WizardActivity; | ||||
| @@ -285,7 +284,7 @@ public final class Preferences { | ||||
|             return mode.getPreferenceNoError(preferences); | ||||
|         } | ||||
|  | ||||
|         public enum Theme { | ||||
|         public enum Theme implements PreferenceEntry { | ||||
|  | ||||
|             default_theme(R.style.Cpp_Theme_Gray), | ||||
|             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_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_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); | ||||
|  | ||||
|             private static final SparseArray<TextColor> textColors = new SparseArray<>(); | ||||
|  | ||||
|             @StringRes | ||||
|             public final int name; | ||||
|             protected final int name; | ||||
|             @StyleRes | ||||
|             public final int theme; | ||||
|             @StyleRes | ||||
| @@ -373,6 +379,18 @@ public final class Preferences { | ||||
|                 } | ||||
|                 return textColor; | ||||
|             } | ||||
|  | ||||
|             @Override | ||||
|             @NonNull | ||||
|             public String getName(@NonNull Context context) { | ||||
|                 return context.getString(name); | ||||
|             } | ||||
|  | ||||
|             @NonNull | ||||
|             @Override | ||||
|             public CharSequence getId() { | ||||
|                 return name(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public enum Mode { | ||||
|   | ||||
| @@ -1,15 +1,15 @@ | ||||
| package org.solovyev.android.calculator.language; | ||||
|  | ||||
| import android.content.Context; | ||||
| import android.support.annotation.NonNull; | ||||
| import android.text.TextUtils; | ||||
|  | ||||
| import org.solovyev.android.calculator.R; | ||||
|  | ||||
| import java.util.Locale; | ||||
| import org.solovyev.android.calculator.preferences.PreferenceEntry; | ||||
|  | ||||
| import javax.annotation.Nonnull; | ||||
| import java.util.Locale; | ||||
|  | ||||
| public final class Language { | ||||
| public final class Language implements PreferenceEntry{ | ||||
|     @Nonnull | ||||
|     public final String code; | ||||
|  | ||||
| @@ -39,6 +39,7 @@ public final class Language { | ||||
|         return locale.getDisplayName(locale); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Nonnull | ||||
|     public String getName(@Nonnull Context context) { | ||||
|         if (!isSystem()) { | ||||
| @@ -48,6 +49,12 @@ public final class Language { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @NonNull | ||||
|     @Override | ||||
|     public CharSequence getId() { | ||||
|         return code; | ||||
|     } | ||||
|  | ||||
|     public boolean isSystem() { | ||||
|         return code.equals(Languages.SYSTEM_LANGUAGE_CODE); | ||||
|     } | ||||
|   | ||||
| @@ -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(); | ||||
| } | ||||
| @@ -1,5 +1,6 @@ | ||||
| package org.solovyev.android.calculator.preferences; | ||||
|  | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.content.SharedPreferences; | ||||
| import android.os.Build; | ||||
| @@ -13,6 +14,7 @@ import android.widget.ListView; | ||||
| import org.solovyev.android.calculator.AdView; | ||||
| import org.solovyev.android.calculator.Engine; | ||||
| 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.language.Language; | ||||
| import org.solovyev.android.calculator.language.Languages; | ||||
| @@ -25,6 +27,7 @@ import org.solovyev.android.wizard.Wizards; | ||||
| import javax.annotation.Nonnull; | ||||
| import javax.annotation.Nullable; | ||||
| import javax.inject.Inject; | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
|  | ||||
| import static org.solovyev.android.calculator.App.cast; | ||||
| @@ -154,32 +157,50 @@ public class PreferencesFragment extends org.solovyev.android.material.preferenc | ||||
|             return; | ||||
|         } | ||||
|         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() { | ||||
|             @Override | ||||
|             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; | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     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) { | ||||
|         if (preference != R.xml.preferences_appearance) { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         final ListPreference language = (ListPreference) preferenceManager.findPreference(Preferences.Gui.language.getKey()); | ||||
|         final List<Language> languagesList = 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); | ||||
|         populate(language, languages.getList()); | ||||
|         language.setSummary(languages.getCurrent().getName(getActivity())); | ||||
|         language.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { | ||||
|             @Override | ||||
|   | ||||
| @@ -23,7 +23,6 @@ | ||||
| package org.solovyev.android.calculator.wizard; | ||||
|  | ||||
| import android.os.Bundle; | ||||
| import android.support.annotation.StringRes; | ||||
| import android.support.v7.view.ContextThemeWrapper; | ||||
| import android.view.LayoutInflater; | ||||
| 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 Spinner spinner = (Spinner) root.findViewById(R.id.wizard_theme_spinner); | ||||
|         themes.clear(); | ||||
|         themes.add(new ThemeUi(Preferences.Gui.Theme.material_theme, R.string.cpp_theme_dark)); | ||||
|         themes.add(new ThemeUi(Preferences.Gui.Theme.material_light_theme, R.string.cpp_theme_light)); | ||||
|         themes.add(new ThemeUi(Preferences.Gui.Theme.metro_blue_theme, R.string.p_metro_blue_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_purple_theme, R.string.p_metro_purple_theme)); | ||||
|         themes.add(new ThemeUi(Preferences.Gui.Theme.material_theme)); | ||||
|         themes.add(new ThemeUi(Preferences.Gui.Theme.material_black_theme)); | ||||
|         themes.add(new ThemeUi(Preferences.Gui.Theme.material_light_theme)); | ||||
|         themes.add(new ThemeUi(Preferences.Gui.Theme.metro_blue_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); | ||||
|         spinner.setAdapter(adapter); | ||||
|         spinner.setSelection(findPosition(theme)); | ||||
| @@ -111,9 +111,9 @@ public class ChooseThemeWizardStep extends WizardFragment implements AdapterView | ||||
|         @Nonnull | ||||
|         final String name; | ||||
|  | ||||
|         public ThemeUi(@Nonnull Preferences.Gui.Theme theme, @StringRes int name) { | ||||
|         public ThemeUi(@Nonnull Preferences.Gui.Theme theme) { | ||||
|             this.theme = theme; | ||||
|             this.name = getString(name); | ||||
|             this.name = theme.getName(getActivity()); | ||||
|         } | ||||
|  | ||||
|         @Override | ||||
|   | ||||
							
								
								
									
										32
									
								
								app/src/main/res/drawable-v21/material_button_black.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								app/src/main/res/drawable-v21/material_button_black.xml
									
									
									
									
									
										Normal 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> | ||||
| @@ -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> | ||||
							
								
								
									
										32
									
								
								app/src/main/res/drawable-v21/material_button_deep_blue.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								app/src/main/res/drawable-v21/material_button_deep_blue.xml
									
									
									
									
									
										Normal 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> | ||||
| @@ -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> | ||||
							
								
								
									
										35
									
								
								app/src/main/res/drawable/material_button_black.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								app/src/main/res/drawable/material_button_black.xml
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										35
									
								
								app/src/main/res/drawable/material_button_black_lighter.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								app/src/main/res/drawable/material_button_black_lighter.xml
									
									
									
									
									
										Normal 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> | ||||
							
								
								
									
										39
									
								
								app/src/main/res/drawable/material_button_deep_blue.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								app/src/main/res/drawable/material_button_deep_blue.xml
									
									
									
									
									
										Normal 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> | ||||
| @@ -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> | ||||
| @@ -21,21 +21,6 @@ | ||||
|   --> | ||||
|  | ||||
| <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"> | ||||
|         <item>@string/p_use_app_theme</item> | ||||
|         <item>@string/cpp_theme_dark</item> | ||||
|   | ||||
| @@ -47,6 +47,11 @@ | ||||
|     <color name="grey_850">#313131</color> | ||||
|     <color name="grey_900">#212121</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_800">#1565C0</color> | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|     <string name="cpp_function_body" translatable="false">f(x, y)</string> | ||||
|     <string name="cpp_show_greek_keyboard" translatable="false">αβγ</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"> | ||||
|         <item>0</item> | ||||
|         <item>1</item> | ||||
|   | ||||
							
								
								
									
										79
									
								
								app/src/main/res/values/theme_material_black.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								app/src/main/res/values/theme_material_black.xml
									
									
									
									
									
										Normal 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> | ||||
| @@ -35,8 +35,6 @@ | ||||
|         a:title="@string/cpp_prefs_vibrate_on_keypress" /> | ||||
|  | ||||
|     <ListPreference | ||||
|         a:entries="@array/p_theme_names" | ||||
|         a:entryValues="@array/p_theme_values" | ||||
|         a:key="gui.theme" | ||||
|         a:title="@string/cpp_theme" /> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 serso
					serso