changes
This commit is contained in:
parent
327f43a323
commit
604c61cf29
@ -6,12 +6,9 @@ import android.content.SharedPreferences;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Display;
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import jscl.AngleUnit;
|
import jscl.AngleUnit;
|
||||||
import jscl.NumeralBase;
|
import jscl.NumeralBase;
|
||||||
@ -66,24 +63,22 @@ public final class CalculatorButtons {
|
|||||||
@NotNull Activity activity) {
|
@NotNull Activity activity) {
|
||||||
preferences = preferences == null ? PreferenceManager.getDefaultSharedPreferences(activity) : preferences;
|
preferences = preferences == null ? PreferenceManager.getDefaultSharedPreferences(activity) : preferences;
|
||||||
|
|
||||||
if (AndroidUtils.getScreenOrientation(activity) == Configuration.ORIENTATION_PORTRAIT || !CalculatorPreferences.Gui.autoOrientation.getPreference(preferences)) {
|
final boolean large = activity.getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE);
|
||||||
final Display display = activity.getWindowManager().getDefaultDisplay();
|
|
||||||
|
|
||||||
final DragButton equalsButton = (DragButton)activity.findViewById(R.id.equalsButton);
|
if (!large) {
|
||||||
if (equalsButton != null) {
|
if (AndroidUtils.getScreenOrientation(activity) == Configuration.ORIENTATION_PORTRAIT
|
||||||
// todo serso: visibility should be changed only for some cases (like small screens)
|
|| !CalculatorPreferences.Gui.autoOrientation.getPreference(preferences)) {
|
||||||
if (CalculatorPreferences.Gui.showEqualsButton.getPreference(preferences)) {
|
|
||||||
equalsButton.setVisibility(View.VISIBLE);
|
final DragButton equalsButton = (DragButton)activity.findViewById(R.id.equalsButton);
|
||||||
if (display.getWidth() <= 480) {
|
if (equalsButton != null) {
|
||||||
// mobile phones
|
if (CalculatorPreferences.Gui.showEqualsButton.getPreference(preferences)) {
|
||||||
|
equalsButton.setVisibility(View.VISIBLE);
|
||||||
final AndroidCalculatorDisplayView calculatorDisplayView = getCalculatorDisplayView();
|
final AndroidCalculatorDisplayView calculatorDisplayView = getCalculatorDisplayView();
|
||||||
if (calculatorDisplayView != null) {
|
if (calculatorDisplayView != null) {
|
||||||
calculatorDisplayView.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
calculatorDisplayView.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
equalsButton.setVisibility(View.GONE);
|
||||||
equalsButton.setVisibility(View.GONE);
|
|
||||||
if (display.getWidth() <= 480) {
|
|
||||||
// mobile phones
|
// mobile phones
|
||||||
final AndroidCalculatorDisplayView calculatorDisplayView = getCalculatorDisplayView();
|
final AndroidCalculatorDisplayView calculatorDisplayView = getCalculatorDisplayView();
|
||||||
if (calculatorDisplayView != null) {
|
if (calculatorDisplayView != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user