Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 27
defaultConfig {
applicationId "com.example.android.emojify"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -24,6 +23,8 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})


compile 'com.android.support:design:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.google.android.gms:play-services-vision:10.2.0'
Expand Down
42 changes: 31 additions & 11 deletions app/src/main/java/com/example/android/emojify/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import timber.log.Timber;


public class MainActivity extends AppCompatActivity {

// (2): Replace all View declarations with Butterknife annotations


public class MainActivity extends AppCompatActivity {

Expand All @@ -52,14 +57,25 @@ public class MainActivity extends AppCompatActivity {

private static final String FILE_PROVIDER_AUTHORITY = "com.example.android.fileprovider";

@BindView(R.id.image_view) ImageView mImageView;

@BindView(R.id.emojify_button) Button mEmojifyButton;
@BindView(R.id.share_button) FloatingActionButton mShareFab;
@BindView(R.id.save_button) FloatingActionButton mSaveFab;
@BindView(R.id.clear_button) FloatingActionButton mClearFab;
@BindView(R.id.image_view)
ImageView mImageView;

@BindView(R.id.emojify_button)
Button mEmojifyButton;

@BindView(R.id.share_button)
FloatingActionButton mShareFab;

@BindView(R.id.save_button)
FloatingActionButton mSaveFab;

@BindView(R.id.clear_button)
FloatingActionButton mClearFab;

@BindView(R.id.title_text_view)
TextView mTitleTextView;

@BindView(R.id.title_text_view) TextView mTitleTextView;

private String mTempPhotoPath;

Expand All @@ -71,11 +87,12 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Bind the views
ButterKnife.bind(this);
// (3): Replace the findViewById calls with the Butterknife data binding
// Bind the views



// Set up Timber
Timber.plant(new Timber.DebugTree());
}

/**
Expand All @@ -100,7 +117,7 @@ public void emojifyMe() {

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
@NonNull int[] grantResults) {
// Called when you request permission to read and write to external storage
switch (requestCode) {
case REQUEST_STORAGE_PERMISSION: {
Expand Down Expand Up @@ -193,6 +210,9 @@ private void processAndSetImage() {
}



// (4): Replace OnClick methods with Butterknife annotations for OnClicks

/**
* OnClick method for the save button.
*/
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
limitations under the License.-->



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Tue Aug 21 15:57:55 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip