diff --git a/News-Android-App/build.gradle b/News-Android-App/build.gradle index a18964ea7..d362392c7 100644 --- a/News-Android-App/build.gradle +++ b/News-Android-App/build.gradle @@ -149,8 +149,9 @@ dependencies { implementation "androidx.recyclerview:recyclerview:1.4.0" implementation "androidx.browser:browser:1.8.0" implementation "androidx.cardview:cardview:1.0.0" - implementation 'com.google.code.gson:gson:2.13.1' implementation 'androidx.constraintlayout:constraintlayout:2.2.1' + implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' + implementation 'com.google.code.gson:gson:2.13.1' implementation "com.github.bumptech.glide:glide:${GLIDE_VERSION}" ksp "com.github.bumptech.glide:ksp:${GLIDE_VERSION}" diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java index 53a337766..97495e90b 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java @@ -40,6 +40,8 @@ import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; import androidx.fragment.app.Fragment; import com.google.android.material.navigation.NavigationView; @@ -168,6 +170,20 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, bindNavigationMenu(binding.getRoot(), inflater); + // move header of sidebar down according to insets + ViewCompat.setOnApplyWindowInsetsListener(binding.headerView, (View v, WindowInsetsCompat insets) -> { + var systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(0, systemBars.top, 0, 0); + return insets; + }); + + // make sure that the end of the sidebar doesn't go behind the navigation bar + ViewCompat.setOnApplyWindowInsetsListener(binding.expandableListView, (View v, WindowInsetsCompat insets) -> { + var systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); + v.setPadding(0, 0, 0, systemBars.bottom); + return insets; + }); + return binding.getRoot(); } diff --git a/News-Android-App/src/main/res/layout-sw600dp-land/activity_newsreader.xml b/News-Android-App/src/main/res/layout-sw600dp-land/activity_newsreader.xml index 4046bc419..22a68c537 100644 --- a/News-Android-App/src/main/res/layout-sw600dp-land/activity_newsreader.xml +++ b/News-Android-App/src/main/res/layout-sw600dp-land/activity_newsreader.xml @@ -1,19 +1,23 @@ - + android:layout_height="match_parent"> + + + android:layout_height="match_parent" + android:fitsSystemWindows="true"> - + - + + \ No newline at end of file diff --git a/News-Android-App/src/main/res/layout/activity_new_feed.xml b/News-Android-App/src/main/res/layout/activity_new_feed.xml index 0f17d599d..05a09eaf4 100644 --- a/News-Android-App/src/main/res/layout/activity_new_feed.xml +++ b/News-Android-App/src/main/res/layout/activity_new_feed.xml @@ -2,7 +2,8 @@ xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_height="match_parent" - android:layout_width="match_parent"> + android:layout_width="match_parent" + android:fitsSystemWindows="true"> + android:layout_width="match_parent" + android:fitsSystemWindows="true"> + + + android:gravity="bottom" + sothree:umanoShadowHeight="4dp"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> - + \ No newline at end of file diff --git a/News-Android-App/src/main/res/layout/activity_pip_video_playback.xml b/News-Android-App/src/main/res/layout/activity_pip_video_playback.xml index 2dd5a9281..66f626955 100644 --- a/News-Android-App/src/main/res/layout/activity_pip_video_playback.xml +++ b/News-Android-App/src/main/res/layout/activity_pip_video_playback.xml @@ -4,8 +4,6 @@ android:id="@+id/layout_activity_pip" android:layout_width="match_parent" android:layout_height="match_parent" + android:fitsSystemWindows="true" tools:context=".PiPVideoPlaybackActivity"> - - - \ No newline at end of file diff --git a/News-Android-App/src/main/res/layout/activity_settings.xml b/News-Android-App/src/main/res/layout/activity_settings.xml index 446491669..6bdb52ddc 100644 --- a/News-Android-App/src/main/res/layout/activity_settings.xml +++ b/News-Android-App/src/main/res/layout/activity_settings.xml @@ -1,7 +1,9 @@ + android:layout_width="match_parent" + android:layout_height="match_parent" + android:fitsSystemWindows="true" + android:orientation="vertical"> + diff --git a/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml b/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml index cf4a3ec19..94262feb6 100644 --- a/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml +++ b/News-Android-App/src/main/res/layout/fragment_newsreader_list.xml @@ -4,62 +4,69 @@ android:layout_height="match_parent" android:background="?attr/colorSurface"> - - + + android:layout_height="wrap_content" + android:background="@color/nextcloudBlue"> - + + android:clickable="true" + android:focusable="true" + android:paddingHorizontal="10dp" + android:paddingVertical="16dp"> - + - + - + + + + + android:layout_height="wrap_content" + android:fitsSystemWindows="true">