Skip to content

Commit

Permalink
v17.2 (#158)
Browse files Browse the repository at this point in the history
* Updates icon to an adaptive launcher icon as introduced in Android 8

* Update to latest gradle versions

* Spanish language changes (#156)

* First test change to edit Spanish strings

* Update #1 to the Spanish strings

* Update to Spanish Strings

* Escape single quotes

* Add null checks

* Add catch for JsonSyntaxException

* Add video links for paprika and lemon balm tea (#136)

* Remove baked beans

* Replace duplicated jasmine-tea video link with lemon-balm

* Fix bug where single serving foods and tweaks would display as "some servings" in history calendars

* Increase compileSdkVersion and targetSdkVersion to 29

* Increase versionCode and versionName

Co-authored-by: Jordan <jordan.sieve@gmail.com>
Co-authored-by: Ángela Graña Varela <68393384+angelagvarela@users.noreply.github.com>
Co-authored-by: Joseph <josephkelemen97@gmail.com>
  • Loading branch information
4 people authored Aug 15, 2020
1 parent aecd951 commit eae5fbc
Show file tree
Hide file tree
Showing 29 changed files with 290 additions and 247 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ configurations {
}

android {
compileSdkVersion 28
compileSdkVersion 29
buildToolsVersion '28.0.3'

compileOptions {
Expand All @@ -35,10 +35,10 @@ android {
defaultConfig {
applicationId "org.nutritionfacts.dailydozen"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
vectorDrawables.useSupportLibrary = true
versionCode 52
versionName "17.1"
versionCode 54
versionName "17.2"
}
buildTypes {
debug {
Expand Down
Binary file added app/src/main/ic_launcher-playstore.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
Expand Up @@ -26,6 +26,7 @@
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import timber.log.Timber;

public class FoodInfoActivity extends InfoActivity {
@BindView(R.id.food_info_image)
Expand All @@ -42,6 +43,13 @@ public class FoodInfoActivity extends InfoActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if (getFood() == null) {
Timber.e("Could not open activity: getFood returned null");
finish();
return;
}

setContentView(R.layout.activity_food_info);
ButterKnife.bind(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import butterknife.BindView;
import butterknife.ButterKnife;
import timber.log.Timber;

public class TweakInfoActivity extends InfoActivity {
@BindView(R.id.tweak_info_image)
Expand All @@ -24,6 +25,13 @@ public class TweakInfoActivity extends InfoActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if (getTweak() == null) {
Timber.e("Could not open activity: getTweak returned null");
finish();
return;
}

setContentView(R.layout.activity_tweak_info);
ButterKnife.bind(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ public static Map<Day, Boolean> getServingsOfFoodInYearAndMonth(final long foodI
argsArray);

for (DDServings serving : servings) {
servingsInMonth.put(
serving.getDay(),
serving.getServings() == food.getRecommendedAmount());
if (serving.getServings() > 0) {
servingsInMonth.put(
serving.getDay(),
serving.getServings() == food.getRecommendedAmount());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ public static Map<Day, Boolean> getServingsOfTweakInYearAndMonth(final long twea
argsArray);

for (TweakServings serving : servings) {
servingsInMonth.put(
serving.getDay(),
serving.getServings() == tweak.getRecommendedAmount());
if (serving.getServings() > 0) {
servingsInMonth.put(
serving.getDay(),
serving.getServings() == tweak.getRecommendedAmount());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.activeandroid.ActiveAndroid;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;

import org.nutritionfacts.dailydozen.Common;
import org.nutritionfacts.dailydozen.R;
Expand Down Expand Up @@ -150,11 +151,12 @@ private void restoreLineCSV(final String[] headers, final String line) {
ActiveAndroid.setTransactionSuccessful();
}
} catch (InvalidDateException e) {
Timber.e(e, "restoreLine: ");
Timber.e(e, "restoreLineCSV: ");
} finally {
ActiveAndroid.endTransaction();
}
}

@DebugLog
private void restoreLineJSON(final String line) {
if (TextUtils.isEmpty(line)) {
Expand Down Expand Up @@ -182,7 +184,9 @@ private void restoreLineJSON(final String line) {

ActiveAndroid.setTransactionSuccessful();
} catch (InvalidDateException e) {
Timber.e(e, "restoreLine: ");
Timber.e(e, "restoreLineJSON: ");
} catch (JsonSyntaxException e) {
Timber.e(e, "restoreLineJSON: ");
} finally {
ActiveAndroid.endTransaction();
}
Expand Down
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="@mipmap/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="@mipmap/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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit eae5fbc

Please sign in to comment.