Skip to content

Commit

Permalink
lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-ML06I0P\Nask committed Aug 18, 2020
1 parent af07868 commit a594a0d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -864,10 +864,9 @@ private void addGcPadSubSettings(ArrayList<SettingsItem> sl, int gcPadNumber, in
Setting bindTriggerR =
bindingsSection.getSetting(SettingsFile.KEY_GCBIND_TRIGGER_R + gcPadNumber);
Setting bindTriggerLAnalog =
bindingsSection.getSetting(SettingsFile.KEY_GCBIND_TRIGGER_L_ANALOG + gcPadNumber);
bindingsSection.getSetting(SettingsFile.KEY_GCBIND_TRIGGER_L_ANALOG + gcPadNumber);
Setting bindTriggerRAnalog =
bindingsSection.getSetting(SettingsFile.KEY_GCBIND_TRIGGER_R_ANALOG + gcPadNumber);

bindingsSection.getSetting(SettingsFile.KEY_GCBIND_TRIGGER_R_ANALOG + gcPadNumber);
Setting bindDPadUp =
bindingsSection.getSetting(SettingsFile.KEY_GCBIND_DPAD_UP + gcPadNumber);
Setting bindDPadDown =
Expand Down Expand Up @@ -920,10 +919,12 @@ private void addGcPadSubSettings(ArrayList<SettingsItem> sl, int gcPadNumber, in
Settings.SECTION_BINDINGS, R.string.trigger_right, bindTriggerR, mGameID));

sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_TRIGGER_L_ANALOG + gcPadNumber,
Settings.SECTION_BINDINGS, R.string.trigger_left_analog, bindTriggerLAnalog, mGameID));
Settings.SECTION_BINDINGS, R.string.trigger_left_analog, bindTriggerLAnalog,
mGameID));

sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_TRIGGER_R_ANALOG + gcPadNumber,
Settings.SECTION_BINDINGS, R.string.trigger_right_analog, bindTriggerRAnalog, mGameID));
Settings.SECTION_BINDINGS, R.string.trigger_right_analog, bindTriggerRAnalog,
mGameID));

sl.add(new HeaderSetting(null, null, R.string.controller_dpad, 0));
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_UP + gcPadNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,12 +535,14 @@ private void addGameCubeOverlayControls(String orientation)
if (mPreferences.getBoolean("buttonToggleGc6", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_l,
R.drawable.gcpad_l_pressed, ButtonType.TRIGGER_L, orientation, R.drawable.gcpad_l_pressed_analog, ButtonType.TRIGGER_L_ANALOG));
R.drawable.gcpad_l_pressed, ButtonType.TRIGGER_L, orientation,
R.drawable.gcpad_l_pressed_analog, ButtonType.TRIGGER_L_ANALOG));
}
if (mPreferences.getBoolean("buttonToggleGc7", true))
{
overlayButtons.add(initializeOverlayButton(getContext(), R.drawable.gcpad_r,
R.drawable.gcpad_r_pressed, ButtonType.TRIGGER_R, orientation, R.drawable.gcpad_r_pressed_analog, ButtonType.TRIGGER_R_ANALOG ));
R.drawable.gcpad_r_pressed, ButtonType.TRIGGER_R, orientation,
R.drawable.gcpad_r_pressed_analog, ButtonType.TRIGGER_R_ANALOG ));
}
if (mPreferences.getBoolean("buttonToggleGc8", true))
{
Expand Down Expand Up @@ -854,12 +856,13 @@ private void saveControlPosition(int sharedPrefsId, int x, int y, String orienta
private static InputOverlayDrawableButton initializeOverlayButton(Context context,
int defaultResId, int pressedResId, int buttonId, String orientation)
{
return initializeOverlayButton(context,defaultResId,pressedResId,buttonId, orientation,
-1,-1);
return initializeOverlayButton(context, defaultResId, pressedResId, buttonId, orientation,
-1, -1);
}

private static InputOverlayDrawableButton initializeOverlayButton(Context context,
int defaultResId, int pressedResId, int buttonId, String orientation, int secondaryPressedResId, int secondaryButtonId )
int defaultResId, int pressedResId, int buttonId, String orientation,
int secondaryPressedResId, int secondaryButtonId )
{
// Resources handle for fetching the initial Drawable resource.
final Resources res = context.getResources();
Expand Down Expand Up @@ -959,7 +962,7 @@ else if (controller == 1 && WIIMOTE_O_BUTTONS.contains(buttonId))
int height = overlayDrawable.getHeight();

// Now set the bounds for the InputOverlayDrawableButton.
// This will dictate where on the screen (and the what the size) the InputOverlayDrawableButton will be.
// This will dictate where on the screen (and what size) the InputOverlayDrawableButton will be.
overlayDrawable.setBounds(drawableX, drawableY, drawableX + width, drawableY + height);

// Need to set the image's position
Expand All @@ -969,12 +972,13 @@ else if (controller == 1 && WIIMOTE_O_BUTTONS.contains(buttonId))
if (SECONDARY_FUNCTION_BUTTONS.contains(buttonId) && buttonId >= 0)
{
final Bitmap secondaryPressedStateBitmap =
resizeBitmap(context, BitmapFactory.decodeResource(res, secondaryPressedResId), scale);
resizeBitmap(context, BitmapFactory.decodeResource(res, secondaryPressedResId),
scale);
overlayDrawable.setSecondaryButton(res, secondaryPressedStateBitmap, secondaryButtonId);

Rect secondaryBounds = new Rect(overlayDrawable.getBounds());
//this will set the analog function to the top half of the button
secondaryBounds.bottom = secondaryBounds.bottom - secondaryBounds.height()/2;
//This will set the analog function to the top half of the button
secondaryBounds.bottom = secondaryBounds.bottom - secondaryBounds.height() / 2;
overlayDrawable.setSecondaryBounds(secondaryBounds);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class InputOverlayDrawableButton

//secondary Input such as analog triggers
private int mSecondaryButtonType;
private Rect secondaryBounds = new Rect();
private Rect secondaryBounds = new Rect();
private BitmapDrawable mSecondaryPressedStateBitmap;
private boolean mSecondaryPressedState = false;

Expand Down Expand Up @@ -62,7 +62,7 @@ public InputOverlayDrawableButton(Resources res, Bitmap defaultStateBitmap,


public void setSecondaryButton(Resources res,
Bitmap pressedStateBitmap, int buttonType)
Bitmap pressedStateBitmap, int buttonType)
{
mSecondaryPressedStateBitmap = new BitmapDrawable(res, pressedStateBitmap);
mSecondaryButtonType = buttonType;
Expand Down Expand Up @@ -137,7 +137,7 @@ public void draw(Canvas canvas)
private BitmapDrawable getCurrentStateBitmapDrawable()
{
if(mSecondaryPressedState){
return mSecondaryPressedStateBitmap;
return mSecondaryPressedStateBitmap;
}

return mPressedState ? mPressedStateBitmap : mDefaultStateBitmap;
Expand Down Expand Up @@ -181,6 +181,7 @@ public void setPressedState(boolean isPressed)
{
mPressedState = isPressed;
}

public void setSecondaryPressedState(boolean isPressed)
{
mSecondaryPressedState = isPressed;
Expand Down

0 comments on commit a594a0d

Please sign in to comment.