android common update
This commit is contained in:
@@ -160,7 +160,7 @@ public abstract class AbstractCalculatorHelper implements SharedPreferences.OnSh
|
||||
toggleButtonDirectionText(root, R.id.plusButton, false, DragDirection.down, DragDirection.up);
|
||||
}
|
||||
|
||||
CalculatorButtons.processButtons(true, theme, root);
|
||||
CalculatorButtons.processButtons(true, theme, layout, root);
|
||||
CalculatorButtons.toggleEqualsButton(preferences, activity);
|
||||
CalculatorButtons.initMultiplicationButton(root);
|
||||
NumeralBaseButtons.toggleNumericDigits(activity, preferences);
|
||||
|
@@ -27,7 +27,6 @@ import org.solovyev.android.calculator.about.CalculatorFragmentType;
|
||||
import org.solovyev.android.calculator.about.CalculatorReleaseNotesFragment;
|
||||
import org.solovyev.android.fragments.FragmentUtils;
|
||||
import org.solovyev.android.prefs.Preference;
|
||||
import org.solovyev.android.view.ColorButton;
|
||||
import org.solovyev.common.equals.EqualsTool;
|
||||
import org.solovyev.common.history.HistoryAction;
|
||||
import org.solovyev.common.text.StringUtils;
|
||||
@@ -279,15 +278,7 @@ public class CalculatorActivity extends SherlockFragmentActivity implements Shar
|
||||
Log.d(String.valueOf(v.getId()), "digitButtonClickHandler() for: " + v.getId() + ". Pressed: " + v.isPressed());
|
||||
|
||||
if (v instanceof Button) {
|
||||
|
||||
boolean processText = true;
|
||||
if ( v instanceof ColorButton) {
|
||||
processText = ((ColorButton) v).isShowText();
|
||||
}
|
||||
|
||||
if ( processText ) {
|
||||
buttonPressed(((Button)v).getText().toString());
|
||||
}
|
||||
buttonPressed(((Button)v).getText().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,6 @@ import org.solovyev.android.AndroidUtils;
|
||||
import org.solovyev.android.calculator.model.AndroidCalculatorEngine;
|
||||
import org.solovyev.android.calculator.view.AngleUnitsButton;
|
||||
import org.solovyev.android.calculator.view.NumeralBasesButton;
|
||||
import org.solovyev.android.view.ColorButton;
|
||||
import org.solovyev.android.view.drag.DragButton;
|
||||
import org.solovyev.android.view.drag.DragDirection;
|
||||
import org.solovyev.android.view.drag.SimpleOnDragListener;
|
||||
@@ -38,18 +37,18 @@ public final class CalculatorButtons {
|
||||
|
||||
public static void processButtons(boolean fixMagicFlames,
|
||||
@NotNull CalculatorPreferences.Gui.Theme theme,
|
||||
@NotNull CalculatorPreferences.Gui.Layout layout,
|
||||
@NotNull View root) {
|
||||
if (theme.getThemeType() == CalculatorPreferences.Gui.ThemeType.metro) {
|
||||
if ( layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile ) {
|
||||
|
||||
if (fixMagicFlames) {
|
||||
// for metro themes we should turn off magic flames
|
||||
AndroidUtils.processViewsOfType(root, ColorButton.class, new AndroidUtils.ViewProcessor<ColorButton>() {
|
||||
@Override
|
||||
public void process(@NotNull ColorButton colorButton) {
|
||||
colorButton.setDrawMagicFlame(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
final float textSize =root.getResources().getDimension(R.dimen.button_text_size_mobile);
|
||||
|
||||
AndroidUtils.processViewsOfType(root, DragButton.class, new AndroidUtils.ViewProcessor<DragButton>() {
|
||||
@Override
|
||||
public void process(@NotNull DragButton button) {
|
||||
button.setTextSize(textSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user