{"id":315,"date":"2012-02-29T00:11:52","date_gmt":"2012-02-28T15:11:52","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2012\/02\/29\/android_8\/"},"modified":"2012-02-29T00:11:52","modified_gmt":"2012-02-28T15:11:52","slug":"android_8","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2012\/02\/29\/android_8\/","title":{"rendered":"Android \u30ea\u30b9\u30c8\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u30a2\u30a4\u30c6\u30e0\u3092\u53d6\u5f97\u3059\u308b\u306e\u3068\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u5927\u304d\u304f\u3059\u308b\u306e\u3068"},"content":{"rendered":"<p>ListView \u304c\u3089\u307f\u306e\u5099\u5fd8\u30922\u3064\u307b\u3069\u3002<\/p>\n<h2>1.\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u5927\u304d\u304f\u3059\u308b<\/h2>\n<p>\u4e0b\u56f3\u306e\u69d8\u306b\u3001\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc(\u30ea\u30b9\u30c8\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3) \u306e\u30a2\u30a4\u30c6\u30e0\u304c\u591a\u3044\u3068\u304d\u306a\u3069\u3001\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30cf\u30f3\u30c9\u30eb\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u3001\u4e00\u6c17\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u308b\u69d8\u306b\u3059\u308b\u306b\u306f\u3001<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_14F42\/fastscrollbar01.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"fastscrollbar01\" border=\"0\" alt=\"fastscrollbar01\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_14F42\/fastscrollbar01_thumb.jpg\" width=\"175\" height=\"289\" \/><\/a> <\/p>\n<h2>Fast scroll enabled \u30d7\u30ed\u30d1\u30c6\u30a3 \u3092 true \u306b\u8a2d\u5b9a\u3059\u308b<\/h2>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_14F42\/fastscrollbar02.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"fastscrollbar02\" border=\"0\" alt=\"fastscrollbar02\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_14F42\/fastscrollbar02_thumb.jpg\" width=\"259\" height=\"303\" \/><\/a> <\/p>\n<\/p>\n<p>\u30b3\u30fc\u30c9\u304b\u3089\u306f\u3001<\/p>\n<p><a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/AbsListView.html#setFastScrollEnabled(boolean)\">setFastScrollEnabled(boolean enabled)<\/a>&nbsp;<\/p>\n<p>\u306b\u3066\u8a2d\u5b9a\u3002<\/p>\n<h2>2.\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc\u3092\u9078\u3093\u3060\u3068\u304d\u306b\u3001\u9078\u629e\u3055\u308c\u305f\u30a2\u30a4\u30c6\u30e0\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc\u306e\u30a2\u30a4\u30c6\u30e0\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d\u306b\u3001\u30a2\u30c0\u30d7\u30bf\u30fc\u304b\u3089\u30a2\u30a4\u30c6\u30e0\u3092\u53d6\u308a\u51fa\u3059\u306e\u306f<\/p>\n<p>\u7c21\u5358\u3002\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u305f\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306b position \u304c\u6e21\u3063\u3066\u304f\u308b\u306e\u3067\u3001<a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/Adapter.html#getItem(int)\">getImte(int position)<\/a> \u3059\u308c\u3070\u826f\u3044\u3002<\/p>\n<p>(\u4ee5\u4e0b\u306e\u4f8b\u306f\u3001\u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u30b9\u3067\u7d99\u627f\u3057\u305f\u30a2\u30c0\u30d7\u30bf\u30fc\u3092\u5229\u7528 public static class WordAdapter extends ArrayAdapter&lt;WordBook.Word&gt;)<\/p>\n<pre class=\"prettyprint linenums\"> @Override\r\n protected void onListItemClick(ListView l, View v, int position, long id) {\r\n     WordBook.Word word = adapter.getItem(position);\r\n     speak(word);\r\n }<\/pre>\n<p>\u3057\u304b\u3057\u306a\u304c\u3089\u3001\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc\u3092\u8868\u793a\u3055\u305b\u3066\u3001\u30e1\u30cb\u30e5\u30fc\u304c\u9078\u629e\u3055\u308c\u305f\u6642\u306b\u547c\u3073\u51fa\u3055\u308c\u308b\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u30fc\u306b\u306f\u3001position \u304c\u306a\u3044\u3002\u3002\u3002<\/p>\n<p><a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Activity.html#onContextItemSelected(android.view.MenuItem)\">public boolean onContextItemSelected (MenuItem item)<\/a><\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_14F42\/context_item.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"context_item\" border=\"0\" alt=\"context_item\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/Android_14F42\/context_item_thumb.jpg\" width=\"182\" height=\"300\" \/><\/a>&nbsp;<\/p>\n<p>\u4ee5\u4e0b\u306e\u69d8\u306b\u3001MenuItem \u304b\u3089\u3001<a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/AdapterView.AdapterContextMenuInfo.html\">AdapterContextMenuInfo<\/a> \u3092\u53d6\u308a\u51fa\u3057\u3066\u3001id \u3092\u53c2\u7167\u3059\u308b\u3068\u3001\u884c\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u5f8c\u306f\u305d\u308c\u3092\u3082\u3063\u3066\u3001\u30a2\u30c0\u30d7\u30bf\u30fc\u306e <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/Adapter.html#getItem(int)\">getImte(int position)<\/a> \u3092\u3059\u308c\u3070\u826f\u3044\u3002<\/p>\n<pre class=\"prettyprint linenums\"> @Override\r\n public boolean onContextItemSelected(MenuItem item) {\r\n\r\n     AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo();\r\n     WordBook.Word word = null;\r\n     try {\r\n         word = adapter.getItem((int)info.id);\r\n     } catch(Exception e){}\r\n     \r\n     switch(item.getItemId()) {\r\n     case MENU_CONTEXT_SHARE:\r\n         shareWord(word);\r\n         break;\r\n     case MENU_CONTEXT_SPEAK:\r\n         speak(word);\r\n         break;\r\n     default:\r\n         break;\r\n     }\r\n     return true;\r\n }<\/pre>\n<\/p>\n<p><a href=\"https:\/\/market.android.com\/details?id=info.typea.eitangoroid.pro\">Android \u3067\u82f1\u5358\u8a9e\u3092\u5b66\u7fd2\u3059\u308b\u306a\u3089\u82f1\u5358\u8a9e\u30ed\u30a4\u30c9!<\/a><\/p>\n<p><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4897978742\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4844329405\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4844331272\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ListView \u304c\u3089\u307f\u306e\u5099\u5fd8\u30922\u3064\u307b\u3069\u3002 1.\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u5927\u304d\u304f\u3059\u308b \u4e0b\u56f3\u306e\u69d8\u306b\u3001\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc(\u30ea\u30b9\u30c8\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3) \u306e\u30a2\u30a4\u30c6\u30e0\u304c\u591a\u3044\u3068\u304d\u306a\u3069\u3001\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30cf\u30f3\u30c9\u30eb\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u3001\u4e00\u6c17\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u308b\u69d8\u306b\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[39],"tags":[],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-android"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}