Giter Site home page Giter Site logo

androidbound's People

Contributors

bblackbelt avatar hamen avatar mrsasha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

androidbound's Issues

Binder checks type when binding through ValueConverter

When binding using ValueConverter - like binding="{Text @= LocalizedFullName(Profile)}", the binder still checks types when binding and complains that object Profile cannot be cast to String required by the method Text:

Error occurred while binding Profile to target Text: org.sharethemeal.app.user.models.Friend$FriendProfile cannot be cast to java.lang.String

Fix example (doesn't use binding)

needed examples:

Activities

  • normal activity
  • bindable activity

UI

  • textview
  • button
  • edittext
  • listview
  • image
  • layout

Binding commands

  • text
  • click
  • font
  • visibility
  • long click
  • resource
  • source
  • items source
  • text color
  • background color
  • text string (edittext)

Custom stuff

  • value converter

allow ValueConverter parameters without ''

currently ValueConverter only interprets parameters inside '', which means that

binding="{Text @= LocalizedFullName(Profile.Firstname, 'Profile.Lastname')}"

sees the parameter, but

binding="{Text @= LocalizedFullName(Profile.Firstname, Profile.Lastname)}"

doesn't, which doesn't allow us to bind to objects as parameters.

viewbinding doesn't work on android 4.4

presumably on all versions 11 < x < 21, it's a bug regarding the support libraries. There's a code in the android.support.v4.view.LayoutInflaterCompatHC that helps.

BindableAcitivities delete all bindings when destroyed

If the call happens too late - as it does with Android, you can actually have two activities open at the same time - then it will also delete binding of other activities. It should just delete the calling activity's parent view bindings.

Parsing null specs shouldn't crash

when parsing binding strings likebinding="{SourceUri @= OptimizedImageUrl(Achievement.ImageUrl, '70, 1.0, png, 80, fill')}}", that extraneous } at the end will confuse the parser and he will try to parse the spec which is null.

here's the (incomplete) stacktrace:

09-06 11:59:37.731: E/AndroidRuntime(17922): FATAL EXCEPTION: main
09-06 11:59:37.731: E/AndroidRuntime(17922): Process: org.sharethemeal.app.android, PID: 17922
09-06 11:59:37.731: E/AndroidRuntime(17922): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
09-06 11:59:37.731: E/AndroidRuntime(17922):    at solutions.alterego.androidbound.factories.SourceBindingFactory.create(SourceBindingFactory.java:23)
09-06 11:59:37.731: E/AndroidRuntime(17922):    at solutions.alterego.androidbound.binding.BindingAssociationEngine.createTargetBinding(BindingAssociationEngine.java:106)
09-06 11:59:37.731: E/AndroidRuntime(17922):    at solutions.alterego.androidbound.binding.BindingAssociationEngine.<init>(BindingAssociationEngine.java:47)
09-06 11:59:37.731: E/AndroidRuntime(17922):    at solutions.alterego.androidbound.binding.TextSpecificationBinder.bind(TextSpecificationBinder.java:49)
09-06 11:59:37.731: E/AndroidRuntime(17922):    at solutions.alterego.androidbound.ViewBinder.bindViewToSource(ViewBinder.java:197)
09-06 11:59:37.731: E/AndroidRuntime(17922):    at solutions.alterego.androidbound.ViewBinder.checkAndBindView(ViewBinder.java:187)
09-06 11:59:37.731: E/AndroidRuntime(17922):    at 

NPE in ViewModel.dispose()

05-22 15:51:47.779: E/AndroidRuntime(9493): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void rx.subjects.PublishSubject.onCompleted()' on a null object reference
05-22 15:51:47.779: E/AndroidRuntime(9493):     at solutions.alterego.androidbound.ViewModel.dispose(ViewModel.java:42)
05-22 15:51:47.779: E/AndroidRuntime(9493):     at solutions.alterego.androidbound.android.BindingAppCompatActivity.onDestroy(BindingAppCompatActivity.java:40)
05-22 15:51:47.779: E/AndroidRuntime(9493):     at org.sharethemeal.app.core.BaseBindingActivity.onDestroy(BaseBindingActivity.java:137)

library cleanup

some small tasks that should be done:

  • add namespaces for attributes
  • fix missing styling support in view constructors - test
  • check implements INotifyPropertyChanged usage - is it necessary?

binder doesn't see inherited methods/properties?

If you try to bind to one of the inherited methods/properties of the object, it won't work. It seems that it doesn't work even if you add the corresponding property getter method to the object.

example:

public class Original {
    public DateTime date;
}

public class OriginalChild extends Original {
    public DateTime getDate();
}

binding to date won't work!

add detailed wiki

we need the following:

  • binding types list with explanations
  • supported widgets list, with supported bindings
  • lifecycle guide
  • value converter guide
  • font manager
  • debugging guide

BindingSpecificationParser fails if the group is closed twice

If the binding finishes with double }} the BindingSpecificationParser will call parseMode with null string, and it will then crash:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
                                                       at solutions.alterego.androidbound.parsers.BindingSpecificationParser.parseMode(BindingSpecificationParser.java:122)
                                                       at solutions.alterego.androidbound.parsers.BindingSpecificationParser.parse(BindingSpecificationParser.java:107)
                                                       at solutions.alterego.androidbound.parsers.BindingSpecificationParser.parse(BindingSpecificationParser.java:16)
                                                       at solutions.alterego.androidbound.parsers.BindingSpecificationListParser.parse(BindingSpecificationListParser.java:52)
                                                       at solutions.alterego.androidbound.parsers.BindingSpecificationListParser.parse(BindingSpecificationListParser.java:11)
                                                       at solutions.alterego.androidbound.binders.TextSpecificationBinder.bind(TextSpecificationBinder.java:41)
                                                       at solutions.alterego.androidbound.android.BindableLayoutInflaterFactory$InflaterFactoryBase.bindView(BindableLayoutInflaterFactory.java:107)
                                                       at solutions.alterego.androidbound.android.BindableLayoutInflaterFactory$2.onCreateView(BindableLayoutInflaterFactory.java:64)
                                                       at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:171)
                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                                                       at solutions.alterego.androidbound.ViewBinder.inflate(ViewBinder.java:193) 
                                                       at solutions.alterego.androidbound.example.MainActivity.onCreate(MainActivity.java:27) 

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.