mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-05-01 18:38:41 +02:00
update Butterknife to 8.0.1
This commit is contained in:
parent
92d61fb2d1
commit
0bb736dfd4
@ -1,4 +1,5 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'android-apt'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
@ -28,7 +29,9 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compile 'com.android.support:appcompat-v7:23.3.0'
|
compile 'com.android.support:appcompat-v7:23.3.0'
|
||||||
compile 'com.jakewharton:butterknife:7.0.1'
|
compile 'com.jakewharton:butterknife:8.0.1'
|
||||||
|
|
||||||
|
apt 'com.jakewharton:butterknife-compiler:8.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
def Properties props = new Properties()
|
def Properties props = new Properties()
|
||||||
|
13
app/proguard-rules.pro
vendored
13
app/proguard-rules.pro
vendored
@ -15,16 +15,3 @@
|
|||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
# public *;
|
# public *;
|
||||||
#}
|
#}
|
||||||
|
|
||||||
# Butterknife
|
|
||||||
-keep class butterknife.** { *; }
|
|
||||||
-dontwarn butterknife.internal.**
|
|
||||||
-keep class **$$ViewBinder { *; }
|
|
||||||
|
|
||||||
-keepclasseswithmembernames class * {
|
|
||||||
@butterknife.* <fields>;
|
|
||||||
}
|
|
||||||
|
|
||||||
-keepclasseswithmembernames class * {
|
|
||||||
@butterknife.* <methods>;
|
|
||||||
}
|
|
||||||
|
@ -9,13 +9,13 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
import butterknife.Bind;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
public class AboutActivity extends AppCompatActivity {
|
public class AboutActivity extends AppCompatActivity {
|
||||||
@Bind(R.id.about_copyright) TextView copyright;
|
@BindView(R.id.about_copyright) TextView copyright;
|
||||||
@Bind(R.id.about_version) TextView version;
|
@BindView(R.id.about_version) TextView version;
|
||||||
@Bind(R.id.about_email) TextView emailTV;
|
@BindView(R.id.about_email) TextView emailTV;
|
||||||
private Resources res;
|
private Resources res;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -6,21 +6,24 @@ import android.support.v7.app.AppCompatActivity;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnClick;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity implements MyCamera {
|
public class MainActivity extends AppCompatActivity implements MyCamera {
|
||||||
private ImageView toggleBtn;
|
@BindView(R.id.toggle_btn) ImageView toggleBtn;
|
||||||
private MyCameraImpl cameraImpl;
|
private MyCameraImpl cameraImpl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
setupToggleButton();
|
|
||||||
setupCameraImpl();
|
setupCameraImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,15 +51,10 @@ public class MainActivity extends AppCompatActivity implements MyCamera {
|
|||||||
cameraImpl.toggleFlashlight();
|
cameraImpl.toggleFlashlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupToggleButton() {
|
@OnClick(R.id.toggle_btn)
|
||||||
toggleBtn = (ImageView) findViewById(R.id.toggle_btn);
|
public void toggleFlashlight() {
|
||||||
toggleBtn.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
cameraImpl.toggleFlashlight();
|
cameraImpl.toggleFlashlight();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
|
@ -6,6 +6,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.1.0'
|
classpath 'com.android.tools.build:gradle:2.1.0'
|
||||||
|
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user