Skip to content

Commit

Permalink
Merge branch 'release/5.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
physphil committed Jan 13, 2019
2 parents e205d96 + f41b09f commit 6b7453c
Show file tree
Hide file tree
Showing 45 changed files with 291 additions and 39 deletions.
7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ apply plugin: 'kotlin-android'

android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
buildToolsVersion '28.0.3'

signingConfigs {
release {
Expand All @@ -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'
}


Expand Down Expand Up @@ -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'
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<activity
android:name=".PreferencesActivity"
android:label="@string/title_activity_settings"/>
<activity
android:name=".AcknowledgementsActivity"
android:label="@string/title_activity_acknowledgements"/>

</application>

Expand Down
Binary file added app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data class Currencies(val currencies: List<Currency>) {
val map = mutableMapOf<Country, Double>()
currencies.forEach {
try {
map.put(Country.valueOf(it.currency), it.rate)
map[Country.valueOf(it.currency)] = it.rate
} catch (ignored: IllegalArgumentException) {}
}
return map
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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() {
Expand All @@ -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);
}
Expand Down Expand Up @@ -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();
Expand Down
32 changes: 32 additions & 0 deletions app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="1204.7059"
android:viewportHeight="1204.7059">
<group android:translateX="90.35294"
android:translateY="90.35294">
<path
android:pathData="M512,512m-512,0a512,512 0,1 1,1024 0a512,512 0,1 1,-1024 0"
android:fillColor="#3B73AF"/>
<path
android:pathData="M686.8,363.9L626.7,539L380.3,292.6l21.1,371.6l316.9,316.9c131.3,-57.6 233.9,-168.7 280,-305.8L686.8,363.9z"
android:strokeAlpha="0.3"
android:fillAlpha="0.3">
<aapt:attr name="android:fillColor">
<gradient
android:startY="395.2906"
android:startX="409.8888"
android:endY="853.6306"
android:endX="893.8214"
android:type="linear">
<item android:offset="0" android:color="#FF4D4D4D"/>
<item android:offset="1" android:color="#66808080"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M685.9,727V530.9v-167h-82.3v19.2v147.8c0,50.5 -41,91.5 -91.5,91.5c-50.5,0 -91.5,-41 -91.5,-91.5V383.1v-19.2h24.5l-65.7,-71.3l-65.7,71.3h24.6v167c0,96 77.8,173.8 173.8,173.8c33.6,0 64.9,-9.5 91.5,-26V727h-24.6l65.7,71.3l65.7,-71.3H685.9z"
android:fillColor="#FFFFFF"/>
</group>
</vector>
39 changes: 39 additions & 0 deletions app/src/main/res/layout/activity_acknowledgements.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->

<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<include
android:id="@+id/toolbar"
layout="@layout/toolbar"/>

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_view_large"
android:text="@string/acknowledgements"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:layout_constraintVertical_bias="0"/>

</android.support.constraint.ConstraintLayout>
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
Expand All @@ -20,6 +20,7 @@
<string name="app_name">Unit Converter Ultimate</string>
<string name="title_activity_donate">Spenden?</string>
<string name="title_activity_settings">Einstellungen</string>
<string name="title_activity_acknowledgements">Danksagungen</string>
<string name="text_from">Von</string>
<string name="text_to">Nach</string>
<string name="default_value">1</string>
Expand Down Expand Up @@ -65,6 +66,10 @@
<string name="prefs_summary_donate">Unterstütze die Entwicklung und mach mir eine Freude :)</string>
<string name="prefs_title_open_issue">Fehler gefunden?</string>
<string name="prefs_summary_open_issue">Melde das Problem auf GitHub</string>
<string name="prefs_title_privacy_policy">Datenschutz-Bestimmungen</string>
<string name="prefs_summary_privacy_policy">Ihre Privatsphäre ist wichtig.</string>
<string name="prefs_title_acknowledgements">Danksagungen</string>
<string name="prefs_summary_acknowledgements">Vielen Dank an diese Leute!</string>

