diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java index 1c838ad18d..9e0bc40366 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java @@ -140,6 +140,12 @@ public final class GameGridActivity extends Activity implements LoaderManager.Lo Intent settings = new Intent(this, SettingsActivity.class); startActivity(settings); return true; + + case R.id.menu_refresh: + getContentResolver().insert(GameProvider.URI_REFRESH, null); + getLoaderManager().restartLoader(LOADER_ID_GAMES, null, this); + + return true; } return false; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameProvider.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameProvider.java index 702c180309..0ee2d3928e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameProvider.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameProvider.java @@ -15,13 +15,17 @@ import org.dolphinemu.dolphinemu.BuildConfig; */ public final class GameProvider extends ContentProvider { + public static final String REFRESH_LIBRARY = "refresh"; + public static final String AUTHORITY = "content://" + BuildConfig.APPLICATION_ID + ".provider"; public static final Uri URI_FOLDER = Uri.parse(AUTHORITY + "/" + GameDatabase.TABLE_NAME_FOLDERS + "/"); public static final Uri URI_GAME = Uri.parse(AUTHORITY + "/" + GameDatabase.TABLE_NAME_GAMES + "/"); + public static final Uri URI_REFRESH = Uri.parse(AUTHORITY + "/" + REFRESH_LIBRARY + "/"); public static final String MIME_TYPE_FOLDER = "vnd.android.cursor.item/vnd.dolphin.folder"; public static final String MIME_TYPE_GAME = "vnd.android.cursor.item/vnd.dolphin.game"; + private GameDatabase mDbHelper; @Override @@ -92,6 +96,12 @@ public final class GameProvider extends ContentProvider if (table != null) { + if (table.equals(REFRESH_LIBRARY)) + { + mDbHelper.scanLibrary(database); + return uri; + } + id = database.insertWithOnConflict(table, null, values, SQLiteDatabase.CONFLICT_IGNORE); // If insertion was successful... diff --git a/Source/Android/app/src/main/res/drawable-hdpi/ic_refresh.png b/Source/Android/app/src/main/res/drawable-hdpi/ic_refresh.png new file mode 100644 index 0000000000..cd16fdd508 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-hdpi/ic_refresh.png differ diff --git a/Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png new file mode 100644 index 0000000000..f9a8915fd2 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png differ diff --git a/Source/Android/app/src/main/res/drawable-mdpi/ic_refresh.png b/Source/Android/app/src/main/res/drawable-mdpi/ic_refresh.png new file mode 100644 index 0000000000..235c84f1e5 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-mdpi/ic_refresh.png differ diff --git a/Source/Android/app/src/main/res/drawable-mdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-mdpi/ic_settings.png new file mode 100644 index 0000000000..fdcf657fad Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-mdpi/ic_settings.png differ diff --git a/Source/Android/app/src/main/res/drawable-xhdpi/ic_refresh.png b/Source/Android/app/src/main/res/drawable-xhdpi/ic_refresh.png new file mode 100644 index 0000000000..5f89fc257b Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xhdpi/ic_refresh.png differ diff --git a/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png new file mode 100644 index 0000000000..12e5d100dd Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxhdpi/ic_refresh.png b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_refresh.png new file mode 100644 index 0000000000..72128fe690 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_refresh.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png new file mode 100644 index 0000000000..6bb8f6e080 Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_refresh.png b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_refresh.png new file mode 100644 index 0000000000..d271d8e03f Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_refresh.png differ diff --git a/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png new file mode 100644 index 0000000000..97e9ca945c Binary files /dev/null and b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png differ diff --git a/Source/Android/app/src/main/res/menu/menu_game_grid.xml b/Source/Android/app/src/main/res/menu/menu_game_grid.xml index 7dfcfdc21c..ca0f117e4f 100644 --- a/Source/Android/app/src/main/res/menu/menu_game_grid.xml +++ b/Source/Android/app/src/main/res/menu/menu_game_grid.xml @@ -1,7 +1,14 @@
\ No newline at end of file diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index 47fefbaf20..e01c06da3a 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -226,6 +226,7 @@