Skip to content

Commit

Permalink
Finish 5.2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
federicoiosue committed Sep 8, 2016
2 parents 7b6ebca + 8df38c7 commit 60e27ad
Show file tree
Hide file tree
Showing 50 changed files with 934 additions and 658 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Note taking <b>open-source</b> application aimed to have both a <b>simple interf
The project was created by the absence of such applications compatible with old phones and old versions of Android that would propose, however, an attractive look and aligned with the most recent design of the Google operating system


**Follow the developments and post your comments and advice on Google+ Beta Comunity at http://goo.gl/eF6qqF**
**Follow the developments and post your comments and advice on Google+ Beta Community at http://goo.gl/eF6qqF**

*Help to keep translations updated is always welcome, if you want give an hand checkout the translation project at [Crowdin][2]*

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
}
Expand Down
2 changes: 1 addition & 1 deletion etc/translations/play_store_description.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Note taking open-source application aimed to have both a lightweight footprint on system performances and simple interface but keeping smart behavior.

Follow the developments and post your comments and advice on Google+ Beta Comunity at https://plus.google.com/u/0/communities/112276053772152071903
Follow the developments and post your comments and advice on Google+ Beta Community at https://plus.google.com/u/0/communities/112276053772152071903

Help to complete translations is needed, if you want give me an hand please send me an e-mail!

Expand Down
5 changes: 5 additions & 0 deletions etc/translations/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<string name="proceed">Proceed</string>
<string name="contracted_view">Reduced view</string>
<string name="expanded_view">Expanded view</string>
<string name="grid_view">Grid view</string>
<string name="add_shortcut">Add shortcut</string>
<string name="shortcut_added">Shortcut added to home screen</string>
<string name="shortcut_note_deleted">Shortcut points to deleted note</string>
Expand Down Expand Up @@ -278,6 +279,7 @@
<string name="minutes">minutes</string>
<string name="settings_simple_calendar">Simple calendar and time</string>
<string name="settings_simple_calendar_summary">Use the (simpler) Android interface for date/time selection, instead of Google interface</string>
<string name="settings_first_day_of_week">First day of week</string>
<string name="settings_tour_show_again">App tour</string>
<string name="settings_tour_show_again_summary">Show me the application tour again</string>
<string name="backup_include_settings">Include settings and password</string>
Expand Down Expand Up @@ -317,6 +319,9 @@
<string name="settings_attachments_on_bottom">Attachments on bottom</string>
<string name="settings_attachments_on_bottom_summary_on">Shows attachments below note content</string>
<string name="settings_attachments_on_bottom_summary_off">Shows attachments above note content</string>
<string name="settings_prettified_dates">Prettified dates</string>
<string name="settings_prettified_dates_summary_on">Dates are shown in a simplier format</string>
<string name="settings_prettified_dates_summary_off">Dates are shown in a more detailed format</string>
<string name="settings_screen_privacy">Privacy</string>
<string name="settings_error_reporting">Error reporting</string>
<string name="settings_error_reporting_summary_on">When app crashes developer will be informed to help you</string>
Expand Down
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

MIN_SDK=14
TARGET_SDK=23
VERSION_NAME=5.2.16
VERSION_CODE=220
VERSION_NAME=5.2.17
VERSION_CODE=227
PACKAGE=it.feio.android.omninotes

# The following properties are empty defaults to allow build and can EVENTUALLY be overridden to allow:
Expand All @@ -28,3 +28,5 @@ ANALYTICS_URL=
CRASH_REPORTING_URL=
# App's version check for update dialog
VERSION_CHECK_URL=
# Google Maps API key to provide addresses autocompletion feature
MAPS_API_KEY=
21 changes: 2 additions & 19 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
#
# Copyright (C) 2015 Federico Iosue ([email protected])
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

