Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #407 from ratan12/fix_rc3
Browse files Browse the repository at this point in the history
Upgrade version to 2.1 RC 3 & fix rating AL
  • Loading branch information
ratan12 committed Jul 8, 2015
2 parents 7a357d6 + aeca270 commit 29da761
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Atarashii/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion Atarashii/src/net/somethingdreadful/MAL/FirstTimeInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

2 changes: 0 additions & 2 deletions Atarashii/src/net/somethingdreadful/MAL/PrefManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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));
Expand All @@ -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();
}
});
Expand All @@ -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.
*
Expand Down

0 comments on commit 29da761

Please sign in to comment.