summaryrefslogtreecommitdiff
path: root/Source/Android/app/src
diff options
context:
space:
mode:
authorsigmabeta <sigmabeta@users.noreply.github.com>2015-06-07 21:15:28 -0400
committersigmabeta <sigmabeta@users.noreply.github.com>2015-06-07 21:15:28 -0400
commit8c843d98b6f17c371ab1fa92a9801de3cf022d2f (patch)
tree7056805046bf3dd3971d35e6175323ec37013770 /Source/Android/app/src
parent5c7caf1f22685430f98f39b86b07cadee3171f68 (diff)
Android: Add refresh library function.
Diffstat (limited to 'Source/Android/app/src')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/GameGridActivity.java6
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/GameProvider.java10
-rw-r--r--Source/Android/app/src/main/res/drawable-hdpi/ic_refresh.pngbin0 -> 531 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-hdpi/ic_settings.pngbin0 -> 561 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-mdpi/ic_refresh.pngbin0 -> 346 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-mdpi/ic_settings.pngbin0 -> 420 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-xhdpi/ic_refresh.pngbin0 -> 637 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.pngbin0 -> 737 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-xxhdpi/ic_refresh.pngbin0 -> 875 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.pngbin0 -> 974 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-xxxhdpi/ic_refresh.pngbin0 -> 1148 bytes
-rw-r--r--Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.pngbin0 -> 1273 bytes
-rw-r--r--Source/Android/app/src/main/res/menu/menu_game_grid.xml9
-rw-r--r--Source/Android/app/src/main/res/values/strings.xml1
14 files changed, 25 insertions, 1 deletions
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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-hdpi/ic_refresh.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-mdpi/ic_refresh.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-mdpi/ic_settings.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-xhdpi/ic_refresh.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_refresh.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_refresh.png
Binary files 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
--- /dev/null
+++ b/Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png
Binary files 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 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
+ android:id="@+id/menu_refresh"
+ android:title="@string/grid_menu_refresh"
+ android:icon="@drawable/ic_refresh"
+ android:showAsAction="ifRoom"/>
+ <item
android:id="@+id/menu_settings"
android:title="@string/grid_menu_settings"
- android:showAsAction="never"/>
+ android:icon="@drawable/ic_settings"
+ android:showAsAction="ifRoom"/>
+
</menu> \ 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 @@
<!-- Game Grid Screen-->
<string name="grid_menu_settings">Settings</string>
+ <string name="grid_menu_refresh">Refresh Library</string>
<!-- Add Directory Screen-->
<string name="add_directory_title">Add Folder to Library</string>