Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
986fbb5
Revised the README files for the adaptive apps samples.
JonEckenrode May 8, 2026
ba26ab6
Revised the README files for the adaptive apps samples.
JonEckenrode May 8, 2026
20b4646
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
5f3049d
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
3f86814
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
0f7b3fe
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
c11c3a7
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
4405b63
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
e516329
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
1711c9a
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
4e81c52
Merge branch 'adaptive-apps-samples-readme-reorg' of github.com:andro…
JonEckenrode May 8, 2026
1c76c83
Add FlexBox sample app and update .gitignore
JonEckenrode May 9, 2026
946fb69
Revert unintended README changes to align with origin/main
JonEckenrode May 9, 2026
ee36736
Address gemini-code-assist bot review feedback: use version catalog, …
JonEckenrode May 9, 2026
300dd22
Refactor MainScreen: remove unused width import, adjust modifier orde…
JonEckenrode May 9, 2026
1d52780
Simplify FlexBox sample project structure and strip unused MVVM boile…
JonEckenrode May 9, 2026
1986ca9
Update FlexBox heading, test assertions, and Example 3 basis/shrink p…
JonEckenrode May 10, 2026
ca8434a
Add README.md for FlexBox sample
JonEckenrode May 10, 2026
3eadf05
Update FlexBox README with latest revised text
JonEckenrode May 10, 2026
e6863b3
Update title and description in FlexBox packaging.yaml
JonEckenrode May 11, 2026
cd32aa4
Address code review feedback: refactor layout, eliminate Spacers, and…
JonEckenrode May 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.jetskicli/
15 changes: 15 additions & 0 deletions FlexBox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
16 changes: 16 additions & 0 deletions FlexBox/.google/packaging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
title: "Adaptive layouts using FlexBox in Jetpack Compose"
description: "A sample demonstrating how to use the FlexBox API in Jetpack Compose to build flexible, flow-based adaptive apps optimized for all form factors."
status: PUBLISHED
technologies: [Android, JetpackCompose]
categories:
- JetpackComposeLayouts
languages: [Kotlin]
solutions:
- Mobile
- JetpackNavigation
github: android/adaptive-apps-samples
level: INTERMEDIATE
apiRefs:
- android:androidx.compose.Composable
- android:androidx.compose.foundation.layout.FlexBox
license: apache2
8 changes: 8 additions & 0 deletions FlexBox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FlexBox layout sample

Build flexible, wrapped, and responsive column/row structures that adapt automatically to display dimensions using Jetpack Compose FlexBox layout APIs.

## Features demonstrated
- **Dynamic wrapping:** Content wrapped inside row/column lines as width adapts.
- **Basis and Shrink parameters:** Proportionally distributing space and shrinking elements under tight dimensions.
- **Alignment & gaps:** Configuring custom alignments and gaps between elements dynamically.
1 change: 1 addition & 0 deletions FlexBox/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
75 changes: 75 additions & 0 deletions FlexBox/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
}

android {
namespace = "com.example.flexboxsample"
compileSdk = 37
defaultConfig {
applicationId = "com.example.flexboxsample"
minSdk = 24
targetSdk = 37
versionCode = 1
versionName = "1.0"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
aidl = false
buildConfig = false
shaders = false
}

packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

kotlin {
jvmToolchain(17)
}

dependencies {
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
androidTestImplementation(composeBom)

// Core Android dependencies
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)

// Compose
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.foundation.layout)
// Tooling
debugImplementation(libs.androidx.compose.ui.tooling)
// Instrumented tests
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.test.manifest)

// Local tests: jUnit, coroutines, Android runner
testImplementation(libs.junit)

// Instrumented tests: jUnit rules and runners
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.espresso.core)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.example.flexboxsample

import androidx.activity.ComponentActivity
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onNodeWithText
import org.junit.Before
import org.junit.Rule
import org.junit.Test

/** UI tests for [FlexBoxSample]. */
class FlexBoxSampleTest {

@get:Rule val composeTestRule = createAndroidComposeRule<ComponentActivity>()

@Before
fun setup() {
composeTestRule.setContent { FlexBoxSample() }
}

@Test
fun flexboxExamples_exist() {
composeTestRule.onNodeWithText("FlexBox sample").assertExists()
composeTestRule.onNodeWithText("Example 0: Column direction (center)").assertExists()
}
}
22 changes: 22 additions & 0 deletions FlexBox/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.MyApplication">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading
Loading