-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marcel Hibbe <[email protected]>
- Loading branch information
Showing
12 changed files
with
255 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
app/src/main/java/com/nextcloud/talk/models/json/status/ClearAt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
package com.nextcloud.talk.models.json.status | ||
|
||
import android.os.Parcelable | ||
import com.bluelinelabs.logansquare.annotation.JsonField | ||
import com.bluelinelabs.logansquare.annotation.JsonObject | ||
import kotlinx.android.parcel.Parcelize | ||
|
||
class ClearAt(val type: String, val time: String) | ||
@Parcelize | ||
@JsonObject | ||
data class ClearAt( | ||
@JsonField(name = ["type"]) | ||
var type: String, | ||
@JsonField(name = ["time"]) | ||
var time: String | ||
) : Parcelable{ | ||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' | ||
constructor() : this("type", "time") | ||
} |
3 changes: 0 additions & 3 deletions
3
app/src/main/java/com/nextcloud/talk/models/json/status/PredefinedStatus.kt
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
app/src/main/java/com/nextcloud/talk/models/json/status/predefined/PredefinedStatus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.nextcloud.talk.models.json.status.predefined | ||
|
||
import android.os.Parcelable | ||
import com.bluelinelabs.logansquare.annotation.JsonField | ||
import com.bluelinelabs.logansquare.annotation.JsonObject | ||
import com.nextcloud.talk.models.json.status.ClearAt | ||
import kotlinx.android.parcel.Parcelize | ||
|
||
@Parcelize | ||
@JsonObject | ||
data class PredefinedStatus( | ||
@JsonField(name = ["id"]) | ||
var id: String, | ||
@JsonField(name = ["icon"]) | ||
var icon: String, | ||
@JsonField(name = ["message"]) | ||
var message: String, | ||
@JsonField(name = ["clearAt"]) | ||
var clearAt: ClearAt? | ||
) : Parcelable { | ||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' | ||
constructor() : this("id", "icon", "message", null) | ||
} | ||
|
||
|
||
|
||
|
||
|
||
// @Parcelize | ||
// @JsonObject | ||
// data class Status( | ||
// @JsonField(name = ["userId"]) | ||
// var userId: String?, | ||
// @JsonField(name = ["message"]) | ||
// var message: String?, | ||
// /* TODO: Change to enum */ | ||
// @JsonField(name = ["messageId"]) | ||
// var messageId: String?, | ||
// @JsonField(name = ["messageIsPredefined"]) | ||
// var messageIsPredefined: Boolean, | ||
// @JsonField(name = ["icon"]) | ||
// var icon: String?, | ||
// @JsonField(name = ["clearAt"]) | ||
// var clearAt: Long = 0, | ||
// /* TODO: Change to enum */ | ||
// @JsonField(name = ["status"]) | ||
// var status: String = "offline", | ||
// @JsonField(name = ["statusIsUserDefined"]) | ||
// var statusIsUserDefined: Boolean | ||
// ) : Parcelable { | ||
// // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' | ||
// constructor() : this(null, null, null, false, null, 0, "offline", false) | ||
// } |
74 changes: 74 additions & 0 deletions
74
app/src/main/java/com/nextcloud/talk/models/json/status/predefined/PredefinedStatusOCS.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* | ||
* Nextcloud Talk application | ||
* | ||
* @author Tim Krüger | ||
* Copyright (C) 2021 Tim Krüger <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.nextcloud.talk.models.json.status.predefined; | ||
|
||
import com.bluelinelabs.logansquare.annotation.JsonField; | ||
import com.bluelinelabs.logansquare.annotation.JsonObject; | ||
import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser; | ||
import com.nextcloud.talk.models.json.generic.GenericOCS; | ||
import com.nextcloud.talk.models.json.status.Status; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import kotlin.jvm.JvmSuppressWildcards; | ||
|
||
@JsonObject | ||
public class PredefinedStatusOCS extends GenericOCS { | ||
@JsonField(name = "data") | ||
List<PredefinedStatus> data; | ||
|
||
public List<PredefinedStatus> getData() { | ||
return this.data; | ||
} | ||
|
||
public void setData(List<PredefinedStatus> data) { | ||
this.data = data; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
if (!super.equals(o)) { | ||
return false; | ||
} | ||
PredefinedStatusOCS that = (PredefinedStatusOCS) o; | ||
return Objects.equals(data, that.data); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), data); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PredefinedStatusOCS{" + | ||
"data=" + data + | ||
'}'; | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
...c/main/java/com/nextcloud/talk/models/json/status/predefined/PredefinedStatusOverall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* | ||
* Nextcloud Talk application | ||
* | ||
* @author Tim Krüger | ||
* Copyright (C) 2021 Tim Krüger <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.nextcloud.talk.models.json.status.predefined; | ||
|
||
import com.bluelinelabs.logansquare.annotation.JsonField; | ||
import com.bluelinelabs.logansquare.annotation.JsonObject; | ||
import com.nextcloud.talk.models.json.status.StatusOCS; | ||
|
||
import java.util.Objects; | ||
|
||
@JsonObject | ||
public class PredefinedStatusOverall { | ||
@JsonField(name = "ocs") | ||
public PredefinedStatusOCS ocs; | ||
|
||
public PredefinedStatusOCS getOcs() { | ||
return this.ocs; | ||
} | ||
|
||
public void setOcs(PredefinedStatusOCS ocs) { | ||
this.ocs = ocs; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
PredefinedStatusOverall that = (PredefinedStatusOverall) o; | ||
return Objects.equals(ocs, that.ocs); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(ocs); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PredefinedStatusOverall{" + | ||
"ocs=" + ocs + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters