diff --git a/app/build.gradle b/app/build.gradle index bc1ad43b..e737f869 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ apply plugin: 'kotlin-android' android { compileSdkVersion 27 - buildToolsVersion '26.0.2' + buildToolsVersion '28.0.3' signingConfigs { release { @@ -40,8 +40,8 @@ android { applicationId "com.physphil.android.unitconverterultimate" minSdkVersion 14 targetSdkVersion 27 - versionCode 50301 - versionName '5.3.1' + versionCode 50400 + versionName '5.4.0' } @@ -74,6 +74,7 @@ dependencies { implementation 'com.android.support:appcompat-v7:27.0.2' implementation 'com.android.support:recyclerview-v7:27.0.2' implementation 'com.android.support:design:27.0.2' + implementation 'com.android.support.constraint:constraint-layout:1.1.2' implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation ('com.squareup.retrofit2:converter-simplexml:2.3.0') { exclude module: 'xpp3' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8c2851e7..23b89437 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -38,6 +38,9 @@ + diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png new file mode 100644 index 00000000..1435e9b9 Binary files /dev/null and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/com/physphil/android/unitconverterultimate/AcknowledgementsActivity.kt b/app/src/main/java/com/physphil/android/unitconverterultimate/AcknowledgementsActivity.kt new file mode 100644 index 00000000..f63799a6 --- /dev/null +++ b/app/src/main/java/com/physphil/android/unitconverterultimate/AcknowledgementsActivity.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2018 Phil Shadlyn + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.physphil.android.unitconverterultimate + +import android.content.Context +import android.content.Intent +import android.os.Bundle + +class AcknowledgementsActivity : BaseActivity() { + + companion object { + @JvmStatic + fun start(context: Context) = + context.startActivity( + Intent(context, AcknowledgementsActivity::class.java) + ) + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_acknowledgements) + + setupToolbar() + setToolbarHomeNavigation(true) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/physphil/android/unitconverterultimate/api/models/Currencies.kt b/app/src/main/java/com/physphil/android/unitconverterultimate/api/models/Currencies.kt index d9492d59..364f40cc 100644 --- a/app/src/main/java/com/physphil/android/unitconverterultimate/api/models/Currencies.kt +++ b/app/src/main/java/com/physphil/android/unitconverterultimate/api/models/Currencies.kt @@ -24,7 +24,7 @@ data class Currencies(val currencies: List) { val map = mutableMapOf() currencies.forEach { try { - map.put(Country.valueOf(it.currency), it.rate) + map[Country.valueOf(it.currency)] = it.rate } catch (ignored: IllegalArgumentException) {} } return map diff --git a/app/src/main/java/com/physphil/android/unitconverterultimate/fragments/PreferencesFragment.java b/app/src/main/java/com/physphil/android/unitconverterultimate/fragments/PreferencesFragment.java index 737d66c5..673de3f4 100644 --- a/app/src/main/java/com/physphil/android/unitconverterultimate/fragments/PreferencesFragment.java +++ b/app/src/main/java/com/physphil/android/unitconverterultimate/fragments/PreferencesFragment.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 Phil Shadlyn + * Copyright 2018 Phil Shadlyn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import android.preference.PreferenceFragment; import android.widget.Toast; +import com.physphil.android.unitconverterultimate.AcknowledgementsActivity; import com.physphil.android.unitconverterultimate.BuildConfig; import com.physphil.android.unitconverterultimate.Preferences; import com.physphil.android.unitconverterultimate.R; @@ -42,6 +43,7 @@ public class PreferencesFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String GITHUB_ISSUE = "https://github.com/physphil/UnitConverterUltimate/issues"; + private static final String PRIVACY_POLICY = "https://privacypolicies.com/privacy/view/f7a41d67f1b0081f249c2ff0a3123136"; public static PreferencesFragment newInstance() { return new PreferencesFragment(); @@ -89,6 +91,15 @@ public boolean onPreferenceClick(Preference preference) { } }); + Preference privacy = findPreference("privacy_policy"); + privacy.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + openPrivacyPolicy(); + return true; + } + }); + Preference donate = findPreference("donate"); if (BuildConfig.FLAVOR.equals(UnitConverterApplication.BUILD_FLAVOUR_GOOGLE)) { donate.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @@ -103,6 +114,15 @@ public boolean onPreferenceClick(Preference preference) { ((PreferenceCategory) findPreference("other")).removePreference(donate); } + Preference acknowledgements = findPreference("acknowledgements"); + acknowledgements.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(Preference preference) { + AcknowledgementsActivity.start(getActivity()); + return true; + } + }); + final ListPreference language = (ListPreference) findPreference("language"); sortLanguageOptions(language); } @@ -155,6 +175,15 @@ private void openIssue() { } } + private void openPrivacyPolicy() { + try { + startActivity(IntentFactory.getOpenUrlIntent(PRIVACY_POLICY)); + } + catch (ActivityNotFoundException ex) { + Toast.makeText(getActivity(), R.string.toast_error_no_browser, Toast.LENGTH_SHORT).show(); + } + } + private void sortLanguageOptions(final ListPreference preference) { // Sort language options so they're always alphabetical, no matter what language the user has chosen final Language[] languages = Language.values(); diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 00000000..a14df072 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_acknowledgements.xml b/app/src/main/res/layout/activity_acknowledgements.xml new file mode 100644 index 00000000..bd7c7025 --- /dev/null +++ b/app/src/main/res/layout/activity_acknowledgements.xml @@ -0,0 +1,39 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..7353dbd1 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..7353dbd1 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index bf1ee28b..cfb5274c 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..cfb5274c Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index 502d8f47..f481d7ea 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..f481d7ea Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 355a0ad1..f41f36f1 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..f41f36f1 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 974fac09..3b214832 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..3b214832 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 5a379456..86b4c736 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..86b4c736 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index a92e8865..c7e6c8d7 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -1,6 +1,6 @@ + + + Thanks so much to jbeguna04 for the sweet new logo! + \n\nBig thanks to pR0Ps for helping me get the app up and running on F-Droid! + \n\nAnd many thanks to the following contributors for help with translations: + \n\t\t- markusgrosser + \n\t\t- kmartins + \n\t\t- ozantopal + \n\t\t- juanda-097 + \n\t\t- naofum + \n\t\t- lna91 + \n\t\t- Poussinou + \n\t\t- tacsipacsi + \n\t\t- arregit + \n\t\t- zmey.vodyanoy.97 + \n\t\t- ilmonco + \n\t\t- n.fantacuzzi + \n\t\t- krule.hr + \n\t\t- aerogallego + \n\t\t- ozantopal + \n\t\t- manuel_a_santos + \n\t\t- maxsmithmo3 + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 64e3bf57..ac9ee6ae 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@