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:
tibbi
2016-01-04 21:56:34 +01:00
parent 39227c7e5f
commit 61cc6061e9
3 changed files with 3 additions and 1 deletions

View File

@ -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'

View File

@ -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);

View File

@ -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() {