diff --git a/Published/ExaltedDice/AndroidManifest.xml b/Published/ExaltedDice/AndroidManifest.xml index 8f6ec9d..2af9856 100755 --- a/Published/ExaltedDice/AndroidManifest.xml +++ b/Published/ExaltedDice/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionName="1.0.1" android:versionCode="13"> mEnd) { current = mStart; @@ -175,19 +167,6 @@ public class ExaltedDice extends Activity implements OnClickListener, OnLongClic listview.setAdapter(new ArrayAdapter(this, R.layout.list_row, rollHistory)); } - private String formatNumber(int value) { - return (mFormatter != null) - ? mFormatter.toString(value) - : String.valueOf(value); - } - - /** - * @return the current value. - */ - public int getCurrent() { - return mCurrent; - } - private int getSelectedPos(String str) { if (mDisplayedValues == null) { return Integer.parseInt(str); @@ -230,14 +209,17 @@ public class ExaltedDice extends Activity implements OnClickListener, OnLongClic e.printStackTrace(); } - if (v.getId() == R.id.up) - changeCurrent(mCurrent + 1); - - if (v.getId() == R.id.down) - changeCurrent(mCurrent - 1); - - if (v.getId() == R.id.roll) - rollDice(); + switch (v.getId()){ + case R.id.up: + changeCurrent(mCurrent + 1); + break; + case R.id.down: + changeCurrent(mCurrent - 1); + break; + case R.id.roll: + rollDice(); + break; + } } /** @@ -337,17 +319,18 @@ public class ExaltedDice extends Activity implements OnClickListener, OnLongClic e.printStackTrace(); } - if (v.getId() == R.id.up) { - mIncrement = true; - mHandler.post(mRunnable); - - } else if (v.getId() == R.id.down) { - mDecrement = true; - mHandler.post(mRunnable); - } else { - return false; + switch (v.getId()){ + case R.id.up: + mIncrement = true; + mHandler.post(mRunnable); + return true; + + case R.id.down: + mDecrement = true; + mHandler.post(mRunnable); + return true; } - return true; + return false; } /** @@ -384,9 +367,7 @@ public class ExaltedDice extends Activity implements OnClickListener, OnLongClic rolled = savedInstanceState.getIntegerArrayList("rolled"); listview.setAdapter(new ArrayAdapter(this, R.layout.list_row, rollHistory)); } - - - + /** * saves application state before rotatoin * @author ricky barrette @@ -497,11 +478,6 @@ public class ExaltedDice extends Activity implements OnClickListener, OnLongClic return roll; } - public void setCurrent(int current) { - mCurrent = current; - updateView(); - } - /** * counts each dice roll that is greater than or equal to 7 as a success. 10 * gets another success (for a total of 2) @@ -534,18 +510,13 @@ public class ExaltedDice extends Activity implements OnClickListener, OnLongClic Toast.makeText(this, msg, Toast.LENGTH_LONG).show(); } + /** + * a convince method that will update the edit text dice to what the current amount of dice is + * + * @author ricky barrette + */ protected void updateView() { - - /* If we don't have displayed values then use the - * current number else find the correct value in the - * displayed values for the current number. - */ - if (mDisplayedValues == null) { - dice.setText(formatNumber(mCurrent)); - } else { - dice.setText(mDisplayedValues[mCurrent - mStart]); - } - dice.setSelection(dice.getText().length()); + dice.setText(mCurrent+""); } /**