Code Monkey home page Code Monkey logo

Comments (5)

pakerfeldt avatar pakerfeldt commented on May 30, 2024

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.

xxv avatar xxv commented on May 30, 2024

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.

pakerfeldt avatar pakerfeldt commented on May 30, 2024

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.

xxv avatar xxv commented on May 30, 2024

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.

pakerfeldt avatar pakerfeldt commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.