Auto adjusted result = fix for Xperia Ray
This commit is contained in:
parent
74aa38dba3
commit
1a755a5773
@ -10,8 +10,5 @@
|
|||||||
xmlns:a="http://schemas.android.com/apk/res/android"
|
xmlns:a="http://schemas.android.com/apk/res/android"
|
||||||
a:id="@+id/calculatorDisplay"
|
a:id="@+id/calculatorDisplay"
|
||||||
style="@style/display_style"
|
style="@style/display_style"
|
||||||
a:minLines="1"
|
|
||||||
a:maxLines="1"
|
|
||||||
a:textStyle="bold"
|
|
||||||
a:scrollHorizontally="true"
|
a:scrollHorizontally="true"
|
||||||
a:scrollbars="none"/>
|
a:scrollbars="horizontal"/>
|
@ -15,7 +15,6 @@
|
|||||||
a:id="@+id/calculatorEditor"
|
a:id="@+id/calculatorEditor"
|
||||||
style="@style/editor_style"
|
style="@style/editor_style"
|
||||||
a:inputType="textMultiLine"
|
a:inputType="textMultiLine"
|
||||||
a:maxLines="4"
|
|
||||||
a:scrollbars="vertical"
|
a:scrollbars="vertical"
|
||||||
a:hint ="@string/c_calc_editor_hint"/>
|
a:hint ="@string/c_calc_editor_hint"/>
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<style name="display_style_parent" parent="default_text">
|
<style name="display_style_parent" parent="default_text">
|
||||||
<item name="android:textSize">25dp</item>
|
<item name="android:textSize">25dp</item>
|
||||||
<item name="android:padding">5dp</item>
|
<item name="android:padding">3dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="editor_style_parent" parent="default_text">
|
<style name="editor_style_parent" parent="default_text">
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<style name="display_style_parent" parent="default_text">
|
<style name="display_style_parent" parent="default_text">
|
||||||
<item name="android:textSize">35dp</item>
|
<item name="android:textSize">35dp</item>
|
||||||
<item name="android:padding">5dp</item>
|
<item name="android:padding">3dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="editor_style_parent" parent="default_text">
|
<style name="editor_style_parent" parent="default_text">
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<style name="display_style_parent" parent="default_text">
|
<style name="display_style_parent" parent="default_text">
|
||||||
<item name="android:textSize">30dp</item>
|
<item name="android:textSize">30dp</item>
|
||||||
<item name="android:padding">5dp</item>
|
<item name="android:padding">3dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="editor_style_parent" parent="default_text">
|
<style name="editor_style_parent" parent="default_text">
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="display_style" parent="display_style_parent">
|
<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_width">fill_parent</item>
|
||||||
<item name="android:layout_height">fill_parent</item>
|
<item name="android:layout_height">fill_parent</item>
|
||||||
</style>
|
</style>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<style name="display_style_parent" parent="default_text">
|
<style name="display_style_parent" parent="default_text">
|
||||||
<item name="android:textSize">25dp</item>
|
<item name="android:textSize">25dp</item>
|
||||||
<item name="android:padding">5dp</item>
|
<item name="android:padding">3dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="editor_style_parent" parent="default_text">
|
<style name="editor_style_parent" parent="default_text">
|
||||||
|
@ -10,18 +10,18 @@ import android.graphics.Color;
|
|||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.TextView;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.solovyev.android.calculator.jscl.JsclOperation;
|
import org.solovyev.android.calculator.jscl.JsclOperation;
|
||||||
import org.solovyev.android.calculator.model.ParseException;
|
import org.solovyev.android.calculator.model.ParseException;
|
||||||
import org.solovyev.android.calculator.model.TextProcessor;
|
import org.solovyev.android.calculator.model.TextProcessor;
|
||||||
|
import org.solovyev.android.view.AutoResizeTextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User: serso
|
* User: serso
|
||||||
* Date: 9/17/11
|
* Date: 9/17/11
|
||||||
* Time: 10:58 PM
|
* Time: 10:58 PM
|
||||||
*/
|
*/
|
||||||
public class CalculatorDisplay extends TextView {
|
public class CalculatorDisplay extends AutoResizeTextView {
|
||||||
|
|
||||||
private boolean valid = true;
|
private boolean valid = true;
|
||||||
|
|
||||||
@ -83,6 +83,13 @@ public class CalculatorDisplay extends TextView {
|
|||||||
Log.d(this.getClass().getName(), text);
|
Log.d(this.getClass().getName(), text);
|
||||||
super.setText(Html.fromHtml(text), BufferType.EDITABLE);
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user