Changes
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
package org.solovyev.android.calculator;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.Html;
|
||||
import android.util.AttributeSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -167,6 +169,12 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
|
||||
|
||||
public synchronized void init(@NotNull Context context) {
|
||||
if (!initialized) {
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
final CalculatorPreferences.Gui.Layout layout = CalculatorPreferences.Gui.getLayout(preferences);
|
||||
if ( layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile ) {
|
||||
setTextSize(getResources().getDimension(R.dimen.cpp_display_text_size_mobile));
|
||||
}
|
||||
|
||||
this.setOnClickListener(new CalculatorDisplayOnClickListener(context));
|
||||
|
||||
this.initialized = true;
|
||||
|
@@ -141,6 +141,11 @@ public class AndroidCalculatorEditorView extends EditText implements SharedPrefe
|
||||
if (!initialized) {
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
final CalculatorPreferences.Gui.Layout layout = CalculatorPreferences.Gui.getLayout(preferences);
|
||||
if ( layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile ) {
|
||||
setTextSize(getResources().getDimension(R.dimen.cpp_editor_text_size_mobile));
|
||||
}
|
||||
|
||||
preferences.registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
this.addTextChangedListener(new TextWatcherImpl());
|
||||
|
@@ -39,7 +39,7 @@ public final class CalculatorButtons {
|
||||
@NotNull View root) {
|
||||
if ( layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile ) {
|
||||
|
||||
final float textSize = root.getResources().getDimension(R.dimen.cpp_button_text_size_mobile);
|
||||
final float textSize = root.getResources().getDimension(R.dimen.cpp_keyboard_button_text_size_mobile);
|
||||
|
||||
AndroidUtils.processViewsOfType(root, DragButton.class, new AndroidUtils.ViewProcessor<DragButton>() {
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user