Skip to content

Commit ff4ef95

Browse files
committed
TLIB.06-Exercise-AddButterknife
1 parent d681cc8 commit ff4ef95

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ dependencies {
2727
compile 'com.android.support:design:25.2.0'
2828
compile 'com.android.support:appcompat-v7:25.2.0'
2929
compile 'com.google.android.gms:play-services-vision:10.2.0'
30+
// TODO (1): Add Butterknife library and annotations dependency
3031
testCompile 'junit:junit:4.12'
3132
}

app/src/main/java/com/example/android/emojify/MainActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
public class MainActivity extends AppCompatActivity {
4343

44+
// TODO (2): Replace all View declarations with Butterknife annotations
45+
4446
private static final int REQUEST_IMAGE_CAPTURE = 1;
4547
private static final int REQUEST_STORAGE_PERMISSION = 1;
4648

@@ -65,6 +67,7 @@ protected void onCreate(Bundle savedInstanceState) {
6567
super.onCreate(savedInstanceState);
6668
setContentView(R.layout.activity_main);
6769

70+
// TODO (3): Replace the findViewById calls with the Butterknife data binding
6871
// Bind the views
6972
mImageView = (ImageView) findViewById(R.id.image_view);
7073
mEmojifyButton = (Button) findViewById(R.id.emojify_button);
@@ -190,6 +193,7 @@ private void processAndSetImage() {
190193
}
191194

192195

196+
// TODO (4): Replace OnClick methods with Butterknife annotations for OnClicks
193197
/**
194198
* OnClick method for the save button.
195199
*

app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.-->
1515

16+
<!-- TODO (5): Remove all the onClick methods in the XML -->
17+
1618
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
1719
xmlns:app="http://schemas.android.com/apk/res-auto"
1820
xmlns:tools="http://schemas.android.com/tools"

0 commit comments

Comments
 (0)