Skip to content
This repository has been archived by the owner on May 21, 2020. It is now read-only.

Commit

Permalink
Final Version!
Browse files Browse the repository at this point in the history
  • Loading branch information
Dounx committed May 14, 2018
1 parent ae4b7d4 commit 7c7d17d
Show file tree
Hide file tree
Showing 142 changed files with 153 additions and 16 deletions.
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "me.dounx.nintendoeshophelper"
minSdkVersion 21
targetSdkVersion 27
versionCode 11
versionName "1.1.9"
versionCode 12
versionName "1.2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified app/src/main/assets/GameBase.db
Binary file not shown.
Binary file added app/src/main/assets/images/AB28.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/ACNG.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/ADM9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AEB8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AEBQ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AEUC.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AEWH.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AEWX.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AEYU.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AFFB.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AFVH.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AFXD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AFY4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AGFZ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AGV8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AH7Q.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/images/AHAX.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AHHB.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AHLL.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AHQS.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AHXC.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AJ4M.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AJ8J.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AJQW.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AJXT.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/assets/images/AK2B.jpg
Binary file added app/src/main/assets/images/AK2Q.jpg
Binary file added app/src/main/assets/images/AK6J.jpg
Binary file added app/src/main/assets/images/AK6Z.jpg
Binary file added app/src/main/assets/images/AK98.jpg
Binary file added app/src/main/assets/images/AK9Z.jpg
Binary file added app/src/main/assets/images/AKB3.jpg
Binary file added app/src/main/assets/images/AKBP.jpg
Binary file added app/src/main/assets/images/AKD5.jpg
Binary file added app/src/main/assets/images/AKN7.jpg
Binary file added app/src/main/assets/images/AKPU.jpg
Binary file added app/src/main/assets/images/AKRV.jpg
Binary file added app/src/main/assets/images/AL2R.jpg
Binary file added app/src/main/assets/images/AL4M.jpg
Binary file added app/src/main/assets/images/AL9Z.jpg
Binary file added app/src/main/assets/images/ALA2.jpg
Binary file added app/src/main/assets/images/ALAJ.jpg
Binary file added app/src/main/assets/images/ALF2.jpg
Binary file added app/src/main/assets/images/ALF3.jpg
Binary file added app/src/main/assets/images/ALGU.jpg
Binary file added app/src/main/assets/images/ALGY.jpg
Binary file added app/src/main/assets/images/ALH4.jpg
Binary file added app/src/main/assets/images/ALHX.jpg
Binary file added app/src/main/assets/images/ALJV.jpg
Binary file added app/src/main/assets/images/ALLA.jpg
Binary file added app/src/main/assets/images/ALU2.jpg
Binary file added app/src/main/assets/images/ALX7.jpg
Binary file added app/src/main/assets/images/ALX8.jpg
Binary file added app/src/main/assets/images/AM4F.jpg
Binary file added app/src/main/assets/images/AM4Z.jpg
Binary file added app/src/main/assets/images/AM53.jpg
Binary file added app/src/main/assets/images/AM54.jpg
Binary file added app/src/main/assets/images/AM64.jpg
Binary file added app/src/main/assets/images/AM9X.jpg
Binary file added app/src/main/assets/images/AMCE.jpg
Binary file added app/src/main/assets/images/AMEK.jpg
Binary file added app/src/main/assets/images/AMEL.jpg
Binary file added app/src/main/assets/images/AMJS.jpg
Binary file added app/src/main/assets/images/AMKM.jpg
Binary file added app/src/main/assets/images/AMLL.jpg
Binary file added app/src/main/assets/images/AMM9.jpg
Binary file added app/src/main/assets/images/AMP5.jpg
Binary file added app/src/main/assets/images/AMPP.jpg
Binary file added app/src/main/assets/images/AMS8.jpg
Binary file added app/src/main/assets/images/AMSG.jpg
Binary file added app/src/main/assets/images/AMVL.jpg
Binary file added app/src/main/assets/images/AMWB.jpg
Binary file added app/src/main/assets/images/AN29.jpg
Binary file added app/src/main/assets/images/AN34.jpg
Binary file added app/src/main/assets/images/AN5V.jpg
Binary file added app/src/main/assets/images/AN5W.jpg
Binary file added app/src/main/assets/images/AN5Z.jpg
Binary file added app/src/main/assets/images/AN62.jpg
Binary file added app/src/main/assets/images/AN66.jpg
Binary file added app/src/main/assets/images/AN6H.jpg
Binary file added app/src/main/assets/images/AN7N.jpg
Binary file added app/src/main/assets/images/AN7P.jpg
Binary file added app/src/main/assets/images/AN7Q.jpg
Binary file added app/src/main/assets/images/AN7R.jpg
Binary file added app/src/main/assets/images/ANB4.jpg
Binary file added app/src/main/assets/images/ANB9.jpg
Binary file added app/src/main/assets/images/ANBD.jpg
Binary file added app/src/main/assets/images/ANBE.jpg
Binary file added app/src/main/assets/images/ANDG.jpg
Binary file added app/src/main/assets/images/ANGT.jpg
Binary file added app/src/main/assets/images/ANNK.jpg
Binary file added app/src/main/assets/images/ANR8.jpg
Binary file added app/src/main/assets/images/ANRL.jpg
Binary file added app/src/main/assets/images/ANWE.jpg
Binary file added app/src/main/assets/images/ANXC.jpg
Binary file added app/src/main/assets/images/ANYR.jpg
Binary file added app/src/main/assets/images/AP4L.jpg
Binary file added app/src/main/assets/images/AP4Z.jpg
Binary file added app/src/main/assets/images/AP5S.jpg
Binary file added app/src/main/assets/images/AP7V.jpg
Binary file added app/src/main/assets/images/APB8.jpg
Binary file added app/src/main/assets/images/APBK.jpg
Binary file added app/src/main/assets/images/APCN.jpg
Binary file added app/src/main/assets/images/APDD.jpg
Binary file added app/src/main/assets/images/APDS.jpg
Binary file added app/src/main/assets/images/APEQ.jpg
Binary file added app/src/main/assets/images/APF3.jpg
Binary file added app/src/main/assets/images/APFN.jpg
Binary file added app/src/main/assets/images/APG5.jpg
Binary file added app/src/main/assets/images/APGE.jpg
Binary file added app/src/main/assets/images/APHV.jpg
Binary file added app/src/main/assets/images/APHW.jpg
Binary file added app/src/main/assets/images/APJF.jpg
Binary file added app/src/main/assets/images/APJU.jpg
Binary file added app/src/main/assets/images/APJV.jpg
Binary file added app/src/main/assets/images/APNL.jpg
Binary file added app/src/main/assets/images/APPP.jpg
Binary file added app/src/main/assets/images/APQR.jpg
Binary file added app/src/main/assets/images/APQW.jpg
Binary file added app/src/main/assets/images/APS2.jpg
Binary file added app/src/main/assets/images/APS7.jpg
Binary file added app/src/main/assets/images/APT2.jpg
Binary file added app/src/main/assets/images/APTC.jpg
Binary file added app/src/main/assets/images/APTD.jpg
Binary file added app/src/main/assets/images/APTE.jpg
Binary file added app/src/main/assets/images/APU3.jpg
Binary file added app/src/main/assets/images/APUP.jpg
Binary file added app/src/main/assets/images/APWC.jpg
Binary file added app/src/main/assets/images/APY5.jpg
Binary file added app/src/main/assets/images/APYN.jpg
Binary file added app/src/main/assets/images/AQAF.jpg
Binary file added app/src/main/assets/images/AQAG.jpg
18 changes: 12 additions & 6 deletions app/src/main/java/GameGrabber/GameLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,19 @@ private void DealWithSpecialGameData(List<Game> games) {
Game game = iterator.next();
// NBA 2K18
if (game.getGameCode() != null && game.getGameCode().equals("AB38")) {
if (game.getUsTitle().equals("NBA 2K18") && game.getJpTitle().equals("NBA 2K18")) {
if (game.getUsTitle() == null || game.getJpTitle() == null) {
iterator.remove();
} else {
if (game.getUsTitle().equals("NBA 2K18") && game.getJpTitle().equals("NBA 2K18")) {
}
else if (game.getUsTitle().equals("NBA 2K18 Legend Edition") && game.getJpTitle().equals("NBA 2K18 レジェンド エディション")) {
}
else if (game.getUsTitle().equals("NBA 2K18 Legend Edition Gold") && game.getJpTitle().equals("NBA 2K18 レジェンド エディション ゴールド")) {
}
else {
iterator.remove();
}
}
if (game.getUsTitle().equals("NBA 2K18 Legend Edition") && game.getJpTitle().equals("NBA 2K18 レジェンド エディション")) {
}
if (game.getUsTitle().equals("NBA 2K18 Legend Edition Gold") && game.getJpTitle().equals("NBA 2K18 レジェンド エディション ゴールド")) {
}
iterator.remove();
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/GameGrabber/USGameGrabTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ protected Integer doInBackground(String... params) {
.build();
try (Response response = client.newCall(request).execute()) {
String responseData = response.body().string();
total = parseJsonWithJSONObjectAndAddToDB(responseData);
if (!responseData.equals("{}")) {
total = parseJsonWithJSONObjectAndAddToDB(responseData);
}
} catch (Exception e) {
e.printStackTrace();
return TYPE_FAILED;
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/Util/ImageDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void run() {
try {
File file = null;
while (file == null) {
Log.d("Download Images", "Start: " + game.getTitle());
file = Glide.with(context)
.load(game.getIconUrl())
.downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
Expand All @@ -58,7 +57,7 @@ public void run() {
inputStream = new FileInputStream(file);
outputStream = new FileOutputStream(imageFile);

byte[] buffer = new byte[4096];
byte[] buffer = new byte[8192];
int len;

while ((len = inputStream.read(buffer)) != -1) {
Expand Down
31 changes: 29 additions & 2 deletions app/src/main/java/me/dounx/nintendoeshophelper/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import GameGrabber.USGameGrabTask;
import Util.QueryPreferences;
import Util.UserPreferences;
import Util.ImageDownloader;

public class MainActivity extends AppCompatActivity {
private static boolean STRICT_MODE = false;
Expand All @@ -86,8 +87,30 @@ protected void onCreate(Bundle savedInstanceState) {
.build());
}

// Get all the images
// ImagesDownload();
// Update all game data just for debug
/*
final USGameGrabTask usGameGrabTask = new USGameGrabTask(mContext);
final EUGameGrabTask euGameGrabTask = new EUGameGrabTask(mContext);
final JPGameGrabTask jpGameGrabTask = new JPGameGrabTask(mContext);
usGameGrabTask.execute();
euGameGrabTask.execute();
jpGameGrabTask.execute();
*/

// Output result just for debug
/*
new Thread(new Runnable() {
@Override
public void run() {
while (usGameGrabTask.getStatus() != AsyncTask.Status.FINISHED ||
euGameGrabTask.getStatus() != AsyncTask.Status.FINISHED ||
jpGameGrabTask.getStatus() != AsyncTask.Status.FINISHED) {
}
Log.d("Data refresh", "Success!");
}
}).start();
*/

// Init Database, Shared Preferences and image files
PackageInfo info = null;
Expand Down Expand Up @@ -139,6 +162,10 @@ public void onFailed() {
prefs.edit().putInt("version", currentVersion).apply();
}

// Get all the images just for debug todo
// ImageDownloader i = new ImageDownloader();
// i.ImagesDownload(mContext);

// Set up the language
Resources resources = getResources();
Configuration config = resources.getConfiguration();
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.2'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
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 @@
#Thu Mar 15 00:48:44 CST 2018
#Mon May 14 15:56:47 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
74 changes: 74 additions & 0 deletions tools/ImageParser.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Function Resize-Image
{
param
(
[Switch]$Percent,
[float]$Percentage,
[Switch]$Pixels,
[int]$Width,
[int]$Height
)

begin
{
if( $Percent -and $Pixels)
{
Write-Error "按照百分比(Percent)或者分辨率(Pixels)缩放,只能任选其一奥!"
break
}
elseif($Percent)
{
if($Percentage -le 0)
{
Write-Error "参数Percentage的值必须大于0!"
break
}
}
elseif($Pixels)
{
if( ($Width -lt 1) -or ($Height -lt 1))
{
Write-Error "参数Width和Height的值必须大于等于1!"
break
}
}
else
{
Write-Error "请选择按照百分比(-Percent)或者分辨率(-Pixels)缩放!"
break
}
Add-Type -AssemblyName 'System.Windows.Forms'
$count=0

}
process
{
$items = Get-ChildItem -Filter "*.jpg" | Select FullName
foreach ($item in $items)
{
$img=[System.Drawing.Image]::FromFile($item.FullName)

# 按百分比重新计算图片大小
if( ($Percentage -gt 0) -and ($Percentage -ne 1.0) )
{
$Width = $img.Width * $Percentage
$Height = $img.Height * $Percentage
}

# 缩放图片
$size = New-Object System.Drawing.Size($Width,$Height)
$bitmap = New-Object System.Drawing.Bitmap($img,$size)

# 保存图片
$img.Dispose()
$bitmap.Save($item.FullName)
$bitmap.Dispose()

$count++
}
}
end
{
"完毕,共处理 $count 了个文件"
}
}

0 comments on commit 7c7d17d

Please sign in to comment.