Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
BlissLauncher
Commits
98d0e964
Commit
98d0e964
authored
Oct 12, 2020
by
Amit Kumar
💻
Browse files
Use insettable for widgets page so that edit button is not hidden behind nav bar.
parent
6c2b9e60
Pipeline
#78820
passed with stage
in 5 minutes and 57 seconds
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/blisslauncher/core/customviews/HorizontalPager.java
View file @
98d0e964
...
...
@@ -563,6 +563,16 @@ public class HorizontalPager extends ViewGroup implements Insettable {
}
}
@Override
public
void
onViewAdded
(
View
child
)
{
super
.
onViewAdded
(
child
);
Log
.
d
(
TAG
,
"onViewAdded() called with: child = ["
+
child
+
"]"
);
if
(
child
instanceof
Insettable
)
{
Log
.
d
(
TAG
,
"child is instance of insettable"
);
((
Insettable
)
child
).
setInsets
(
insets
);
}
}
public
static
class
SavedState
extends
BaseSavedState
{
int
currentScreen
=
-
1
;
...
...
app/src/main/java/foundation/e/blisslauncher/core/customviews/InsettableFrameLayout.kt
0 → 100644
View file @
98d0e964
package
foundation.e.blisslauncher.core.customviews
import
android.content.Context
import
android.util.AttributeSet
import
android.view.WindowInsets
import
android.widget.FrameLayout
import
foundation.e.blisslauncher.BlissLauncher
class
InsettableFrameLayout
(
private
val
mContext
:
Context
,
attrs
:
AttributeSet
?)
:
FrameLayout
(
mContext
,
attrs
),
Insettable
{
override
fun
setInsets
(
insets
:
WindowInsets
?)
{
if
(
insets
==
null
)
return
val
deviceProfile
=
BlissLauncher
.
getApplication
(
mContext
).
deviceProfile
setPadding
(
paddingLeft
,
paddingTop
,
paddingRight
,
paddingBottom
+
insets
.
systemWindowInsetBottom
)
}
}
\ No newline at end of file
app/src/main/java/foundation/e/blisslauncher/core/customviews/InsettableScrollLayout.java
View file @
98d0e964
...
...
@@ -2,13 +2,12 @@ package foundation.e.blisslauncher.core.customviews;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.WindowInsets
;
import
android.widget.ScrollView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
public
class
InsettableScrollLayout
extends
ScrollView
implements
Insettable
{
public
class
InsettableScrollLayout
extends
ScrollView
{
public
InsettableScrollLayout
(
@NonNull
Context
context
)
{
super
(
context
);
...
...
@@ -21,14 +20,4 @@ public class InsettableScrollLayout extends ScrollView implements Insettable {
public
InsettableScrollLayout
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@Override
public
void
setInsets
(
WindowInsets
insets
)
{
if
(
insets
==
null
)
return
;
int
top
=
getPaddingTop
();
int
left
=
getPaddingLeft
();
int
right
=
getPaddingRight
();
int
bottom
=
getPaddingBottom
();
setPadding
(
left
,
top
,
right
,
bottom
+
insets
.
getSystemWindowInsetBottom
());
}
}
app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java
View file @
98d0e964
...
...
@@ -101,6 +101,7 @@ import foundation.e.blisslauncher.core.customviews.BlissFrameLayout;
import
foundation.e.blisslauncher.core.customviews.BlissInput
;
import
foundation.e.blisslauncher.core.customviews.DockGridLayout
;
import
foundation.e.blisslauncher.core.customviews.HorizontalPager
;
import
foundation.e.blisslauncher.core.customviews.InsettableFrameLayout
;
import
foundation.e.blisslauncher.core.customviews.InsettableRelativeLayout
;
import
foundation.e.blisslauncher.core.customviews.InsettableScrollLayout
;
import
foundation.e.blisslauncher.core.customviews.PageIndicatorLinearLayout
;
...
...
@@ -1284,7 +1285,7 @@ public class LauncherActivity extends AppCompatActivity implements
}
private
void
createWidgetsPage
()
{
widgetsPage
=
(
FrameLayout
)
getLayoutInflater
().
inflate
(
R
.
layout
.
widgets_page
,
widgetsPage
=
(
Insettable
FrameLayout
)
getLayoutInflater
().
inflate
(
R
.
layout
.
widgets_page
,
mHorizontalPager
,
false
);
widgetContainer
=
widgetsPage
.
findViewById
(
R
.
id
.
widget_container
);
/*widgetsPage.setPadding(0,
...
...
app/src/main/res/layout/widgets_page.xml
View file @
98d0e964
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
foundation.e.blisslauncher.core.customviews.Insettable
FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
@@ -93,4 +93,4 @@
android:text=
"Max"
android:textColor=
"@color/white"
/>
</RelativeLayout>
</FrameLayout>
\ No newline at end of file
</foundation.e.blisslauncher.core.customviews.InsettableFrameLayout>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment