All Projects → LightSun → Android Databinding

LightSun / Android Databinding

Licence: apache-2.0
this is the databinding framework of android . help to binding data to the view.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android Databinding

Paonet
【MVVM+RxJava2+AspectJ】泡网第三方客户端,网站主页:http://www.jcodecraeer.com/index.php
Stars: ✭ 374 (+302.15%)
Mutual labels:  demo, databinding
Beatplayer
Music Player
Stars: ✭ 117 (+25.81%)
Mutual labels:  android-studio, databinding
Cameraxdemo
A sample camera app with CameraX API from Android Jetpack
Stars: ✭ 112 (+20.43%)
Mutual labels:  android-studio, demo
Trailersapp
A simple demo project for The Movie DB based on MVVM clean architecture.
Stars: ✭ 180 (+93.55%)
Mutual labels:  android-studio, databinding
LiveData-DataBinding-Kotlin
Sample to practice LiveData + DataBinding
Stars: ✭ 89 (-4.3%)
Mutual labels:  android-studio, databinding
Chat-App-Android
Chat app based on the MVVM architecture using Kotlin, ViewModel, LiveData, DataBinding and more.
Stars: ✭ 70 (-24.73%)
Mutual labels:  android-studio, databinding
Name That Color Intellij Plugin
This plugin lets you insert a name for a color you copy-paste or type in an android resource file.
Stars: ✭ 157 (+68.82%)
Mutual labels:  android-studio, demo
Github-Trending-Repos
An Android App that lists the most trending repositories from Github.
Stars: ✭ 57 (-38.71%)
Mutual labels:  android-studio, databinding
Android Yolo
Real-time object detection on Android using the YOLO network with TensorFlow
Stars: ✭ 604 (+549.46%)
Mutual labels:  android-studio, demo
Godot Demos
Godot demos and tutorials
Stars: ✭ 88 (-5.38%)
Mutual labels:  demo
Csgoverview
A 2D demo replay tool for Counter Strike: Global Offensive.
Stars: ✭ 88 (-5.38%)
Mutual labels:  demo
Preact Todomvc
💣 TodoMVC done in Preact. Under 6kb and fast.
Stars: ✭ 88 (-5.38%)
Mutual labels:  demo
Tensorflow Demos
all kinds of demos of tensorflow code
Stars: ✭ 89 (-4.3%)
Mutual labels:  demo
Gatsby Demo Store
Elastic Path + Gatsby powered online store
Stars: ✭ 91 (-2.15%)
Mutual labels:  demo
Pdfmerge
Command-line utility for merging, splicing, and rotating PDF documents.
Stars: ✭ 88 (-5.38%)
Mutual labels:  pdf
Nextjs Starter
A starter project for Next.js with authentication
Stars: ✭ 1,313 (+1311.83%)
Mutual labels:  demo
Demo
Easy to use KubeVirt demo based on minikube.
Stars: ✭ 88 (-5.38%)
Mutual labels:  demo
Dropdot
☁️ Direct Upload to Amazon S3 With CORS demo. Built with Node/Express
Stars: ✭ 87 (-6.45%)
Mutual labels:  demo
Ngx Dynamic Form Builder
FormBuilder + class-transformer + class-validator = dynamic form group builder for Angular10+
Stars: ✭ 93 (+0%)
Mutual labels:  demo
Portablesigner2
PortableSigner - A Commandline and GUI Tool to digital sign PDF files with X.509 certificates
Stars: ✭ 92 (-1.08%)
Mutual labels:  pdf

this lib will not uphold. if you are interested in 'Data-Binding' please move to Data-Mediator.

这个库将不再维护。如果你对数据绑定感兴趣。推荐你去Data-Mediator. 这个库更加强大.

android-databinding

this framework is now can be used in your app. By test and test,by find bug and fix i think it is now can work with well. it helps you fast bind data and event. Plugin and xml schema file for this framework can be used now. 如果你熟悉汉语, 请点击看中文版

Demo Screen Capture Demo Screen Capture Demo Screen Capture

before build the sample project,you need to import the xml schema file of this databind framework, see it below. see [How to use plugin and xml schema ?]

Why I developed this ?

at google-io-2015. android databindingnow can be used, it have some problem, even if this is not the reason. because i think the engineer of google's is one of the best of the world. so it can be better and better i believe. I absolutely can not be compared with them. but i don't like to writing databinding expression in android layout file(in javaweb I hate it too ). so I developed this framework.

support plugin and xml schema

android studio plugin and the xml schema of config file which are used for android-databinding framework is now available .

Features

  • you can apply image property (round,borderColor,borderWidth,circle) by you like now. so to apply image property you must call like this.
