Skip to content

Commit bc348ac

Browse files
authored
Merge pull request #5868 from nextcloud/feat/3248/ecosystem
📚 Add ecosystem bar to account chooser dialog
2 parents 72c2db3 + 01e2e3c commit bc348ac

16 files changed

Lines changed: 482 additions & 193 deletions

File tree

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ dependencies {
315315
implementation 'androidx.core:core-ktx:1.17.0'
316316
implementation 'androidx.activity:activity-ktx:1.12.4'
317317
implementation 'com.github.nextcloud.android-common:ui:0.33.0'
318+
implementation 'com.github.nextcloud.android-common:core:0.33.0'
318319
implementation 'com.github.nextcloud-deps:android-talk-webrtc:132.6834.0'
319320

320321
gplayImplementation 'com.google.android.gms:play-services-base:18.10.0'

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@
110110
<category android:name="android.intent.category.LAUNCHER" />
111111
</intent-filter>
112112

113+
<intent-filter>
114+
<action android:name="com.nextcloud.intent.OPEN_ECOSYSTEM_APP" />
115+
<category android:name="android.intent.category.DEFAULT" />
116+
</intent-filter>
117+
113118
<intent-filter>
114119
<action android:name="android.intent.action.VIEW" />
115120
<category android:name="android.intent.category.DEFAULT" />

app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4313,6 +4313,7 @@ class ChatActivity :
43134313
}
43144314
}
43154315

4316+
@Suppress("Detekt.TooGenericExceptionCaught")
43164317
private fun shareToNotes(
43174318
shareUri: Uri?,
43184319
roomToken: String,

app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,15 @@ class ConversationsListActivity :
756756
}
757757

758758
private fun showChooseAccountDialog() {
759+
val brandedClient = getResources().getBoolean(R.bool.is_branded_client)
759760
binding.genericComposeView.apply {
760761
val shouldDismiss = mutableStateOf(false)
761762
setContent {
762-
ChooseAccountDialogCompose().GetChooseAccountDialog(shouldDismiss, this@ConversationsListActivity)
763+
ChooseAccountDialogCompose().GetChooseAccountDialog(
764+
shouldDismiss,
765+
this@ConversationsListActivity,
766+
appPreferences.isShowEcosystem && !brandedClient
767+
)
763768
}
764769
}
765770
}

app/src/main/java/com/nextcloud/talk/conversationlist/viewmodels/ConversationsListViewModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ class ConversationsListViewModel @Inject constructor(
281281
return differenceMillis > checkIntervalInMillies
282282
}
283283

284+
@Suppress("Detekt.TooGenericExceptionCaught")
284285
fun checkIfFollowedThreadsExist() {
285286
val threadsUrl = ApiUtils.getUrlForSubscribedThreads(
286287
version = 1,

app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ class SettingsActivity :
216216
}
217217

218218
setupCheckables(isOnline.value)
219+
setupEcosystemSetting()
219220
setupScreenLockSetting()
220221
setupNotificationSettings()
221222
setupProxyTypeSettings()
@@ -252,6 +253,14 @@ class SettingsActivity :
252253
}
253254
}
254255

256+
private fun setupEcosystemSetting() {
257+
if (getResources().getBoolean(R.bool.is_branded_client)) {
258+
binding.settingsShowEcosystem.visibility = View.GONE
259+
} else {
260+
binding.settingsShowEcosystem.visibility = View.VISIBLE
261+
}
262+
}
263+
255264
@Suppress("MagicNumber")
256265
private fun scrollToNotificationCategory() {
257266
binding.scrollView.post {
@@ -771,6 +780,7 @@ class SettingsActivity :
771780
private fun themeSwitchPreferences() {
772781
binding.run {
773782
listOf(
783+
settingsShowEcosystemSwitch,
774784
settingsShowNotificationWarningSwitch,
775785
settingsScreenLockSwitch,
776786
settingsScreenSecuritySwitch,
@@ -967,6 +977,8 @@ class SettingsActivity :
967977
}
968978

969979
private fun setupCheckables(isOnline: Boolean) {
980+
setupShowEcosystemCheckable()
981+
970982
binding.settingsShowNotificationWarningSwitch.isChecked =
971983
appPreferences.showRegularNotificationWarning
972984

@@ -1031,6 +1043,15 @@ class SettingsActivity :
10311043
}
10321044
}
10331045

1046+
private fun setupShowEcosystemCheckable() {
1047+
binding.settingsShowEcosystemSwitch.isChecked = appPreferences.isShowEcosystem
1048+
binding.settingsShowEcosystem.setOnClickListener {
1049+
val isChecked = binding.settingsShowEcosystemSwitch.isChecked
1050+
binding.settingsShowEcosystemSwitch.isChecked = !isChecked
1051+
appPreferences.setShowEcosystem(!isChecked)
1052+
}
1053+
}
1054+
10341055
private fun setupPhoneBookIntegrationSetting() {
10351056
binding.settingsPhoneBookIntegrationSwitch.isChecked = appPreferences.isPhoneBookIntegrationEnabled
10361057
binding.settingsPhoneBookIntegration.setOnClickListener {

0 commit comments

Comments
 (0)