frantisekgazo / blade Goto Github PK
View Code? Open in Web Editor NEWAndroid library for boilerplate destruction
License: Apache License 2.0
Android library for boilerplate destruction
License: Apache License 2.0
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.NoClassDefFoundError: javax/inject/Inject
After including and downloading Blade
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'eu.f3rog.blade:plugin:2.7.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'blade'
Hi, I have a suggestion I would like to propose an adjustment to the library for discussion.
I am using Blade in 2 projects now and I am really happy with how easy to use it is and the great job of boilerplate destruction. :D
My adjustment is to allow for an Arg and a State to be applied to the same variable in a way that the State is applied AFTER the Arg is so it is not overwritten by the Arg bundle stored variable, but instead ends up with the restored state from the State.
I have noticed that this happens the other way around and perhaps there is a way that it can be adjusted to allow for my suggestion?
Perhaps also there is a reason for it being done the way it is that I am unaware of.
I will try and implement it myself but honestly I don't have much idea where to start.
Thanks!
When migrating to Gradle 4.x presents the error:
Execution failed for task ':app:transformClassesWithBladeForDebug'.
java.io.FileNotFoundException: C:\A-NG\azure\mntng- android\app\build\intermediates\transforms\Blade\debug\0\androidx\dynamicanimation\R$id.class
(O sistema não pode encontrar o caminho especificado)
I want to pass List as Extra (MyType is Serializable). How can I do that?
I can use ArrayList instead of List, but I think that to use concreate implementation is not a good programming practice.
Could you please modify BundleWrapper, so it will support lists of serializable objects?
Some activities don't have extras but I would like to use I.startMyActivity() pattern for all activities in my project.
Please consider adding some way how to mark activities to be included in I class.
I would prefer to introduce @BladeActivity (and @BladeFragment, @BladeService, ...) for this purpose. Such a annotation could give more fine grained control over code generation.
I have simplest sample with Butterknife and Blade here https://github.com/aartikov/BladeTest
It crashes with NullPointerException because of Butterknife does not bind my views.
When method parameter is annotated with @NonNull
-> generate runtime assertions in code like this:
void foo(@NonNull final String param) {
/* Code generated by Blade */
if (param == null) {
throw new AssertionError("text == null");
}
/* ~ */
// Actual method code here
}
Consider adding support for other Android support annotations e.g.:
@IntRange
:
void foo(@IntRange(from=0) final int index) {
/* Code generated by Blade */
if (index < 0) {
throw new AssertionError("index < 0");
}
/* ~ */
// Actual method code here
}
Other possible assertions for: @FloatRange, @Size, @UiThread, @WorkerThread, @RequiresApi
[idea] And what about when method has annotated return value like this:
@NonNull
public String foo() {
// Actual method code here
String returnVal = null;
/* Code modified by Blade */
if (returnVal == null) {
throw new AssertionError("return value of method foo is null");
}
return returnVal;
/* ~ */
}
Hi, have you thought about adding support for Parceler
i'm getting this
/home/gabriel/projetos/mntng-android/app/build/tmp/kapt3/stubs/debug/br/com/ngi/mnt/ui/main/service/orders/OrdersPageFragment.java:12: error: Only Fragment subclass can contain @Arg.
public final class OrdersPageFragment extends br.com.ngi.mnt.base.BaseFragment implements br.com.ngi.mnt.ui.main.service.orders.contracts.OrdersPageView {
after migrating to AndroidX, i think that is cuz the fragment import changed from
import android.support.v4.app.Fragment
to
import androidx.fragment.app.Fragment
And blade doesn't recognize the new package as a fragment
Since version 3 compile
dependencies need to be changed to implementation
.
Instead of blade.json
you should be able to use blade.yaml
Add support for MVVM. Unlike in MVP, the View holds a reference to the View Model, but the View Model has no information about the View.
Hi,
I've tried to use this lib within my Kotlin project - to no avail.
Is it / will it be possible to use Blade with Kotlin? (Kotlin uses kapt
instead of aapt
)
Currently Blade generates only MyFragment newMyFragment(...)
method for a class MyFragment inside the blade.F
class.
Add also Bundle forMyFragment(...)
method to enable creation of bundles separately.
This is usefull for projects with a generic detail activity that has to save the content fragment' bundle also into the intent for state restoration purposes.
Right now it's working, but not completely.
i'm doing this:
class MainActivity : BaseActivity() {
@Extra
lateinit var userModel: LoginModel
@Extra
var cameFromLogin: Boolean = false
}
and i get the error:
error: Field annotated with @Extra cannot be private, protected nor final private boolean cameFromLogin;
i could try to resolve, but i have no idea where the code is generated/parsed
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.