diff --git a/Atarashii/build.gradle b/Atarashii/build.gradle index 955eea0e..e088bf7f 100644 --- a/Atarashii/build.gradle +++ b/Atarashii/build.gradle @@ -49,8 +49,8 @@ android { } Beta { applicationId 'net.somethingdreadful.MAL.beta' - versionCode 50 - versionName '2.1 RC 2' + versionCode 51 + versionName '2.1 RC 3' } } } diff --git a/Atarashii/src/net/somethingdreadful/MAL/FirstTimeInit.java b/Atarashii/src/net/somethingdreadful/MAL/FirstTimeInit.java index 029b2d80..af0f3c24 100644 --- a/Atarashii/src/net/somethingdreadful/MAL/FirstTimeInit.java +++ b/Atarashii/src/net/somethingdreadful/MAL/FirstTimeInit.java @@ -152,8 +152,12 @@ public void onClick(View v) { viewFlipper.setDisplayedChild(1); break; case R.id.anilist: - viewFlipper.setDisplayedChild(2); + if (MALApi.isNetworkAvailable(this)) + viewFlipper.setDisplayedChild(2); + else + Theme.Snackbar(this, R.string.toast_error_noConnectivity); break; } } } + diff --git a/Atarashii/src/net/somethingdreadful/MAL/PrefManager.java b/Atarashii/src/net/somethingdreadful/MAL/PrefManager.java index fa3dbf1d..3e3dad53 100644 --- a/Atarashii/src/net/somethingdreadful/MAL/PrefManager.java +++ b/Atarashii/src/net/somethingdreadful/MAL/PrefManager.java @@ -237,8 +237,6 @@ public static void setAiringOnly(boolean airing) { * 4. :( & :| & :) * 5. 0.0 - 10.0 * - * note: number 4 is currently not supported! - * * @param type The type number */ public static void setScoreType(int type) { diff --git a/Atarashii/src/net/somethingdreadful/MAL/dialog/NumberPickerDialogFragment.java b/Atarashii/src/net/somethingdreadful/MAL/dialog/NumberPickerDialogFragment.java index 908818e9..8f61a2ff 100644 --- a/Atarashii/src/net/somethingdreadful/MAL/dialog/NumberPickerDialogFragment.java +++ b/Atarashii/src/net/somethingdreadful/MAL/dialog/NumberPickerDialogFragment.java @@ -16,6 +16,7 @@ import net.somethingdreadful.MAL.PrefManager; import net.somethingdreadful.MAL.R; import net.somethingdreadful.MAL.Theme; +import net.somethingdreadful.MAL.account.AccountService; public class NumberPickerDialogFragment extends DialogFragment { @@ -35,7 +36,10 @@ private View makeNumberPicker() { if (!inputScore) { numberPicker.setMaxValue(max != 0 ? max : 999); numberPicker.setMinValue(0); - numberPicker.setValue(current); + if (!AccountService.isMAL() && isRating()) + numberPicker.setValue(Integer.parseInt(Theme.getDisplayScore(current))); + else + numberPicker.setValue(current); numberInput.setVisibility(View.GONE); } else { numberInput.setText(Theme.getDisplayScore(current)); @@ -56,8 +60,11 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { public void onClick(DialogInterface dialog, int whichButton) { numberPicker.clearFocus(); numberInput.clearFocus(); - int value = Theme.getRawScore(numberInput.getText().toString()); - callback.onUpdated(PrefManager.getScoreType() != 3 && PrefManager.getScoreType() != 1 ? value : numberPicker.getValue(), getArguments().getInt("id")); + int value = Theme.getRawScore(!inputScore ? Integer.toString(numberPicker.getValue()) : numberInput.getText().toString()); + if (!AccountService.isMAL() && isRating()) + callback.onUpdated(value, getArguments().getInt("id")); + else + callback.onUpdated(numberPicker.getValue(), getArguments().getInt("id")); dismiss(); } }); @@ -71,6 +78,10 @@ public void onClick(DialogInterface dialog, int whichButton) { return builder.create(); } + private boolean isRating() { + return getArguments().getInt("id") == R.id.scorePanel; + } + /** * Get the integer from an argument. *