DataBindingFactory.setImagePropertyApplier(new VolleyImageApplier()); //here i just use volley to load
  • supported by plugin and xml schema file.

  • support for bind data and event handler by xml. but you must call bind method in java code.

  • support for notify data change.

  • Support for custom attr and listener

  • support for bind adapter for any child of Adapter view or RecyclerView ( contains multi items and multi select mode of adapter )

  • support for bind image (like round/borderColor/borderWith/placeHolder/errorResId),see it bellow.

  • The common support attrs:

      //event name
      String ON_CLICK                =    "onClick";
      String ON_LONG_CLICK           =    "onLongClick";
      String TEXT_CHANGE_BEFORE      =    "textChange_before";
      String TEXT_CHANGE             =    "textChange";
      String TEXT_CHANGE_AFTER       =    "textChange_after";
      String ON_FOCUS_CHANGE         =    "onFocusChange";
    
      String ON_TOUCH                =    "onTouch";
    
      //common name
      String BACKGROUND              =    "background";       //drawable /color / res id
      String BACKGROUND_COLOR        =    "backgroundColor";
      String BACKGROUND_RES          =    "background_res";
    
      String TEXT                    =    "text";
      String TEXT_RES                =    "text_res";
    
      String TEXT_COLOR              =    "textColor";
      String TEXT_COLOR_RES          =    "textColor_res";
      String TEXT_COLOR_STATE        =    "textColor_state";
      String TEXT_COLOR_STATE_RES    =    "textColor_stateRes";
      String TEXT_SIZE               =    "textSize";
      String TEXT_SIZE_RES           =    "textSize_res";
    
      String VISIBILITY              =    "visibility";
      //image
      String IMGAE_URL               =    "img_url";
      String IMGAE_BITMAP            =    "img_bitmap";
      String IMGAE_DRAWABLE          =    "img_drawable";
      
     //ps:  and also support self-attrs 
    
  • Support multi expressions. eg: java calling expression (only nested ternary expression is not support), android resource reference expression {@drawable/ic_default} or R.drawable.ic_default , dp and sp like "15dp", and color like "#ff0000" and so on.

  • the image full config was supported now (round/circle/borderWith/borderColor/placeHolder).
    here is the demo:

     <bind id="eniv2">
          <property name="onClick" referVariable="eventHandler" > eventHandler.onClickImage()</property>
          <imageProperty type="round" referVariable="imageParam">  <!-- round / circle / oval -->
              <roundSize>{@dimen/corner_size}</roundSize>
              <borderWidth>5dp</borderWidth>
              <borderColor>#ff0000</borderColor>
    
              <url>imageParam.link</url>
              <default>{@drawable/ic_default}</default>     <!-- support drawable ,bitmap,  resource id -->
              <errorResId>R.drawable.ic_error</errorResId>  <!-- only support resource id -->
    
          </imageProperty>
      </bind>
    

    the more to see in sample/RoundImageBindTest Activity.

  • blog and pdf is at the bottom of this page.

####How to use plugin and xml schema ?

  • 1, click here to donwload the zip. It contains a xml schema file and a jar of android-databinding plugin.

  • 2 , Add the xml schema file (android_databinding.xsd )to android studio. and the URI must be 'http://schemas.android.com/heaven7/android-databinding/1'. And the xsd file can be found in the downloaded zip . add xsd file to as

  • 3, install the plugin 'android_databinding_plugin'. step: in android studio click file-> setting->plugins -> install plugin from disk and select the file android_databinding_plugin.jar which can be found in the downloaded zip file.

  • 4, at the res directory of android studio, right-click and select android-databinding then follow it. and then you can enjoy the android-databinding framework. use demo use demo

version log

Gradle

gradle config:

dependencies {
    compile 'com.heaven7.databinding:android-databinding:1.1.5'
}

Usage

The explanation of usage is moved to child directory. click to see it. Usage Detail

blog and pdf resource

if you are a chinese developer or know chinese. please click here to see more easier. chinese pdf

Compare to google's databinding

see it here. this currently only have chinese doc.

refer lib

android-common-util-light

TODO

  • support gesture image (also nested in viewpager)
  • support generate relative code.
  • add demo for fragment .
  • optimize the plugin to use easier.

issue

  • this framework i will try my best to uphold , and if you have a good suggestion about this, please tell me. Thanks!

About me

hope

i like technology. especially the open-source technology.And previous i didn't contribute to it caused by i am a little lazy, but now i really want to do some for the open-source. So i hope to share and communicate with the all of you.

License

Copyright 2015   
                heaven7([email protected])

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].