From 8c843d98b6f17c371ab1fa92a9801de3cf022d2f Mon Sep 17 00:00:00 2001 From: sigmabeta Date: Sun, 7 Jun 2015 21:15:28 -0400 Subject: [PATCH] Android: Add refresh library function. --- .../dolphinemu/activities/GameGridActivity.java | 6 ++++++ .../dolphinemu/model/GameProvider.java | 10 ++++++++++ .../src/main/res/drawable-hdpi/ic_refresh.png | Bin 0 -> 531 bytes .../src/main/res/drawable-hdpi/ic_settings.png | Bin 0 -> 561 bytes .../src/main/res/drawable-mdpi/ic_refresh.png | Bin 0 -> 346 bytes .../src/main/res/drawable-mdpi/ic_settings.png | Bin 0 -> 420 bytes .../src/main/res/drawable-xhdpi/ic_refresh.png | Bin 0 -> 637 bytes .../src/main/res/drawable-xhdpi/ic_settings.png | Bin 0 -> 737 bytes .../src/main/res/drawable-xxhdpi/ic_refresh.png | Bin 0 -> 875 bytes .../src/main/res/drawable-xxhdpi/ic_settings.png | Bin 0 -> 974 bytes .../src/main/res/drawable-xxxhdpi/ic_refresh.png | Bin 0 -> 1148 bytes .../main/res/drawable-xxxhdpi/ic_settings.png | Bin 0 -> 1273 bytes .../app/src/main/res/menu/menu_game_grid.xml | 9 ++++++++- .../Android/app/src/main/res/values/strings.xml | 1 + 14 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Source/Android/app/src/main/res/drawable-hdpi/ic_refresh.png create mode 100644 Source/Android/app/src/main/res/drawable-hdpi/ic_settings.png create mode 100644 Source/Android/app/src/main/res/drawable-mdpi/ic_refresh.png create mode 100644 Source/Android/app/src/main/res/drawable-mdpi/ic_settings.png create mode 100644 Source/Android/app/src/main/res/drawable-xhdpi/ic_refresh.png create mode 100644 Source/Android/app/src/main/res/drawable-xhdpi/ic_settings.png create mode 100644 Source/Android/app/src/main/res/drawable-xxhdpi/ic_refresh.png create mode 100644 Source/Android/app/src/main/res/drawable-xxhdpi/ic_settings.png create mode 100644 Source/Android/app/src/main/res/drawable-xxxhdpi/ic_refresh.png create mode 100644 Source/Android/app/src/main/res/drawable-xxxhdpi/ic_settings.png 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 0000000000000000000000000000000000000000..cd16fdd5080541f0e67ebf3bfc97a50ac2beda79 GIT binary patch literal 531 zcmV+u0_^>XP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00E0hL_t(Y$L*H8N&`U@hX07hLJ8QYpqOmZ*^79od;tp^ zb%|K|0D_Rp=xbQncq^;|UIV^E2ncpc1O*Y)CMNkT9HN`dY$94Hc&1o(=bUfn%$f5u z5%e?Gp?}b?040^tsY)uVqFbFQBQG$Y4ZL9=9tTuuv?@EqjmHLjj<93Wyx_7Y77&}z z8nk9YYUJ?o=%SMZKF4*~iFt;C(#EO4Skv4zSAo@qfIO4b89mmd`?zTjv~O0^<0!&r zdn-y(1!|V0J}T7~C<8#wfyp*i&bA9ge9pQ2f VFoeR4ydnSq002ovPDHLkV1j|y+zbE! literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..f9a8915fd2dc378d35756de89784556e6fdc7db9 GIT binary patch literal 561 zcmV-10?z%3P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00F5aMxdglhe=rd5VQ00000NkvXXu0mjf7RTZX literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..235c84f1e5ae02090f7d9e606ab025ac421791d3 GIT binary patch literal 346 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1g=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tWO=~G=WkKx z$X}z-W_$b!{UqMfxgg+Y2*GnN7D4e#B!a-54~*{Z!wwfd3NoTilU2CuZ0B6Z_UsBP`#&E m+Is1!bIblNdm{hmW&YvE^KNo&|F$0JI|ffzKbLh*2~7YK7l&a0 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..fdcf657fadf9e5191bde2ac712d34664973044d3 GIT binary patch literal 420 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1g=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tWO=~G=WkOt zDC6nk7-DgH>lAx0=0Jh=__E6@GhL4acR2YeGG08ipu>EFfq=E3%Ou^Fh6s)%F55=2 zt_7`T*EU783QU=!AQ)~xd;8|i{w3xMjPK?@n|=JxL&-B4dH8{V_b&$ysca^)_| z3ZsxlW*Z*1`O|{fbzaLod*M~;pZ4gqwrtwnjd`~NlueHvShe+ibw^{G-2$KUZB8|w z`k!*H>V1}qco8PzJz#>Dg+-aTCPEHmV?ulSCq zO{~i-)FwSC@0+pYkgEB+kG(bbZk=bbILm&eV@>|Q%jzFi*E3%JEA6-TR-H32@EAN@ L{an^LB{Ts5Lbah? literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..5f89fc257b71bee3b3e6ca55d89e57a3f3b2d4d4 GIT binary patch literal 637 zcmV-@0)qXCP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002V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a T4YrnW00000NkvXXu0mjftyfGA literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..72128fe69086bd90233bd2f16ca25cd52f423326 GIT binary patch literal 875 zcmV-x1C;!UP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00QGlL_t(&-tE~>NRwe4!0}CTo{HE;x%AM%xu62Y4l4=5 zL)5J>sA)kGC5fenLhzE>F|ZsdL3A_fP}i9R5)?rwRM%VObYIzLi4$aA zihqXFZWXpZqu8**g`zoKtYlnHjrybG@8@_{Ip!(53P$agM%M4?utis$x-&H*Dp zk8kE-)f!b=q{JT%hI7$0*Sxmp~@O40KeOUgyh7>7%-wczKq z66Ym5OSRWg$yI5pEZi39rJ}T(FFuBgtmZFq1JB0n26^b_)jEaWHD1u2f6Y^>?Wt{? z004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00TxzL_t(&-tC%ONK`=>$5(Te(xUPj>1rX0iHP)INJ2!= zTM#5k6k=FdP*Km(1#(xT2(ya>f=~*Y5ZxXNwTLdHDUw7NO4BY@W?GhsznTShOU=po%aP#Ll~WFDwd3RGtvs9g$l z-#pN;6zG#_paiTU+AL7MCD019KwB+=wwMKSS^^!OYM@Y>7@(RQpEnWg;I$=C52Zx- z^j*$5-cwJAK2V8U`T-?Gx}O))gKE5Dqq|=e+j;1IQ=|(tk9Qu@L!2R-1g@hSSBWEs zYQA_p?I%hP=$K#eZv+zld%1Lg(img9<2y^$fv#a9E~x^o#Z;_T0Se=>F`!OnSp)6C zWbCv8iebIoCpK|2kKD!t@dt+IHUmA+1x)JE88RZzL%Ib5Q| z7$&G>f6kpmOK0P-oJ-}tSx8)5H%Lu0)^dy0UZ#?IhBE20)_qm2+-b{He{kn-L4GOIhB(- zlPAJu?@+=?5ia{~GIW6orFqt+1XLl-^#$rcb}B6^v_s+hSUHE|{_3Hx&?0Url*Jb8 zQk-yZE2uORZv~Xk8%5*LAVCV}qM}M4c`~3_Mm4Net6<<#l)lbneD!qI-ovG5VMiz@ z*$bvZbHhDGjBLnG1z_?!sKtegS~>$T`6uLaXdxesZi5Cq9kstzw#z6`smfNm%NWih zLRAvu8e>4KR7=NYBREa!wJen%(~dLB5}o3DRFHQ9iD8|ciwI~gZ#}vXQb{JUT+zm9 zB$_O$`0Q0OB6a=H@3ZXmKwAn1sN=u;J|NH{a=5=@R*RMEjv`K;PnFo>|+FdXY wbVLet&^%B&&lwlAXQT#yMhOB1fo3YuFU0)zMLKxvdjJ3c07*qoM6N<$f_WFC82|tP literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d271d8e03f41181bc2ee2c26762a11597ca486ce GIT binary patch literal 1148 zcmV-?1cUpDP)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00Z<%L_t(|+U=TeNS#$2$M3zGqNy_{Ehs`}tygo=h7qGz zTgG09vD#iO3ihTKU8nAafz+mwnnmGQAvHEC{}jZ8jScoksFgd%gF0e$R0aoO9k?p8GxD&%Nh4=RCjX8zB!&24 z{Qv=8<4>g860an%9}qwWCy;LM-kVCz%I5(9WYd?_$`swisi2f1vdAExQua{8SIi{+ zUKg2~{Qv;6xR}tw93AXTx>xL`lUoVD|C8Y}VSpHC6AV5YG z?$SbTS~{EglvVoxuNsFKrOeY(u$L*j08bis+;7P9yc9pe6?*_NzBkB!Ow89_p2K-t z0B;z?KM^OgW~q};^lzUJrJQ<`)%69 z0rb~~hvWcqnN!4<*&%9wx3<V-!G`{#e4a4kQJ3NwDUaHO zv5!;1rxr6gm#_>t&q>OS39Ntc%Q=}O}VINOWOg0a&iEX?< z9X*D<&*HxKb_j4 zImqB^A;(zoWPX7LAG^3{^f-??hSM@XOx(YDIe@kP3?K00x004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00002VoOIv0RM-N%)bBt010qN zS#tmY3ljhU3ljkVnw%H_00ePKL_t(|+U=WNY*a-QfV*4TDlG(JXqQ@kO2Zo@2nYd6 zi4|ffAvBn%sYmMXSn{@=n&0Rl9}+vQra+)HeOE9l}RN{3_gD22G809d@{`JO}0@K|FwwY*vL@| zpU}0Ho5Oyuu>~mPzK7WXPEtXXD*nJ$?(rH?Dmcl2r^79>132ho`Zt0SKTY*E0P`7Q z1#}8 zB;n&U8)$Epr)1dQDR=6W>`BK02AJnEPE8+AqieY$`V}$Udeg zah&@t3tK>P5wc@wwyyXnQ>!z&+=badSi+Miqq65ty zgZ^hes?h6zkLuuB5pJ2MN-BVfp534iIl?j`tQI!h`^gN{=cjw~_j4|`-~S~Z{#`fk z56JVli|Kv^r9Ry+0oA$*@U9r(Z8rhR!~hG@{VL)FS1*I!5!N`Jz0F!FXvx3Litt8v j2oM5<03kpK5Y+PsBjmQg + + android:icon="@drawable/ic_settings" + android:showAsAction="ifRoom"/> + \ 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 @@ Settings + Refresh Library Add Folder to Library