Skip to content

Commit

Permalink
Merge branch 'release/v2.6.1'
Browse files Browse the repository at this point in the history
* release/v2.6.1: (33 commits)
  Updates readme
  Fixes invalid language qualifier
  Bumps version codes and adds changelog
  Adds translator to readme
  Apply translations in fr
  Apply translations in nl_NL
  Apply translations in ru
  Apply translations in uk
  Disables calendar view in landscape for now
  Fixes string again
  Ensures image was copied successfully and removes unsuccessful images
  Reduces buffer for import/encrypt tasks
  Apply translations in uk
  Fixes missing localisation for last feeding
  Fixes bad grammar
  Apply translations in uk
  Adds basic import functionality
  Apply translations in ru
  Apply translations in uk
  Adds basic backup path functionality
  ...
  • Loading branch information
7LPdWcaW committed Dec 18, 2019
2 parents 00ce576 + 5291721 commit ff0986b
Show file tree
Hide file tree
Showing 35 changed files with 963 additions and 167 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Welcome to grow tracker. This is a utility app designed for gardening and tracki

[Latest Nightly Build (Experimental!)](https://github.com/7LPdWcaW/GrowTracker-Android/releases/tag/alpha)

[Latest APK: (SHA256) 4009957e99cc7e0d8a4d1fd9ef8f724cbd65566eb776c94350b6ed1e8a405275 v2.6](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.6/v2.6-production.apk)
[Latest APK: (SHA256) 501786b7350eceb7b894a5745c06c378f1d2f2e6f4bf659ee2576b3dfaca5732 v2.6.1](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.6.1/v2.6.1-production.apk)

[Latest APK (English only): (SHA256) 0f9cd87e57bcb9e402c9aeafba719a9f19be5c26fae54f756924da286403dcaa v2.6](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.6/v2.6-en.apk)
[Latest APK (English only): (SHA256) e366c67c54548da4c46206c953e8847ba6e4c933449ca8d33525601ee2d87bb8 v2.6.1](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.6.1/v2.6.1-en.apk)

[Latest APK (Discrete): (SHA256) 3feb38df6d8044d71fa3616092afe1242f5a9d2dd69d39e0660d125d57590f59 v2.6](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.6/v2.6-discrete.apk)
[Latest APK (Discrete): (SHA256) 3b5edaceb462c6fcd51d11652943357976f75b53dacdfe650f422933357688d9 v2.6.1](https://github.com/7LPdWcaW/GrowTracker-Android/releases/download/v2.6.1/v2.6.1-discrete.apk)

[Get it on F-Droid with automatic updates](https://f-droid.org/packages/me.anon.grow/)

Expand Down Expand Up @@ -279,6 +279,7 @@ Translations provided by;

- Alex (Noxmiles) - de ![DE - German](https://transifex-open-api.herokuapp.com/badge/growutils/project/growtracker/language/de_DE/translated.png)
- Basti B (Weltenesche) - de ![DE - German](https://transifex-open-api.herokuapp.com/badge/growutils/project/growtracker/language/de_DE/translated.png)
- Heimen Stoffels (Vistaus) - nl ![NL - Dutch](https://transifex-open-api.herokuapp.com/badge/growutils/project/growtracker/language/nl_NL/translated.png)
- EmmanuelMess - es ![ES - Spanish](https://transifex-open-api.herokuapp.com/badge/growutils/project/growtracker/language/es/translated.png)
- Maxtille - fr ![FR - French](https://transifex-open-api.herokuapp.com/badge/growutils/project/growtracker/language/fr/translated.png)
- Patrick B (EukalyptusX) - de ![DE - German](https://transifex-open-api.herokuapp.com/badge/growutils/project/growtracker/language/de_DE/translated.png)
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
applicationId "me.anon.grow"
minSdkVersion 17
targetSdkVersion 29
versionCode getCommitCountTotal()
versionName "2.6"
versionCode 1370//getCommitCountTotal()
versionName "2.6.1"
versionNameSuffix (travis ? "-alpha" : "")

compileOptions {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

<application
android:allowBackup="true"
Expand All @@ -12,6 +13,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name=".MainApplication"
android:requestLegacyExternalStorage="true"
>
<provider
android:name="androidx.core.content.FileProvider"
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/me/anon/grow/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.AlarmManager;
import android.app.Application;
import android.app.PendingIntent;
import android.app.backup.BackupManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -35,6 +36,7 @@

import me.anon.controller.receiver.BackupService;
import me.anon.lib.handler.ExceptionHandler;
import me.anon.lib.helper.BackupHelper;
import me.anon.lib.manager.FileManager;
import me.anon.lib.manager.GardenManager;
import me.anon.lib.manager.PlantManager;
Expand Down Expand Up @@ -120,9 +122,12 @@ public static SharedPreferences getDefaultPreferences()
PlantManager.getInstance().initialise(this);
encrypted = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("encrypt", false) || PlantManager.isFileEncrypted();

BackupHelper.FILES_PATH = PreferenceManager.getDefaultSharedPreferences(this).getString("backup_location", "");
FileManager.IMAGE_PATH = PreferenceManager.getDefaultSharedPreferences(this).getString("image_location", "");
if (TextUtils.isEmpty(BackupHelper.FILES_PATH)) BackupHelper.FILES_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/backups/GrowTracker/";
if (TextUtils.isEmpty(FileManager.IMAGE_PATH)) FileManager.IMAGE_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getPath() + "/GrowTracker/";
new File(FileManager.IMAGE_PATH).mkdir();
new File(FileManager.IMAGE_PATH).mkdirs();
new File(BackupHelper.FILES_PATH).mkdirs();

isTablet = getResources().getBoolean(R.bool.is_tablet);

Expand Down Expand Up @@ -270,7 +275,7 @@ protected File getFile(String imageUri)
return new File(dir, fileName);
}
})
.diskCacheExtraOptions(512, 512, null)
.diskCacheExtraOptions(768, 768, null)
.imageDecoder(new BaseImageDecoder(false)
{
@Override protected InputStream getImageStream(ImageDecodingInfo decodingInfo) throws IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ else if (getArguments() != null)
}
});
calendar.setCurrentDate(CalendarDay.today());
calendar.setVisibility(filtered ? View.VISIBLE : View.GONE);
calendar.setVisibility(filtered && getResources().getBoolean(R.bool.is_portrait) ? View.VISIBLE : View.GONE);
adapter.setFilterDate(selectedFilterDate);

setActions();
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/me/anon/grow/fragment/GardenFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,13 @@ private synchronized void saveCurrentState()
{
Plant plant = data.getParcelableExtra("plant");
PlantManager.getInstance().upsert(plant);

if (requestCode == 5 && !garden.getPlantIds().contains(plant.getId()))
{
garden.getPlantIds().add(plant.getId());
GardenManager.getInstance().save();
}

filter();
PlantWidgetProvider.triggerUpdateAll(getActivity());
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/me/anon/grow/fragment/GardenHostFragment.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.anon.grow.fragment

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
Expand Down Expand Up @@ -45,6 +46,12 @@ class GardenHostFragment : Fragment()
}
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?)
{
super.onActivityResult(requestCode, resultCode, data)
childFragmentManager.findFragmentById(R.id.child_fragment_holder)?.onActivityResult(requestCode, resultCode, data)
}

override fun onSaveInstanceState(outState: Bundle)
{
outState.putParcelable("garden", garden)
Expand Down
35 changes: 32 additions & 3 deletions app/src/main/java/me/anon/grow/fragment/PlantDetailsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private void setLastFeeding()
DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(getActivity());
Date actionDate = new Date(lastWater.getDate());
lastFeedingFullDate.setText(dateFormat.format(actionDate) + " " + timeFormat.format(actionDate));
lastFeedingDate.setText(Html.fromHtml("<b>" + new DateRenderer(getActivity()).timeAgo(lastWater.getDate()).formattedDate + "</b> ago"));
lastFeedingDate.setText(Html.fromHtml(getString(R.string.ago, "<b>" + new DateRenderer(getActivity()).timeAgo(lastWater.getDate()).formattedDate + "</b>")));

final Water finalLastWater = lastWater;
duplicateFeeding.setOnClickListener(new View.OnClickListener()
Expand Down Expand Up @@ -431,6 +431,12 @@ private void setUi()

@Views.OnClick public void onPhotoClick()
{
if (!PermissionHelper.hasPermission(getActivity(), Manifest.permission.CAMERA))
{
PermissionHelper.doPermissionCheck(this, Manifest.permission.CAMERA, 1, getString(R.string.camera_permission_summary));
return;
}

if (!PermissionHelper.hasPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE))
{
PermissionHelper.doPermissionCheck(this, Manifest.permission.WRITE_EXTERNAL_STORAGE, 1, getString(R.string.permission_summary));
Expand Down Expand Up @@ -517,8 +523,31 @@ private void setUi()
{
if (resultCode == Activity.RESULT_CANCELED)
{
new File(plant.getImages().get(plant.getImages().size() - 1)).delete();
plant.getImages().remove(plant.getImages().size() - 1);
File imageFile = new File(plant.getImages().get(plant.getImages().size() - 1));

if (imageFile.delete())
{
plant.getImages().remove(plant.getImages().size() - 1);
}

File folderFile = imageFile.getParentFile();
String[] list = folderFile.list();
if (list != null)
{
if (list.length == 1 && ".nomedia".equals(list[0]))
{
new File(folderFile, ".nomedia").delete();
}

if (folderFile.list() == null || folderFile.list().length == 0)
{
folderFile.delete();
}
}
else
{
folderFile.delete();
}
}
else
{
Expand Down
Loading

0 comments on commit ff0986b

Please sign in to comment.