{"id":27003010,"url":"https://github.com/styropyr0/nowbar","last_synced_at":"2025-09-12T18:41:19.679Z","repository":{"id":283528410,"uuid":"952018257","full_name":"styropyr0/NowBar","owner":"styropyr0","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-29T18:26:45.000Z","size":900,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T19:27:28.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/styropyr0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-20T15:49:33.000Z","updated_at":"2025-03-29T18:26:48.000Z","dependencies_parsed_at":"2025-03-20T18:43:06.526Z","dependency_job_id":null,"html_url":"https://github.com/styropyr0/NowBar","commit_stats":null,"previous_names":["styropyr0/nowbar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FNowBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FNowBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FNowBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styropyr0%2FNowBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/styropyr0","download_url":"https://codeload.github.com/styropyr0/NowBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123068,"owners_count":20887261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-04T05:14:54.721Z","updated_at":"2025-04-04T05:14:55.290Z","avatar_url":"https://github.com/styropyr0.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **NowBar**\nThis project is a fan-made recreation of Samsung's Now Bar from One UI 7, built entirely with Jetpack Compose. It is not affiliated with or endorsed by Samsung in any way but serves as a tribute to their innovative UI design.\n\n---\n\n\u003cdiv style=\"display: flex; justify-content: center; gap: 10px;\"\u003e\n    \u003cimg src=\"./images/sc1.png\" alt=\"Screenshot 1\" width=\"300\"/\u003e\n    \u003cimg src=\"./images/sc2.png\" alt=\"Screenshot 2\" width=\"300\"/\u003e\n    \u003cimg src=\"./images/sc3.png\" alt=\"Screenshot 3\" width=\"300\"/\u003e\n    \u003cimg src=\"./images/sc4.png\" alt=\"Screenshot 3\" width=\"300\"/\u003e\n    \u003cimg src=\"./images/sc5.png\" alt=\"Screenshot 3\" width=\"300\"/\u003e\n\u003c/div\u003e\n\n## **NowBarWidget**\nThe **NowBarWidget** is inspired by Samsung's Now Bar lock screen interactive widget. It's a customizable widget system, providing gesture-based interactions and dynamic widgets. Below is the detailed API documentation:\n\n### **Parameters**\n```kotlin\n/**\n * NowBar Widget inspired from Samsung's Now Bar lockscreen interactive widget.\n * @param innerPadding The innerPadding for the widget.\n * @param widgets The list of widgets to be displayed. Accepts NowBarComponent type widgets. \n *                You can make your own NowBarComponent widget from NowBarComponent class.\n * @param modifier The modifier for the widget.\n * @param metrics The custom metrics object for the widget.\n * @param dragDirection The drag direction which is to be supported by the widget. \n *                      Accepts values from NowBarDragController enum.\n * @author Saurav Sajeev\n */\n@Composable\nfun NowBarWidget(\n    innerPadding: PaddingValues,\n    widgets: MutableList\u003cNowBarComponent\u003e,\n    modifier: Modifier = Modifier,\n    metrics: NowBarMetrics = NowBarMetrics(),\n    dragDirection: NowBarDragController = NowBarDragController.DRAG_UP\n)\n```\n\n---\n\n## **NowBarComponent**\n```kotlin\n/**\n * The NowBarComponent class represents a widget in the NowBar widget system.\n * @param widget The widget to be displayed.\n * @param dismissible A flag indicating whether the widget can be dismissed using the gesture.\n */\ndata class NowBarComponent(\n    val widget: @Composable () -\u003e Unit,\n    val dismissible: Boolean = true,\n)\n```\n\n---\n\n## **Customizable Widgets**\n### MediaPlayerWidget\n```kotlin\n/**\n * Media player widget that supports playing music and providing sharing functionality.\n * @param music A list of music resources with their corresponding titles.\n * @param innerPadding The inner padding values for the widget.\n */\n@Composable\nfun MediaPlayerWidget(music: List\u003cPair\u003cInt, String\u003e\u003e, innerPadding: PaddingValues)\n```\n\n### NotificationWidget\n```kotlin\n/**\n * Customizable notification widget that displays an icon, title, and content.\n * @param icon The resource ID of the icon to be displayed.\n * @param title The title of the notification.\n * @param content The content of the notification.\n * @param colorController The color controller for the notification.\n */\n@Composable\nfun NotificationWidget(\n    icon: Int,\n    title: String,\n    content: String,\n    colorController: NotificationColorController = NotificationColorController()\n)\n```\n\n### RoutinesWidget\n```kotlin\n/**\n * Customizable routines widget that displays a title and content.\n * @param title The title of the widget.\n * @param content The content of the widget.\n */\n@Composable\nfun RoutinesWidget(\n    title: String = \"Bixby Routines\",\n    content: String\n)\n```\n\n### SportsWidget\n```kotlin\n/**\n * Customizable sports widget that displays a title and content.\n * @param title The title of the widget.\n * @param content The content of the widget.\n */\n@Composable\nfun SportsWidget(title: String, content: String)\n```\n\n### TimerWidget\n```kotlin\n/**\n * Customizable timer widget that displays a title and content.\n * @param seconds The time in seconds.\n */\n@Composable\nfun TimerWidget(seconds: Int)\n```\n\n---\n\n## **NowBar Metrics**\n```kotlin\n/**\n * Data class representing NowBar metrics.\n * @param cornerRadius The corner radius of the now bar widget.\n * @param widgetHeight The height of the now bar widget.\n * @param translationClamp The translation clamp of the now bar widget.\n * @param shadowElevation The shadow elevation of the now bar widget.\n * @param fillMaxWidthOffset The fill max width offset of the now bar widget.\n * @param animationMultiplier The animation multiplier of the now bar widget.\n */\ndata class NowBarMetrics(\n    var cornerRadius: Dp = Dimensions.BorderRadius,\n    var widgetHeight: Dp = Dimensions.NowBarHeight,\n    var translationClamp: Pair\u003cFloat, Float\u003e = Dimensions.TranslationClamp,\n    var shadowElevation: Dp = Dimensions.ShadowElevation,\n    var fillMaxWidthOffset: Float = Dimensions.FillMaxWidthOffset,\n    var animationMultiplier: Int = 1\n)\n```\n\n---\n\n## **Notification Color Controller**\n```kotlin\n/**\n * Data class representing notification color controller.\n * @param backgroundColor The background color of the notification.\n * @param backgroundColorGradient The background gradient color of the notification.\n * @param iconColor The icon color of the notification.\n * @param titleColor The title color of the notification.\n * @param contentColor The content color of the notification.\n */\ndata class NotificationColorController(\n    var backgroundColor: Color = Color(0xFF303164),\n    var backgroundColorGradient: Brush? = null,\n    var iconColor: Color = Color.White,\n    var titleColor: Color = Color.White,\n    var contentColor: Color = Color.White\n)\n```\n\n---\n\n### **Example Code:**\nBelow is a sample implementation to get started:\n\n```kotlin\npackage com.matrix.nowbar\n\nimport android.os.Bundle\nimport androidx.activity.ComponentActivity\nimport androidx.activity.compose.setContent\nimport androidx.activity.enableEdgeToEdge\nimport androidx.compose.foundation.layout.Box\nimport androidx.compose.foundation.layout.PaddingValues\nimport androidx.compose.foundation.layout.fillMaxSize\nimport androidx.compose.foundation.layout.padding\nimport androidx.compose.material3.Scaffold\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.unit.dp\nimport com.matrix.nowbar.widgets.*\n\nclass MainActivity : ComponentActivity() {\n\n    val music = listOf(\n        R.drawable.bliever to \"Believer_Imagine Dragons\",\n        R.drawable.sit_next to \"Sit Next To Me_Foster The People\",\n        R.drawable.renegade to \"Renegade_Axwell /\\ Ingrosso\"\n    )\n\n    val widgets = mutableListOf(\n        NowBarComponent({ MediaPlayerWidget(music, PaddingValues.Absolute(0.dp)) }, isRemovable = false),\n        NowBarComponent({ TimerWidget(seconds = 65) }),\n        NowBarComponent({ RoutinesWidget(content = \"At work and 2 others running\") }),\n        NowBarComponent({\n            SportsWidget(\n                \"ICC Champions Trophy 2025 (Final)\\nIND vs NZ\",\n                \"IND won by 4 wickets\"\n            )\n        }),\n        NowBarComponent({\n            NotificationWidget(\n                R.drawable.ic_linkedin,\n                \"LinkedIn\",\n                \"You appeared in 54 searches last week.\",\n                colorController = NotificationColorController(\n                    backgroundColorGradient = Brush.linearGradient(\n                        colors = listOf(\n                            Color(0xFF0A66C2),\n                            Color(0xFFB3D5FA)\n                        )\n                    )\n                )\n            )\n        }),\n        NowBarComponent({\n            NotificationWidget(\n                R.drawable.ic_flipkart,\n                \"Arriving today\",\n                \"Your order Acer Predator Gaming Laptop is out for delivery.\",\n                colorController = NotificationColorController(\n                    backgroundColorGradient = Brush.linearGradient(\n                        colors = listOf(\n                            Color(0xFFFADC1E),\n                            Color(0xFF0D69B3)\n                        )\n                    )\n                )\n            )\n        })\n    )\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        enableEdgeToEdge()\n        setContent {\n            Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -\u003e\n                Box(\n                    modifier = Modifier\n                        .fillMaxSize()\n                        .padding(bottom = 50.dp),\n                    contentAlignment = Alignment.BottomCenter,\n                ) {\n                    NowBarWidget(innerPadding, widgets)\n                }\n            }\n        }\n    }\n}\n```\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyropyr0%2Fnowbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyropyr0%2Fnowbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyropyr0%2Fnowbar/lists"}