butterknife

Obsfucation + Butterknife/Databinding

风格不统一 提交于 2019-12-08 05:57:55
问题 I currently use Butterknife to inject views into my code. I noticed class names are not obsfucated when i use minifyenabled, since butterknife needs the correct class name to generate the proxy classes that will do the binding. (MainActivity.class -> MainActivity_ViewBinding.class) I'm willing to switch to the "new" Data Binding Library in android studio. But since it's a lot of work considering my project is huge, here's my question: Will the Data Binding Library also not obsfucate the

Bound view is null when using Butterknife in fragment

五迷三道 提交于 2019-12-07 19:59:05
问题 I am using Butterknife to bind a single view in one of my fragments. I have used Butterknife with no issue in a separate fragment, but for some reason in this fragment the bound view is null. I am trying to add a child layout to it and I am receiving a NPE and I cannot figure out why. The setup I have in this fragment is the same as I have in my other fragment that works perfectly. This is a snippet from the fragment including the Butterknife code. private View view; @BindView(R.id

Bind with Butterknife to dynamically added view in android

馋奶兔 提交于 2019-12-07 09:21:21
问题 How Can I bind the views present inside the Layout which is dynamically added to the parent view with ButterKnife. I have a LinearLayout say container . And I have a custom layout which contains two buttons say this layout as childview In activity I added the childview successfully to the parent LinearLayout container . This is how I did to inflate the custom view and added to the LinearLayout bubbleView = inflater.inflate(R.layout.child, null); systemChatLayoutContainer.addView(bubbleView);

Butter Knife won't inject

蹲街弑〆低调 提交于 2019-12-07 07:03:21
问题 I'm trying to use Butter Knife at Android Studio these days, yet it fails me with some odd problems. I used to try Butter Knife at eclipse, and it worked fine. I don't know if I configured something wrong at Android Studio. I followed instructions at Jake Wharton's website, yet it's still not working. At first, It could be compiled and installed, but after Butterknife.inject(this) , the view would still be null, and it threw a null pointer error. Then I googled how to configure Butterknife at

ButterKnife binding views with inheritance issue

蓝咒 提交于 2019-12-07 05:32:17
问题 I have already read Some issues on github, but still haven't found solution. My problem is that I cannot bind views in a child activity inherited from BaseActivty Code in my BaseActivity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ViewGroup rootView = (ViewGroup) this.findViewById(android.R.id.content); View rootBaseView = getLayoutInflater().inflate(R.layout.activity_base, rootView, false); ButterKnife.bind(this, rootBaseView); .... int

Why do I have problems whith 'com.jakewharton:butterknife:7.0.1' in Android Studio 3.0?

我只是一个虾纸丫 提交于 2019-12-07 05:21:16
问题 I have the following problem when I run the 'app' (Android studio emulator): Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration. - butterknife-7.0.1.jar (com.jakewharton:butterknife:7.0.1) Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions

Proguard while Butterknife library and other warnings

◇◆丶佛笑我妖孽 提交于 2019-12-07 04:49:36
问题 My Activities , Fragments ,Services and BroadcastReceivers I want to implement a ProGuard taken to the safety of the classroom. Error I get when Proguard. What should I write into the file? -> proguard-android.txt ve proguard-rules.pro I'd written into the grade. lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } buildTypes { release { minifyEnabled true

java.lang.IllegalStateException Butterknife

断了今生、忘了曾经 提交于 2019-12-07 02:48:41
问题 I am facing java.lang.IllegalStateException Required view 'splash_text' but I have included it in the xml. I am using Butterknife to Bind the views. compile 'com.jakewharton:butterknife:7.0.1' Xml : <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/holo_orange_light"> <com.CustomTextView

Proguard Duplicate Zip Entry

為{幸葍}努か 提交于 2019-12-06 21:55:37
问题 I am trying to run my android application through Proguard, however this keeps appearing: Warning:Exception while processing task java.io.IOException: Can't write [C:\Users\Aliaksei\AndroidStudioProjects\SignOutSystem\app\build\intermediates\transforms\proguard\debug\jars\3\1f\main.jar] (Can't read [D:\Users\Aliaksei\.android\build-cache\f7a6034d02d095f18cc21950f131d07fa78b41c0\output\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [android/support/v4/os/j.class == classes.jar:android

源码解析ButterKnife

a 夏天 提交于 2019-12-06 14:11:07
0、引子 话说我们做程序员的,都应该多少是个懒人,我们总是想办法驱使我们的电脑帮我们干活,所以我们学会了各式各样的语言来告诉电脑该做什么——尽管,他们有时候也会误会我们的意思。 突然有一天,我觉得有些代码其实,可以按照某种规则生成,但你又不能不写——不是所有的重复代码都可以通过重构并采用高端技术比如泛型来消除的——比如我最痛恨的代码: TextView textView = (TextView) findViewById(R.id.text_view); Button button = (Button) findViewById(R.id.button); 这样的代码,你总不能不写吧,真是让人沮丧。突然想到以前背单词的故事:正着背背不过 C,倒着背背不过 V。嗯,也许写 Android app,也是写不过 findViewById 的吧。。 我们今天要介绍的 ButterKnife 其实就是一个依托 Java 的注解机制来实现辅助代码生成的框架,读完本文,你将能够了解到 Java 的注解处理器的强大之处,你也会对 dagger2 和 androidannotations 这样类似的框架有一定的认识。 1、初识 ButterKnife 1.1 ButterKnife 简介 说真的,我一直对于 findViewById 这个的东西有意见,后来见到了 Afinal 这个框架