Last active
December 1, 2016 02:52
-
-
Save Qixingchen/ff42cd45e2a1185b5e3f6d9eee5640c2 to your computer and use it in GitHub Desktop.
ActivityMainBinding in library & application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file is in application | |
package moe.xing.databindingnogetter.databinding; | |
import moe.xing.databindingnogetter.R; | |
import moe.xing.databindingnogetter.BR; | |
import android.view.View; | |
public class ActivityMainBinding extends android.databinding.ViewDataBinding { | |
private static final android.databinding.ViewDataBinding.IncludedLayouts sIncludes; | |
private static final android.util.SparseIntArray sViewsWithIds; | |
static { | |
sIncludes = null; | |
sViewsWithIds = null; | |
} | |
// views | |
private final android.widget.LinearLayout mboundView0; | |
private final android.widget.TextView mboundView1; | |
// variables | |
private java.lang.String mText; | |
// values | |
// listeners | |
// Inverse Binding Event Handlers | |
public ActivityMainBinding(android.databinding.DataBindingComponent bindingComponent, View root) { | |
super(bindingComponent, root, 0); | |
final Object[] bindings = mapBindings(bindingComponent, root, 2, sIncludes, sViewsWithIds); | |
this.mboundView0 = (android.widget.LinearLayout) bindings[0]; | |
this.mboundView0.setTag(null); | |
this.mboundView1 = (android.widget.TextView) bindings[1]; | |
this.mboundView1.setTag(null); | |
setRootTag(root); | |
// listeners | |
invalidateAll(); | |
} | |
@Override | |
public void invalidateAll() { | |
synchronized(this) { | |
mDirtyFlags = 0x2L; | |
} | |
requestRebind(); | |
} | |
@Override | |
public boolean hasPendingBindings() { | |
synchronized(this) { | |
if (mDirtyFlags != 0) { | |
return true; | |
} | |
} | |
return false; | |
} | |
public boolean setVariable(int variableId, Object variable) { | |
switch(variableId) { | |
case BR.text : | |
setText((java.lang.String) variable); | |
return true; | |
} | |
return false; | |
} | |
public void setText(java.lang.String Text) { | |
this.mText = Text; | |
synchronized(this) { | |
mDirtyFlags |= 0x1L; | |
} | |
notifyPropertyChanged(BR.text); | |
super.requestRebind(); | |
} | |
public java.lang.String getText() { | |
return mText; | |
} | |
@Override | |
protected boolean onFieldChange(int localFieldId, Object object, int fieldId) { | |
switch (localFieldId) { | |
} | |
return false; | |
} | |
@Override | |
protected void executeBindings() { | |
long dirtyFlags = 0; | |
synchronized(this) { | |
dirtyFlags = mDirtyFlags; | |
mDirtyFlags = 0; | |
} | |
java.lang.String text = mText; | |
if ((dirtyFlags & 0x3L) != 0) { | |
} | |
// batch finished | |
if ((dirtyFlags & 0x3L) != 0) { | |
// api target 1 | |
android.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView1, text); | |
} | |
} | |
// Listener Stub Implementations | |
// callback impls | |
// dirty flag | |
private long mDirtyFlags = 0xffffffffffffffffL; | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater, android.view.ViewGroup root, boolean attachToRoot) { | |
return inflate(inflater, root, attachToRoot, android.databinding.DataBindingUtil.getDefaultComponent()); | |
} | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater, android.view.ViewGroup root, boolean attachToRoot, android.databinding.DataBindingComponent bindingComponent) { | |
return android.databinding.DataBindingUtil.<ActivityMainBinding>inflate(inflater, moe.xing.databindingnogetter.R.layout.activity_main, root, attachToRoot, bindingComponent); | |
} | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater) { | |
return inflate(inflater, android.databinding.DataBindingUtil.getDefaultComponent()); | |
} | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater, android.databinding.DataBindingComponent bindingComponent) { | |
return bind(inflater.inflate(moe.xing.databindingnogetter.R.layout.activity_main, null, false), bindingComponent); | |
} | |
public static ActivityMainBinding bind(android.view.View view) { | |
return bind(view, android.databinding.DataBindingUtil.getDefaultComponent()); | |
} | |
public static ActivityMainBinding bind(android.view.View view, android.databinding.DataBindingComponent bindingComponent) { | |
if (!"layout/activity_main_0".equals(view.getTag())) { | |
throw new RuntimeException("view tag isn't correct on view:" + view.getTag()); | |
} | |
return new ActivityMainBinding(bindingComponent, view); | |
} | |
/* flag mapping | |
flag 0 (0x1L): text | |
flag 1 (0x2L): null | |
flag mapping end*/ | |
//end | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file is in library | |
package moe.xing.databindingnogetterinlibrary.databinding; | |
import android.databinding.Bindable; | |
import android.databinding.DataBindingUtil; | |
import android.databinding.ViewDataBinding; | |
public abstract class ActivityMainBinding extends ViewDataBinding { | |
protected ActivityMainBinding(android.databinding.DataBindingComponent bindingComponent, android.view.View root_, int localFieldCount | |
) { | |
super(bindingComponent, root_, localFieldCount); | |
} | |
public abstract void setText(java.lang.String text); | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater, android.view.ViewGroup root, boolean attachToRoot) { | |
return inflate(inflater, root, attachToRoot, android.databinding.DataBindingUtil.getDefaultComponent()); | |
} | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater) { | |
return inflate(inflater, android.databinding.DataBindingUtil.getDefaultComponent()); | |
} | |
public static ActivityMainBinding bind(android.view.View view) { | |
return null; | |
} | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater, android.view.ViewGroup root, boolean attachToRoot, android.databinding.DataBindingComponent bindingComponent) { | |
return null; | |
} | |
public static ActivityMainBinding inflate(android.view.LayoutInflater inflater, android.databinding.DataBindingComponent bindingComponent) { | |
return null; | |
} | |
public static ActivityMainBinding bind(android.view.View view, android.databinding.DataBindingComponent bindingComponent) { | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment