gueei / androidbinding Goto Github PK
View Code? Open in Web Editor NEWMVVM for Android
License: MIT License
MVVM for Android
License: MIT License
Hi @gueei ,
I like your project and it saves me time. Thanks for that.
I was wondering if you are planning to add support for FragmentActivities. I need them for my project. If you don't have the time or don't want to implement it, please let me know. With some instructions I can try to implement this if you want.
Very nice project, keep up the good work ๐
The built JAR file provided in the root of this enlistment embeds instead of references Google's android-support-v4 library (as opposed to the earlier released android-binding-v30-0.52.jar which does not). This difference makes it difficult to build a project that references both the android-bindings JAR and the app compat library (com.android.support:appcompat-v7) due to duplicate errors raised during DEX-ing. BTW, I noticed that the ".fatjar" file under androidbindingv30 does attempt to exclude android-support-v4:
excludes=<jar|android-support-v4.jar>;<jar|annotations.jar>
but for some reason this didn't seem to stick...
Could you update the published binary to not include the external bits?
Hi,
I tryed to use your library in my project, and all was fine. But when i sturt to use BindableLinearLayout I give the next runtime errors:
10-21 15:27:31.111: W/dalvikvm(15077): Link of class 'Lgueei/binding/v30/viewAttributes/absListView/MultiChoiceMode;' failed
10-21 15:27:31.111: E/dalvikvm(15077): Could not find class 'gueei.binding.v30.viewAttributes.absListView.MultiChoiceMode', referenced from method gueei.binding.v30.bindingProviders.ListViewProviderV30.createAttributeForView
10-21 15:27:31.121: W/dalvikvm(15077): VFY: unable to resolve new-instance 648 (Lgueei/binding/v30/viewAttributes/absListView/MultiChoiceMode;) in Lgueei/binding/v30/bindingProviders/ListViewProviderV30;
10-21 15:27:31.121: W/dalvikvm(15077): Link of class 'Lgueei/binding/v30/viewAttributes/absListView/ModalCheckedItemPositions;' failed
10-21 15:27:31.121: E/dalvikvm(15077): Could not find class 'gueei.binding.v30.viewAttributes.absListView.ModalCheckedItemPositions', referenced from method gueei.binding.v30.bindingProviders.ListViewProviderV30.createAttributeForView
10-21 15:27:31.121: W/dalvikvm(15077): VFY: unable to resolve new-instance 645 (Lgueei/binding/v30/viewAttributes/absListView/ModalCheckedItemPositions;) in Lgueei/binding/v30/bindingProviders/ListViewProviderV30;
10-21 15:27:31.121: W/dalvikvm(15077): Link of class 'Lgueei/binding/v30/viewAttributes/OnAttachViewAttributeV30;' failed
10-21 15:27:31.121: E/dalvikvm(15077): Could not find class 'gueei.binding.v30.viewAttributes.OnAttachViewAttributeV30', referenced from method gueei.binding.v30.bindingProviders.ViewProviderV30.createAttributeForView
10-21 15:27:31.121: W/dalvikvm(15077): VFY: unable to resolve new-instance 641 (Lgueei/binding/v30/viewAttributes/OnAttachViewAttributeV30;) in Lgueei/binding/v30/bindingProviders/ViewProviderV30;
10-21 15:27:31.121: W/dalvikvm(15077): Link of class 'Lgueei/binding/v30/viewAttributes/OnDetachViewAttributeV30;' failed
10-21 15:27:31.121: E/dalvikvm(15077): Could not find class 'gueei.binding.v30.viewAttributes.OnDetachViewAttributeV30', referenced from method gueei.binding.v30.bindingProviders.ViewProviderV30.createAttributeForView
10-21 15:27:31.121: W/dalvikvm(15077): VFY: unable to resolve new-instance 642 (Lgueei/binding/v30/viewAttributes/OnDetachViewAttributeV30;) in Lgueei/binding/v30/bindingProviders/ViewProviderV30;
10-21 15:27:31.141: W/dalvikvm(15077): VFY: unable to resolve virtual method 3874: Lgueei/binding/v30/app/BindingActivityV30;.getActionBar ()Landroid/app/ActionBar;
10-21 15:27:31.161: W/dalvikvm(15077): VFY: unable to resolve virtual method 3879: Lgueei/binding/v30/app/BindingActivityV30;.invalidateOptionsMenu ()V
10-21 15:27:31.171: W/dalvikvm(15077): threadid=1: thread exiting with uncaught exception (group=0x40020ac0)
10-21 15:27:31.181: E/AndroidRuntime(15077): FATAL EXCEPTION: main
10-21 15:27:31.181: E/AndroidRuntime(15077): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.alexdov.carprods/com.alexdov.carprods.MainActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class binding.BindableLinearLayout
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.os.Handler.dispatchMessage(Handler.java:99)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.os.Looper.loop(Looper.java:123)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-21 15:27:31.181: E/AndroidRuntime(15077): at java.lang.reflect.Method.invokeNative(Native Method)
10-21 15:27:31.181: E/AndroidRuntime(15077): at java.lang.reflect.Method.invoke(Method.java:521)
10-21 15:27:31.181: E/AndroidRuntime(15077): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
10-21 15:27:31.181: E/AndroidRuntime(15077): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
10-21 15:27:31.181: E/AndroidRuntime(15077): at dalvik.system.NativeStart.main(Native Method)
10-21 15:27:31.181: E/AndroidRuntime(15077): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class binding.BindableLinearLayout
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-21 15:27:31.181: E/AndroidRuntime(15077): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.Activity.setContentView(Activity.java:1647)
10-21 15:27:31.181: E/AndroidRuntime(15077): at com.alexdov.carprods.MainActivity.onCreate(MainActivity.java:14)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-21 15:27:31.181: E/AndroidRuntime(15077): ... 11 more
10-21 15:27:31.181: E/AndroidRuntime(15077): Caused by: java.lang.ClassNotFoundException: binding.BindableLinearLayout in loader dalvik.system.PathClassLoader[/data/app/com.alexdov.carprods-2.apk]
10-21 15:27:31.181: E/AndroidRuntime(15077): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
10-21 15:27:31.181: E/AndroidRuntime(15077): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
10-21 15:27:31.181: E/AndroidRuntime(15077): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
10-21 15:27:31.181: E/AndroidRuntime(15077): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
10-21 15:27:31.181: E/AndroidRuntime(15077): ... 20 more
Can you help me?
Regards Alexey Dovgan.
has custom bindable lib - https://github.com/gueei/AndroidBinding
package gueei.binding;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.LayoutInflater.Factory;
import java.util.ArrayList;
public class ViewFactory implements import android.view.LayoutInflater.Factory; {
}
Here my snippet:
import gueei.binding.Binder;
import gueei.binding.Binder.InflateResult;
import gueei.binding.ViewFactory;
import androidx.fragment.app.FragmentActivity;
LayoutInflater layoutInflater = LayoutInflater.from(context)
.cloneInContext(context);
LayoutInflater.Factory layoutInflaterFactory = layoutInflater
.getFactory();
ViewFactory bindingViewFactory = null;
if (!(layoutInflaterFactory instanceof FragmentActivity)) {
bindingViewFactory = (ViewFactory) layoutInflaterFactory;
}
if (bindingViewFactory == null) {
bindingViewFactory = new ViewFactory(layoutInflater);
layoutInflater.setFactory(bindingViewFactory);
}
And when I use android.support.v4.app.FragmentActivity
my code work fine.
But now I upgrade android project to use androidx.appcompat.app.AppCompatActivity;
and as result in line:
bindingViewFactory = (ViewFactory) layoutInflaterFactory;
I has runtime error:
FATAL EXCEPTION: main
Process: com.myproject.tango.debug, PID: 10249
java.lang.ClassCastException: androidx.appcompat.app.AppCompatDelegateImpl cannot be cast to gueei.binding.ViewFactory
at com.myproject.binding.widget.BindableWidgetHelper.bindv4Fragment(BindableWidgetHelper.java:138)
at com.myproject.commons.LayoutService.addView(LayoutService.java:128)
at com.myproject.commons.LayoutService.addBody(LayoutService.java:150)
at com.myproject.tango.widget.banner.BannerFragment.prepareChild(BannerFragment.java:211)
at com.myproject.commons.roots.RootFragment.onCreateView(RootFragment.java:103)
at com.myproject.tango.widget.banner.BannerFragment_.onCreateView(BannerFragment_.java:42)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2612)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:874)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1228)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1293)
Steps to reproduce:
ShowHomeAsUp
and ShowHome
ActionBar buttonstrue
to false
I'm not super familiar with the internals of Android Binding so I haven't figured out the solution to this just yet. If you can guide me in the right direction, I'd be happy to write a patch.
:)
Thanks for a great library!
When I'm trying to combine two to ViewPagerAdapters removing objects from any ArrayListObjervable is not updating the UI.
If I use one adapter and I remove the objects works as expected
Using: Latest Version on Github
Hi, there!
Are you still supporting and developing this library?
Because I found a few places with getting-started tutorials and I can see they must be old or something because using the current jar is published here (BTW: is that library compiled with the last codebase?) things seem to be different...
Thanks
I migrate my android project from Eclipse to Android Studio.
In Eclipse I use lib androidbinding.jar
And it's work fine. Nice.
But now on Android Studio I use gradle to load all libs. How I can load lib AndroidBinding
via gradle?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.