From 72b333681ceb56c69d50f8b8405e925370dd200a Mon Sep 17 00:00:00 2001 From: serso Date: Wed, 23 Mar 2016 21:32:51 +0100 Subject: [PATCH] Fix lint issues --- app/build.gradle | 3 + app/src/main/AndroidManifest.xml | 5 +- .../android/calculator/VariablesRegistry.java | 32 +++--- .../android/calculator/about/TextHelper.java | 61 ---------- .../converter/ConverterFragment.java | 2 +- .../entities/BaseEntitiesRegistry.java | 52 +++------ .../functions/FunctionsRegistry.java | 46 +++++--- .../operators/OperatorsRegistry.java | 29 ++--- .../operators/PostfixFunctionsRegistry.java | 24 ++-- .../calculator/release/ReleaseNote.java | 21 ++++ .../release/ReleaseNoteFragment.java | 22 +--- .../calculator/release/ReleaseNotes.java | 82 +++++++------- .../calculator/wizard/WelcomeWizardStep.java | 3 + .../calculator/wizard/WizardFragment.java | 1 + .../solovyev/common/text/NumberMapper.java | 4 +- .../solovyev/common/text/NumberParser.java | 4 +- .../res/drawable-hdpi/ic_share_white_48dp.png | Bin 698 -> 0 bytes .../res/drawable-mdpi/ic_share_white_48dp.png | Bin 496 -> 0 bytes .../cpp_wizard_button_selector.xml | 28 ----- .../res/drawable-v21/material_blue_button.xml | 2 +- .../material_blue_button_lighter.xml | 2 +- .../res/drawable-v21/material_button_dark.xml | 2 +- .../material_button_dark_lighter.xml | 2 +- .../drawable-v21/material_button_light.xml | 2 +- .../material_button_light_darker.xml | 2 +- .../material_button_light_primary.xml | 2 +- .../material_button_light_primary_darker.xml | 2 +- .../res/drawable-v21/metro_blue_button.xml | 2 +- .../res/drawable-v21/metro_button_dark.xml | 2 +- .../res/drawable-v21/metro_button_green.xml | 2 +- .../res/drawable-v21/metro_button_light.xml | 2 +- .../res/drawable-v21/metro_button_purple.xml | 2 +- .../res/drawable-v21/metro_widget_button.xml | 2 +- .../drawable-v21/metro_widget_button_dark.xml | 2 +- .../metro_widget_button_light.xml | 2 +- .../res/drawable-v21/widget_button_no_bg.xml | 2 +- .../widget_button_no_bg_light.xml | 2 +- .../drawable-xhdpi/ic_share_white_48dp.png | Bin 938 -> 0 bytes .../drawable-xxhdpi/ic_share_white_48dp.png | Bin 1356 -> 0 bytes .../drawable-xxxhdpi/ic_share_white_48dp.png | Bin 1973 -> 0 bytes .../drawable/cpp_wizard_button_selector.xml | 28 ----- .../cpp_wizard_button_shape_normal.xml | 33 ------ .../cpp_wizard_button_shape_pressed.xml | 32 ------ .../main/res/layout/cpp_app_button_clear.xml | 2 +- .../main/res/layout/cpp_app_button_donate.xml | 29 ----- .../main/res/layout/cpp_app_button_empty.xml | 24 ---- .../main/res/layout/cpp_app_button_equals.xml | 33 ------ .../res/layout/cpp_app_button_operators.xml | 31 ------ .../main/res/layout/cpp_simple_button_0.xml | 4 +- .../layout/cpp_simple_button_0_material.xml | 4 +- .../cpp_simple_button_0_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_1.xml | 4 +- .../layout/cpp_simple_button_1_material.xml | 4 +- .../cpp_simple_button_1_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_2.xml | 4 +- .../layout/cpp_simple_button_2_material.xml | 4 +- .../cpp_simple_button_2_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_3.xml | 4 +- .../layout/cpp_simple_button_3_material.xml | 4 +- .../cpp_simple_button_3_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_4.xml | 4 +- .../layout/cpp_simple_button_4_material.xml | 4 +- .../cpp_simple_button_4_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_5.xml | 4 +- .../layout/cpp_simple_button_5_material.xml | 4 +- .../cpp_simple_button_5_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_6.xml | 4 +- .../layout/cpp_simple_button_6_material.xml | 4 +- .../cpp_simple_button_6_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_7.xml | 4 +- .../layout/cpp_simple_button_7_material.xml | 4 +- .../cpp_simple_button_7_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_8.xml | 4 +- .../layout/cpp_simple_button_8_material.xml | 4 +- .../cpp_simple_button_8_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_9.xml | 4 +- .../layout/cpp_simple_button_9_material.xml | 4 +- .../cpp_simple_button_9_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_app.xml | 1 - .../layout/cpp_simple_button_app_material.xml | 1 - .../cpp_simple_button_app_material_light.xml | 1 - .../res/layout/cpp_simple_button_copy.xml | 1 - .../cpp_simple_button_copy_material.xml | 1 - .../cpp_simple_button_copy_material_light.xml | 1 - .../res/layout/cpp_simple_button_division.xml | 4 +- .../cpp_simple_button_division_material.xml | 4 +- ..._simple_button_division_material_light.xml | 4 +- .../main/res/layout/cpp_simple_button_dot.xml | 4 +- .../layout/cpp_simple_button_dot_material.xml | 4 +- .../cpp_simple_button_dot_material_light.xml | 4 +- .../res/layout/cpp_simple_button_equals.xml | 4 +- .../cpp_simple_button_equals_material.xml | 4 +- ...pp_simple_button_equals_material_light.xml | 4 +- .../res/layout/cpp_simple_button_erase.xml | 1 - .../cpp_simple_button_erase_material.xml | 1 - ...cpp_simple_button_erase_material_light.xml | 1 - .../cpp_simple_button_multiplication.xml | 4 +- ..._simple_button_multiplication_material.xml | 4 +- ...e_button_multiplication_material_light.xml | 4 +- .../res/layout/cpp_simple_button_paste.xml | 1 - .../cpp_simple_button_paste_material.xml | 1 - ...cpp_simple_button_paste_material_light.xml | 1 - .../res/layout/cpp_simple_button_percent.xml | 4 +- .../cpp_simple_button_percent_material.xml | 4 +- ...p_simple_button_percent_material_light.xml | 4 +- .../res/layout/cpp_simple_button_plus.xml | 4 +- .../cpp_simple_button_plus_material.xml | 4 +- .../cpp_simple_button_plus_material_light.xml | 4 +- .../res/layout/cpp_simple_button_power.xml | 4 +- .../cpp_simple_button_power_material.xml | 4 +- ...cpp_simple_button_power_material_light.xml | 4 +- .../cpp_simple_button_round_brackets.xml | 4 +- ..._simple_button_round_brackets_material.xml | 4 +- ...e_button_round_brackets_material_light.xml | 4 +- .../res/layout/cpp_simple_button_settings.xml | 1 - .../cpp_simple_button_settings_material.xml | 1 - ..._simple_button_settings_material_light.xml | 1 - .../main/res/layout/cpp_unit_converter.xml | 8 +- .../layout/cpp_wizard_step_choose_mode.xml | 4 +- .../layout/cpp_wizard_step_drag_button.xml | 4 +- app/src/main/res/layout/tabs.xml | 47 -------- app/src/main/res/values-ar/text_about.xml | 1 - app/src/main/res/values-ar/text_converter.xml | 2 +- .../main/res/values-ar/text_preferences.xml | 11 -- app/src/main/res/values-ar/text_strings.xml | 91 --------------- app/src/main/res/values-cs/text_about.xml | 1 - app/src/main/res/values-cs/text_converter.xml | 2 +- .../main/res/values-cs/text_preferences.xml | 11 -- app/src/main/res/values-cs/text_strings.xml | 93 ---------------- app/src/main/res/values-de/text_about.xml | 1 - app/src/main/res/values-de/text_converter.xml | 2 +- .../main/res/values-de/text_preferences.xml | 11 -- app/src/main/res/values-de/text_strings.xml | 91 --------------- app/src/main/res/values-es/text_about.xml | 1 - app/src/main/res/values-es/text_converter.xml | 2 +- .../main/res/values-es/text_preferences.xml | 11 -- app/src/main/res/values-es/text_strings.xml | 88 --------------- app/src/main/res/values-fi/text_about.xml | 1 - app/src/main/res/values-fi/text_converter.xml | 2 +- .../main/res/values-fi/text_preferences.xml | 11 -- app/src/main/res/values-fi/text_strings.xml | 88 --------------- app/src/main/res/values-fr/text_about.xml | 1 - app/src/main/res/values-fr/text_converter.xml | 2 +- .../main/res/values-fr/text_preferences.xml | 11 -- app/src/main/res/values-fr/text_strings.xml | 88 --------------- app/src/main/res/values-it/text_about.xml | 1 - app/src/main/res/values-it/text_converter.xml | 2 +- .../main/res/values-it/text_preferences.xml | 11 -- app/src/main/res/values-it/text_strings.xml | 92 --------------- app/src/main/res/values-ja/text_about.xml | 1 - app/src/main/res/values-ja/text_converter.xml | 2 +- .../main/res/values-ja/text_preferences.xml | 11 -- app/src/main/res/values-ja/text_strings.xml | 95 ---------------- app/src/main/res/values-large/dimens.xml | 2 - app/src/main/res/values-nl/text_about.xml | 1 - app/src/main/res/values-nl/text_converter.xml | 2 +- .../main/res/values-nl/text_preferences.xml | 11 -- app/src/main/res/values-nl/text_strings.xml | 88 --------------- app/src/main/res/values-normal/dimens.xml | 1 - app/src/main/res/values-pl/text_about.xml | 1 - app/src/main/res/values-pl/text_converter.xml | 2 +- .../main/res/values-pl/text_preferences.xml | 11 -- app/src/main/res/values-pl/text_strings.xml | 92 --------------- app/src/main/res/values-pt-rBR/text_about.xml | 1 - .../main/res/values-pt-rBR/text_converter.xml | 2 +- .../res/values-pt-rBR/text_preferences.xml | 11 -- .../main/res/values-pt-rBR/text_strings.xml | 88 --------------- app/src/main/res/values-pt-rPT/text_about.xml | 1 - .../main/res/values-pt-rPT/text_converter.xml | 2 +- .../res/values-pt-rPT/text_preferences.xml | 11 -- .../main/res/values-pt-rPT/text_strings.xml | 88 --------------- app/src/main/res/values-ru/text_about.xml | 1 - app/src/main/res/values-ru/text_converter.xml | 2 +- .../main/res/values-ru/text_preferences.xml | 18 +-- app/src/main/res/values-ru/text_strings.xml | 105 ------------------ app/src/main/res/values-tr/text_about.xml | 1 - app/src/main/res/values-tr/text_converter.xml | 2 +- .../main/res/values-tr/text_preferences.xml | 11 -- app/src/main/res/values-tr/text_strings.xml | 91 --------------- app/src/main/res/values-uk/text_about.xml | 1 - app/src/main/res/values-uk/text_converter.xml | 9 ++ .../main/res/values-uk/text_preferences.xml | 13 --- app/src/main/res/values-uk/text_strings.xml | 98 ---------------- app/src/main/res/values-vi/text_about.xml | 1 - app/src/main/res/values-vi/text_converter.xml | 2 +- .../main/res/values-vi/text_preferences.xml | 11 -- app/src/main/res/values-vi/text_strings.xml | 92 --------------- app/src/main/res/values-xlarge/dimens.xml | 2 - app/src/main/res/values-zh-rCN/text_about.xml | 1 - .../main/res/values-zh-rCN/text_converter.xml | 2 +- .../res/values-zh-rCN/text_preferences.xml | 11 -- .../main/res/values-zh-rCN/text_strings.xml | 90 --------------- app/src/main/res/values-zh-rTW/text_about.xml | 1 - .../main/res/values-zh-rTW/text_converter.xml | 2 +- .../res/values-zh-rTW/text_preferences.xml | 14 --- .../main/res/values-zh-rTW/text_strings.xml | 92 --------------- app/src/main/res/values/arrays.xml | 8 +- app/src/main/res/values/colors.xml | 5 +- app/src/main/res/values/dimens.xml | 3 - app/src/main/res/values/preferences.xml | 26 ----- app/src/main/res/values/prefs_attributes.xml | 30 ----- app/src/main/res/values/text_about.xml | 1 - app/src/main/res/values/text_converter.xml | 2 +- .../main/res/values/text_imported_aosp.xml | 2 +- .../main/res/values/text_non_translatable.xml | 4 - app/src/main/res/values/text_preferences.xml | 16 --- .../main/res/values/text_release_notes.xml | 3 - app/src/main/res/values/text_strings.xml | 94 +--------------- .../main/res/xml/preferences_appearance.xml | 2 +- .../solovyev/android/translations/Utils.java | 1 + 210 files changed, 394 insertions(+), 2690 deletions(-) delete mode 100644 app/src/main/java/org/solovyev/android/calculator/about/TextHelper.java create mode 100644 app/src/main/java/org/solovyev/android/calculator/release/ReleaseNote.java delete mode 100644 app/src/main/res/drawable-hdpi/ic_share_white_48dp.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_share_white_48dp.png delete mode 100644 app/src/main/res/drawable-v21/cpp_wizard_button_selector.xml delete mode 100644 app/src/main/res/drawable-xhdpi/ic_share_white_48dp.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_share_white_48dp.png delete mode 100644 app/src/main/res/drawable-xxxhdpi/ic_share_white_48dp.png delete mode 100644 app/src/main/res/drawable/cpp_wizard_button_selector.xml delete mode 100644 app/src/main/res/drawable/cpp_wizard_button_shape_normal.xml delete mode 100644 app/src/main/res/drawable/cpp_wizard_button_shape_pressed.xml delete mode 100644 app/src/main/res/layout/cpp_app_button_donate.xml delete mode 100644 app/src/main/res/layout/cpp_app_button_empty.xml delete mode 100644 app/src/main/res/layout/cpp_app_button_equals.xml delete mode 100644 app/src/main/res/layout/cpp_app_button_operators.xml delete mode 100644 app/src/main/res/layout/tabs.xml create mode 100644 app/src/main/res/values-uk/text_converter.xml delete mode 100644 app/src/main/res/values/preferences.xml delete mode 100644 app/src/main/res/values/prefs_attributes.xml diff --git a/app/build.gradle b/app/build.gradle index 87292ce6..34108ff6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -50,6 +50,9 @@ android { lintOptions { abortOnError false warning 'MissingTranslation' + disable 'ContentDescription' + // floating icon is semi-transparent + disable 'IconLauncherShape' } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6546bdd7..6d3d81a8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -25,7 +26,8 @@ android:hardwareAccelerated="true" android:icon="@drawable/ic_launcher" android:label="@string/c_app_name" - android:theme="@style/Cpp.Theme.Material"> + android:theme="@style/Cpp.Theme.Material" + tools:ignore="UnusedAttribute"> diff --git a/app/src/main/java/org/solovyev/android/calculator/VariablesRegistry.java b/app/src/main/java/org/solovyev/android/calculator/VariablesRegistry.java index b94c7600..125d0cfd 100644 --- a/app/src/main/java/org/solovyev/android/calculator/VariablesRegistry.java +++ b/app/src/main/java/org/solovyev/android/calculator/VariablesRegistry.java @@ -44,27 +44,27 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; import java.io.File; -import java.util.HashMap; import java.util.List; -import java.util.Map; @Singleton public class VariablesRegistry extends BaseEntitiesRegistry { - - @Nonnull - private static final Map substitutes = new HashMap<>(); - - static { - substitutes.put("π", "pi"); - substitutes.put("Π", "PI"); - substitutes.put("∞", "inf"); - substitutes.put("h", "h_reduced"); - substitutes.put("NaN", "nan"); + { + addDescription("Π", R.string.c_var_description_PI); + addDescription("π", R.string.c_var_description_pi); + addDescription("e", R.string.c_var_description_e); + addDescription("i", R.string.c_var_description_i); + addDescription("c", R.string.c_var_description_c); + addDescription("G", R.string.c_var_description_G); + addDescription("h", R.string.c_var_description_h_reduced); + addDescription("∞", R.string.c_var_description_inf); + addDescription("inf", R.string.c_var_description_inf); + addDescription("nan", R.string.c_var_description_nan); + addDescription("NaN", R.string.c_var_description_nan); } @Inject public VariablesRegistry(@Nonnull JsclMathEngine mathEngine) { - super(mathEngine.getConstantsRegistry(), "c_var_description_"); + super(mathEngine.getConstantsRegistry()); } public void addOrUpdate(@Nonnull IConstant newVariable, @Nullable IConstant oldVariable) { @@ -82,12 +82,6 @@ public class VariablesRegistry extends BaseEntitiesRegistry { bus.post(new RemovedEvent(variable)); } - @Nonnull - @Override - protected Map getSubstitutes() { - return substitutes; - } - public void init() { Check.isNotMainThread(); diff --git a/app/src/main/java/org/solovyev/android/calculator/about/TextHelper.java b/app/src/main/java/org/solovyev/android/calculator/about/TextHelper.java deleted file mode 100644 index 3953c803..00000000 --- a/app/src/main/java/org/solovyev/android/calculator/about/TextHelper.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 - */ - -package org.solovyev.android.calculator.about; - -import android.content.res.Resources; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * User: serso - * Date: 4/20/12 - * Time: 3:31 PM - */ -public class TextHelper { - - @Nonnull - public String packageName; - - @Nonnull - public Resources resources; - - public TextHelper(@Nonnull Resources resources, @Nonnull String packageName) { - this.packageName = packageName; - this.resources = resources; - } - - @Nullable - public String getText(@Nonnull String stringName) { - final int stringId = this.resources.getIdentifier(stringName, "string", this.packageName); - try { - if (stringId == 0) { - return null; - } - return resources.getString(stringId); - } catch (Resources.NotFoundException e) { - return null; - } - } - -} diff --git a/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java b/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java index b087c9a4..948a7b28 100644 --- a/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java @@ -390,7 +390,7 @@ public class ConverterFragment extends BaseDialogFragment ELECTRIC_CURRENT(Dimension.ELECTRIC_CURRENT, R.string.cpp_converter_electric_current), LENGTH(Dimension.LENGTH, R.string.cpp_converter_length), MASS(Dimension.MASS, R.string.cpp_converter_mass), - TEMPERATURE(Dimension.TEMPERATURE, R.string.cpp_converter_termperature); + TEMPERATURE(Dimension.TEMPERATURE, R.string.cpp_converter_temperature); @NonNull public final Dimension dimension; diff --git a/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesRegistry.java b/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesRegistry.java index 50566be2..ea8798b2 100644 --- a/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesRegistry.java +++ b/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesRegistry.java @@ -23,16 +23,17 @@ package org.solovyev.android.calculator.entities; import android.app.Application; -import android.content.Context; import android.content.SharedPreferences; -import android.content.res.Resources; import android.os.Handler; import android.support.annotation.NonNull; +import android.support.annotation.StringRes; import com.squareup.otto.Bus; import org.json.JSONArray; import org.json.JSONException; import org.solovyev.android.Check; -import org.solovyev.android.calculator.*; +import org.solovyev.android.calculator.AppModule; +import org.solovyev.android.calculator.EntitiesRegistry; +import org.solovyev.android.calculator.ErrorReporter; import org.solovyev.android.calculator.json.Json; import org.solovyev.android.calculator.json.Jsonable; import org.solovyev.android.io.FileSaver; @@ -46,10 +47,7 @@ import javax.inject.Inject; import javax.inject.Named; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.Executor; public abstract class BaseEntitiesRegistry implements EntitiesRegistry { @@ -58,8 +56,6 @@ public abstract class BaseEntitiesRegistry implements Enti protected final Object lock = this; @Nonnull private final MathRegistry mathRegistry; - @Nonnull - private final String prefix; @NonNull private final WriteTask writeTask = new WriteTask(); @Inject @@ -81,33 +77,29 @@ public abstract class BaseEntitiesRegistry implements Enti @Named(AppModule.DIR_FILES) public File filesDir; + @Nonnull + private final Map descriptions = new HashMap<>(); + // synchronized on lock private boolean initialized; - protected BaseEntitiesRegistry(@Nonnull MathRegistry mathRegistry, - @Nonnull String prefix) { + protected BaseEntitiesRegistry(@Nonnull MathRegistry mathRegistry) { this.mathRegistry = mathRegistry; - this.prefix = prefix; } - - @Nonnull - protected abstract Map getSubstitutes(); + protected void addDescription(@Nonnull String name, @StringRes int description) { + descriptions.put(name, description); + } @Nullable @Override public String getDescription(@Nonnull String name) { - final String stringName; - - final Map substitutes = getSubstitutes(); - final String substitute = substitutes.get(name); - if (substitute == null) { - stringName = prefix + name; - } else { - stringName = prefix + substitute; + final Integer description = descriptions.get(name); + if (description == null || description == 0) { + return null; } - return getDescription(application, stringName); + return application.getResources().getString(description); } @Override @@ -115,18 +107,6 @@ public abstract class BaseEntitiesRegistry implements Enti setInitialized(); } - @Nullable - public String getDescription(@Nonnull Context context, @Nonnull String descriptionId) { - final Resources resources = context.getResources(); - - final int stringId = resources.getIdentifier(descriptionId, "string", CalculatorApplication.class.getPackage().getName()); - try { - return resources.getString(stringId); - } catch (Resources.NotFoundException e) { - return null; - } - } - @NonNull protected final List loadEntities(@NonNull Json.Creator creator) { final File file = getEntitiesFile(); diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsRegistry.java b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsRegistry.java index 7857a310..7b88f1c2 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsRegistry.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsRegistry.java @@ -30,6 +30,7 @@ import jscl.math.function.IFunction; import org.simpleframework.xml.Serializer; import org.simpleframework.xml.core.Persister; import org.solovyev.android.Check; +import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.entities.BaseEntitiesRegistry; import org.solovyev.android.calculator.entities.Category; import org.solovyev.android.calculator.entities.Entities; @@ -43,23 +44,47 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; import java.io.File; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import static android.text.TextUtils.isEmpty; @Singleton public class FunctionsRegistry extends BaseEntitiesRegistry { - @Nonnull - private static final Map substitutes = new HashMap<>(); - - static { - substitutes.put("√", "sqrt"); + { + addDescription("sin", R.string.c_fun_description_sin); + addDescription("cos", R.string.c_fun_description_cos); + addDescription("tan", R.string.c_fun_description_tan); + addDescription("cot", R.string.c_fun_description_cot); + addDescription("asin", R.string.c_fun_description_asin); + addDescription("acos", R.string.c_fun_description_acos); + addDescription("atan", R.string.c_fun_description_atan); + addDescription("acot", R.string.c_fun_description_acot); + addDescription("ln", R.string.c_fun_description_ln); + addDescription("lg", R.string.c_fun_description_lg); + addDescription("log", R.string.c_fun_description_log); + addDescription("exp", R.string.c_fun_description_exp); + addDescription("√", R.string.c_fun_description_sqrt); + addDescription("sqrt", R.string.c_fun_description_sqrt); + addDescription("cubic", R.string.c_fun_description_cubic); + addDescription("abs", R.string.c_fun_description_abs); + addDescription("sgn", R.string.c_fun_description_sgn); + addDescription("eq", R.string.c_fun_description_eq); + addDescription("le", R.string.c_fun_description_le); + addDescription("ge", R.string.c_fun_description_ge); + addDescription("ne", R.string.c_fun_description_ne); + addDescription("lt", R.string.c_fun_description_lt); + addDescription("gt", R.string.c_fun_description_gt); + addDescription("rad", R.string.c_fun_description_rad); + addDescription("dms", R.string.c_fun_description_dms); + addDescription("deg", R.string.c_fun_description_deg); } @Inject public FunctionsRegistry(@Nonnull JsclMathEngine mathEngine) { - super(mathEngine.getFunctionsRegistry(), "c_fun_description_"); + super(mathEngine.getFunctionsRegistry()); } public void addOrUpdate(@Nonnull Function newFunction, @Nullable Function oldFunction) { @@ -91,6 +116,7 @@ public class FunctionsRegistry extends BaseEntitiesRegistry { setInitialized(); } } + @Nullable protected Function addSafely(@Nonnull CustomFunction.Builder builder) { try { @@ -141,12 +167,6 @@ public class FunctionsRegistry extends BaseEntitiesRegistry { return new File(filesDir, "functions.json"); } - @Nonnull - @Override - protected Map getSubstitutes() { - return substitutes; - } - @Override public Category getCategory(@Nonnull Function function) { return Entities.getCategory(function, FunctionCategory.values()); diff --git a/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsRegistry.java b/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsRegistry.java index 28980aeb..0332b271 100644 --- a/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsRegistry.java +++ b/app/src/main/java/org/solovyev/android/calculator/operators/OperatorsRegistry.java @@ -25,6 +25,7 @@ package org.solovyev.android.calculator.operators; import android.support.annotation.NonNull; import jscl.JsclMathEngine; import jscl.math.operator.Operator; +import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.entities.BaseEntitiesRegistry; import org.solovyev.android.calculator.entities.Category; import org.solovyev.android.calculator.entities.Entities; @@ -35,33 +36,23 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; import java.io.File; -import java.util.HashMap; -import java.util.Map; @Singleton public class OperatorsRegistry extends BaseEntitiesRegistry { - @Nonnull - private static final Map substitutes = new HashMap(); - - static { - substitutes.put("Σ", "sum"); - substitutes.put("∏", "product"); - substitutes.put("∂", "derivative"); - substitutes.put("∫ab", "integral_ab"); - substitutes.put("∫", "integral"); - substitutes.put("Σ", "sum"); + { + addDescription("mod", R.string.c_op_description_mod); + addDescription("Σ", R.string.c_op_description_sum); + addDescription("∏", R.string.c_op_description_product); + addDescription("∂", R.string.c_op_description_derivative); + addDescription("∫ab", R.string.c_op_description_integral_ab); + addDescription("∫", R.string.c_op_description_integral); + addDescription("Σ", R.string.c_op_description_sum); } @Inject public OperatorsRegistry(@Nonnull JsclMathEngine mathEngine) { - super(mathEngine.getOperatorsRegistry(), "c_op_description_"); - } - - @Nonnull - @Override - protected Map getSubstitutes() { - return substitutes; + super(mathEngine.getOperatorsRegistry()); } @Nullable diff --git a/app/src/main/java/org/solovyev/android/calculator/operators/PostfixFunctionsRegistry.java b/app/src/main/java/org/solovyev/android/calculator/operators/PostfixFunctionsRegistry.java index ba45972b..74d61221 100644 --- a/app/src/main/java/org/solovyev/android/calculator/operators/PostfixFunctionsRegistry.java +++ b/app/src/main/java/org/solovyev/android/calculator/operators/PostfixFunctionsRegistry.java @@ -25,6 +25,7 @@ package org.solovyev.android.calculator.operators; import android.support.annotation.NonNull; import jscl.JsclMathEngine; import jscl.math.operator.Operator; +import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.entities.BaseEntitiesRegistry; import org.solovyev.android.calculator.entities.Category; import org.solovyev.android.calculator.entities.Entities; @@ -35,31 +36,20 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; import java.io.File; -import java.util.HashMap; -import java.util.Map; @Singleton public class PostfixFunctionsRegistry extends BaseEntitiesRegistry { - @Nonnull - private static final Map substitutes = new HashMap(); - - static { - substitutes.put("%", "percent"); - substitutes.put("!", "factorial"); - substitutes.put("!!", "double_factorial"); - substitutes.put("°", "degree"); + { + addDescription("%", R.string.c_pf_description_percent); + addDescription("!", R.string.c_pf_description_factorial); + addDescription("!!", R.string.c_pf_description_double_factorial); + addDescription("°", R.string.c_pf_description_degree); } @Inject public PostfixFunctionsRegistry(@Nonnull JsclMathEngine mathEngine) { - super(mathEngine.getPostfixFunctionsRegistry(), "c_pf_description_"); - } - - @Nonnull - @Override - protected Map getSubstitutes() { - return substitutes; + super(mathEngine.getPostfixFunctionsRegistry()); } @Nullable diff --git a/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNote.java b/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNote.java new file mode 100644 index 00000000..aadb626b --- /dev/null +++ b/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNote.java @@ -0,0 +1,21 @@ +package org.solovyev.android.calculator.release; + +import android.support.annotation.NonNull; +import android.support.annotation.StringRes; + +public class ReleaseNote { + @NonNull + public final String versionName; + @StringRes + public final int description; + + private ReleaseNote(@NonNull String versionName, int description) { + this.versionName = versionName; + this.description = description; + } + + @NonNull + public static ReleaseNote make(@NonNull String versionName, int description) { + return new ReleaseNote(versionName, description); + } +} diff --git a/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNoteFragment.java b/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNoteFragment.java index 177a7758..1869ddeb 100644 --- a/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNoteFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNoteFragment.java @@ -6,12 +6,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; - -import com.google.common.base.Strings; - -import org.solovyev.android.calculator.CalculatorApplication; import org.solovyev.android.calculator.R; -import org.solovyev.android.calculator.about.TextHelper; import org.solovyev.android.calculator.wizard.WizardFragment; import javax.annotation.Nonnull; @@ -33,25 +28,14 @@ public class ReleaseNoteFragment extends WizardFragment { version = getArguments().getInt(ARG_VERSION, 0); } + @Nonnull @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = super.onCreateView(inflater, container, savedInstanceState); final TextView title = (TextView) view.findViewById(R.id.release_note_title); - final TextHelper textHelper = new TextHelper(getActivity().getResources(), CalculatorApplication.class.getPackage().getName()); - title.setText(getString(R.string.cpp_new_in_version, getReleaseNoteVersion(textHelper))); + title.setText(getString(R.string.cpp_new_in_version, ReleaseNotes.getReleaseNoteVersion(version))); final TextView message = (TextView) view.findViewById(R.id.release_note_message); - message.setText(Html.fromHtml(getReleaseNote(textHelper))); + message.setText(Html.fromHtml(ReleaseNotes.getReleaseNoteDescription(getActivity(), version))); return view; } - - @Nonnull - private String getReleaseNoteVersion(@Nonnull TextHelper textHelper) { - return ReleaseNotes.getVersionName(textHelper, version); - } - - @Nonnull - private String getReleaseNote(@Nonnull TextHelper textHelper) { - final String resourceId = ReleaseNotes.makeReleaseNotesResourceId(version); - return Strings.nullToEmpty(textHelper.getText(resourceId)).replace("\n", "
"); - } } diff --git a/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNotes.java b/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNotes.java index b4c9616b..6f0aa6d4 100644 --- a/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNotes.java +++ b/app/src/main/java/org/solovyev/android/calculator/release/ReleaseNotes.java @@ -1,10 +1,9 @@ package org.solovyev.android.calculator.release; import android.content.Context; +import android.util.SparseArray; import org.solovyev.android.calculator.App; -import org.solovyev.android.calculator.CalculatorApplication; import org.solovyev.android.calculator.R; -import org.solovyev.android.calculator.about.TextHelper; import org.solovyev.common.text.Strings; import javax.annotation.Nonnull; @@ -13,11 +12,30 @@ import java.util.List; public final class ReleaseNotes { + private static final SparseArray map = new SparseArray<>(); + static { + map.put(118, ReleaseNote.make("2.0.0", R.string.c_release_notes_for_118)); + map.put(141, ReleaseNote.make("2.1.2", R.string.c_release_notes_for_141)); + map.put(143, ReleaseNote.make("2.1.4", R.string.c_release_notes_for_143)); + } + @Nonnull public static String getReleaseNotes(@Nonnull Context context) { return getReleaseNotesString(context, 0); } + @Nonnull + public static String getReleaseNoteVersion(int version) { + final ReleaseNote releaseNote = map.get(version); + return releaseNote == null ? String.valueOf(version) : releaseNote.versionName; + } + + @Nonnull + public static String getReleaseNoteDescription(@Nonnull Context context, int version) { + final ReleaseNote releaseNote = map.get(version); + return releaseNote == null ? "" : context.getString(releaseNote.description); + } + @Nonnull public static String getReleaseNotesString(@Nonnull Context context, int minVersion) { final StringBuilder result = new StringBuilder(); @@ -25,22 +43,21 @@ public final class ReleaseNotes { final String releaseNotesForTitle = context.getString(R.string.c_release_notes_for_title); final int currentVersionCode = App.getAppVersionCode(context); - final TextHelper textHelper = new TextHelper(context.getResources(), CalculatorApplication.class.getPackage().getName()); - boolean first = true; for (int versionCode = currentVersionCode; versionCode >= minVersion; versionCode--) { - final String versionName = getVersionName(textHelper, versionCode); - String releaseNotesForVersion = textHelper.getText(makeReleaseNotesResourceId(versionCode)); - if (!Strings.isEmpty(releaseNotesForVersion)) { - if (!first) { - result.append("

"); - } else { - first = false; - } - releaseNotesForVersion = releaseNotesForVersion.replace("\n", "
"); - result.append("").append(releaseNotesForTitle).append(versionName).append("

"); - result.append(releaseNotesForVersion); + final ReleaseNote releaseNote = map.get(versionCode); + if (releaseNote == null) { + continue; } + if (!first) { + result.append("

"); + } else { + first = false; + } + final String description = context.getResources().getString(releaseNote.description); + final String descriptionHtml = description.replace("\n", "
"); + result.append("").append(releaseNotesForTitle).append(releaseNote.versionName).append("

"); + result.append(descriptionHtml); } return result.toString(); @@ -51,14 +68,17 @@ public final class ReleaseNotes { final List releaseNotes = new ArrayList<>(); final int currentVersionCode = App.getAppVersionCode(context); - final TextHelper textHelper = new TextHelper(context.getResources(), CalculatorApplication.class.getPackage().getName()); for (int versionCode = currentVersionCode; versionCode >= minVersion; versionCode--) { if (versionCode == ChooseThemeReleaseNoteStep.VERSION_CODE) { releaseNotes.add(ChooseThemeReleaseNoteStep.VERSION_CODE); } - final String releaseNotesForVersion = textHelper.getText(makeReleaseNotesResourceId(versionCode)); - if (!Strings.isEmpty(releaseNotesForVersion)) { + final ReleaseNote releaseNote = map.get(versionCode); + if (releaseNote == null) { + continue; + } + final String description = context.getString(releaseNote.description); + if (!Strings.isEmpty(description)) { releaseNotes.add(versionCode); } } @@ -68,36 +88,20 @@ public final class ReleaseNotes { public static boolean hasReleaseNotes(@Nonnull Context context, int minVersion) { final int currentVersionCode = App.getAppVersionCode(context); - final TextHelper textHelper = new TextHelper(context.getResources(), CalculatorApplication.class.getPackage().getName()); for (int versionCode = currentVersionCode; versionCode >= minVersion; versionCode--) { if (versionCode == ChooseThemeReleaseNoteStep.VERSION_CODE) { return true; } - String releaseNotesForVersion = textHelper.getText(makeReleaseNotesResourceId(versionCode)); - if (!Strings.isEmpty(releaseNotesForVersion)) { + final ReleaseNote releaseNote = map.get(versionCode); + if (releaseNote == null) { + continue; + } + if (!Strings.isEmpty(context.getString(releaseNote.description))) { return true; } } return false; } - - @Nonnull - public static String getVersionName(@Nonnull TextHelper textHelper, int versionCode) { - final String versionName = textHelper.getText(makeVersionResourceId(versionCode)); - if (versionName != null) { - return versionName; - } else { - return String.valueOf(versionCode); - } - } - - public static String makeReleaseNotesResourceId(int versionCode) { - return "c_release_notes_for_" + versionCode; - } - - private static String makeVersionResourceId(int versionCode) { - return "c_release_notes_for_" + versionCode + "_version"; - } } diff --git a/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java b/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java index 98987ebd..b0f00941 100644 --- a/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java +++ b/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java @@ -31,6 +31,8 @@ import android.widget.TextView; import org.solovyev.android.calculator.App; import org.solovyev.android.calculator.R; +import javax.annotation.Nonnull; + public final class WelcomeWizardStep extends WizardFragment { @Override @@ -38,6 +40,7 @@ public final class WelcomeWizardStep extends WizardFragment { return R.layout.cpp_wizard_step_welcome; } + @Nonnull @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = super.onCreateView(inflater, container, savedInstanceState); diff --git a/app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java b/app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java index b987b19c..72fcf175 100644 --- a/app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/wizard/WizardFragment.java @@ -68,6 +68,7 @@ public abstract class WizardFragment extends Fragment implements View.OnClickLis throw new AssertionError("Wizard step for class " + getClass() + " was not found"); } + @Nonnull @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.fragment_wizard, container, false); diff --git a/app/src/main/java/org/solovyev/common/text/NumberMapper.java b/app/src/main/java/org/solovyev/common/text/NumberMapper.java index b82f5c29..7ff0c9ce 100644 --- a/app/src/main/java/org/solovyev/common/text/NumberMapper.java +++ b/app/src/main/java/org/solovyev/common/text/NumberMapper.java @@ -22,6 +22,8 @@ package org.solovyev.common.text; +import org.solovyev.android.Check; + import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.HashMap; @@ -74,7 +76,7 @@ public class NumberMapper implements Mapper { @Nonnull public static Mapper of(@Nonnull Class clazz) { - assert supportedClasses.contains(clazz) : "Class " + clazz + " is not supported by " + NumberMapper.class; + Check.isTrue(supportedClasses.contains(clazz), "Class " + clazz + " is not supported by " + NumberMapper.class); return (Mapper) mappers.get(clazz); } diff --git a/app/src/main/java/org/solovyev/common/text/NumberParser.java b/app/src/main/java/org/solovyev/common/text/NumberParser.java index 232cbbc9..663429b0 100644 --- a/app/src/main/java/org/solovyev/common/text/NumberParser.java +++ b/app/src/main/java/org/solovyev/common/text/NumberParser.java @@ -22,6 +22,8 @@ package org.solovyev.common.text; +import org.solovyev.android.Check; + import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Arrays; @@ -50,7 +52,7 @@ public class NumberParser implements Parser { @Nonnull public static Parser of(@Nonnull Class clazz) { - assert supportedClasses.contains(clazz) : "Class " + clazz + " is not supported by " + NumberParser.class; + Check.isTrue(supportedClasses.contains(clazz), "Class " + clazz + " is not supported by " + NumberParser.class); return (Parser) parsers.get(clazz); } diff --git a/app/src/main/res/drawable-hdpi/ic_share_white_48dp.png b/app/src/main/res/drawable-hdpi/ic_share_white_48dp.png deleted file mode 100644 index a35b3cd14af89804b7c3aab8f9b54cfe88771d19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 698 zcmV;r0!96aP))E)Qv=1Dpnk1InpvI&qSnTPM&I{WK*8?NJ&ecW~5|Co@S)v zo;+)jihdt!$TJgZIOCp9j7RYtcTHy&qi7EMT1#hYjzy7Fyz4JnxBa7?nwO$TPFj`q zr?*r*?-yB%jzw_{yK2{dO_w|wdyK1E*V43R#&{IRA)lzr`oVKi2CrL}b=NCV1}DtR zdf-F7Q4|%E=4@)&v1!&s>@nzymi_)U?dd3vQ7f{R9MxmWmaIiDM3IbXXy<|7Wc}gI zD3(zTooV{g6HzP`D?0PNXQFr}b>fbfBMo!%)O?^fQn4w|-AGAGo@S(ETb^d5WJ8`i zk&;ORsJsW`0@zk4-OaZ6`@bTm>hqOLRBE*psAIi;?hzpcu;@0>~$&4^`LKYLci zIrnAV_F@#zgsOE-E$e2C#U2B`(z4&Ks^KV)cEMwO`8>gR#dEQ>t#buIhb5Q9LKD%GxreN1uxt9@X%L{wSIr@7a>|t0nC$dn$@& z&^LB;W=UV9V8l;4^I4?g4IA>+3`Qyrxu7A>*+|KZJl{o1ZpgC`DY-7se57PXp6N)* zlss=oN`^EXF8i@ z;dr8?qTnEcf#YSTw1b150_0@p@+*a+28_exGc&aM`@C!DnA6=W1TD^dHLWnpGa); zm^Y+_9MMXOw6r - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/material_blue_button.xml b/app/src/main/res/drawable-v21/material_blue_button.xml index 4aa5eb6b..771214b2 100644 --- a/app/src/main/res/drawable-v21/material_blue_button.xml +++ b/app/src/main/res/drawable-v21/material_blue_button.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/material_blue_button_lighter.xml b/app/src/main/res/drawable-v21/material_blue_button_lighter.xml index e411274c..f1589cf5 100644 --- a/app/src/main/res/drawable-v21/material_blue_button_lighter.xml +++ b/app/src/main/res/drawable-v21/material_blue_button_lighter.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/material_button_dark.xml b/app/src/main/res/drawable-v21/material_button_dark.xml index cf12f0e7..d7fc0204 100644 --- a/app/src/main/res/drawable-v21/material_button_dark.xml +++ b/app/src/main/res/drawable-v21/material_button_dark.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/material_button_dark_lighter.xml b/app/src/main/res/drawable-v21/material_button_dark_lighter.xml index 981c917c..ae40f300 100644 --- a/app/src/main/res/drawable-v21/material_button_dark_lighter.xml +++ b/app/src/main/res/drawable-v21/material_button_dark_lighter.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/material_button_light.xml b/app/src/main/res/drawable-v21/material_button_light.xml index 128dd08f..7e7c4fae 100644 --- a/app/src/main/res/drawable-v21/material_button_light.xml +++ b/app/src/main/res/drawable-v21/material_button_light.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/material_button_light_darker.xml b/app/src/main/res/drawable-v21/material_button_light_darker.xml index 981c917c..ae40f300 100644 --- a/app/src/main/res/drawable-v21/material_button_light_darker.xml +++ b/app/src/main/res/drawable-v21/material_button_light_darker.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/material_button_light_primary.xml b/app/src/main/res/drawable-v21/material_button_light_primary.xml index a5184695..7521016d 100644 --- a/app/src/main/res/drawable-v21/material_button_light_primary.xml +++ b/app/src/main/res/drawable-v21/material_button_light_primary.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/material_button_light_primary_darker.xml b/app/src/main/res/drawable-v21/material_button_light_primary_darker.xml index dbc7ad02..204fb0e0 100644 --- a/app/src/main/res/drawable-v21/material_button_light_primary_darker.xml +++ b/app/src/main/res/drawable-v21/material_button_light_primary_darker.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/metro_blue_button.xml b/app/src/main/res/drawable-v21/metro_blue_button.xml index ef39da25..2dcb5c44 100644 --- a/app/src/main/res/drawable-v21/metro_blue_button.xml +++ b/app/src/main/res/drawable-v21/metro_blue_button.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/metro_button_dark.xml b/app/src/main/res/drawable-v21/metro_button_dark.xml index 1f26b920..2d7d7087 100644 --- a/app/src/main/res/drawable-v21/metro_button_dark.xml +++ b/app/src/main/res/drawable-v21/metro_button_dark.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/metro_button_green.xml b/app/src/main/res/drawable-v21/metro_button_green.xml index c34da930..f7a722b3 100644 --- a/app/src/main/res/drawable-v21/metro_button_green.xml +++ b/app/src/main/res/drawable-v21/metro_button_green.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/metro_button_light.xml b/app/src/main/res/drawable-v21/metro_button_light.xml index 2808bb2e..691e0ba5 100644 --- a/app/src/main/res/drawable-v21/metro_button_light.xml +++ b/app/src/main/res/drawable-v21/metro_button_light.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/metro_button_purple.xml b/app/src/main/res/drawable-v21/metro_button_purple.xml index dba279f6..462a9f73 100644 --- a/app/src/main/res/drawable-v21/metro_button_purple.xml +++ b/app/src/main/res/drawable-v21/metro_button_purple.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/metro_widget_button.xml b/app/src/main/res/drawable-v21/metro_widget_button.xml index 7ee5f89f..2b054b8a 100644 --- a/app/src/main/res/drawable-v21/metro_widget_button.xml +++ b/app/src/main/res/drawable-v21/metro_widget_button.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/metro_widget_button_dark.xml b/app/src/main/res/drawable-v21/metro_widget_button_dark.xml index 941daee5..d0fe7057 100644 --- a/app/src/main/res/drawable-v21/metro_widget_button_dark.xml +++ b/app/src/main/res/drawable-v21/metro_widget_button_dark.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/metro_widget_button_light.xml b/app/src/main/res/drawable-v21/metro_widget_button_light.xml index ee88b312..cc00d1ba 100644 --- a/app/src/main/res/drawable-v21/metro_widget_button_light.xml +++ b/app/src/main/res/drawable-v21/metro_widget_button_light.xml @@ -23,6 +23,6 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/widget_button_no_bg.xml b/app/src/main/res/drawable-v21/widget_button_no_bg.xml index 3fe76bfa..196ff9d7 100644 --- a/app/src/main/res/drawable-v21/widget_button_no_bg.xml +++ b/app/src/main/res/drawable-v21/widget_button_no_bg.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_dark"> diff --git a/app/src/main/res/drawable-v21/widget_button_no_bg_light.xml b/app/src/main/res/drawable-v21/widget_button_no_bg_light.xml index 2d3bcc9d..bb31c32c 100644 --- a/app/src/main/res/drawable-v21/widget_button_no_bg_light.xml +++ b/app/src/main/res/drawable-v21/widget_button_no_bg_light.xml @@ -23,7 +23,7 @@ --> + a:color="@color/cpp_ripple_material_light"> diff --git a/app/src/main/res/drawable-xhdpi/ic_share_white_48dp.png b/app/src/main/res/drawable-xhdpi/ic_share_white_48dp.png deleted file mode 100644 index e351c7beb089e9513ef5ddaa2ac3f1a6638474cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 938 zcmV;b16BNqP)OV%)fi;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--git a/app/src/main/res/drawable/cpp_wizard_button_selector.xml b/app/src/main/res/drawable/cpp_wizard_button_selector.xml deleted file mode 100644 index 5e285c2c..00000000 --- a/app/src/main/res/drawable/cpp_wizard_button_selector.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/cpp_wizard_button_shape_normal.xml b/app/src/main/res/drawable/cpp_wizard_button_shape_normal.xml deleted file mode 100644 index 6cb7c8bc..00000000 --- a/app/src/main/res/drawable/cpp_wizard_button_shape_normal.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - diff --git a/app/src/main/res/drawable/cpp_wizard_button_shape_pressed.xml b/app/src/main/res/drawable/cpp_wizard_button_shape_pressed.xml deleted file mode 100644 index 811d51b2..00000000 --- a/app/src/main/res/drawable/cpp_wizard_button_shape_pressed.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/layout/cpp_app_button_clear.xml b/app/src/main/res/layout/cpp_app_button_clear.xml index b741f791..3c3ee5cb 100644 --- a/app/src/main/res/layout/cpp_app_button_clear.xml +++ b/app/src/main/res/layout/cpp_app_button_clear.xml @@ -28,5 +28,5 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:a="http://schemas.android.com/apk/res/android" a:text="@string/c_clear" - app:directionTextUp="MC" + app:directionTextUp="@string/cpp_kb_memory_clear" a:textStyle="bold"/> \ No newline at end of file diff --git a/app/src/main/res/layout/cpp_app_button_donate.xml b/app/src/main/res/layout/cpp_app_button_donate.xml deleted file mode 100644 index a0374533..00000000 --- a/app/src/main/res/layout/cpp_app_button_donate.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/cpp_app_button_empty.xml b/app/src/main/res/layout/cpp_app_button_empty.xml deleted file mode 100644 index 507e3c51..00000000 --- a/app/src/main/res/layout/cpp_app_button_empty.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/cpp_app_button_equals.xml b/app/src/main/res/layout/cpp_app_button_equals.xml deleted file mode 100644 index 915b3ca4..00000000 --- a/app/src/main/res/layout/cpp_app_button_equals.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/cpp_app_button_operators.xml b/app/src/main/res/layout/cpp_app_button_operators.xml deleted file mode 100644 index ee8775c5..00000000 --- a/app/src/main/res/layout/cpp_app_button_operators.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/cpp_simple_button_0.xml b/app/src/main/res/layout/cpp_simple_button_0.xml index 511ef796..bee37500 100644 --- a/app/src/main/res/layout/cpp_simple_button_0.xml +++ b/app/src/main/res/layout/cpp_simple_button_0.xml @@ -24,6 +24,8 @@