butterknife

use of multiple <include /> tags in layout with ButterKnife

霸气de小男生 提交于 2019-12-19 06:05:51
问题 I have a layout where I include the same sub-layout multiple times, each one with a different role: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <include android:id="@+id/settings_eco_seekarc" android:layout_width="match_parent" android:layout_height="match_parent" layout="@layout/settings_arc" /> <include android:id="@+id/settings_comfort_seekarc" android:layout_width="match_parent" android:layout_height="match

Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'

笑着哭i 提交于 2019-12-19 06:03:18
问题 build.gradle buildscript { ext.kotlin_version = '1.1.51' repositories { jcenter() mavenCentral() maven { url "https://jitpack.io" } } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'me.tatarka:gradle-retrolambda:3.6.1' classpath 'com.google.gms:google-services:3.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } app/build.gradle buildscript { repositories { jcenter() } dependencies { classpath 'com.jakewharton:butterknife-gradle-plugin:8

lateinit property has not been initialized

让人想犯罪 __ 提交于 2019-12-18 19:00:06
问题 I have a custom linearlayout class and when I want to create instance of this class, I got an error lateinit property has not been initialized I'm using the latest version of butterknife library this is my kotlin class class MenuItemView : LinearLayout { @BindView(R.id.menu_title_text_view_id) lateinit var menuTitleTextView : CTextBasic constructor(ctx: Context) : super(ctx) { } init { val view = LayoutInflater.from(context).inflate(R.layout.menu_item,this) ButterKnife.bind(this,view) }

Remove “Method is never used” warning for OnClick annotation in Android Studio

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 13:54:12
问题 Sorry if this question has been asked before. I am using the Butterknife 5.0 with the latest version of Android Studio(0.5.7). How can I remove the "Method is never used" warning for methods that use the 'OnClick' Annotation of ButterKnife.I noticed that Eclipse doesnt give this warning for the 'OnClick' methods. Thanks in advance 回答1: The correct way in Android Studio to suppress these warnings is to press Alt+Enter on the method giving the Method 'yourFunction()' is never used warning, and

cannot find symbol class DaggerAppComponent or cannot find symbol class DaggerActivityComponent

一个人想着一个人 提交于 2019-12-18 12:58:11
问题 I get this error after adding inject on my class then it gives me a compilation error. If I remove @Inject static ApiService mApiService; it's working fine And I'm using 2 Application class those are extended MultidexApplication because I have merge 2 application first is using dagger2 and second application is butterknife and both directory structure are differnet and both application interdependently working fine but after merge the code application not compile and give DaggerAppComponent

Using Butter Knife library for view injection

爷,独闯天下 提交于 2019-12-18 02:56:25
问题 What i am doing :: I am trying to run butter knife library for my simple project I have followed all the steps in documentation, but still i am getting log errors How can i resolve this, am i missing any step I have also added the jar in libs folder MainActivity.java package com.example.butterknife; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import butterknife.ButterKnife; import butterknife.InjectView; public class MainActivity extends Activity {

Kotlin Android View Binding: findViewById vs Butterknife vs Kotlin Android Extension

一笑奈何 提交于 2019-12-17 23:18:03
问题 I'm trying to figure out the best way to do Android View Binding in Kotlin. It seems like there are a few of options out there: findViewById val button: Button by lazy { findViewById<Button>(R.id.button) } Butterknife https://github.com/JakeWharton/butterknife @BindView(R.id.button) lateinit var button: Button Kotlin Android Extensions https://kotlinlang.org/docs/tutorials/android-plugin.html import kotlinx.android.synthetic.main.activity_main.* I'm pretty familiar with findViewById and

AndroidStudio 混淆打包

北慕城南 提交于 2019-12-17 19:52:54
AndroidStudio中的项目可以用compile的形式引入github上的开 源项目,可以引用module,而不一定都要用libs文件夹中添加jar包的形式。在最终realease打包时,混淆的设置是比较重要的,否则会导致 生成的包有很多功能不能正常使用。下面列举一个基本的app的build.gradle和混淆文件。并注意,混淆打包后的apk文件大小会比不使用混淆要 小。 在app根目录下设置build.gradle和混淆文件,然后把混淆选项写入混淆文件就可以。虽然app项目中可能引用了一些module,但这些module工程可以不定义自己的混淆,我的工程目录结构如下: 其中app是应用主模块,引用剩余的module,被引用module的build.gradle中都使用默认的设置不启用混淆: buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 在主目录的build.gradle: apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyy-MM-dd"

AndroidStudio 混淆打包

旧街凉风 提交于 2019-12-17 19:52:23
AndroidStudio中的项目可以用compile的形式引入github上的开源项目,可以引用module,而不一定都要用libs文件夹中添加jar包的形式。在最终realease打包时,混淆的设置是比较重要的,否则会导致生成的包有很多功能不能正常使用。下面列举一个基本的app的build.gradle和混淆文件。并注意,混淆打包后的apk文件大小会比不使用混淆要小。 在app根目录下设置build.gradle和混淆文件,然后把混淆选项写入混淆文件就可以。虽然app项目中可能引用了一些module,但这些module工程可以不定义自己的混淆,我的工程目录结构如下: 其中app是应用主模块,引用剩余的module,被引用module的build.gradle中都使用默认的设置不启用混淆: buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } 在主目录的build.gradle: apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyy-MM-dd",

Difference between Dagger and ButterKnife Android

a 夏天 提交于 2019-12-17 17:26:17
问题 Can anyone point out the difference between Dagger and Butterknife? I know that Butterknife is a view injection library and Dagger is a dependency injection library. But the documentation online seems a bit overhead for me. According to Butterknife documentation, you can do non-activity injections as well, which is what Dagger does? Or did I misunderstand something? 回答1: ButterKnife is targeted to inject views only. Non-activity injection just means that you can provide your own view root to