Skip to content

Commit 0a5d5bf

Browse files
committed
Shrink add account fab on scroll and add padding in preferences
1 parent e7941f2 commit 0a5d5bf

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ private void setupWindowInsets() {
8989

9090
return windowInsets;
9191
});
92+
93+
nestedScrollView.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
94+
if (scrollY > oldScrollY) {
95+
fab.shrink();
96+
} else if (scrollY < oldScrollY) {
97+
fab.extend();
98+
}
99+
});
92100
}
93101

94102
private void enableEdgeToEdgeNoContrast() {

play-services-core/microg-ui-tools/src/main/res/layout/settings_activity.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
android:layout_height="wrap_content"
101101
android:layout_gravity="end|bottom"
102102
android:layout_margin="17dp"
103+
android:scrollbars="none"
103104
android:textColor="?attr/colorOnTertiaryContainer"
104105
android:visibility="gone"
105106
app:backgroundTint="?attr/colorTertiaryContainer"

play-services-core/src/main/java/org/microg/gms/ui/MainSettingsActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
9393

9494
appBarConfiguration = new AppBarConfiguration.Builder(getNavController().getGraph()).build();
9595
NavigationUI.setupWithNavController(toolbarLayout, toolbar, getNavController(), appBarConfiguration);
96+
97+
nestedScrollView.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> {
98+
if (scrollY > oldScrollY) {
99+
fab.shrink();
100+
} else {
101+
fab.extend();
102+
}
103+
});
96104
}
97105

98106
private void enableEdgeToEdgeNoContrast() {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<View xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:layout_width="match_parent"
3+
android:layout_height="?attr/listPreferredItemHeightLarge" />

play-services-core/src/main/res/layout/settings_root_activity.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
android:layout_height="wrap_content"
7272
android:layout_gravity="end|bottom"
7373
android:layout_margin="17dp"
74+
android:scrollbars="none"
7475
android:textColor="?attr/colorOnTertiaryContainer"
7576
android:visibility="gone"
7677
app:backgroundTint="?attr/colorTertiaryContainer"

play-services-core/src/main/res/xml/preferences_accounts.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,8 @@
5252
android:layout="@layout/preference_material_information"
5353
android:selectable="false"
5454
android:title="@string/pref_accounts_login_accounts_summary" />
55+
56+
<Preference
57+
android:layout="@layout/preference_material_scroll_margin"
58+
android:selectable="false" />
5559
</PreferenceScreen>

0 commit comments

Comments
 (0)