Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
meikpiep committed Feb 21, 2025
1 parent 54b991b commit c6e0883
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import android.view.MenuItem
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.appbar.MaterialToolbar
Expand All @@ -32,6 +34,40 @@ class LoadGameListActivity : AppCompatActivity() {

val recyclerView = findViewById<RecyclerView>(android.R.id.list)

ViewCompat.setOnApplyWindowInsetsListener(
findViewById<RecyclerView>(R.id.saveGameAppBar),
) { v, insets ->
val innerPadding =
insets.getInsets(
WindowInsetsCompat.Type.systemBars()
or WindowInsetsCompat.Type.displayCutout(),
)
v.setPadding(
innerPadding.left,
innerPadding.top,
innerPadding.right,
0,
)

WindowInsetsCompat.CONSUMED
}

ViewCompat.setOnApplyWindowInsetsListener(recyclerView) { v, insets ->
val innerPadding =
insets.getInsets(
WindowInsetsCompat.Type.systemBars()
or WindowInsetsCompat.Type.displayCutout(),
)
v.setPadding(
innerPadding.left,
0,
innerPadding.right,
innerPadding.bottom,
)

WindowInsetsCompat.CONSUMED
}

activityUtils.configureTheme(this)
activityUtils.configureFullscreen(this)

Expand Down
5 changes: 3 additions & 2 deletions gauguin-app/src/main/res/layout/activity_savegame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liftOnScroll="true">
>

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/saveGameAppBar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
app:title="@string/load_game_screen_title"
app:menu="@menu/save_game_app_bar"
app:navigationIcon="@drawable/outline_arrow_back_24"
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface"
app:layout_scrollFlags="scroll|enterAlways|snap"
android:elevation="4dp"/>

</com.google.android.material.appbar.AppBarLayout>
Expand Down

0 comments on commit c6e0883

Please sign in to comment.