Comments (4)
It would probably be simplest to add a new method to ShakeDelegate
that you can optionally override to set the sensitivity int. I'm skeptical that there are enough other things people would want to customize to be worth letting them set a custom ShakeDetector
(but feel free to disagree and explain why).
Happy to accept a PR for this, thanks for flagging it :)
from shaky-android.
That's interesting, I actually hadn't thought about that.
In my mental conception of the entities, ShakeDelegate was the thing you delegated the shake event to, to figure out how to process it. I didn't expect it to have any configuration for the ShakeDetector, though I see now that it already does a little bit of that (isEnabled()).
I'm not yet sure how I feel about that, it seems odd to be injecting something to a ShakeDetector that both configures it and processes its output. They seem like two semantically different things to me, so I would have assumed you would inject a ShakeDetectionConfiguration and a ShakeDelegate separately.
Am I thinking about your modeling the wrong way?
from shaky-android.
From a "pure" modeling perspective, your approach is probably more correct. My reasoning is mostly just that this is a fairly simple library and I was hoping to keep a fairly simple API, where most things just work out of the box with no configuration.
ShakeDelegate
is maybe not the greatest name because I'm really thinking of it as the way the app hooks into the library, both for configuration and for processing. It's possible we might want to separate out two objects like you described, but since isEnabled
is already in ShakeDelegate
, we can't do that without a breaking change.
So how about for now we just add the extra method to ShakeDelegate
and then if we keep getting more requests for configuration options, I'll make a major version bump down the line and separate it out into a separate configuration object. I'm hoping that strikes the right balance between correctness and practicality, what do you think?
from shaky-android.
Sent in a basic PR based off of your comments. Held off on doing anything too fancy for now, though I did restrict knowledge of the Seismic constants to the one class that interacts with Seismic, and created corresponding values for within Shaky.
Not ideal, but leaking abstractions or using weaker modeling (strings or something) made me a little uncomfortable.
Ankur
from shaky-android.
Related Issues (17)
- Allow views to be theme-able
- imageUri overwrites original image (preventing undo after re-drawing)
- google map screenshot
- Customized email fragment
- Failed to resolve: com.linkedin.shaky:shaky:2.0.1 HOT 7
- Draw paths not translated if user rotates device while drawing
- Support for Oauth / user accounts
- send feedback option is not available HOT 1
- App crash during Feedback
- Screenshots don't grab all views (e.g., popup dialogs) HOT 1
- JCenter is shutting down 1st May 2021, can the dependency move to another repository? HOT 3
- Is there any alternative shortcut instead of SHAKE? HOT 1
- Support for manual feedback creation
- Dialog button text color is not visible
- Exception on Android S API 31 re permission HIGH_SAMPLING_RATE_SENSORS HOT 1
- Small Screenshot on Markup Screen HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shaky-android.