Skip to content

Commit

Permalink
1.10.7: Support minSdkVersion 15
Browse files Browse the repository at this point in the history
  • Loading branch information
caarmen committed Oct 30, 2016
1 parent 7e20547 commit be6b17b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Change Log
==========

1.10.7 *(2016-10-30)*
--------------------
* Support Android 4.0.3-4.0.4 (api level 15).

1.10.6 *(2016-10-29)*
--------------------
* Fix issue #36: save voice-searched words to suggested words list.
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ android {

defaultConfig {
applicationId "ca.rmen.android.poetassistant"
minSdkVersion 16
minSdkVersion 15
targetSdkVersion 25
versionCode 1106
versionName "1.10.6"
versionCode 1107
versionName "1.10.7"
// setting vectorDrawables.useSupportLibrary = true means pngs won't be generated at
// build time: http://android-developers.blogspot.fr/2016/02/android-support-library-232.html
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.Build;
import android.support.annotation.VisibleForTesting;
import android.util.Log;

Expand Down Expand Up @@ -125,7 +126,12 @@ private void open() {
String dbFile = getDbFileName(DB_VERSION);
File dbPath = new File(mContext.getDir("databases", Context.MODE_PRIVATE), dbFile);
try {
mDb = SQLiteDatabase.openDatabase(dbPath.getAbsolutePath(), null, SQLiteDatabase.OPEN_READONLY);
int flags = SQLiteDatabase.OPEN_READONLY;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
// http://stackoverflow.com/questions/2528489/no-such-table-android-metadata-whats-the-problem
flags |= SQLiteDatabase.NO_LOCALIZED_COLLATORS;
}
mDb = SQLiteDatabase.openDatabase(dbPath.getAbsolutePath(), null, flags);
} catch (SQLiteException e) {
Log.w(TAG, "Could not open database " + DB_NAME + ":" + DB_VERSION + ": " + e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import android.content.ComponentName;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
Expand Down Expand Up @@ -117,7 +118,12 @@ public void search(String word) {
public void onGlobalLayout() {
Log.d(TAG, "searching after layout");
performSearch.run();
mViewPager.getViewTreeObserver().removeOnGlobalLayoutListener(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mViewPager.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
//noinspection deprecation
mViewPager.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
}
}
);
Expand Down

0 comments on commit be6b17b

Please sign in to comment.