Skip to content

Fix and upgrade many things#21

Closed
Attect wants to merge 22 commits intoYalantis:masterfrom
Attect:master
Closed

Fix and upgrade many things#21
Attect wants to merge 22 commits intoYalantis:masterfrom
Attect:master

Conversation

@Attect
Copy link
Copy Markdown

@Attect Attect commented Apr 27, 2019

see commit
it can build by Android Studio 3.4 and run on Android pie

val selected = mSelectedItems
val removed = mRemovedItems
if (selected is Serializable) {
if (true) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not remove this line and 330?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android Studio tell me it is always true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (true) {
    putSerializable(STATE_SELECTED, selected)
}

... is the same as ...

putSerializable(STATE_SELECTED, selected)

just remove the if condition

toX: Int, toY: Int): Boolean {
var fromX = fromX
var fromY = fromY
var fx = fromX
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inconsistent variable naming: Before there was fromX and toX. Now it is fx and toX. I suggest reverting back to the old naming style

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android Studio:Name shadowed: fromX

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I overlooked the parameter names. However, that warning won't create issues in this code. You could attach @Suppress("NAME_SHADOWING") to those 2 variables.

Technically the old 194 - 195 code could have been named better as the fromX and fromY variables are modified in the code. Maybe something like _fromX and _fromY

Regardless, the names of fx and fy don't fit the variable naming standard and should be changed

@Attect
Copy link
Copy Markdown
Author

Attect commented Apr 29, 2019

update code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants