Skip to content
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

Replace Popup bubble with Material Button #4474

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ import java.util.Objects
import java.util.concurrent.TimeUnit
import javax.inject.Inject

@SuppressLint("StringFormatInvalid")
@AutoInjector(NextcloudTalkApplication::class)
class ConversationsListActivity :
BaseActivity(),
Expand Down Expand Up @@ -1037,8 +1038,8 @@ 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,
Expand All @@ -1060,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()
Expand All @@ -1070,13 +1071,13 @@ class ConversationsListActivity :
if (hasUnreadItems(conversation) && position > lastVisibleItem) {
nextUnreadConversationScrollPosition = position
if (!binding.newMentionPopupBubble.isShown) {
binding.newMentionPopupBubble.show()
binding.newMentionPopupBubble.visibility = View.VISIBLE
}
return@subscribe
}
}
nextUnreadConversationScrollPosition = 0
binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.visibility = View.GONE
} catch (e: NullPointerException) {
Log.d(
TAG,
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/activity_conversations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
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"
Expand All @@ -265,6 +265,7 @@
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"
style="@style/Widget.AppTheme.Button.ElevatedButton"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion scripts/analysis/lint-results.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 73 errors and 158 warnings</span>
<span class="mdl-layout-title">Lint Report: 68 errors and 158 warnings</span>