Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

size readjustments

  • Loading branch information...
commit 311c9900c127c8d290f2b04fbf22f768bd7800af 1 parent f47212c
Will authored
2  res/layout/history_entry.xml
View
@@ -8,6 +8,7 @@
android:layout_height="wrap_content"
android:textSize="@dimen/small_display_text_size"
android:textColor="@color/history_input"
+ android:layout_marginBottom="-5dp"
android:id="@+id/base" />
<TextView
android:layout_width="match_parent"
@@ -15,5 +16,6 @@
android:textSize="@dimen/display_text_size"
android:textColor="@color/history_result"
android:gravity="right"
+ android:layout_marginBottom="-5dp"
android:id="@+id/edited" />
</com.android2.calculator3.view.HistoryLine>
3  src/com/android2/calculator3/EquationFormatter.java
View
@@ -39,7 +39,8 @@ public String insertSupscripts(String input) {
sub_open++;
if(i + 1 == input.length()) {
formattedInput.append(c);
- sub_open--;
+ formattedInput.append("</sup>");
+ sub_closed++;
}
else {
formattedInput.append(PLACEHOLDER);
24 src/com/android2/calculator3/view/ColorButton.java
View
@@ -47,6 +47,7 @@
EventListener mListener;
Paint mFeedbackPaint;
Paint mHintPaint;
+ Paint mHintExponentPaint;
Rect bounds = new Rect();
public ColorButton(Context context, AttributeSet attrs) {
@@ -68,7 +69,10 @@ private void init(Calculator calc) {
getPaint().setColor(res.getColor(R.color.button_text));
mHintPaint = new Paint();
mHintPaint.setColor(res.getColor(R.color.grey));
- mHintPaint.setTextSize((float) (getTextSize() * .8));
+ mHintPaint.setTextSize(getTextSize() * 0.8f);
+ mHintExponentPaint = new Paint();
+ mHintExponentPaint.setColor(res.getColor(R.color.grey));
+ mHintExponentPaint.setTextSize(getTextSize() * 0.64f);
mAnimStart = -1;
}
@@ -127,12 +131,18 @@ else if(isPressed()) {
if(hint != null) {
String[] exponents = hint.toString().split(Pattern.quote("^"));
int offsetX = LogicalDensity.convertDpToPixel(10, getContext());
- int offsetY = (int) (LogicalDensity.convertDpToPixel(20, getContext()) + (mTextY - LogicalDensity.convertDpToPixel(20, getContext()) - getTextHeight(
- mHintPaint, hint.toString())) / 2);
+ int offsetY = (int) ((mTextY + LogicalDensity.convertDpToPixel(20, getContext()) - getTextHeight(mHintPaint, hint.toString())) / 2);
for(String str : exponents) {
- canvas.drawText(str, 0, str.length(), mTextX + offsetX, mTextY - offsetY, mHintPaint);
- offsetY += LogicalDensity.convertDpToPixel(6, getContext());
- offsetX += mHintPaint.measureText(str);
+ if(str == exponents[0]) {
+ canvas.drawText(str, 0, str.length(), mTextX + offsetX, mTextY - offsetY, mHintPaint);
+ offsetY += LogicalDensity.convertDpToPixel(8, getContext());
+ offsetX += mHintPaint.measureText(str);
+ }
+ else {
+ canvas.drawText(str, 0, str.length(), mTextX + offsetX, mTextY - offsetY, mHintExponentPaint);
+ offsetY += LogicalDensity.convertDpToPixel(8, getContext());
+ offsetX += mHintExponentPaint.measureText(str);
+ }
}
}
@@ -145,7 +155,7 @@ private int getTextHeight(Paint paint, String text) {
int height = bounds.height();
String[] exponents = text.split(Pattern.quote("^"));
for(int i = 1; i < exponents.length; i++) {
- height += LogicalDensity.convertDpToPixel(6, getContext());
+ height += LogicalDensity.convertDpToPixel(8, getContext());
}
return height;
}
2  src/com/android2/calculator3/view/MatrixInverseView.java
View
@@ -40,7 +40,7 @@ public MatrixInverseView(final AdvancedDisplay display) {
super(display.getContext());
setCustomSelectionActionModeCallback(new NoTextSelectionMode());
setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
- setText(Html.fromHtml("<sup>-1</sup>"));
+ setText(Html.fromHtml("<sup><small>-1</small></sup>"));
setTextAppearance(display.getContext(), R.style.display_style);
setPadding(0, 0, 0, 0);
}
2  src/com/android2/calculator3/view/MatrixTransposeView.java
View
@@ -39,7 +39,7 @@ public MatrixTransposeView(final AdvancedDisplay display) {
super(display.getContext());
setCustomSelectionActionModeCallback(new NoTextSelectionMode());
setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
- setText(Html.fromHtml("<sup>T</sup>"));
+ setText(Html.fromHtml("<sup><small>T</small></sup>"));
setTextAppearance(display.getContext(), R.style.display_style);
setPadding(0, 0, 0, 0);
}
Please sign in to comment.
Something went wrong with that request. Please try again.