Android Compose wheel picker library based on LazyColumn in vertical and LazyRow in horizontal.

Last update: Aug 1, 2022

About

Android Compose wheel picker library based on LazyColumn in vertical and LazyRow in horizontal.

Gradle

Sample

Default Item size Unfocused count Custom divider Custom focus
Scroll to index Observe index Custom content wrapper Reverse layout Horizontal

Default

FVerticalWheelPicker(
    modifier = Modifier.width(60.dp),
    // Specified item count.
    count = 50,
) { index ->
    Text(index.toString())
}

Item size

FVerticalWheelPicker(
    // ......
    // Specified item height.
    itemHeight = 60.dp,
) {
    // ......
}

Unfocused count

FVerticalWheelPicker(
    // ......
    // Specified unfocused count.
    unfocusedCount = 2,
) {
    // ......
}

Custom divider

FVerticalWheelPicker(
    // ......
    focus = {
        // Custom divider.
        FWheelPickerFocusVertical(dividerColor = Color.Red, dividerSize = 2.dp)
    },
) {
    // ......
}

Custom focus

FVerticalWheelPicker(
    // ......
    // Custom focus.
    focus = {
        Box(modifier = Modifier
            .fillMaxSize()
            .border(width = 1.dp, color = Color.Gray))
    },
) {
    // ......
}

Scroll to index

// Specified initial index.
val state = rememberFWheelPickerState(10)
LaunchedEffect(state) {
    delay(2000)
    // Scroll to index.
    state.animateScrollToIndex(20)
}

FVerticalWheelPicker(
    // ......
    // state
    state = state,
) {
    // ......
}

Observe index

  • FWheelPickerState.currentIndex - Index of picker when it is idle.
  • FWheelPickerState.currentIndexSnapshot - Index of picker when it is idle or scrolling but not fling.
val state = rememberFWheelPickerState()
FVerticalWheelPicker(
    // ......
    // state
    state = state,
    // Index change callback
    onIndexChanged = {
        Log.i(TAG, "onIndexChanged ${state.currentIndex}")
    },
) {
    // ......
}

// Observe currentIndex, It is same with the onIndexChanged callback.
LaunchedEffect(state) {
    snapshotFlow { state.currentIndex }
        .distinctUntilChanged()
        .collect {
            Log.i(TAG, "currentIndex ${state.currentIndex}")
        }
}

// Observe currentIndexSnapshot.
LaunchedEffect(state) {
    snapshotFlow { state.currentIndexSnapshot }
        .distinctUntilChanged()
        .collect {
            Log.i(TAG, "currentIndexSnapshot ${state.currentIndexSnapshot}")
        }
}

Custom content wrapper

FVerticalWheelPicker(
    // ......
    // Content wrapper
    contentWrapper = { index, state ->
        if (state.currentIndexSnapshot == index) {
            content(index)
        } else {
            // Modify content if it is not in focus.
            Box(
                modifier = Modifier
                    .rotate(90f)
                    .alpha(0.5f)
            ) {
                content(index)
            }
        }
    }
) {
    // ......
}

Reverse layout

FVerticalWheelPicker(
    // ......
    // Reverse layout.
    reverseLayout = true,
) {
    // ......
}

Horizontal

FHorizontalWheelPicker is almost the same as FVerticalWheelPicker.

FHorizontalWheelPicker(
    modifier = Modifier.height(60.dp),
    // Specified item count.
    count = 50,
) { index ->
    Text(index.toString())
}

GitHub

