ml-opensource / ml-opensource/CutoutViewIndicator

Add new `OffsetHint` constants for disabling animations

Open
#78 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Java
Stars
21
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Credits to @agrosner for reporting this.

Currently, the value 0 (the standard 'disabled' value for an integer flag) is accepted by CutoutViewIndicator::setOffsetHints(int). Passing that to the function prevents any sort of offset in CutoutImageCell from working, which in turn prevents the indicator from...well, indicating anything.

To make this more transparent, and simpler for new users of the library, I propose two new OffsetHint constants:

  1. an explicit constant STOP_EVERYTHING with value 0
    • this'd disable offset-event visual effects
    • well, at least until a different value is set on the indicator
  2. a constant ONLY_ROUND_NUMBERS with value 1 << 4
    • that'd cause cells to only react to OffsetEvents which return an integer from ::getFraction()
    • ideally some minor rounding to handle floating-point nonsense

Also, a new convenience method or two for setting that second flag: not sure on the name(s), but the should have the same vibe as ::justShowTheSelectionsWithoutAnimatingAnything() and ::pleaseGoBackToAnimatingEverything().

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CutoutViewIndicator::setOffsetHints(int), CutoutImageCell, OffsetHint, and the existing methods ::justShowTheSelectionsWithoutAnimatingAnything() and ::pleaseGoBackToAnimatingEverything(). Define the requested constants and clarify the convenience-method names and floating-point rounding behavior before considering the feature complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.