#Thu Nov 27 09:24:39 CET 2014
#Mon Sep 05 22:26:56 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
1 change: 1 addition & 0 deletions omniNotes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,5 @@ android.buildTypes.each { type ->
type.buildConfigField 'String', 'ANALYTICS_URL', '"' + ANALYTICS_URL + '"'
type.buildConfigField 'String', 'CRASH_REPORTING_URL', '"' + CRASH_REPORTING_URL + '"'
type.buildConfigField 'String', 'VERSION_CHECK_URL', '"' + VERSION_CHECK_URL + '"'
type.buildConfigField 'String', 'MAPS_API_KEY', '"' + MAPS_API_KEY + '"'
}
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ public void onPositive(MaterialDialog materialDialog) {
if (TextUtils.isEmpty(autoCompView.getText().toString())) {
noteTmp.setLatitude(location.getLatitude());
noteTmp.setLongitude(location.getLongitude());
// GeocodeHelper.getAddressFromCoordinates(location, mFragment);
GeocodeHelper.getAddressFromCoordinates(location, mFragment);
} else {
GeocodeHelper.getCoordinatesFromAddress(autoCompView.getText().toString(),
mFragment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,62 +21,60 @@
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.widget.Filterable;

import java.util.ArrayList;

import it.feio.android.omninotes.utils.GeocodeHelper;

import java.util.List;

public class PlacesAutoCompleteAdapter extends ArrayAdapter<String> implements Filterable {

private static final int MIN_CHARS = 7;
public class PlacesAutoCompleteAdapter extends ArrayAdapter<String> implements Filterable {

private ArrayList<String> resultList;
private static final int MIN_CHARS = 7;

private List<String> resultList;

public PlacesAutoCompleteAdapter(Context context, int textViewResourceId) {
super(context, textViewResourceId);
}

public PlacesAutoCompleteAdapter(Context context, int textViewResourceId) {
super(context, textViewResourceId);
}

@Override
public int getCount() {
return resultList.size();
}

@Override
public int getCount() {
return resultList.size();
}

@Override
public String getItem(int index) {
return resultList.get(index);
}

@Override
public String getItem(int index) {
return resultList.get(index);
}

@Override
public Filter getFilter() {
return new Filter() {
@Override
protected FilterResults performFiltering(CharSequence constraint) {
FilterResults filterResults = new FilterResults();
if (constraint != null && constraint.length() > MIN_CHARS) {
// Retrieve the autocomplete results.
resultList = GeocodeHelper.autocomplete(constraint.toString());

// Assign the data to the FilterResults
filterResults.values = resultList;
filterResults.count = resultList.size();
}
return filterResults;
}
@Override
public Filter getFilter() {
return new Filter() {
@Override
protected FilterResults performFiltering(CharSequence constraint) {
FilterResults filterResults = new FilterResults();
if (constraint != null && constraint.length() > MIN_CHARS) {
// Retrieve the autocomplete results.
resultList = GeocodeHelper.autocomplete(constraint.toString());
// Assign the data to the FilterResults
filterResults.values = resultList;
filterResults.count = resultList.size();
}
return filterResults;
}


@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
if (results != null && results.count > 0) {
notifyDataSetChanged();
} else {
notifyDataSetInvalidated();
}
}
};
}
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
if (results != null && results.count > 0) {
notifyDataSetChanged();
} else {
notifyDataSetInvalidated();
}
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.nlopez.smartlocation.location.config.LocationParams;
import io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesWithFallbackProvider;
import io.nlopez.smartlocation.rx.ObservableFactory;
import it.feio.android.omninotes.BuildConfig;
import it.feio.android.omninotes.OmniNotes;
import it.feio.android.omninotes.models.listeners.OnGeoUtilResultListener;
import org.json.JSONArray;
Expand All @@ -41,6 +42,7 @@
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
Expand All @@ -54,7 +56,6 @@ public class GeocodeHelper implements LocationListener {
private static final String PLACES_API_BASE = "https://maps.googleapis.com/maps/api/place";
private static final String TYPE_AUTOCOMPLETE = "/autocomplete";
private static final String OUT_JSON = "/json";
private static final String API_KEY = "AIzaSyBq_nZEz9sZMwEJ28qmbg20CFG1Xo1JGp0";

private static GeocodeHelper instance;
private static LocationManager locationManager;
Expand Down Expand Up @@ -115,15 +116,14 @@ public void onError(Throwable e) {


public static void stop() {

SmartLocation.with(OmniNotes.getAppContext()).location().stop();
if (Geocoder.isPresent()) {
SmartLocation.with(OmniNotes.getAppContext()).geocoding().stop();
}
}


public static String getAddressFromCoordinates(Context mContext, double latitude,
static String getAddressFromCoordinates(Context mContext, double latitude,
double longitude) throws IOException {
String addressString = "";
Geocoder geocoder = new Geocoder(mContext, Locale.getDefault());
Expand Down Expand Up @@ -176,13 +176,17 @@ public static void getCoordinatesFromAddress(String address, final OnGeoUtilResu
}


public static ArrayList<String> autocomplete(String input) {
public static List<String> autocomplete(String input) {
String MAPS_API_KEY = BuildConfig.MAPS_API_KEY;
if (TextUtils.isEmpty(MAPS_API_KEY)) {
return Collections.emptyList();
}
ArrayList<String> resultList = null;

HttpURLConnection conn = null;
StringBuilder jsonResults = new StringBuilder();
try {
URL url = new URL(PLACES_API_BASE + TYPE_AUTOCOMPLETE + OUT_JSON + "?key=" + API_KEY + "&input=" +
URL url = new URL(PLACES_API_BASE + TYPE_AUTOCOMPLETE + OUT_JSON + "?key=" + MAPS_API_KEY + "&input=" +
URLEncoder.encode(input, "utf8"));
conn = (HttpURLConnection) url.openConnection();
InputStreamReader in = new InputStreamReader(conn.getInputStream());
Expand All @@ -195,10 +199,10 @@ public static ArrayList<String> autocomplete(String input) {
}
} catch (MalformedURLException e) {
Log.e(Constants.TAG, "Error processing Places API URL");
return resultList;
return null;
} catch (IOException e) {
Log.e(Constants.TAG, "Error connecting to Places API");
return resultList;
return null;
} finally {
if (conn != null) {
conn.disconnect();
Expand Down
5 changes: 5 additions & 0 deletions omniNotes/src/main/res/raw/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
-->
<changelog bulletedList="true">

<changelogversion versionName="5.2.17" changeDate="Sep 09, 2016">
<changelogtext>[i]Improved[/i] Updated translations</changelogtext>
<changelogtext>[u]Fix[/u] Location retrieval should work again thanks to new API key</changelogtext>
</changelogversion>

<changelogversion versionName="5.2.16" changeDate="Jun 21, 2016">
<changelogtext>[u]Fix[/u] Opening the same note twice from home widget broke the navigation</changelogtext>
<changelogtext>[u]Fix[/u] Removed searched string label when changing sort order</changelogtext>
Expand Down
Loading

0 comments on commit 60e27ad

Please sign in to comment.