Comments (5)
I suppose you are talking about attributes like our sidebuffer and the need of defining the namespace like xmlns:app="http://schemas.android.com/apk/res/your.application.package.here" in your layout XML. AFAIK, this is the standard (and only) way of consuming custom XML attributes in Android. Please comment this issue if you believe it could be done elsewise and I'll have it re-opened.
from android-viewflow.
Yeah, that's what I was referring to.
The technique I was thinking of (attrs.getAttributeValue(NS, "your_attr")) does allow for custom namespaces, but seems to bypass the whole theming system (which is bad). I still think it's more complex than it should be for reusable widgets, but it also seems to be standard.
from android-viewflow.
I actually don't think that the xmlns:app thingy is all that bad. And after all, we could add the feature of setting the sidebuffer programmatically as well, just to give an alternative way of defining a side buffer. Would that be satisfying you think?
from android-viewflow.
My main issue with the app-specific namespace is that that it adds a dependency on your app and makes the widget less reusable. Ideally, it should be as easy to use a custom widget as it is to use a MapView (hopefully without all the bugs or special activities). One should be able to put a bit of sample code out that you can copy into your activity without having to adjust a namespace string.
I think this could be accomplished using an Android library for the widget, but I need to investigate further to really understand what's going on. The whole Android style/theming system is a bit of a kludge and it's hard to see how it's intended to be used properly when you aren't the main Android source.
from android-viewflow.
You could very well publish a re-usable code snippet by simply leave out the sidebuffer attribute, thus getting rid of the app specific namespace. It would get a default sidebuffer value assigned to it though, but still, it would be perfectly re-usable without any change needed.
from android-viewflow.
Related Issues (20)
- adapter getview position always return 0?
- How to make the margin between images become zero? HOT 1
- how to run the examples ?
- "ant jar" build failure
- how to adjust the sensitivity of the switching bewteen views?
- native typeface cannot be made
- Inflate the same Layout?
- viewflow cause memory leak? HOT 2
- Unable to set Text for other layout HOT 1
- the return value of method getSelectedItemPosition() is not refreshed instantly
- NullPointerException occurs randomly while scrolling
- Increase Size of CircleFlowIndicator HOT 1
- ViewFlow displays only one title for Holo Light Theme.
- Request
- How to add Settings in DiffViewFlow
- the master version can`t support API below Level 11 HOT 13
- java.lang.NoSuchMethodError: android.view.View.getMeasuredState HOT 2
- view flow inside list view HOT 1
- Problem on ExpandableListView HOT 1
- IndexOutOfBoundException 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 android-viewflow.