https://github.com/zj565061763/compose-wheel-picker
Comments
  • 1. Adaptive Sync Not Working

    Hi,

    Thanks for making this program! When I apply a 3dlut, Adaptive Sync is disabled. I do not game, but the windows Movies & TV UWP video player uses Adaptive Sync to match the display + video framerates to eliminate judder. Is this something that can be fixed?

    Reviewed by perrinpagess at 2021-11-28 12:20
  • 2. Add ability to specify LUT file paths via command argument

    DwmLut has some useful command arguments right now. However, if user wants to switch between different lut files via command, he has to edit config.xml then run with -apply.

    This is attempt to fill the void by supporting two extra arguments "-sdr" and "-hdr". Example:

    DwmLutGUI.exe -sdr "1:C:\luts\1\sdr.lut;2:C:\luts\2\sdr.lut" -hdr "1:C:\luts\1\hdr.lut;2:C:\luts\2\hdr.lut" -apply -exit
    

    This example sets monitor 1's SDR lut to "C:\luts\1\sdr.lut", and monitor 2's SDR lut to "C:\luts\2\sdr.lut". Similar to HDR luts.

    Also, paths set via this way does not permanently change the content of config.xml. This suits the "temporary" nature of this argument.

    What do you think?

    Reviewed by CrendKing at 2022-03-15 07:12
  • 3. Incompatible with HDCP Protected Content (Netflix)

    When playing DRM protected content, HDCP activates and causes one or two black flashes of the screen. The LUT is unloaded. The application status becomes "Inactive". And the video begins playing.

    As a reminder, High-bandwidth Digital Content Protection (HDCP) is used for DRM on video streaming services.

    Instructions:

    1. Launch dwm_lut and press Apply
    2. Log into a video streaming platform, like Netflix, Amazon Prime, BBC iPlayer, etc.
    3. Play a video (I recommend testing on Firefox. It shows a HDCP icon in the address bar whenever it kicks in.)

    I don't know what you could do about this. Maybe reactivate once HDCP is no longer active?

    Reviewed by Terrobility at 2021-11-26 07:37
  • 4. Not working with Intel HD3000

    On Windows 11. Says active but no change in color output is seen. Oddly with a generic Microsoft driver active did work as expected. According to GPU-Z the generic driver supports OpenGL 2.1, the Intel driver supports OpenGL 3.1 with many report on the web talking about wonky OpenGL support.

    Any testing I can do? Let me know.

    Reviewed by markanini at 2022-04-12 19:39
  • 5. Using LUT with Netflix app causes screen to pixelate

    Applying the LUT while the Netflix app is running causes the screen to become pixelated and unusable. Disabling the LUT immediately resolves the issue. I also tried with the native Hulu and Amazon Prime Video apps and it did not reproduce. Not a big deal to turn it off, though.

    Example of the issue https://photos.app.goo.gl/r4ta6sHf8H8NBUUZ8

    Reviewed by adbowers at 2021-09-10 21:49
  • 6. Inacuracy in the shadows

    I found it looks different when I apply my calibration LUT to LUT stress test image in Resolve, compared to loading it into DwmLut. I can't show it, because (luckily) screenshots aren't affected by the LUT, but it makes shadows desaturated, compared to applying the LUT in Resolve. Also it looks like there is some downsizing of the cube size of the LUT before applying the LUT. Probably this is the reason for the artifact I got?

    Reviewed by antonmeleshkevich at 2021-11-21 22:22
  • 7. Extended Display and 2 GPU's

    @ledoge First of all I want to thank you for your work and for this product. It is trully a great tool and it saved me the trouble and money because I was set on buying a new monitor before finding this tool!

    Now, the problem I encountered. My laptop has 2 GPU's. An integrated one and a dedicated one. My laptop is always in hybrid mode because I usually use my laptop on different places and I need the battery life when I'm on the go. If the laptop is in hybrid mode, when I use both monitors at the same time (in extended mode), both monitors are assigned the same number (1) in DWM_LUT. This causes the program to assign the lut but a few seconds later the screen goes black and then the program goes to the state of "inactive". If I disable hybrid mode (dedicated gpu only), the program assigns different numbers to the displays, Laptop display number one and external display number 2, and the luts are applied.

    Maybe a simple fix would be to not allow the program to assign the same number to different monitors. If a number is already assigned, then the program assigns a different number.

    iGPU + dGPU (same number applied to both monitors) iGPU + dGPU

    dGPU only (different number applied to the monitors) dGPU

    Reviewed by dimipisi at 2022-05-08 14:55
  • 8. how to create cube file from icm profile ?

    hey im using an icm profile in novideo_srgb just fine. scrolling through the hue in photoshop color picker results in no obvious banding. using the same profile converted to a cube file used in dwm_lut gives heavy banding instead . i guess its not the fault of the program but rather a conversion issue.

    I used DisplayCAL-3DLUT-maker.exe to convert back but maybe you know a better way , would be nice if we could just load the icm like novideo_srgb does

    Reviewed by Ulf3000 at 2022-04-10 14:03
  • 9. Installer and Automatic Start/Restart

    @ledoge Have you considered creating an installer/uninstaller with an option in dwm_lut to automatically start with Windows and then also automatically restart it when the power state has changed?

    I've accomplished the automatic start and restart on power state change here with a scheduled task: https://hub.displaycal.net/forums/topic/i-made-a-tool-for-applying-3d-luts-to-the-windows-desktop/page/10/#post-34665

    I think this would make the tool even more accessible in a professional environment.

    Reviewed by aaronmmarks at 2022-03-29 14:42
  • 10. "Failed to load or initialize DLL...." on Windows 11 22H2

    Im getting "Failed to load or initialize DLL. This probably means that a LUT file is malformed or that DWM got updated." on Windows 11 Version 22H2 (OS Build 22581.100)

    Reviewed by Fardin48 at 2022-03-29 13:20
  • 11. UI Suggestion: multiple LUTS for a monitor in UI

    Hi, I would like to thank you for the tool and suggest an UI change: maybe it is possible to make UI look more like a DisplayCal Loader - where you select a monitor and below you have a selectable list of LUT files for this monitor. For example, in my case I have 3 profiles - for Full Gamut L75, Full Gamut L100 and sRGB emulation L100 - currenly it is not very convenient to select the profile - you have to navigate to a folder every time (multiple folders if profiles are in different folders).

    Reviewed by avastfake25 at 2022-03-25 00:10
