-
Notifications
You must be signed in to change notification settings - Fork 5
feat: unified share #939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alperozturk96
wants to merge
30
commits into
main
Choose a base branch
from
feat/unified-share
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: unified share #939
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
19c9da8
feat: unified share
alperozturk96 569b392
add api models
alperozturk96 362f4c3
adopt mock models to api models
alperozturk96 38c34f0
add translations, bind ui actions
alperozturk96 73869d4
add translations, bind ui actions
alperozturk96 de4598e
wip
alperozturk96 3f72cec
wip
alperozturk96 3cc1841
add test ocs call
alperozturk96 4e242b8
fix test call
alperozturk96 5b73728
use client
alperozturk96 1bb4574
wip
alperozturk96 6a76774
wip
alperozturk96 0433bf0
wip
alperozturk96 cecb3e9
wip
alperozturk96 f8e9e89
wip
alperozturk96 66f177c
wip
alperozturk96 ce736aa
wip
alperozturk96 6adec5b
wip
alperozturk96 c1aa2ad
add empty view state
alperozturk96 3f9087a
wip
alperozturk96 6392ed0
wip
alperozturk96 22f7e36
wip
alperozturk96 1352224
wip
alperozturk96 ee8ee78
wip
alperozturk96 ab810bc
wip
alperozturk96 0050987
wip
alperozturk96 76e624d
wip
alperozturk96 408f0e8
wip
alperozturk96 3d60ff3
wip
alperozturk96 46c04be
wip
alperozturk96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,3 +1,4 @@ | ||
|
|
||
| /* | ||
| * Nextcloud Android Common Library | ||
| * | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
64 changes: 64 additions & 0 deletions
64
ui/src/main/java/com/nextcloud/android/common/ui/component/ContentUnavailableView.kt
This file contains hidden or 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,64 @@ | ||
| /* | ||
| * Nextcloud Android Common Library | ||
| * | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
|
|
||
| package com.nextcloud.android.common.ui.component | ||
|
|
||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.unit.dp | ||
|
|
||
| @Composable | ||
| fun ContentUnavailableView(title: String, description: String? = null, iconId: Int? = null) { | ||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
| .padding(16.dp), | ||
| verticalArrangement = Arrangement.Center, | ||
| horizontalAlignment = Alignment.CenterHorizontally | ||
| ) { | ||
| iconId?.let { | ||
| Image( | ||
| painter = painterResource(iconId), | ||
| modifier = Modifier.size(48.dp), | ||
| contentDescription = "", | ||
| ) | ||
| } | ||
|
|
||
| Spacer(modifier = Modifier.height(16.dp)) | ||
|
|
||
| Text( | ||
| text = title, | ||
| style = MaterialTheme.typography.headlineMedium, | ||
| textAlign = TextAlign.Center | ||
| ) | ||
|
|
||
| description?.let { | ||
| Spacer(modifier = Modifier.height(8.dp)) | ||
|
|
||
| Text( | ||
| text = description, | ||
| style = MaterialTheme.typography.headlineSmall, | ||
| textAlign = TextAlign.Center | ||
| ) | ||
| } | ||
|
|
||
| Spacer(modifier = Modifier.height(32.dp)) | ||
| } | ||
| } |
43 changes: 43 additions & 0 deletions
43
ui/src/main/java/com/nextcloud/android/common/ui/network/PredefinedStatus.kt
This file contains hidden or 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,43 @@ | ||
| /* | ||
| * Nextcloud Android Common Library | ||
| * | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
|
|
||
| package com.nextcloud.android.common.ui.network | ||
|
|
||
| import kotlinx.serialization.KSerializer | ||
| import kotlinx.serialization.Serializable | ||
| import kotlinx.serialization.descriptors.PrimitiveKind | ||
| import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor | ||
| import kotlinx.serialization.encoding.Decoder | ||
| import kotlinx.serialization.encoding.Encoder | ||
| import kotlinx.serialization.json.JsonDecoder | ||
| import kotlinx.serialization.json.JsonPrimitive | ||
|
|
||
| object ClearAtTimeSerializer : KSerializer<String> { | ||
| override val descriptor = PrimitiveSerialDescriptor("ClearAtTime", PrimitiveKind.STRING) | ||
|
|
||
| override fun deserialize(decoder: Decoder): String { | ||
| val jsonDecoder = decoder as? JsonDecoder ?: return decoder.decodeString() | ||
| return (jsonDecoder.decodeJsonElement() as? JsonPrimitive)?.content ?: "" | ||
| } | ||
|
|
||
| override fun serialize(encoder: Encoder, value: String) = encoder.encodeString(value) | ||
| } | ||
|
|
||
| @Serializable | ||
| data class ClearAt( | ||
| val type: String, | ||
| @Serializable(with = ClearAtTimeSerializer::class) | ||
| val time: String | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class PredefinedStatus( | ||
| val id: String, | ||
| val icon: String, | ||
| val message: String, | ||
| val clearAt: ClearAt? = null | ||
| ) |
30 changes: 30 additions & 0 deletions
30
ui/src/main/java/com/nextcloud/android/common/ui/network/UserStatusRepository.kt
This file contains hidden or 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,30 @@ | ||
| /* | ||
| * Nextcloud Android Common Library | ||
| * | ||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
|
|
||
| package com.nextcloud.android.common.ui.network | ||
|
|
||
| import com.nextcloud.android.common.ui.network.http.HttpMethod | ||
| import com.nextcloud.android.common.ui.network.http.NextcloudHttpClient | ||
| import com.nextcloud.android.common.ui.network.model.NetworkResult | ||
| import com.nextcloud.android.common.ui.network.model.OcsResponse | ||
| import com.nextcloud.android.common.ui.network.serialization.OCSSerializer | ||
|
|
||
| class UserStatusRepository(private val client: NextcloudHttpClient) { | ||
|
|
||
| private companion object { | ||
| private const val PREDEFINED_STATUSES_ENDPOINT = | ||
| "/ocs/v2.php/apps/user_status/api/v1/predefined_statuses" | ||
| } | ||
|
|
||
| suspend fun fetchPredefinedStatuses(): NetworkResult<List<PredefinedStatus>> = | ||
| client.executeRequest( | ||
| endpoint = PREDEFINED_STATUSES_ENDPOINT, | ||
| method = HttpMethod.GET | ||
| ) { body -> | ||
| OCSSerializer.json.decodeFromString<OcsResponse<List<PredefinedStatus>>>(body).ocs.data | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For test activity