Merge pull request #4474 from nextcloud/popup_bubble

Replace Popup bubble with Material Button
This commit is contained in:
Marcel Hibbe 2025-01-08 17:55:12 +01:00 committed by GitHub
commit d8bc113c28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 37 additions and 12 deletions

View File

@ -272,8 +272,6 @@ dependencies {
implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido:${fidoVersion}"
implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido2:${fidoVersion}"
implementation 'com.github.nextcloud:PopupBubble:2.0.0'
implementation "com.afollestad.material-dialogs:core:${materialDialogsVersion}"
implementation "com.afollestad.material-dialogs:datetime:${materialDialogsVersion}"
implementation "com.afollestad.material-dialogs:bottomsheets:${materialDialogsVersion}"

View File

@ -33,6 +33,7 @@ import android.view.Menu
import android.view.MenuItem
import android.view.MotionEvent
import android.view.View
import android.view.animation.AnimationUtils
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.Toast
@ -148,6 +149,7 @@ import java.util.Objects
import java.util.concurrent.TimeUnit
import javax.inject.Inject
@SuppressLint("StringFormatInvalid")
@AutoInjector(NextcloudTalkApplication::class)
class ConversationsListActivity :
BaseActivity(),
@ -1035,13 +1037,14 @@ class ConversationsListActivity :
newFragment.show(supportFragmentManager, FilterConversationFragment.TAG)
}
binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.setPopupBubbleListener {
binding.newMentionPopupBubble.visibility = View.GONE
binding.newMentionPopupBubble.setOnClickListener {
val layoutManager = binding.recyclerView.layoutManager as SmoothScrollLinearLayoutManager?
layoutManager?.scrollToPositionWithOffset(
nextUnreadConversationScrollPosition,
binding.recyclerView.height / OFFSET_HEIGHT_DIVIDER
)
binding.newMentionPopupBubble.visibility = View.GONE
}
binding.newMentionPopupBubble.let { viewThemeUtils.material.colorMaterialButtonPrimaryFilled(it) }
}
@ -1058,7 +1061,7 @@ class ConversationsListActivity :
searchBehaviorSubject.subscribe { value ->
if (value) {
nextUnreadConversationScrollPosition = 0
binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.visibility = View.GONE
} else {
try {
val lastVisibleItem = layoutManager!!.findLastCompletelyVisibleItemPosition()
@ -1068,13 +1071,15 @@ class ConversationsListActivity :
if (hasUnreadItems(conversation) && position > lastVisibleItem) {
nextUnreadConversationScrollPosition = position
if (!binding.newMentionPopupBubble.isShown) {
binding.newMentionPopupBubble.show()
binding.newMentionPopupBubble.visibility = View.VISIBLE
val popupAnimation = AnimationUtils.loadAnimation(this, R.anim.popup_animation)
binding.newMentionPopupBubble.startAnimation(popupAnimation)
}
return@subscribe
}
}
nextUnreadConversationScrollPosition = 0
binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.visibility = View.GONE
} catch (e: NullPointerException) {
Log.d(
TAG,

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Nextcloud Talk - Android Client
~
~ SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
~ SPDX-License-Identifier: GPL-3.0-or-later
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_decelerate_interpolator">
<scale
android:duration="300"
android:fromXScale="0.7"
android:fromYScale="0.7"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" />
<alpha
android:duration="300"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>

View File

@ -251,11 +251,10 @@
app:tint="@color/white"
app:backgroundTint="@color/colorPrimary"/>
<com.nextcloud.ui.popupbubble.PopupBubble
<com.google.android.material.button.MaterialButton
android:id="@+id/newMentionPopupBubble"
android:theme="@style/Button.Primary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="40dp"
android:layout_gravity="bottom|center"
android:layout_marginStart="88dp"
android:layout_marginTop="16dp"
@ -265,6 +264,8 @@
android:text="@string/nc_new_mention"
app:background="@color/colorPrimary"
app:cornerRadius="@dimen/button_corner_radius"
app:icon="@drawable/ic_baseline_arrow_downward_24px" />
app:icon="@drawable/ic_baseline_arrow_downward_24px"
app:iconPadding="@dimen/standard_padding"
style="@style/Widget.AppTheme.Button.ElevatedButton"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 71 errors and 158 warnings</span>
<span class="mdl-layout-title">Lint Report: 66 errors and 158 warnings</span>