-
-
Notifications
You must be signed in to change notification settings - Fork 298
Adding bubbles support #5554
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
arlexTech
wants to merge
22
commits into
nextcloud:master
Choose a base branch
from
arlexTech:feature/bubble-conversations
base: master
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
Adding bubbles support #5554
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
18a7a2f
Adding bubbles support
arlexTech 57c2d7f
fix ktlintCheck detekt testGplayDebugUnitTest
arlexTech 0053b5b
remove deprecated onBackPressed and extracted code in function
arlexTech 734a700
prevent second app instance and adding talk icon button in bubble mode
arlexTech 3cc598e
fix potential issue with room token
arlexTech eaf4731
fix getLargeIcon preventing bubble notification
arlexTech 63f0818
bubbles off by default and lead to android bubble settings if needed …
arlexTech 7c463cb
codacy warnings
arlexTech 4e23c56
systemNotificationId fix
arlexTech d11c761
Fix 2 bubbles
arlexTech 0578f62
Merge branch 'master' into feature/bubble-conversations
arlexTech 605af97
fix user provider usage
mahibi 6a5a728
change logic to not delete bubbles
mahibi 0341869
fix to enable system bubble when they are disabled but "create bubble…
mahibi 39bb469
Merge branch 'nextcloud:master' into feature/bubble-conversations
arlexTech 43f442f
Merge branch 'nextcloud:master' into feature/bubble-conversations
arlexTech 304da57
Remove outdated comment
arlexTech a255e19
Merge branch 'nextcloud:master' into feature/bubble-conversations
arlexTech 374c378
Fix build
arlexTech 8ab2945
Extracted bubble logic
arlexTech 658d629
Fix codacy
arlexTech 93f31f2
Fix codacy fix
arlexTech 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
93 changes: 93 additions & 0 deletions
93
app/src/main/java/com/nextcloud/talk/chat/BubbleActivity.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,93 @@ | ||
| /* | ||
| * Nextcloud Talk - Android Client | ||
| * | ||
| * SPDX-FileCopyrightText: 2025 Alexandre Wery <nextcloud-talk-android@alwy.be> | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| */ | ||
|
|
||
| package com.nextcloud.talk.chat | ||
|
|
||
| import android.content.Context | ||
| import android.content.Intent | ||
| import android.os.Bundle | ||
| import androidx.activity.OnBackPressedCallback | ||
| import com.nextcloud.talk.R | ||
| import com.nextcloud.talk.activities.MainActivity | ||
| import com.nextcloud.talk.utils.bundle.BundleKeys | ||
|
|
||
| class BubbleActivity : ChatActivity() { | ||
|
|
||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||
| supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_talk) | ||
| supportActionBar?.setDisplayShowHomeEnabled(true) | ||
| findViewById<androidx.appcompat.widget.Toolbar>(R.id.chat_toolbar)?.setNavigationOnClickListener { | ||
| openConversationList() | ||
| } | ||
|
|
||
| onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) { | ||
| override fun handleOnBackPressed() { | ||
| moveTaskToBack(false) | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| override fun onPrepareOptionsMenu(menu: android.view.Menu): Boolean { | ||
| super.onPrepareOptionsMenu(menu) | ||
|
|
||
| menu.findItem(R.id.create_conversation_bubble)?.isVisible = false | ||
| menu.findItem(R.id.open_conversation_in_app)?.isVisible = true | ||
|
|
||
| return true | ||
| } | ||
|
|
||
| override fun onOptionsItemSelected(item: android.view.MenuItem): Boolean = | ||
| when (item.itemId) { | ||
| R.id.open_conversation_in_app -> { | ||
| openInMainApp() | ||
| true | ||
| } | ||
| android.R.id.home -> { | ||
| openConversationList() | ||
| true | ||
| } | ||
| else -> super.onOptionsItemSelected(item) | ||
| } | ||
|
|
||
| private fun openInMainApp() { | ||
| val intent = Intent(this, MainActivity::class.java).apply { | ||
| action = Intent.ACTION_MAIN | ||
| addCategory(Intent.CATEGORY_LAUNCHER) | ||
| putExtras(this@BubbleActivity.intent) | ||
| conversationUser?.id?.let { putExtra(BundleKeys.KEY_INTERNAL_USER_ID, it) } | ||
| flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP | ||
| } | ||
| startActivity(intent) | ||
| } | ||
|
|
||
| private fun openConversationList() { | ||
| val intent = Intent(this, MainActivity::class.java).apply { | ||
| action = Intent.ACTION_MAIN | ||
| addCategory(Intent.CATEGORY_LAUNCHER) | ||
| flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP | ||
| } | ||
| startActivity(intent) | ||
| } | ||
|
|
||
| @Deprecated("Deprecated in Java") | ||
| override fun onSupportNavigateUp(): Boolean { | ||
| openInMainApp() | ||
| return true | ||
| } | ||
|
|
||
| companion object { | ||
| fun newIntent(context: Context, roomToken: String, conversationName: String?): Intent = | ||
| Intent(context, BubbleActivity::class.java).apply { | ||
| putExtra(BundleKeys.KEY_ROOM_TOKEN, roomToken) | ||
| conversationName?.let { putExtra(BundleKeys.KEY_CONVERSATION_NAME, it) } | ||
| action = Intent.ACTION_VIEW | ||
| flags = Intent.FLAG_ACTIVITY_NEW_DOCUMENT or Intent.FLAG_ACTIVITY_MULTIPLE_TASK | ||
| } | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.