Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1547a08
Snackbar Updates
Dhruv-Mishra Aug 8, 2025
3f31223
Initial implementation
Dhruv-Mishra Aug 8, 2025
c3986a4
Improvements
Dhruv-Mishra Aug 8, 2025
de11efd
Added configuration to stack above
Dhruv-Mishra Aug 8, 2025
bc13139
Added removal animation, enforced stack limit
Dhruv-Mishra Aug 8, 2025
c3d5c43
Added expanded view
Dhruv-Mishra Aug 8, 2025
2c1a220
Added smooth state transitions
Dhruv-Mishra Aug 8, 2025
59d14cc
Smooth resize
Dhruv-Mishra Aug 8, 2025
edae3f0
Removing Dialog to Fix Animation Jank
Dhruv-Mishra Aug 9, 2025
b3debba
Last known good
Dhruv-Mishra Aug 9, 2025
1cdd1fe
Added Width Scale
Dhruv-Mishra Aug 9, 2025
3eac524
Fade Out Animation Responsive, added default scope within state
Dhruv-Mishra Aug 11, 2025
77d6260
Added thread safety
Dhruv-Mishra Aug 12, 2025
5e88da0
Working Hide Show Logic
Dhruv-Mishra Aug 17, 2025
525a99e
Refactor
Dhruv-Mishra Aug 17, 2025
07962ec
Before Mutex
Dhruv-Mishra Aug 17, 2025
192fada
After mutex and jank addition fix, before scrollable
Dhruv-Mishra Aug 17, 2025
8f781b3
Minor changes
Dhruv-Mishra Aug 17, 2025
487d768
Minor improvements
Dhruv-Mishra Aug 26, 2025
4238e39
improvements
Dhruv-Mishra Aug 26, 2025
eaa4c71
Added KDocs
Dhruv-Mishra Aug 26, 2025
ada9d9c
Added tokens
Dhruv-Mishra Aug 27, 2025
31d9750
Added scrollable behavior in expanded state
Dhruv-Mishra Sep 14, 2025
ec6c97d
Using only single list as source of truth
Dhruv-Mishra Sep 14, 2025
bfca4be
Minor improvements
Dhruv-Mishra Sep 14, 2025
1993efb
More improvements
Dhruv-Mishra Sep 14, 2025
e8951f0
Added Pop in Animation, Changed Card Order
Dhruv-Mishra Sep 14, 2025
2671951
Minor fix
Dhruv-Mishra Sep 14, 2025
c3d1395
Added configuration
Dhruv-Mishra Sep 15, 2025
115cb9d
KDocs updated
Dhruv-Mishra Sep 15, 2025
9a2e4ad
Simplified Layout, moved translations to graphics layer
Dhruv-Mishra Sep 16, 2025
313b95e
Added Scrim
Dhruv-Mishra Sep 19, 2025
9b03ff4
Adding Scrim Demo
Dhruv-Mishra Sep 19, 2025
9bed818
Added Dynamic Sized Cards In Expanded Mode
Dhruv-Mishra Sep 23, 2025
cf5b762
Added Snackbar Attributes in Model, removed content
Dhruv-Mishra Sep 23, 2025
bfc71dc
Modified Removal Animation, Added Trailing Fluent Icon
Dhruv-Mishra Sep 25, 2025
a81e334
Moved visibility to map and out of model
Dhruv-Mishra Sep 25, 2025
87ef9ee
Updated Heights To Use Map
Dhruv-Mishra Sep 26, 2025
80957ea
Minor changes
Dhruv-Mishra Sep 26, 2025
bf79e08
Added new activity
Dhruv-Mishra Sep 29, 2025
fc68570
Screen Width Calculation Update
Dhruv-Mishra Sep 29, 2025
5b8d535
Added KDocs and labels
Dhruv-Mishra Sep 29, 2025
ddc3de3
Added Offset Tokens For Providing Additional Offset
Dhruv-Mishra Sep 29, 2025
4692c13
Added Token in Demo
Dhruv-Mishra Sep 29, 2025
0d89162
Updated Controls and Params URLs
Dhruv-Mishra Sep 29, 2025
7ff9b1a
Created new release PR
Dhruv-Mishra Sep 30, 2025
f5a0a66
Incorporating Comment Suggestions
Dhruv-Mishra Oct 1, 2025
78cf990
Specified Explicit version for Compose Animation Module
Dhruv-Mishra Oct 3, 2025
a91b34c
Downgraded to a working verison
Dhruv-Mishra Oct 3, 2025
9ad9cba
Updated to maximum compatible version
Dhruv-Mishra Oct 6, 2025
17846d3
Package version upgrades
Dhruv-Mishra Oct 6, 2025
20a83f5
Trigger CI Rerun
Dhruv-Mishra Oct 8, 2025
b36c5b8
Merge branch 'master' into dhruvMishra/composeAnimationVersionUpgrade
Dhruv-Mishra Oct 8, 2025
1891218
Merge branch 'master' into dhruvMishra/fluent_release_0.3.10
Dhruv-Mishra Oct 8, 2025
8b2c4e7
Merge branch 'master' into dhruvMishra/addedOffsetTokenForBottomsheet
Dhruv-Mishra Oct 8, 2025
f1a8395
Merge branch 'master' into dhruvMishra/workingSnackbarStack
Dhruv-Mishra Oct 8, 2025
5a24921
Merge pull request #807 from microsoft/dhruvMishra/composeAnimationVe…
Dhruv-Mishra Oct 9, 2025
eece725
Merge pull request #801 from microsoft/dhruvMishra/workingSnackbarStack
Dhruv-Mishra Oct 9, 2025
559c4e6
Merge pull request #805 from microsoft/dhruvMishra/addedOffsetTokenFo…
Dhruv-Mishra Oct 9, 2025
c5c8b7f
Merge pull request #806 from microsoft/dhruvMishra/fluent_release_0.3.10
Dhruv-Mishra Oct 9, 2025
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
4 changes: 2 additions & 2 deletions FluentUI.Demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId 'com.microsoft.fluentuidemo'
minSdkVersion 23
targetSdkVersion 34
versionCode 2009
versionName '0.3.9'
versionCode 2010
versionName '0.3.10'
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
kotlinOptions {
Expand Down
1 change: 1 addition & 0 deletions FluentUI.Demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<activity android:name="com.microsoft.fluentuidemo.demos.V2ShimmerActivity" />
<activity android:name="com.microsoft.fluentuidemo.demos.V2SideRailActivity" />
<activity android:name="com.microsoft.fluentuidemo.demos.V2SnackbarActivity" />
<activity android:name="com.microsoft.fluentuidemo.demos.V2StackableSnackbarActivity" />
<activity android:name="com.microsoft.fluentuidemo.demos.V2TabBarActivity" />
<activity
android:name="com.microsoft.fluentuidemo.demos.V2TextFieldActivity"
Expand Down
12 changes: 4 additions & 8 deletions FluentUI.Demo/src/main/assets/dogfood-release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
Release version 0.3.9
Release version 0.3.10
What's new
Fluent v2:
Fix/enhancement:
1. Added elevation tokens for V2 Snackbar
2. Fluent V2 Native Controls Accessibility Fixes
3. Added Tooltip support for V2 AppBar, along with a new modifier to add tooltips to any component
4. Added TextOverflow Tokens for V2 ListItem
5. Fixed V2 AppBar Layout Focus Navigation
6. V2 Acrylic Pane now supports blur behind effect
7. Added a new default SearchViewModel for V2 Searchbar
1. Added new Stackable Snackbar Component which allows showing multiple notifications at once.
2. Fixed V2 BottomDrawer not dismissing on back button press when in focus
3. Added Offset Tokens for V2 BottomSheet to Offset the Anchors

Note:
The Demo App for Fluent Controls will now also be published on Github starting from v0.3.8
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import com.microsoft.fluentuidemo.demos.V2SegmentedControlActivity
import com.microsoft.fluentuidemo.demos.V2ShimmerActivity
import com.microsoft.fluentuidemo.demos.V2SideRailActivity
import com.microsoft.fluentuidemo.demos.V2SnackbarActivity
import com.microsoft.fluentuidemo.demos.V2StackableSnackbarActivity
import com.microsoft.fluentuidemo.demos.V2TabBarActivity
import com.microsoft.fluentuidemo.demos.V2TextFieldActivity
import com.microsoft.fluentuidemo.demos.V2ToolTipActivity
Expand Down Expand Up @@ -107,6 +108,7 @@ const val V2SEGMENTED_CONTROL = "V2 SegmentedControl"
const val V2SHIMMER = "V2 Shimmer"
const val V2SIDE_RAIL = "V2 SideRail"
const val V2SNACKBAR = "V2 Snackbar"
const val V2STACKABLE_SNACKBAR = "V2 StackableSnackbar"
const val V2TAB_BAR = "V2 TabBar"
const val V2TEXT_FIELD = "V2 TextField"
const val V2TOOL_TIP = "V2 ToolTip"
Expand Down Expand Up @@ -165,7 +167,7 @@ val V1DEMO = arrayListOf(
)

val V2DEMO = arrayListOf(
Demo(V2ACRYLICPANE, V2AcrylicPaneActivity::class, Badge.Modified),
Demo(V2ACRYLICPANE, V2AcrylicPaneActivity::class, Badge.New),
Demo(V2ACTION_BAR, V2ActionBarActivity::class),
Demo(V2APP_BAR_LAYOUT, V2AppBarActivity::class, Badge.Modified),
Demo(V2AVATAR, V2AvatarActivity::class),
Expand Down Expand Up @@ -198,6 +200,7 @@ val V2DEMO = arrayListOf(
Demo(V2SHIMMER, V2ShimmerActivity::class, Badge.Modified),
Demo(V2SIDE_RAIL, V2SideRailActivity::class),
Demo(V2SNACKBAR, V2SnackbarActivity::class, Badge.Modified),
Demo(V2STACKABLE_SNACKBAR, V2StackableSnackbarActivity::class, Badge.New),
Demo(V2TAB_BAR, V2TabBarActivity::class),
Demo(V2TEXT_FIELD, V2TextFieldActivity::class),
Demo(V2TOOL_TIP, V2ToolTipActivity::class),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
package com.microsoft.fluentuidemo.demos

import android.os.Build
import android.os.Bundle
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.BasicText
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.microsoft.fluentui.theme.token.FluentIcon
import com.microsoft.fluentui.tokenized.controls.Button
import com.microsoft.fluentui.tokenized.notification.Scrim
import com.microsoft.fluentui.tokenized.notification.SnackBarItemModel
import com.microsoft.fluentui.tokenized.notification.SnackBarStack
import com.microsoft.fluentui.tokenized.notification.SnackBarStackConfig
import com.microsoft.fluentui.tokenized.notification.rememberSnackBarStackState
import com.microsoft.fluentuidemo.V2DemoActivity
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch


class V2StackableSnackbarActivity : V2DemoActivity() {
init {
setupActivity(this)
}

override val paramsUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#params-37"
override val controlTokensUrl =
"https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-35"

@RequiresApi(Build.VERSION_CODES.N)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val context = this
setActivityContent {
SnackBarStackDemoLayout(context = context)
}
}
}

@Composable
fun BackgroundContent(context: V2StackableSnackbarActivity) {
val scrollState = rememberScrollState()
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
repeat(5) { index ->
Button(
onClick = {
Toast.makeText(context, "Button #$index pressed", Toast.LENGTH_SHORT).show()
},
text = "Button #$index",
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp)
)
Spacer(modifier = Modifier.height(10.dp))
}

Spacer(modifier = Modifier.height(24.dp))

repeat(20) { index ->
BasicText(
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
modifier = Modifier
.fillMaxWidth()
.padding(8.dp)
)
}
Spacer(modifier = Modifier.height(50.dp))
}
}

