mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 09:39:25 -04:00
Syle[control]: use consistent mapping dropdown
This commit is contained in:
parent
efca2c98c3
commit
fd5f46f243
@ -20,7 +20,6 @@ import android.view.animation.Interpolator;
|
|||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
@ -45,17 +44,14 @@ import java.util.List;
|
|||||||
* Class providing a sort of popup on top of a Layout, allowing to edit a given ControlButton
|
* Class providing a sort of popup on top of a Layout, allowing to edit a given ControlButton
|
||||||
*/
|
*/
|
||||||
public class EditControlPopup {
|
public class EditControlPopup {
|
||||||
|
protected final Spinner[] mKeycodeSpinners = new Spinner[4];
|
||||||
private final DefocusableScrollView mScrollView;
|
private final DefocusableScrollView mScrollView;
|
||||||
private ConstraintLayout mRootView;
|
|
||||||
private final ColorSelector mColorSelector;
|
private final ColorSelector mColorSelector;
|
||||||
|
|
||||||
private final ObjectAnimator mEditPopupAnimator;
|
private final ObjectAnimator mEditPopupAnimator;
|
||||||
private final ObjectAnimator mColorEditorAnimator;
|
private final ObjectAnimator mColorEditorAnimator;
|
||||||
private boolean mDisplaying = false;
|
|
||||||
private boolean mDisplayingColor = false;
|
|
||||||
public boolean internalChanges = false; // True when we programmatically change stuff.
|
|
||||||
private ControlInterface mCurrentlyEditedButton;
|
|
||||||
private final int mMargin;
|
private final int mMargin;
|
||||||
|
public boolean internalChanges = false; // True when we programmatically change stuff.
|
||||||
private final View.OnLayoutChangeListener mLayoutChangedListener = new View.OnLayoutChangeListener() {
|
private final View.OnLayoutChangeListener mLayoutChangedListener = new View.OnLayoutChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||||
@ -75,25 +71,26 @@ public class EditControlPopup {
|
|||||||
internalChanges = false;
|
internalChanges = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected EditText mNameEditText, mWidthEditText, mHeightEditText;
|
protected EditText mNameEditText, mWidthEditText, mHeightEditText;
|
||||||
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
@SuppressLint("UseSwitchCompatOrMaterialCode")
|
||||||
protected Switch mToggleSwitch, mPassthroughSwitch, mSwipeableSwitch;
|
protected Switch mToggleSwitch, mPassthroughSwitch, mSwipeableSwitch;
|
||||||
protected Spinner mOrientationSpinner;
|
protected Spinner mOrientationSpinner;
|
||||||
protected final Spinner[] mKeycodeSpinners = new Spinner[4];
|
protected TextView[] mKeycodeTextviews = new TextView[4];
|
||||||
protected SeekBar mStrokeWidthSeekbar, mCornerRadiusSeekbar, mAlphaSeekbar;
|
protected SeekBar mStrokeWidthSeekbar, mCornerRadiusSeekbar, mAlphaSeekbar;
|
||||||
protected TextView mStrokePercentTextView, mCornerRadiusPercentTextView, mAlphaPercentTextView;
|
protected TextView mStrokePercentTextView, mCornerRadiusPercentTextView, mAlphaPercentTextView;
|
||||||
protected TextView mSelectBackgroundColor, mSelectStrokeColor;
|
protected TextView mSelectBackgroundColor, mSelectStrokeColor;
|
||||||
protected ArrayAdapter<String> mAdapter;
|
protected ArrayAdapter<String> mAdapter;
|
||||||
protected List<String> mSpecialArray;
|
protected List<String> mSpecialArray;
|
||||||
protected CheckBox mDisplayInGameCheckbox, mDisplayInMenuCheckbox;
|
protected CheckBox mDisplayInGameCheckbox, mDisplayInMenuCheckbox;
|
||||||
|
private ConstraintLayout mRootView;
|
||||||
|
private boolean mDisplaying = false;
|
||||||
|
private boolean mDisplayingColor = false;
|
||||||
|
private ControlInterface mCurrentlyEditedButton;
|
||||||
// Decorative textviews
|
// Decorative textviews
|
||||||
private TextView mOrientationTextView, mMappingTextView, mNameTextView,
|
private TextView mOrientationTextView, mMappingTextView, mNameTextView,
|
||||||
mCornerRadiusTextView, mVisibilityTextView, mSizeTextview, mSizeXTextView;
|
mCornerRadiusTextView, mVisibilityTextView, mSizeTextview, mSizeXTextView;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public EditControlPopup(Context context, ViewGroup parent) {
|
public EditControlPopup(Context context, ViewGroup parent) {
|
||||||
mScrollView = (DefocusableScrollView) LayoutInflater.from(context).inflate(R.layout.dialog_control_button_setting, parent, false);
|
mScrollView = (DefocusableScrollView) LayoutInflater.from(context).inflate(R.layout.dialog_control_button_setting, parent, false);
|
||||||
parent.addView(mScrollView);
|
parent.addView(mScrollView);
|
||||||
@ -121,8 +118,13 @@ public class EditControlPopup {
|
|||||||
setupRealTimeListeners();
|
setupRealTimeListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setPercentageText(TextView textView, int progress) {
|
||||||
|
textView.setText(textView.getContext().getString(R.string.percent_format, progress));
|
||||||
|
}
|
||||||
|
|
||||||
/** Slide the layout into the visible screen area */
|
/**
|
||||||
|
* Slide the layout into the visible screen area
|
||||||
|
*/
|
||||||
public void appear(boolean fromRight) {
|
public void appear(boolean fromRight) {
|
||||||
disappearColor(); // When someone jumps from a button to another
|
disappearColor(); // When someone jumps from a button to another
|
||||||
|
|
||||||
@ -141,7 +143,9 @@ public class EditControlPopup {
|
|||||||
mDisplaying = true;
|
mDisplaying = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Slide out the layout */
|
/**
|
||||||
|
* Slide out the layout
|
||||||
|
*/
|
||||||
public void disappear() {
|
public void disappear() {
|
||||||
if (!mDisplaying) return;
|
if (!mDisplaying) return;
|
||||||
|
|
||||||
@ -154,7 +158,9 @@ public class EditControlPopup {
|
|||||||
mEditPopupAnimator.start();
|
mEditPopupAnimator.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Slide the layout into the visible screen area */
|
/**
|
||||||
|
* Slide the layout into the visible screen area
|
||||||
|
*/
|
||||||
public void appearColor(boolean fromRight, int color) {
|
public void appearColor(boolean fromRight, int color) {
|
||||||
if (fromRight) {
|
if (fromRight) {
|
||||||
if (!mDisplayingColor || !isAtRight()) {
|
if (!mDisplayingColor || !isAtRight()) {
|
||||||
@ -172,7 +178,9 @@ public class EditControlPopup {
|
|||||||
mColorSelector.show(color == -1 ? Color.WHITE : color);
|
mColorSelector.show(color == -1 ? Color.WHITE : color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Slide out the layout */
|
/**
|
||||||
|
* Slide out the layout
|
||||||
|
*/
|
||||||
public void disappearColor() {
|
public void disappearColor() {
|
||||||
if (!mDisplayingColor) return;
|
if (!mDisplayingColor) return;
|
||||||
|
|
||||||
@ -185,8 +193,11 @@ public class EditControlPopup {
|
|||||||
mColorEditorAnimator.start();
|
mColorEditorAnimator.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Slide out the first visible layer.
|
/**
|
||||||
* @return True if the last layer is disappearing */
|
* Slide out the first visible layer.
|
||||||
|
*
|
||||||
|
* @return True if the last layer is disappearing
|
||||||
|
*/
|
||||||
public boolean disappearLayer() {
|
public boolean disappearLayer() {
|
||||||
if (mDisplayingColor) {
|
if (mDisplayingColor) {
|
||||||
disappearColor();
|
disappearColor();
|
||||||
@ -197,7 +208,9 @@ public class EditControlPopup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Switch the panels position if needed */
|
/**
|
||||||
|
* Switch the panels position if needed
|
||||||
|
*/
|
||||||
public void adaptPanelPosition() {
|
public void adaptPanelPosition() {
|
||||||
if (mDisplaying) {
|
if (mDisplaying) {
|
||||||
boolean isAtRight = mCurrentlyEditedButton.getControlView().getX() + mCurrentlyEditedButton.getControlView().getWidth() / 2f < currentDisplayMetrics.widthPixels / 2f;
|
boolean isAtRight = mCurrentlyEditedButton.getControlView().getX() + mCurrentlyEditedButton.getControlView().getWidth() / 2f < currentDisplayMetrics.widthPixels / 2f;
|
||||||
@ -205,7 +218,6 @@ public class EditControlPopup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
((ViewGroup) mScrollView.getParent()).removeView(mColorSelector.getRootView());
|
((ViewGroup) mScrollView.getParent()).removeView(mColorSelector.getRootView());
|
||||||
((ViewGroup) mScrollView.getParent()).removeView(mScrollView);
|
((ViewGroup) mScrollView.getParent()).removeView(mScrollView);
|
||||||
@ -232,8 +244,6 @@ public class EditControlPopup {
|
|||||||
mOrientationSpinner.setAdapter(adapter);
|
mOrientationSpinner.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void setDefaultVisibilitySetting() {
|
private void setDefaultVisibilitySetting() {
|
||||||
for (int i = 0; i < mRootView.getChildCount(); ++i) {
|
for (int i = 0; i < mRootView.getChildCount(); ++i) {
|
||||||
mRootView.getChildAt(i).setVisibility(VISIBLE);
|
mRootView.getChildAt(i).setVisibility(VISIBLE);
|
||||||
@ -244,14 +254,11 @@ public class EditControlPopup {
|
|||||||
return mScrollView.getX() > currentDisplayMetrics.widthPixels / 2f;
|
return mScrollView.getX() > currentDisplayMetrics.widthPixels / 2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void setPercentageText(TextView textView, int progress){
|
|
||||||
textView.setText(textView.getContext().getString(R.string.percent_format, progress));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* LOADING VALUES */
|
/* LOADING VALUES */
|
||||||
|
|
||||||
/** Load values for basic control data */
|
/**
|
||||||
|
* Load values for basic control data
|
||||||
|
*/
|
||||||
public void loadValues(ControlData data) {
|
public void loadValues(ControlData data) {
|
||||||
setDefaultVisibilitySetting();
|
setDefaultVisibilitySetting();
|
||||||
mOrientationTextView.setVisibility(GONE);
|
mOrientationTextView.setVisibility(GONE);
|
||||||
@ -285,7 +292,9 @@ public class EditControlPopup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Load values for extended control data */
|
/**
|
||||||
|
* Load values for extended control data
|
||||||
|
*/
|
||||||
public void loadValues(ControlDrawerData data) {
|
public void loadValues(ControlDrawerData data) {
|
||||||
loadValues(data.properties);
|
loadValues(data.properties);
|
||||||
|
|
||||||
@ -293,10 +302,10 @@ public class EditControlPopup {
|
|||||||
ControlDrawerData.orientationToInt(data.orientation));
|
ControlDrawerData.orientationToInt(data.orientation));
|
||||||
|
|
||||||
mMappingTextView.setVisibility(GONE);
|
mMappingTextView.setVisibility(GONE);
|
||||||
mKeycodeSpinners[0].setVisibility(GONE);
|
for (int i = 0; i < mKeycodeSpinners.length; i++) {
|
||||||
mKeycodeSpinners[1].setVisibility(GONE);
|
mKeycodeSpinners[i].setVisibility(GONE);
|
||||||
mKeycodeSpinners[2].setVisibility(GONE);
|
mKeycodeTextviews[i].setVisibility(GONE);
|
||||||
mKeycodeSpinners[3].setVisibility(GONE);
|
}
|
||||||
|
|
||||||
mOrientationTextView.setVisibility(VISIBLE);
|
mOrientationTextView.setVisibility(VISIBLE);
|
||||||
mOrientationSpinner.setVisibility(VISIBLE);
|
mOrientationSpinner.setVisibility(VISIBLE);
|
||||||
@ -306,15 +315,17 @@ public class EditControlPopup {
|
|||||||
mToggleSwitch.setVisibility(View.GONE);
|
mToggleSwitch.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Load values for the joystick */
|
/**
|
||||||
|
* Load values for the joystick
|
||||||
|
*/
|
||||||
public void loadJoystickValues(ControlData data) {
|
public void loadJoystickValues(ControlData data) {
|
||||||
loadValues(data);
|
loadValues(data);
|
||||||
|
|
||||||
mMappingTextView.setVisibility(GONE);
|
mMappingTextView.setVisibility(GONE);
|
||||||
mKeycodeSpinners[0].setVisibility(GONE);
|
for (int i = 0; i < mKeycodeSpinners.length; i++) {
|
||||||
mKeycodeSpinners[1].setVisibility(GONE);
|
mKeycodeSpinners[i].setVisibility(GONE);
|
||||||
mKeycodeSpinners[2].setVisibility(GONE);
|
mKeycodeTextviews[i].setVisibility(GONE);
|
||||||
mKeycodeSpinners[3].setVisibility(GONE);
|
}
|
||||||
|
|
||||||
mNameTextView.setVisibility(GONE);
|
mNameTextView.setVisibility(GONE);
|
||||||
mNameEditText.setVisibility(GONE);
|
mNameEditText.setVisibility(GONE);
|
||||||
@ -328,7 +339,9 @@ public class EditControlPopup {
|
|||||||
mToggleSwitch.setVisibility(View.GONE);
|
mToggleSwitch.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Load values for sub buttons */
|
/**
|
||||||
|
* Load values for sub buttons
|
||||||
|
*/
|
||||||
public void loadSubButtonValues(ControlData data) {
|
public void loadSubButtonValues(ControlData data) {
|
||||||
loadValues(data);
|
loadValues(data);
|
||||||
|
|
||||||
@ -357,6 +370,10 @@ public class EditControlPopup {
|
|||||||
mKeycodeSpinners[1] = mScrollView.findViewById(R.id.editMapping_spinner_2);
|
mKeycodeSpinners[1] = mScrollView.findViewById(R.id.editMapping_spinner_2);
|
||||||
mKeycodeSpinners[2] = mScrollView.findViewById(R.id.editMapping_spinner_3);
|
mKeycodeSpinners[2] = mScrollView.findViewById(R.id.editMapping_spinner_3);
|
||||||
mKeycodeSpinners[3] = mScrollView.findViewById(R.id.editMapping_spinner_4);
|
mKeycodeSpinners[3] = mScrollView.findViewById(R.id.editMapping_spinner_4);
|
||||||
|
mKeycodeTextviews[0] = mScrollView.findViewById(R.id.mapping_1_textview);
|
||||||
|
mKeycodeTextviews[1] = mScrollView.findViewById(R.id.mapping_2_textview);
|
||||||
|
mKeycodeTextviews[2] = mScrollView.findViewById(R.id.mapping_3_textview);
|
||||||
|
mKeycodeTextviews[3] = mScrollView.findViewById(R.id.mapping_4_textview);
|
||||||
mOrientationSpinner = mScrollView.findViewById(R.id.editOrientation_spinner);
|
mOrientationSpinner = mScrollView.findViewById(R.id.editOrientation_spinner);
|
||||||
mStrokeWidthSeekbar = mScrollView.findViewById(R.id.editStrokeWidth_seekbar);
|
mStrokeWidthSeekbar = mScrollView.findViewById(R.id.editStrokeWidth_seekbar);
|
||||||
mCornerRadiusSeekbar = mScrollView.findViewById(R.id.editCornerRadius_seekbar);
|
mCornerRadiusSeekbar = mScrollView.findViewById(R.id.editCornerRadius_seekbar);
|
||||||
@ -386,9 +403,12 @@ public class EditControlPopup {
|
|||||||
public void setupRealTimeListeners() {
|
public void setupRealTimeListeners() {
|
||||||
mNameEditText.addTextChangedListener(new TextWatcher() {
|
mNameEditText.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
@ -403,9 +423,12 @@ public class EditControlPopup {
|
|||||||
|
|
||||||
mWidthEditText.addTextChangedListener(new TextWatcher() {
|
mWidthEditText.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
@ -421,9 +444,12 @@ public class EditControlPopup {
|
|||||||
|
|
||||||
mHeightEditText.addTextChangedListener(new TextWatcher() {
|
mHeightEditText.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
@ -460,9 +486,12 @@ public class EditControlPopup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {}
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {}
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mStrokeWidthSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
mStrokeWidthSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||||
@ -475,9 +504,12 @@ public class EditControlPopup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {}
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {}
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mCornerRadiusSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
mCornerRadiusSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||||
@ -490,14 +522,19 @@ public class EditControlPopup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {}
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {}
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < mKeycodeSpinners.length; ++i) {
|
for (int i = 0; i < mKeycodeSpinners.length; ++i) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
|
mKeycodeTextviews[i].setOnClickListener(v -> mKeycodeSpinners[finalI].performClick());
|
||||||
|
|
||||||
mKeycodeSpinners[i].setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
mKeycodeSpinners[i].setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
@ -508,10 +545,12 @@ public class EditControlPopup {
|
|||||||
} else {
|
} else {
|
||||||
mCurrentlyEditedButton.getProperties().keycodes[finalI] = EfficientAndroidLWJGLKeycode.getValueByIndex(mKeycodeSpinners[finalI].getSelectedItemPosition() - mSpecialArray.size());
|
mCurrentlyEditedButton.getProperties().keycodes[finalI] = EfficientAndroidLWJGLKeycode.getValueByIndex(mKeycodeSpinners[finalI].getSelectedItemPosition() - mSpecialArray.size());
|
||||||
}
|
}
|
||||||
|
mKeycodeTextviews[finalI].setText((String) mKeycodeSpinners[finalI].getSelectedItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {}
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -529,7 +568,8 @@ public class EditControlPopup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected(AdapterView<?> parent) {}
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mDisplayInGameCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
mDisplayInGameCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<corners android:radius="@dimen/_8sdp" />
|
<corners android:radius="@dimen/_8sdp" />
|
||||||
<padding
|
<padding
|
||||||
android:bottom="2dp"
|
android:bottom="@dimen/_2sdp"
|
||||||
android:left="2dp"
|
android:left="@dimen/_2sdp"
|
||||||
android:right="2dp"
|
android:right="@dimen/_2sdp"
|
||||||
android:top="2dp" />
|
android:top="@dimen/_2sdp" />
|
||||||
<solid android:color="@color/background_app" />
|
<solid android:color="@color/background_app" />
|
||||||
</shape>
|
</shape>
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editSize_editTextX"
|
android:id="@+id/editSize_editTextX"
|
||||||
android:layout_width="@dimen/_138sdp"
|
android:layout_width="@dimen/_134sdp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:imeOptions="flagNoExtractUi"
|
android:imeOptions="flagNoExtractUi"
|
||||||
@ -104,20 +104,83 @@
|
|||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/editMapping_spinner_1"
|
android:id="@+id/editMapping_spinner_1"
|
||||||
android:layout_width="0dp"
|
android:layout_width="1px"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginTop="@dimen/_2sdp"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
|
android:dropDownWidth="@dimen/_267sdp"
|
||||||
|
android:dropDownVerticalOffset="30dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/editMapping_spinner_3"
|
app:layout_constraintBottom_toTopOf="@id/editMapping_spinner_3"
|
||||||
app:layout_constraintEnd_toStartOf="@id/editMapping_spinner_2"
|
|
||||||
|
|
||||||
app:layout_constraintHorizontal_chainStyle="spread"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/editMapping_textView"
|
app:layout_constraintTop_toBottomOf="@+id/editMapping_textView" />
|
||||||
app:layout_constraintVertical_chainStyle="spread" />
|
|
||||||
|
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/editMapping_spinner_2"
|
||||||
|
android:layout_width="1px"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:dropDownWidth="@dimen/_267sdp"
|
||||||
|
android:dropDownHorizontalOffset="30dp"
|
||||||
|
android:dropDownVerticalOffset="30dp"
|
||||||
|
android:gravity="center"
|
||||||
|
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/editMapping_spinner_1"
|
||||||
|
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/editMapping_spinner_1" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/editMapping_spinner_3"
|
||||||
|
android:layout_width="1px"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:dropDownWidth="@dimen/_267sdp"
|
||||||
|
android:dropDownVerticalOffset="30dp"
|
||||||
|
android:gravity="center"
|
||||||
|
|
||||||
|
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/editMapping_spinner_1" />
|
||||||
|
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/editMapping_spinner_4"
|
||||||
|
android:layout_width="1px"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:dropDownWidth="@dimen/_267sdp"
|
||||||
|
android:dropDownVerticalOffset="30dp"
|
||||||
|
|
||||||
|
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/editMapping_spinner_2" />
|
||||||
|
|
||||||
|
<!-- Clickable textview linked to the spinners
|
||||||
|
Spinners are hidden at the same place because the dropdown offset doesn't work
|
||||||
|
Do those textview acts as the spinner idle state
|
||||||
|
-->
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mapping_1_textview"
|
||||||
|
style="?android:attr/spinnerItemStyle"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/_30sdp"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:gravity="center"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAlignment="inherit"
|
||||||
|
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/mapping_2_textview"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/editMapping_textView"
|
||||||
|
|
||||||
|
tools:text="HELLO" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/editMapping_plus_1"
|
android:id="@+id/editMapping_plus_1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -125,47 +188,42 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="+"
|
android:text="+"
|
||||||
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/editMapping_spinner_1"
|
app:layout_constraintBottom_toBottomOf="@+id/mapping_1_textview"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/editMapping_spinner_1"
|
app:layout_constraintEnd_toEndOf="@+id/mapping_1_textview"
|
||||||
app:layout_constraintTop_toTopOf="@+id/editMapping_spinner_1" />
|
app:layout_constraintStart_toEndOf="@id/mapping_1_textview"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/mapping_1_textview" />
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/editMapping_spinner_2"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:background="@android:color/transparent"
|
|
||||||
android:gravity="center"
|
|
||||||
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/editMapping_spinner_1"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/editMapping_spinner_1"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/editMapping_spinner_1" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/editMapping_plus_2"
|
android:id="@+id/mapping_2_textview"
|
||||||
android:layout_width="wrap_content"
|
style="?android:attr/spinnerItemStyle"
|
||||||
android:layout_height="0dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="+"
|
|
||||||
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/editMapping_textView"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/editMapping_textView"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/editMapping_spinner_3"
|
|
||||||
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/editMapping_spinner_3"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="@dimen/_30sdp"
|
||||||
android:background="@android:color/transparent"
|
android:ellipsize="marquee"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAlignment="inherit"
|
||||||
|
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/mapping_1_textview"
|
||||||
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/editMapping_spinner_4"
|
app:layout_constraintTop_toTopOf="@+id/mapping_1_textview"
|
||||||
|
tools:text="HELLO" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mapping_3_textview"
|
||||||
|
style="?android:attr/spinnerItemStyle"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/_30sdp"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:gravity="center"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAlignment="inherit"
|
||||||
|
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/mapping_4_textview"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/editMapping_spinner_1" />
|
app:layout_constraintTop_toBottomOf="@id/mapping_1_textview"
|
||||||
|
|
||||||
|
tools:text="HELLO" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/editMapping_plus_3"
|
android:id="@+id/editMapping_plus_3"
|
||||||
@ -175,21 +233,26 @@
|
|||||||
android:text="+"
|
android:text="+"
|
||||||
|
|
||||||
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/editMapping_spinner_3"
|
app:layout_constraintBottom_toBottomOf="@+id/mapping_3_textview"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/editMapping_spinner_3"
|
app:layout_constraintEnd_toEndOf="@+id/mapping_3_textview"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/editMapping_spinner_1" />
|
app:layout_constraintStart_toEndOf="@id/mapping_3_textview"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/mapping_1_textview" />
|
||||||
|
|
||||||
<Spinner
|
<TextView
|
||||||
android:id="@+id/editMapping_spinner_4"
|
android:id="@+id/mapping_4_textview"
|
||||||
|
style="?android:attr/spinnerItemStyle"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="@dimen/_30sdp"
|
||||||
android:background="@android:color/transparent"
|
android:ellipsize="marquee"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAlignment="inherit"
|
||||||
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/editMapping_spinner_3"
|
app:layout_constraintStart_toEndOf="@id/mapping_3_textview"
|
||||||
app:layout_constraintTop_toBottomOf="@id/editMapping_spinner_2" />
|
app:layout_constraintTop_toTopOf="@id/mapping_3_textview"
|
||||||
|
|
||||||
|
tools:text="HELLO" />
|
||||||
|
|
||||||
|
|
||||||
<!-- ORIENTATION SECTION -->
|
<!-- ORIENTATION SECTION -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user