-
-
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.
- Added 4 new model data classes - Added the new API function to NcApi - Implemented the changes in the Repository + ViewModel - Implemented the changes in the Activity - Added some helper functions to support impl Signed-off-by: Julius Linus <[email protected]>
- Loading branch information
1 parent
f6f9f35
commit 7de77ca
Showing
14 changed files
with
259 additions
and
53 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
41 changes: 41 additions & 0 deletions
41
app/src/main/java/com/nextcloud/talk/translate/repositories/model/Language.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,41 @@ | ||
/* | ||
* Nextcloud Talk application | ||
* | ||
* @author Julius Linus | ||
* Copyright (C) 2023 Julius Linus <[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.translate.repositories.model | ||
|
||
import android.os.Parcelable | ||
import com.bluelinelabs.logansquare.annotation.JsonField | ||
import com.bluelinelabs.logansquare.annotation.JsonObject | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
@JsonObject | ||
data class Language( | ||
@JsonField(name = ["from"]) | ||
var from: String?, | ||
@JsonField(name = ["fromLabel"]) | ||
var fromLabel: String?, | ||
@JsonField(name = ["to"]) | ||
var to: String?, | ||
@JsonField(name = ["toLabel"]) | ||
var toLabel: String? | ||
) : Parcelable { | ||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' | ||
constructor() : this(null, null, null, null) | ||
} |
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/nextcloud/talk/translate/repositories/model/LanguagesData.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,37 @@ | ||
/* | ||
* Nextcloud Talk application | ||
* | ||
* @author Julius Linus | ||
* Copyright (C) 2023 Julius Linus <[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.translate.repositories.model | ||
|
||
import android.os.Parcelable | ||
import com.bluelinelabs.logansquare.annotation.JsonField | ||
import com.bluelinelabs.logansquare.annotation.JsonObject | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
@JsonObject | ||
data class LanguagesData( | ||
@JsonField(name = ["languageDetection"]) | ||
var languageDetection: Boolean?, | ||
@JsonField(name = ["languages"]) | ||
var languages: List<Language>? | ||
) : Parcelable { | ||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' | ||
constructor() : this(null, null) | ||
} |
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/nextcloud/talk/translate/repositories/model/LanguagesOCS.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,38 @@ | ||
/* | ||
* Nextcloud Talk application | ||
* | ||
* @author Julius Linus | ||
* Copyright (C) 2023 Julius Linus <[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.translate.repositories.model | ||
|
||
import android.os.Parcelable | ||
import com.bluelinelabs.logansquare.annotation.JsonField | ||
import com.bluelinelabs.logansquare.annotation.JsonObject | ||
import com.nextcloud.talk.models.json.generic.GenericMeta | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
@JsonObject | ||
data class LanguagesOCS( | ||
@JsonField(name = ["meta"]) | ||
var meta: GenericMeta?, | ||
@JsonField(name = ["data"]) | ||
var data: LanguagesData? | ||
) : Parcelable { | ||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' | ||
constructor() : this(null, null) | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/nextcloud/talk/translate/repositories/model/LanguagesOverall.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,35 @@ | ||
/* | ||
* Nextcloud Talk application | ||
* | ||
* @author Julius Linus | ||
* Copyright (C) 2023 Julius Linus <[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.translate.repositories.model | ||
|
||
import android.os.Parcelable | ||
import com.bluelinelabs.logansquare.annotation.JsonField | ||
import com.bluelinelabs.logansquare.annotation.JsonObject | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
@JsonObject | ||
class LanguagesOverall( | ||
@JsonField(name = ["ocs"]) | ||
var ocs: LanguagesOCS? | ||
) : Parcelable { | ||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' | ||
constructor() : this(null) | ||
} |
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
Oops, something went wrong.