Created
August 21, 2025 02:35
-
-
Save rainbow23/eb69b706e73a157b4b923a9ed654e687 to your computer and use it in GitHub Desktop.
two_pane.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<!-- 画面中央の垂直ガイドライン(比率は必要に応じて調整) --> | |
<androidx.constraintlayout.widget.Guideline | |
android:id="@+id/guideline_mid" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:orientation="vertical" | |
app:layout_constraintGuide_percent="0.5" /> | |
<!-- 左スロット:Material3 Dark を適用 --> | |
<FrameLayout | |
android:id="@+id/left_slot" | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:theme="@style/AppTheme.Material3.Dark" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintEnd_toStartOf="@id/guideline_mid" | |
app:layout_constraintTop_toTopOf="parent" | |
app:layout_constraintBottom_toBottomOf="parent"> | |
<!-- 共通レイアウトを直接 include --> | |
<include | |
android:id="@+id/include_left" | |
layout="@layout/content_common" | |
tools:ignore="DuplicateIds"/> | |
</FrameLayout> | |
<!-- 右スロット:Car UI を適用 --> | |
<FrameLayout | |
android:id="@+id/right_slot" | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
android:theme="@style/AppTheme.CarUi" <!-- parent=Theme.CarUi.WithToolbar を想定 --> | |
app:layout_constraintStart_toEndOf="@id/guideline_mid" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintTop_toTopOf="parent" | |
app:layout_constraintBottom_toBottomOf="parent"> | |
<!-- 共通レイアウトを直接 include --> | |
<include | |
android:id="@+id/include_right" | |
layout="@layout/content_common" | |
tools:ignore="DuplicateIds"/> | |
</FrameLayout> | |
<!-- 仕切り線(表示したい場合) --> | |
<View | |
android:layout_width="1dp" | |
android:layout_height="0dp" | |
android:background="@android:color/darker_gray" | |
app:layout_constraintStart_toStartOf="@id/guideline_mid" | |
app:layout_constraintEnd_toEndOf="@id/guideline_mid" | |
app:layout_constraintTop_toTopOf="parent" | |
app:layout_constraintBottom_toBottomOf="parent"/> | |
</androidx.constraintlayout.widget.ConstraintLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment