Fix a bunch of lint warning

This commit is contained in:
CappielloAntonio 2021-08-14 17:06:49 +02:00
parent 9c661bd283
commit a49626aa43
7 changed files with 34 additions and 24 deletions

View file

@ -100,6 +100,25 @@ public class Server implements Parcelable {
this.timestamp = timestamp;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Server server = (Server) o;
return serverId.equals(server.getServerId());
}
@Override
public int hashCode() {
return serverId.hashCode();
}
@Override
public String toString() {
return serverId;
}
@Override
public int describeContents() {
return 0;
@ -125,4 +144,10 @@ public class Server implements Parcelable {
this.salt = in.readString();
this.timestamp = in.readLong();
}
public static final Creator<Server> CREATOR = new Creator<Server>() {
public Server createFromParcel(Parcel in) { return new Server(in); }
public Server[] newArray(int size) { return new Server[size]; }
};
}

View file

@ -1,6 +1,5 @@
package com.cappielloantonio.play.model;
import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
@ -305,7 +304,6 @@ public class Song implements Parcelable {
return 0;
}
@SuppressLint("NewApi")
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.id);
@ -330,7 +328,6 @@ public class Song implements Parcelable {
dest.writeLong(this.lastPlay);
}
@SuppressLint("NewApi")
protected Song(Parcel in) {
this.id = in.readString();
this.title = in.readString();

View file

@ -153,6 +153,10 @@ public class MainActivity extends BaseActivity {
if (playerBottomSheetFragment != null)
playerBottomSheetFragment.scrollOnTop();
break;
case BottomSheetBehavior.STATE_DRAGGING:
case BottomSheetBehavior.STATE_EXPANDED:
case BottomSheetBehavior.STATE_HALF_EXPANDED:
break;
}
}