mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
make the result and formula textview font scale automatically
- works only in the app, not in the widget - we have to leave the textviews as TextView type, else the widget breaks totally
This commit is contained in:
@ -25,6 +25,7 @@ dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||
compile 'com.jakewharton:butterknife:7.0.1'
|
||||
compile 'me.grantland:autofittextview:0.2.1'
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile 'org.robolectric:robolectric:3.0'
|
||||
|
@ -13,7 +13,6 @@ public class Formatter {
|
||||
symbols.setDecimalSeparator('.');
|
||||
|
||||
final DecimalFormat formatter = new DecimalFormat();
|
||||
formatter.setMaximumIntegerDigits(12);
|
||||
formatter.setMaximumFractionDigits(12);
|
||||
formatter.setDecimalFormatSymbols(symbols);
|
||||
formatter.setGroupingUsed(false);
|
||||
|
@ -10,6 +10,7 @@ import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import butterknife.OnLongClick;
|
||||
import me.grantland.widget.AutofitHelper;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements Calculator {
|
||||
@Bind(R.id.result) TextView result;
|
||||
@ -24,6 +25,7 @@ public class MainActivity extends AppCompatActivity implements Calculator {
|
||||
ButterKnife.bind(this);
|
||||
calc = new CalculatorImpl(this);
|
||||
setupResultView();
|
||||
AutofitHelper.create(result);
|
||||
}
|
||||
|
||||
private void setupResultView() {
|
||||
|
Reference in New Issue
Block a user