Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
44d189aa
Commit
44d189aa
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
HomeFragment: fix various glitches
Change-Id: Ia4bfc0ef3a9cbe4c8f9c0c49c43735b0b2b0b5c6
parent
155cbb83
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jami-android/app/src/main/java/cx/ring/fragments/HomeFragment.kt
+8
-19
8 additions, 19 deletions
...droid/app/src/main/java/cx/ring/fragments/HomeFragment.kt
jami-android/app/src/main/res/layout/frag_home.xml
+22
-21
22 additions, 21 deletions
jami-android/app/src/main/res/layout/frag_home.xml
with
30 additions
and
40 deletions
jami-android/app/src/main/java/cx/ring/fragments/HomeFragment.kt
+
8
−
19
View file @
44d189aa
...
...
@@ -29,6 +29,8 @@ import android.view.animation.DecelerateInterpolator
import
androidx.activity.OnBackPressedCallback
import
androidx.appcompat.widget.SearchView
import
androidx.coordinatorlayout.widget.CoordinatorLayout
import
androidx.core.view.ViewCompat
import
androidx.core.view.WindowInsetsCompat
import
androidx.core.view.isVisible
import
androidx.core.view.updateLayoutParams
import
androidx.core.view.updatePadding
...
...
@@ -265,11 +267,6 @@ class HomeFragment: BaseSupportFragment<HomePresenter, HomeView>(),
item
.
accountId
,
item
.
uri
)
// Weird bug fixed by line below.
// Without it, the appBarLayoutBottom is not displayed correctly
// when collapsing the pendingList (no space between statusBar and
// appBarLayout).
//mBinding?.appBar?.fitsSystemWindows = true
}
override
fun
onItemLongClick
(
item
:
Conversation
)
{
...
...
@@ -333,17 +330,19 @@ class HomeFragment: BaseSupportFragment<HomePresenter, HomeView>(),
ChangeBounds
().
setInterpolator
(
DecelerateInterpolator
())
)
binding
.
appBarContainer
.
fitsSystemWindows
=
true
// Make the invitation card take all the height.
binding
.
appBar
.
updateLayoutParams
{
height
=
ViewGroup
.
LayoutParams
.
MATCH_PARENT
}
binding
.
appBarContainer
.
updatePadding
(
bottom
=
0
)
val
insetsCompat
=
ViewCompat
.
getRootWindowInsets
(
binding
.
invitationCard
.
invitationGroup
)
?:
return
val
insets
=
insetsCompat
.
getInsets
(
WindowInsetsCompat
.
Type
.
systemBars
())
binding
.
appBar
.
updatePadding
(
bottom
=
insets
.
bottom
)
// Adapt the margins of the invitation card.
requireContext
().
resources
.
getDimensionPixelSize
(
R
.
dimen
.
bottom_sheet_radius
).
let
{
(
binding
.
invitationCard
.
invitationGroup
.
layoutParams
as
ViewGroup
.
MarginLayoutParams
)
.
setMargins
(
it
,
it
,
it
,
it
)
.
setMargins
(
it
,
it
,
it
,
2
*
it
)
}
// Enable to possibility to scroll the invitation pending list.
(
binding
.
appBar
.
layoutParams
as
CoordinatorLayout
.
LayoutParams
).
behavior
=
null
...
...
@@ -381,17 +380,7 @@ class HomeFragment: BaseSupportFragment<HomePresenter, HomeView>(),
Fade
()
)
binding
.
appBarContainer
.
fitsSystemWindows
=
false
// Update AppBarLayoutBottom padding.
mDisposable
.
add
(
mAccountService
.
currentAccountSubject
.
switchMap
{
account
->
account
.
getPendingSubject
()
}
.
firstOrError
().
subscribe
{
list
->
updateAppBarLayoutBottomPadding
(
hasInvites
=
list
.
isNotEmpty
())
}
)
binding
.
appBar
.
updatePadding
(
bottom
=
0
)
// Make the invitation card wrap content (not take all space available anymore).
binding
.
appBar
.
updateLayoutParams
{
...
...
This diff is collapsed.
Click to expand it.
jami-android/app/src/main/res/layout/frag_home.xml
+
22
−
21
View file @
44d189aa
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2004-2016 Savoir-faire Linux Inc.
This program is free software; you can redistribute it and/or modify
...
...
@@ -21,7 +20,8 @@ along with this program; if not, write to the Free Software
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
>
<!-- Smartlist to display swarms -->
<androidx.fragment.app.FragmentContainerView
...
...
@@ -41,8 +41,8 @@ along with this program; if not, write to the Free Software
android:id=
"@+id/app_bar_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:background=
"@drawable/background_appbar_gradient"
android:orientation=
"vertical"
app:layout_scrollFlags=
"scroll|enterAlways|snap|exitUntilCollapsed"
>
<!-- Search bar to search for a swarm or for new contacts -->
...
...
@@ -70,6 +70,7 @@ along with this program; if not, write to the Free Software
android:id=
"@+id/search_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
android:hint=
"@string/searchbar_hint"
app:layout_anchor=
"@id/search_bar"
tools:visibility=
"gone"
>
...
...
@@ -160,22 +161,22 @@ along with this program; if not, write to the Free Software
<!-- Floating button to start a new conversation -->
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id=
"@+id/new_swarm_fab"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|end"
android:layout_margin=
"8dp"
android:backgroundTint=
"@color/fab_background_color"
android:
text=
"@string/start_conversati
on"
android:
outlineProvider=
"n
on
e
"
android:textColor=
"@color/fab_text_color"
app:icon=
"@drawable/baseline_chat_24"
app:iconTint=
"@color/fab_text_color"
app:layout_anchorGravity=
"bottom|center_horizontal"
app:pressedTranslationZ=
"12dp"
app:shapeAppearanceOverlay=
"@style/HomeFabButton"
/>
android:layout_height=
"match_parent"
>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id=
"@+id/new_swarm_fab"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|end"
android:layout_margin=
"8dp"
android:backgroundTint=
"@color/fab_background_color"
android:
outlineProvider=
"n
on
e
"
android:
text=
"@string/start_conversati
on"
android:textColor=
"@color/fab_text_color"
app:icon=
"@drawable/baseline_chat_24"
app:iconTint=
"@color/fab_text_color"
app:layout_anchorGravity=
"bottom|center_horizontal"
app:pressedTranslationZ=
"12dp"
app:shapeAppearanceOverlay=
"@style/HomeFabButton"
/>
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment