androidruler

repository·master·Indexed 19 days ago

https://github.com/yixiaolunhui/androidruler

A curated collection of Android custom ruler and scale implementations. It includes various open-source libraries and demos for UI components used to measure distances, angles, and time, or for selecting numeric values such as height and weight. Featured components include RulerAdjust, WheelView-Android, HorizontalWheelView, NoEndlessRuler, RulerView, DecimalScaleRulerView, and ScaleRulerView.

Tokens
6.6K
Snippets
19
Records
37
Agent score
65%

What's inside androidruler

  1. Overview of Android Ruler Demo Repository

    master
    This repository is a collection of various Android custom ruler (scale/ruler) implementations. It serves as a demo repository that aggregates different open-source libraries for measuring distances, angles, time, or selecting values (like height, weight, or money) using scrolling ruler views. Developers can use this repository to find a specific ruler implementation that fits their UI requirements, such as horizontal/vertical orientation, specific scale formats, or specialized modes like timeline views.
  2. Overview of RulerView

    master

    RulerView is a custom Android View designed to function as a ruler. It provides a visual scale that users can interact with, typically via sliding gestures. Key features include:

    • Configurable scale parameters: Set maximum values, minimum values, initial values, and interval increments.
    • Smooth interaction: Includes a snapping animation that stops the ruler at the nearest scale mark after sliding.
    • Real-time feedback: Displays the current numerical value of the ruler's position.
  3. Common Ruler Features and Capabilities

    master

    Based on the aggregated libraries in this repository, common features you can look for in an Android ruler implementation include:

    • Measurement Types: Distance (straight ruler), Angles (circular ruler), Time (timeline mode), and Weight/Height selection.
    • Customization: Font size/color, scale color/size (e.g., large, medium, small), tick mark intervals, and custom indicators/markers.
    • Interaction & Animation: Support for gestures like springBack, fling, and OverScroll; smooth scrolling via smoothScrollToPosition or smoothScrollToValue; and automatic alignment to ticks (setAutoAlign).
    • Modes: Horizontal or vertical orientation, and specialized modes like timeline mode (HH:mm) or normal ruler mode.
    • Data Handling: Dynamic value updates via listeners (e.g., OnScaleListener) and support for custom data display.
  4. Configure Ruler modes and visibility

    master

    The Ruler supports two distinct modes and three levels of tick mark visibility:

    Ruler Modes (ruler_mode)

    • timeline: A timeline format (e.g., 24-hour format HH:mm).
    • ruler: A standard ruler mode.

    Tick Visibility (unit_visible)

    Controls which tick marks (large, medium, or small) are rendered:

    • max: Only large tick marks are visible.
    • min: Both large and small tick marks are visible.
    • mid: Large, medium, and small tick marks are all visible.
  5. Configure RulerView scale and behavior

    master

    RulerView allows you to customize the scale properties to match your specific use case. You can control the range and the granularity of the markings using the following parameters:

    • Maximum Value: The upper limit of the ruler scale.
    • Minimum Value: The lower limit of the ruler scale.
    • Initial Value: The starting position of the ruler.
    • Interval Value: The distance/increment between each scale mark.
  6. Use the HorizontalRuler component

    master
    The HorizontalRuler is a UI component designed for horizontal sliding ruler functionality in Android. It allows users to interact with a ruler that can be configured with custom minimum and maximum values, providing flexibility for different measurement or selection use cases.