<string name="dialog_btn_got_it">Verstanden</string>
<string name="dialog_title_help">Hilfe</string>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
Expand All @@ -20,6 +20,7 @@
<string name="app_name">Unit Converter Ultimate</string>
<string name="title_activity_donate">¿Donar?</string>
<string name="title_activity_settings">Ajustes</string>
<string name="title_activity_acknowledgements">Expresiones de gratitud</string>
<string name="text_from">De</string>
<string name="text_to">A</string>
<string name="default_value">1</string>
Expand Down Expand Up @@ -65,6 +66,10 @@
<string name="prefs_summary_donate">Apoye el desarrollo y hacedme sonreír :)</string>
<string name="prefs_title_open_issue">¿Encontró un Error?</string>
<string name="prefs_summary_open_issue">Abra un problema en GitHub.</string>
<string name="prefs_title_privacy_policy">Política de privacidad</string>
<string name="prefs_summary_privacy_policy">Tu privacidad es importante.</string>
<string name="prefs_title_acknowledgements">Expresiones de gratitud</string>
<string name="prefs_summary_acknowledgements">¡Gracias a estas personas!</string>

<string name="dialog_btn_got_it">Lo tengo</string>
<string name="dialog_title_help">Ayuda</string>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
Expand All @@ -20,6 +20,7 @@
<string name="app_name">مبدل واحد ها</string>
<string name="title_activity_donate">پرداخت</string>
<string name="title_activity_settings">تنظیمات</string>
<string name="title_activity_acknowledgements">سپاسگزاریها</string>
<string name="text_from">از</string>
<string name="text_to">به</string>
<string name="default_value">1</string>
Expand Down Expand Up @@ -65,6 +66,10 @@
<string name="prefs_summary_donate">از توسعه دهنده حمایت کنید </string>
<string name="prefs_title_open_issue"> یک مشکل یافتید ؟</string>
<string name="prefs_summary_open_issue">بازکردن یک مشکل در گیت هاب</string>
<string name="prefs_title_privacy_policy">سیاست حفظ حریم خصوصی</string>
<string name="prefs_summary_privacy_policy">حریم خصوصی شما مهم است</string>
<string name="prefs_title_acknowledgements">سپاسگزاریها</string>
<string name="prefs_summary_acknowledgements">با تشکر از شما به این افراد!</string>

<string name="dialog_btn_got_it">متوجه شدم</string>
<string name="dialog_title_help">راهنمایی</string>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
Expand All @@ -20,6 +20,7 @@
<string name="app_name">Unit Converter Ultimate</string>
<string name="title_activity_donate">Donner?</string>
<string name="title_activity_settings">Réglages</string>
<string name="title_activity_acknowledgements">Remerciements</string>
<string name="text_from">De</string>
<string name="text_to">Vers</string>
<string name="default_value">1</string>
Expand Down Expand Up @@ -65,6 +66,10 @@
<string name="prefs_summary_donate">Soutenez le développement et faites moi sourire :)</string>
<string name="prefs_title_open_issue">Vous avez trouvé un bug?</string>
<string name="prefs_summary_open_issue">Ouvrez une nouvelle Issue sur GitHub.</string>
<string name="prefs_title_privacy_policy">Politique de confidentialité</string>
<string name="prefs_summary_privacy_policy">Votre vie privée est importante.</string>
<string name="prefs_title_acknowledgements">"Remerciements "</string>
<string name="prefs_summary_acknowledgements">Merci à ces personnes!</string>

<string name="dialog_btn_got_it">Compris</string>
<string name="dialog_title_help">Aide</string>
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
Expand All @@ -20,6 +20,7 @@
<string name="app_name">Unit Converter Ultimate</string>
<string name="title_activity_donate">Doniraj?</string>
<string name="title_activity_settings">Postavke</string>
<string name="title_activity_acknowledgements">Priznanja</string>
<string name="text_from">Iz</string>
<string name="text_to">U</string>
<string name="default_value">1</string>
Expand Down Expand Up @@ -65,6 +66,10 @@
<string name="prefs_summary_donate">Podržite razvoj i nasmiješite me :)</string>
<string name="prefs_title_open_issue">Pronašli ste pogrešku?</string>
<string name="prefs_summary_open_issue">Prijavite ju na GitHubu.</string>
<string name="prefs_title_privacy_policy">Pravila o privatnosti</string>
<string name="prefs_summary_privacy_policy">Vaša je privatnost važna.</string>
<string name="prefs_title_acknowledgements">Priznanja</string>
<string name="prefs_summary_acknowledgements">Hvala ovim ljudima!</string>

<string name="dialog_btn_got_it">Shvaćam</string>
<string name="dialog_title_help">Pomoć</string>
Expand Down
Loading

0 comments on commit 6b7453c

Please sign in to comment.