Skip to content

Commit

Permalink
Merge branch 'hotfix/5.5.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Iosue committed May 26, 2018
2 parents 2e53446 + 364eb2c commit 8d09f7a
Show file tree
Hide file tree
Showing 9 changed files with 264 additions and 1,023 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ branches:
only:
- develop
- master
- feature/sonarqube-optimizations
- /^feature/.*$/
- /^hotfix/.*$/
- /^release/.*$/
android:
components:
- tools
- tools
- platform-tools
- build-tools-27.0.3
- android-27
- android-23
- extra-google-m2repository
- extra-android-m2repository
licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+
before_install:
- yes | sdkmanager "platforms;android-27"
script:
- ./gradlew clean build jacocoTestReport sonarqube
after_success:
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
![icon](etc/logo.png)

Omni-Notes
==========

![SLicense](https://img.shields.io/badge/License-GPLv3-red.svg)
[![Stories in Ready](https://badge.waffle.io/federicoiosue/Omni-Notes.png?label=ready&title=Ready)](https://waffle.io/federicoiosue/Omni-Notes)
[![Stories in In Progress](https://badge.waffle.io/federicoiosue/Omni-Notes.png?label=In%20Progress&title=InProgress)](https://waffle.io/federicoiosue/Omni-Notes)
Expand All @@ -6,10 +11,6 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ade707d00ef468fa79d3f6b622444b5)](https://www.codacy.com/app/federico-iosue/Omni-Notes?utm_source=github.com&utm_medium=referral&utm_content=federicoiosue/Omni-Notes&utm_campaign=Badge_Grade)
[![GitHub release](https://img.shields.io/github/release/federicoiosue/omni-notes.svg)](https://github.com/federicoiosue/Omni-Notes/releases/latest)


Omni-Notes
==========

Note taking <b>open-source</b> application aimed to have both a <b>simple interface</b> but keeping <b>smart</b> behavior.

The project was inspired by the absence of such applications compatible with old phones and old versions of Android. It aims to provide an attractive look and follow the most recent design guidelines of the Google operating system.
Expand Down Expand Up @@ -167,7 +168,7 @@ They're all listed into the [build.gradle](https://github.com/federicoiosue/Omni

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.


[2]: https://crowdin.net/project/omni-notes/
[2]: https://crowdin.net/project/omni-notes/
Binary file added etc/ON_banner_site.png
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 etc/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,215 changes: 222 additions & 993 deletions etc/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

VERSION_NAME=5.5.1
VERSION_CODE=246
VERSION_NAME=5.5.2
VERSION_CODE=247
PACKAGE=it.feio.android.omninotes

MIN_SDK=16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,23 +450,8 @@ private void handleIntents() {
noteTmp.setContent(content);
}

// Single attachment data
Uri uri = i.getParcelableExtra(Intent.EXTRA_STREAM);
// Due to the fact that Google Now passes intent as text but with
// audio recording attached the case must be handled in specific way
if (uri != null && !Constants.INTENT_GOOGLE_NOW.equals(i.getAction())) {
String name = FileHelper.getNameFromUri(mainActivity, uri);
new AttachmentTask(this, uri, name, this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
importAttachments(i);

// Multiple attachment data
ArrayList<Uri> uris = i.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
if (uris != null) {
for (Uri uriSingle : uris) {
String name = FileHelper.getNameFromUri(mainActivity, uriSingle);
new AttachmentTask(this, uriSingle, name, this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
}

if (IntentChecker.checkAction(i, Intent.ACTION_MAIN, Constants.ACTION_WIDGET_SHOW_LIST, Constants
Expand All @@ -477,6 +462,26 @@ private void handleIntents() {
i.setAction(null);
}

private void importAttachments(Intent i) {

if (!i.hasExtra(Intent.EXTRA_STREAM)) return;

if (i.getExtras().get(Intent.EXTRA_STREAM) instanceof Uri) {
Uri uri = i.getParcelableExtra(Intent.EXTRA_STREAM);
// Google Now passes Intent as text but with audio recording attached the case must be handled like this
if (!Constants.INTENT_GOOGLE_NOW.equals(i.getAction())) {
String name = FileHelper.getNameFromUri(mainActivity, uri);
new AttachmentTask(this, uri, name, this).execute();
}
} else {
ArrayList<Uri> uris = i.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
for (Uri uriSingle :uris) {
String name = FileHelper.getNameFromUri(mainActivity, uriSingle);
new AttachmentTask(this, uriSingle, name, this).execute();
}
}
}

@SuppressLint("NewApi")
private void initViews() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import it.feio.android.omninotes.helpers.NotesHelper;
import it.feio.android.omninotes.models.*;
import it.feio.android.omninotes.utils.*;
import org.apache.commons.lang.StringEscapeUtils;

import java.io.IOException;
import java.util.*;
Expand Down Expand Up @@ -536,6 +537,7 @@ public void emptyTrash() {
* @return Notes list
*/
public List<Note> getNotesByPattern(String pattern) {
String escapedPattern = StringEscapeUtils.escapeSql(pattern);
int navigation = Navigation.getNavigation();
String whereCondition = " WHERE "
+ KEY_TRASHED + (navigation == Navigation.TRASH ? " IS 1" : " IS NOT 1")
Expand All @@ -545,9 +547,9 @@ public List<Note> getNotesByPattern(String pattern) {
+ " == 0) " : "")
+ (Navigation.checkNavigation(Navigation.REMINDERS) ? " AND " + KEY_REMINDER + " IS NOT NULL" : "")
+ " AND ("
+ " ( " + KEY_LOCKED + " IS NOT 1 AND (" + KEY_TITLE + " LIKE '%" + pattern + "%' " + " OR " +
KEY_CONTENT + " LIKE '%" + pattern + "%' ))"
+ " OR ( " + KEY_LOCKED + " = 1 AND " + KEY_TITLE + " LIKE '%" + pattern + "%' )"
+ " ( " + KEY_LOCKED + " IS NOT 1 AND (" + KEY_TITLE + " LIKE '%" + escapedPattern + "%' " + " OR " +
KEY_CONTENT + " LIKE '%" + escapedPattern + "%' ))"
+ " OR ( " + KEY_LOCKED + " = 1 AND " + KEY_TITLE + " LIKE '%" + escapedPattern + "%' )"
+ ")";
return getNotes(whereCondition, true);
}
Expand Down
4 changes: 4 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,10 @@
-->
<changelog bulletedList="true">

<changelogversion versionName="5.5.2" changeDate="May 25, 2018">
<changelogtext>[u]Fix[/u] Various minor fixes</changelogtext>
</changelogversion>

<changelogversion versionName="5.5.1" changeDate="May 11, 2018">
<changelogtext>[i]Improved![/i] Updated translations</changelogtext>
<changelogtext>[u]Fix[/u] Attachments' dialog opening on Kitkat</changelogtext>
Expand Down

0 comments on commit 8d09f7a

Please sign in to comment.