Skip to content

Commit

Permalink
Merge pull request #3818 from CruGlobal/android15
Browse files Browse the repository at this point in the history
GT-2479 Update lesson UI for Android 15 edge-to-edge display mode
  • Loading branch information
frett authored Dec 11, 2024
2 parents dd7d214 + c3e18e8 commit 3e0970a
Showing 1 changed file with 61 additions and 54 deletions.
115 changes: 61 additions & 54 deletions ui/lesson-renderer/src/main/res/layout/lesson_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,69 +18,76 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@{ManifestKt.getBackgroundColor(manifest)}">

<include
layout="@layout/activity_tool_loading"
app:progress="@{loadingProgress}"
app:loadingState="@{loadingState}" />

<include
layout="@layout/activity_tool_missing"
app:loadingState="@{loadingState}" />

<include
layout="@layout/activity_tool_offline"
app:loadingState="@{loadingState}" />
android:background="@color/black"
android:fitsSystemWindows="true">

<FrameLayout
android:id="@+id/mainContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:visibleIf="@{loadingState == LoadingState.LOADED}">
android:background="@{ManifestKt.getBackgroundColor(manifest)}">

<include
layout="@layout/activity_tool_loading"
app:loadingState="@{loadingState}"
app:progress="@{loadingProgress}" />

<include
layout="@layout/activity_tool_missing"
app:loadingState="@{loadingState}" />

<include
layout="@layout/activity_tool_offline"
app:loadingState="@{loadingState}" />

<org.cru.godtools.base.tool.widget.SimpleScaledPicassoImageView
<FrameLayout
android:id="@+id/mainContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:cropToPadding="false"
app:gravity="@{ManifestKt.getBackgroundImageGravity(manifest)}"
app:picassoFile="@{manifest.backgroundImage}"
app:scaleType="@{ManifestKt.getBackgroundImageScaleType(manifest)}"
app:visibleIf="@{manifest.backgroundImage != null}" />
app:visibleIf="@{loadingState == LoadingState.LOADED}">

<androidx.viewpager2.widget.ViewPager2
android:id="@+id/pages"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<org.cru.godtools.base.tool.widget.SimpleScaledPicassoImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:cropToPadding="false"
app:gravity="@{ManifestKt.getBackgroundImageGravity(manifest)}"
app:picassoFile="@{manifest.backgroundImage}"
app:scaleType="@{ManifestKt.getBackgroundImageScaleType(manifest)}"
app:visibleIf="@{manifest.backgroundImage != null}" />

<androidx.appcompat.widget.Toolbar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
android:background="@{ManifestKt.getLessonNavBarColor(manifest)}"
android:theme="@style/ThemeOverlay.GodTools.Toolbar.AppBar"
app:menuItemIconTint="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:navigationIconTint="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:overflowIconTint="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:subtitleTextColor="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:titleTextColor="@{ManifestKt.getLessonNavBarControlColor(manifest)}">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/pages"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>

<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="1"
android:progress="1"
app:indicatorColor="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:trackCornerRadius="4dp"
app:trackThickness="8dp"
app:visibleIf="@{loadingState == LoadingState.LOADED}"
tools:max="2"
tools:progress="1" />
</androidx.appcompat.widget.Toolbar>
<androidx.appcompat.widget.Toolbar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
android:background="@{ManifestKt.getLessonNavBarColor(manifest)}"
android:theme="@style/ThemeOverlay.GodTools.Toolbar.AppBar"
app:menuItemIconTint="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:navigationIconTint="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:overflowIconTint="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:subtitleTextColor="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:titleTextColor="@{ManifestKt.getLessonNavBarControlColor(manifest)}">

<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progress"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:max="1"
android:progress="1"
app:indicatorColor="@{ManifestKt.getLessonNavBarControlColor(manifest)}"
app:trackCornerRadius="4dp"
app:trackThickness="8dp"
app:visibleIf="@{loadingState == LoadingState.LOADED}"
tools:max="2"
tools:progress="1" />
</androidx.appcompat.widget.Toolbar>
</FrameLayout>
</FrameLayout>
</layout>

0 comments on commit 3e0970a

Please sign in to comment.