@Composable
fun SnackBarStackDemoLayout(context: V2StackableSnackbarActivity) {
Box() {
val stackState = rememberSnackBarStackState(
maxExpandedSize = 10,
maxCollapsedSize = 5
)
var counter by rememberSaveable { mutableIntStateOf(0) }
val scope = rememberCoroutineScope()
BackgroundContent(context)
Scrim(
isActivated = stackState.expanded && stackState.sizeVisible() > 0,
onDismiss = {}
)
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Bottom
) {

SnackBarStack(
state = stackState,
snackBarStackConfig = SnackBarStackConfig(
snackbarGapWhenExpanded = 10.dp
)
)
Spacer(modifier = Modifier.height(10.dp))
Row() {
Button(onClick = {
val id = counter++

stackState.addSnackbar(
SnackBarItemModel(
id = id.toString(),
message = "Snackbar #$id",
actionText = "Expand",
trailingIcon = FluentIcon(
Icons.Default.Close,
Icons.Default.Close,
contentDescription = "Close",
onClick = {
scope.launch {
stackState.removeSnackbarByIdWithAnimation(
id.toString(),
showLastHiddenSnackbarOnRemove = true
)
}
}
),
onActionTextClicked = {
stackState.toggleExpandedState()
})
)
}, text = "Add Snackbar")

Spacer(modifier = Modifier.width(12.dp))

Button(onClick = {
scope.launch {
stackState.clearAllSnackBars(animateRemoval = true)
}
}, text = "Clear All")

Spacer(modifier = Modifier.width(12.dp))
Button(onClick = {
scope.launch {
val id = counter++
for (i in 0..15) {
stackState.addSnackbar(
SnackBarItemModel(
id = "$id-$i",
message = "Snackbar #$id-$i".repeat(i + 4),
actionText = "Expand",
trailingIcon = FluentIcon(
Icons.Default.Close,
Icons.Default.Close,
contentDescription = "Close",
onClick = {
scope.launch {
stackState.removeSnackbarByIdWithAnimation(
"$id-$i",
showLastHiddenSnackbarOnRemove = true
)
}
}
),
onActionTextClicked = {
stackState.toggleExpandedState()
})
)
delay(2000)
}
}
}, text = "Keep Adding")
}
Spacer(modifier = Modifier.height(10.dp))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ import com.microsoft.fluentui.persona.PersonaListView
import com.microsoft.fluentui.theme.FluentTheme
import com.microsoft.fluentui.theme.ThemeMode
import com.microsoft.fluentui.theme.token.FluentAliasTokens
import com.microsoft.fluentui.theme.token.controlTokens.BottomSheetInfo
import com.microsoft.fluentui.theme.token.controlTokens.BottomSheetTokens
import com.microsoft.fluentui.theme.token.controlTokens.ButtonSize
import com.microsoft.fluentui.theme.token.controlTokens.ButtonStyle
import com.microsoft.fluentui.tokenized.bottomsheet.BottomSheet
Expand Down Expand Up @@ -150,6 +152,12 @@ private fun CreateActivityUI() {
val content = listOf(0, 1, 2)
val selectedOption = remember { mutableStateOf(content[0]) }

val customSheetTokens: BottomSheetTokens = object: BottomSheetTokens(){
override fun additionalOffset(bottomSheetInfo: BottomSheetInfo): Int {
return 0
}
}

BottomSheet(
sheetContent = sheetContentState,
expandable = expandableState,
Expand All @@ -161,7 +169,8 @@ private fun CreateActivityUI() {
enableSwipeDismiss = enableSwipeDismiss,
preventDismissalOnScrimClick = preventDismissalOnScrimClick,
stickyThresholdUpward = stickyThresholdUpwardDrag,
stickyThresholdDownward = stickyThresholdDownwardDrag
stickyThresholdDownward = stickyThresholdDownwardDrag,
bottomSheetTokens = customSheetTokens
) {
Column(
verticalArrangement = Arrangement.spacedBy(10.dp),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.microsoft.fluentuidemo.demos

import android.os.Build
import android.os.Bundle
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
Expand Down Expand Up @@ -59,6 +61,7 @@ class V2SnackbarActivity : V2DemoActivity() {
override val controlTokensUrl =
"https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-34"

@RequiresApi(Build.VERSION_CODES.N)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val context = this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class V2TabBarActivity : V2DemoActivity() {
setupActivity(this)
}

override val paramsUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#params-37"
override val paramsUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#params-38"
override val controlTokensUrl =
"https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-35"
"https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-36"

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class V2TextFieldActivity : V2DemoActivity() {
setupActivity(this)
}

override val paramsUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#params-38"
override val paramsUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#params-39"
override val controlTokensUrl =
"https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-36"
"https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-37"

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class V2ToolTipActivity : V2DemoActivity() {
setupActivity(this)
}

override val paramsUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#params-39"
override val controlTokensUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-37"
override val paramsUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#params-40"
override val controlTokensUrl = "https://github.com/microsoft/fluentui-android/wiki/Controls#control-tokens-38"

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ allprojects {
composeBomVersion = '2023.09.00'
composeTestVersion = '1.4.3'
composeCompilerVersion = '1.4.7'
composeAnimationVersion = '1.6.7'
composeRuntimeSaveableVersion = '1.6.7'
constraintLayoutVersion = '2.1.4'
constraintLayoutComposeVersion = '1.0.1'
espressoVersion = '3.5.1'
Expand Down
Loading