Skip to content
This repository has been archived by the owner on Feb 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #33 from akshatgoel/gradleFix
Browse files Browse the repository at this point in the history
- Disable note saved message for empty notes #14 
- Update Gradle and Java #31
  • Loading branch information
vishesh authored Dec 24, 2016
2 parents 48a9cff + 67b6f50 commit 6fce7d2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 27 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
language: android
jdk: oraclejdk8
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'

android:
components:
# Uncomment the lines below if you want to
# use the latest revision of Android SDK Tools
# - platform-tools
# - tools
- platform-tools
- tools

# The BuildTools version used by your project
- build-tools-19.1.0
- build-tools-21.0.0

# The SDK version used to compile your project
- android-19
Expand Down
20 changes: 10 additions & 10 deletions Sealnote/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
apply plugin: 'android'
apply plugin: 'com.android.application'

repositories {
mavenCentral()
jcenter()
}

android {
compileSdkVersion 19
buildToolsVersion '19.1'
buildToolsVersion '21.0.0'

defaultConfig {
minSdkVersion 14
Expand All @@ -35,16 +35,16 @@ android {

buildTypes {
release {
runProguard false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
debuggable false
jniDebugBuild false
jniDebuggable false
signingConfig signingConfigs.release
}
debug {
debuggable true
jniDebugBuild true
runProguard false
jniDebuggable true
minifyEnabled false
}
}

Expand All @@ -65,7 +65,7 @@ task nativeLibsToJar(type: Zip, description: 'create a jar archive of the native
into 'lib/'
}

tasks.withType(Compile) {
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,15 @@ public boolean onOptionsItemSelected(MenuItem item) {
/**
* Save old or new note to database
*/
public void saveNote() {
public boolean saveNote() {
final DatabaseHandler handler = SealnoteApplication.getDatabase();
final String title = mTitleView.getText().toString();
final NoteContent noteContent = mNoteView.getNoteContent();
final String text = noteContent.toString();

if (title.equals("") && text.trim().equals("")) {
Toast.makeText(this, getResources().getString(R.string.empty_note), Toast.LENGTH_SHORT).show();
return;
return false;
}

final boolean tagsChanged = mNote != null && mNote.getTags() != null &&
Expand All @@ -437,7 +437,7 @@ public void saveNote() {
} else if (mAutoSaveEnabled && !anythingChanged) {
// Also avoid unnecessarily updating the edit timestamp of note
Log.d(TAG, "Note didn't change. No need to autosave");
return;
return false;
}

mNote.setTitle(title);
Expand All @@ -455,6 +455,7 @@ public void saveNote() {
// only those two have changed
handler.updateNote(mNote, contentChanged);
}
return true;
}

/**
Expand Down Expand Up @@ -526,8 +527,10 @@ public void doRestore() {
*/
public void doSave() {
if (mSaveButtonClicked) return; else mSaveButtonClicked = true; //FIXME: Hack. Avoids double saving
saveNote();
Toast.makeText(this, getResources().getString(R.string.note_saved), Toast.LENGTH_SHORT).show();
final boolean noteSaved = saveNote();
if (noteSaved) {
Toast.makeText(this, getResources().getString(R.string.note_saved), Toast.LENGTH_SHORT).show();
}
finish();
}

Expand Down
8 changes: 4 additions & 4 deletions aFileChooser/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2+'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}

apply plugin: 'android-library'
apply plugin: 'com.android.library'

dependencies {
compile 'com.android.support:support-v4:20.0.+'
}

android {
compileSdkVersion 19
buildToolsVersion "19.1"
buildToolsVersion "21.0.0"

defaultConfig {
minSdkVersion 14
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}

allprojects {
repositories {
mavenCentral()
jcenter()
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Oct 13 02:27:37 IST 2014
#Sat Dec 24 20:50:11 IST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

0 comments on commit 6fce7d2

Please sign in to comment.