Auto adjusted result = fix for Xperia Ray

This commit is contained in:
Sergey Solovyev 2011-11-01 15:04:27 +04:00
parent 74aa38dba3
commit 1a755a5773
8 changed files with 15 additions and 12 deletions

View File

@ -10,8 +10,5 @@
xmlns:a="http://schemas.android.com/apk/res/android"
a:id="@+id/calculatorDisplay"
style="@style/display_style"
a:minLines="1"
a:maxLines="1"
a:textStyle="bold"
a:scrollHorizontally="true"
a:scrollbars="none"/>
a:scrollbars="horizontal"/>

View File

@ -15,7 +15,6 @@
a:id="@+id/calculatorEditor"
style="@style/editor_style"
a:inputType="textMultiLine"
a:maxLines="4"
a:scrollbars="vertical"
a:hint ="@string/c_calc_editor_hint"/>

View File

@ -17,7 +17,7 @@
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">25dp</item>
<item name="android:padding">5dp</item>
<item name="android:padding">3dp</item>
</style>
<style name="editor_style_parent" parent="default_text">

View File

@ -17,7 +17,7 @@
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">35dp</item>
<item name="android:padding">5dp</item>
<item name="android:padding">3dp</item>
</style>
<style name="editor_style_parent" parent="default_text">

View File

@ -17,7 +17,7 @@
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">30dp</item>
<item name="android:padding">5dp</item>
<item name="android:padding">3dp</item>
</style>
<style name="editor_style_parent" parent="default_text">

View File

@ -58,7 +58,7 @@
</style>
<style name="display_style" parent="display_style_parent">
<item name="android:gravity">right|center_vertical</item>
<item name="android:gravity">center_vertical|right</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>

View File

@ -17,7 +17,7 @@
<style name="display_style_parent" parent="default_text">
<item name="android:textSize">25dp</item>
<item name="android:padding">5dp</item>
<item name="android:padding">3dp</item>
</style>
<style name="editor_style_parent" parent="default_text">

View File

@ -10,18 +10,18 @@ import android.graphics.Color;
import android.text.Html;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.TextView;
import org.jetbrains.annotations.NotNull;
import org.solovyev.android.calculator.jscl.JsclOperation;
import org.solovyev.android.calculator.model.ParseException;
import org.solovyev.android.calculator.model.TextProcessor;
import org.solovyev.android.view.AutoResizeTextView;
/**
* User: serso
* Date: 9/17/11
* Time: 10:58 PM
*/
public class CalculatorDisplay extends TextView {
public class CalculatorDisplay extends AutoResizeTextView {
private boolean valid = true;
@ -83,6 +83,13 @@ public class CalculatorDisplay extends TextView {
Log.d(this.getClass().getName(), text);
super.setText(Html.fromHtml(text), BufferType.EDITABLE);
}
// todo serso: think where to move it (keep in mind org.solovyev.android.view.AutoResizeTextView.resetTextSize())
setAddEllipsis(false);
setMinTextSize(10);
setMaxTextSize(70);
setTextSize(70);
resizeText();
}
}