{"id":5206,"date":"2016-12-20T10:00:59","date_gmt":"2016-12-20T01:00:59","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=5206"},"modified":"2016-12-19T18:45:17","modified_gmt":"2016-12-19T09:45:17","slug":"%e6%96%b0%e4%ba%ba%e6%88%90%e9%95%b7%e8%a8%98%e9%8c%b218th","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/5206","title":{"rendered":"\u65b0\u4eba\u6210\u9577\u8a18\u933218th"},"content":{"rendered":"<p>View\u306e\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u304c\u624b\u9593\u3067\u3001View\u306e\u6570\u304c\u591a\u3044\u753b\u9762\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3092\u601d\u3046\u3068\u6c17\u304c\u6ec5\u5165\u308b\u3053\u3068\u304b\u3089\u3001\u3053\u306e\u624b\u9593\u3092\u6e1b\u3089\u305b\u306a\u3044\u3082\u306e\u304b\u3068\u8003\u3048\u308b\u3053\u3068\u304c\u591a\u304f\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u89e3\u6d88\u65b9\u6cd5\u3092\u6a21\u7d22\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059<\/p>\n<p><!--more--><\/p>\n<p>\u6700\u521d\u306b\u898b\u3064\u3051\u305f\u306e\u306f<a href=\"http:\/\/jakewharton.github.io\/butterknife\/\" target=\"_blank\">ButterKnife<\/a>\u3068\u8a00\u308f\u308c\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059<br \/>\n\u307e\u305f\u3001View\u306e\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u4ee5\u5916\u306b\u3082\u4fbf\u5229\u306a\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u3042\u308b<a href=\"http:\/\/androidannotations.org\/\" target=\"_blank\">AndroidAnnotation<\/a>\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u3042\u308a\u307e\u3059<br \/>\nAndroidAnnotation\u3067\u306f\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u9069\u7528\u3057\u305fActivity\u3092\u7d99\u627f\u3057\u305f\u5225\u306eActivity\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059<br \/>\nManifest\u3084intent\u6642\u306b\u3001\u305d\u306e\u81ea\u52d5\u751f\u6210\u3055\u308c\u305fActivity\u3092\u6307\u5b9a\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306a\u3069\u3001\u5c11\u3057\u4e0d\u4fbf\u3068\u601d\u3063\u305f\u306e\u3067ButterKnife\u306e\u65b9\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059<\/p>\n<h3>ButterKnife\u306e\u5c0e\u5165<\/h3>\n<p>ButterKnife\u3092\u5c0e\u5165\u3059\u308b\u306b\u306fGradle\u3092\u7de8\u96c6\u3057\u3066\u3044\u304d\u307e\u3059<br \/>\ndependencies\u306b&#8217;com.jakewharton:butterknife:8.4.0&#8217;\u3068&#8217;com.jakewharton:butterknife-compiler:8.4.0&#8217;\u3092\u8ffd\u52a0\u3057\u307e\u3059<br \/>\n\u30d0\u30fc\u30b8\u30e7\u30f38.0\u672a\u6e80\u3092\u4f7f\u7528\u3059\u308b\u4eba\u306f\u3001compiler\u306e\u8ffd\u52a0\u306f\u4e0d\u8981\u3067\u3059\u304c\u3001ProGuard\u3078\u8ffd\u8a18\u304c\u5fc5\u8981\u307f\u305f\u3044\u3067\u3059<br \/>\n\u79c1\u306f\u3001\u4ed6\u306e\u8a18\u4e8b\u3092\u898b\u3066&#8217;com.jakewharton:butterknife:8.4.0&#8217;\u3060\u3051\u3092\u8ffd\u52a0\u3057\u3066\u3001@OnClick\u304c\u767a\u751f\u305b\u305a\u306b\u5c11\u3057\u60a9\u3093\u3067\u3057\u307e\u3044\u307e\u3057\u305f<br \/>\n\u3088\u304f\u3088\u304f\u8abf\u3079\u308b\u3068\u30d0\u30fc\u30b8\u30e7\u30f38.0\u304b\u3089\u30e2\u30b8\u30e5\u30fc\u30eb\u304c2\u3064\u306b\u5206\u5272\u3055\u308c\u305f\u3088\u3046\u306a\u306e\u3067\u3001\u4f7f\u7528\u6642\u306b\u306f\u8981\u6ce8\u610f\u3067\u3059<\/p>\n<pre style=\"border: dashed #000000 2px\"><code>apply plugin: 'android-apt'\r\n\r\ndependencies {\r\n    compile fileTree(include: ['*.jar'], dir: 'libs')\r\n    compile 'com.android.support:appcompat-v7:24.2.1'\r\n    compile 'com.jakewharton:butterknife:8.4.0'\r\n    apt 'com.jakewharton:butterknife-compiler:8.4.0'\r\n}\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u307e\u305f\u3001&#8217;android-apt&#8217;\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306bbuildscript\u306edependencies\u306b\u3082&#8217;com.neenbedankt.gradle.plugins:android-apt:1.8&#8217;\u306eclasspath\u3092\u8ffd\u52a0\u3057\u307e\u3059<\/p>\n<h3>ButterKnife\u306e\u4f7f\u3044\u65b9<\/h3>\n<p>\u305d\u308c\u3067\u306f\u3001\u30b3\u30fc\u30c9\u5185\u3067\u306eButterKnife\u306e\u4f7f\u3044\u65b9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059<br \/>\n\u4ee5\u4e0b\u306e\u5ba3\u8a00\u3067ID:txt_title\u306eTextView\u3078\u306e\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u304c\u5b8c\u4e86\u3067\u3059<\/p>\n<pre style=\"border: dashed #000000 2px\"><code>\t@BindView(R.id.txt_title)\r\n\tTextView textView;\r\n\r\n\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_main);\r\n\t\t\/\/\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u306e\u6709\u52b9\u5316\r\n\t\tButterKnife.bind(this);\r\n\t}\r\n<\/code><\/pre>\n<p>&nbsp;<br \/>\n\u975e\u5e38\u306b\u7c21\u5358\u306b\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u304c\u3067\u304d\u307e\u3057\u305f<br \/>\n\u5f8c\u306f\u3001\u666e\u6bb5\u901a\u308a\u306b\u4f7f\u7528\u3059\u308b\u3060\u3051\u3067\u3059<\/p>\n<p>\u307e\u305f\u3001\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u306b\u3064\u3044\u3066\u3082\u975e\u5e38\u306b\u7c21\u5358\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 2px\"><code>\t@OnClick({R.id.btn_A, R.id.btn_B})\r\n\tpublic void click(View view) {\r\n\t\tswitch (view.getId()) {\r\n\t\t\tcase R.id.btn_A:\r\n\t\t\t\tToast.makeText(context, \"A\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\tbreak;\r\n\t\t\tcase R.id.btn_B:\r\n\t\t\t\tToast.makeText(context, \"B\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n<\/code><\/pre>\n<p>&nbsp;<br \/>\n@OnClick\u306b\u306f\u8907\u6570\u306eView\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059<br \/>\n\u3053\u308c\u3067Implements\u3067OnClickListener\u306e\u5b9f\u88c5\u3084\u3001\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u3092\u3057\u3066\u304b\u3089\u30ea\u30b9\u30ca\u30fc\u3092\u30bb\u30c3\u30c8\u3059\u308b\u3088\u3046\u306a\u624b\u9593\u3092\u7701\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059<\/p>\n<h3>\u7d42\u308f\u308a\u306b<\/h3>\n<p>\u6a5f\u80fd\u3092\u8db3\u3059\u3088\u3046\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u306a\u304f\u3001\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u306e\u3092\u697d\u306b\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306f\u521d\u3081\u3066\u89e6\u308c\u307e\u3057\u305f\u304c\u3001\u4e2d\u3005\u826f\u3044\u3082\u306e\u3067\u3059\u306d<br \/>\n\u672a\u3060\u77e5\u3089\u306a\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u305f\u304f\u3055\u3093\u3042\u308b\u306e\u3067\u3001\u3069\u3093\u3069\u3093\u958b\u767a\u3092\u4fbf\u5229\u306b\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u63a2\u3057\u3066\u3044\u304d\u305f\u3044\u3067\u3059\u306d<\/p>\n<p>OSS\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3067\u5927\u304d\u306a\u5909\u66f4\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u3082\u3042\u308b\u306e\u3067\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u304c\u3042\u3063\u305f\u304b\u3089\u3068\u3044\u3063\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3082\u4e0a\u3052\u3066\u3057\u307e\u3046\u3068\u5927\u304d\u306a\u4fee\u6b63\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059<\/p>\n<p>\u4eca\u5f8c\u3082\u3053\u306e\u3088\u3046\u306a\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3064\u3044\u3066\u3082\u66f8\u3044\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059<\/p>\n<p>\u706b\u66dc\u65e5\u62c5\u5f53\uff1apoppy<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5206\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/5206\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"\u65b0\u4eba\u6210\u9577\u8a18\u933218th\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5206\" data-text=\"\u65b0\u4eba\u6210\u9577\u8a18\u933218th\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5206\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/5206\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>View\u306e\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u304c\u624b\u9593\u3067\u3001View\u306e\u6570\u304c\u591a\u3044\u753b\u9762\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3092\u601d\u3046\u3068\u6c17\u304c\u6ec5\u5165\u308b\u3053\u3068\u304b\u3089\u3001\u3053\u306e\u624b\u9593\u3092\u6e1b\u3089\u305b\u306a\u3044\u3082\u306e\u304b\u3068\u8003\u3048\u308b\u3053\u3068\u304c\u591a\u304f\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u89e3\u6d88\u65b9\u6cd5\u3092\u6a21\u7d22\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100,12],"tags":[56,79,104],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5206"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=5206"}],"version-history":[{"count":10,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5206\/revisions"}],"predecessor-version":[{"id":5242,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5206\/revisions\/5242"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=5206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=5206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=5206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}