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

Commit

Permalink
Fix score crash Anilist
Browse files Browse the repository at this point in the history
  • Loading branch information
ratan12 committed Jul 9, 2015
1 parent 29da761 commit 4c9470e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Atarashii/src/net/somethingdreadful/MAL/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.SnackbarManager;

import io.fabric.sdk.android.Fabric;
import net.somethingdreadful.MAL.account.AccountService;

import java.util.Locale;

import io.fabric.sdk.android.Fabric;

public class Theme extends Application {

public static boolean darkTheme;
Expand Down Expand Up @@ -150,7 +151,7 @@ else if (score <= 60)
Double score5 = Math.floor(score / 10);
return score5 > 0.0 ? String.format("%.1f", score5) : "?";
default:
return String.format("%.0f", Math.floor(score / 10));
return "?";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import net.somethingdreadful.MAL.account.AccountService;

public class NumberPickerDialogFragment extends DialogFragment {

NumberPicker numberPicker;
EditText numberInput;
private onUpdateClickListener callback;
Expand All @@ -36,10 +35,12 @@ private View makeNumberPicker() {
if (!inputScore) {
numberPicker.setMaxValue(max != 0 ? max : 999);
numberPicker.setMinValue(0);
if (!AccountService.isMAL() && isRating())
numberPicker.setValue(Integer.parseInt(Theme.getDisplayScore(current)));
else
if (!AccountService.isMAL() && isRating()) {
String score = Theme.getDisplayScore(current);
numberPicker.setValue(score.equals("?") ? 0 : Integer.parseInt(score));
} else {
numberPicker.setValue(current);
}
numberInput.setVisibility(View.GONE);
} else {
numberInput.setText(Theme.getDisplayScore(current));
Expand Down

0 comments on commit 4c9470e

Please sign in to comment.