Wheel-like spinner widget for Android

Update Dec 2016 Library is discontinued There's still a lot of wheel libraries out there. Update Oct 2014 I am thinking of rewriting this control. Upd

Jul 16, 2022
Aug 9, 2022
A material Date Range Picker based on wdullaers MaterialDateTimePicker
A material Date Range Picker based on wdullaers MaterialDateTimePicker

Material Date and Time Picker with Range Selection Credits to the original amazing material date picker library by wdullaer - https://github.com/wdull

Aug 12, 2022
A material Date Range Picker based on wdullaers MaterialDateTimePicker
A material Date Range Picker based on wdullaers MaterialDateTimePicker

Material Date and Time Picker with Range Selection Credits to the original amazing material date picker library by wdullaer - https://github.com/wdull

Aug 9, 2022
JetCountrypicker - Country code bottomsheet picker in Jetpack Compose
JetCountrypicker - Country code bottomsheet picker in Jetpack Compose

JetCountryPicker Country code bottomsheet picker in Jetpack Compose How to add i

Aug 4, 2022
A simple compose weight picker drawn with canvas.

CanvasWeightPicker A simple compose weight picker drawn with canvas. Features Drag scale to select weight Haptic feedback on weight selected Video of

Jul 28, 2022
A customizable, easy-to-use, and functional circular time range picker library for Android
A customizable, easy-to-use, and functional circular time range picker library for Android

A customizable, easy-to-use, and functional circular time range picker library for Android. Use this library to mimic Apple's iOS or Samsung's bedtime picker.

Aug 7, 2022
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments

/!\ This Project is no longer maintained /!\ DialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numb

Jul 20, 2022
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments

/!\ This Project is no longer maintained /!\ DialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numb

Jul 20, 2022
Android time range picker

TimeRangePicker TimeRangePicker is a library which can be used to select a time range. WARNING Requires android-support-v4 Description This library pr

Jan 19, 2022
A date time range picker for android written in Kotlin
A date time range picker for android written in Kotlin

DateTimeRangePicker A date time range picker for android Usage Firstly, grab latest release of the library via JitPack. And note that, it utilizes Jod

May 19, 2022
Simplge ImageGallery Picker
Simplge ImageGallery Picker

SimpleImagePicker add camera and files permissions to manifest file <uses-permission android:name="android.permission.CAMERA" /> <uses-permiss

Nov 27, 2021
Time-DatePicker - A Simple Time Date Picker With Kotlin

Time-DatePicker Time.DatePicker.mp4

Jan 19, 2022
Android interval timer app using compose + compose navigation, dagger hilt, room, kotlin coroutines + flow and mvvm design pattern.
Android interval timer app using compose + compose navigation, dagger hilt,  room, kotlin coroutines + flow and mvvm design pattern.

What's InTime? ⏳ InTime is an interval timer application using android jetpack components and a long running service. The purpose of this project is t

Aug 2, 2022
JetCalendarView - A calendar library for Jetpack Compose
JetCalendarView - A calendar library for Jetpack Compose

JetCalendar WIP 2022 Hit Refresh! Calendar view ❤️ Jetpack Compose License Copyr

Aug 17, 2022
Android DatePicker with month and year build with Compose UI
Android DatePicker with month and year build with Compose UI

Compose Date Picker - Select month and year Compose Date Picker tries to offer you the year and month pickers which you can customize for your require

Jul 17, 2022
Kalendar - A calendar to integrate Calendar with Custom design in your jetpack compose project
Kalendar - A calendar to integrate Calendar with Custom design in your jetpack compose project

Kalendar - An Elementary Compose Calendar. This is a calendar to integrate Calen

Aug 10, 2022
Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.

Android Week View Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling. Fea

Aug 1, 2022
An android library which provides a compact calendar view much like the one used in google calenders.
An android library which provides a compact calendar view much like the one used in google calenders.

CompactCalendarView CompactCalendarView is a simple calendar view which provides scrolling between months. It's based on Java's Date and Calendar clas

Aug 1, 2022