{"id":1059,"date":"2015-12-16T22:25:17","date_gmt":"2015-12-16T14:25:17","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=1059"},"modified":"2015-12-16T22:49:22","modified_gmt":"2015-12-16T14:49:22","slug":"%e4%ba%8c%e7%ba%a7%e4%b8%8b%e6%8b%89%e5%88%97%e8%a1%a8%e8%8f%9c%e5%8d%95expandtabview%e6%94%b9%e8%bf%9b%e7%89%88%ef%bc%88%e4%bb%bf%e7%be%8e%e5%9b%a2%ef%bc%8c%e5%a4%a7%e4%bc%97%e7%82%b9%e8%af%84","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=1059","title":{"rendered":"\u4e8c\u7ea7\u4e0b\u62c9\u5217\u8868\u83dc\u5355ExpandTabView\u6539\u8fdb\u7248\uff08\u4eff\u7f8e\u56e2\uff0c\u5927\u4f17\u70b9\u8bc4\uff09"},"content":{"rendered":"<p>\u7f8e\u56e2\uff0c\u5927\u4f17\u70b9\u8bc4\u7b49\u591a\u6b3eAPP\u4e2d\u90fd\u6d89\u53ca\u5230\u4e8c\u7ea7\u4e0b\u62c9\u5217\u8868\u83dc\u5355\u6548\u679c\uff0c\u7f51\u4e0a\u4e5f\u6709\u5f88\u591a\u5b9e\u73b0\u5982ExpandTabView\uff0cGihub\u4e0b\u8f7d\u5730\u5740\u70b9\u8fd9\u91cc<a href=\"https:\/\/github.com\/yueyueniao2012\/ExpandTabView\">DownLoad<\/a>.<\/p>\n<p><!--more--><\/p>\n<p>\u8fd9\u91cc\u5236\u4f5c\u4e00\u4e2a\u6539\u8fdb\u7248\uff0c\u52a0\u6df1\u5bf9Android\u76f8\u5173\u754c\u9762\u6280\u672f\u7684\u7406\u89e3\uff0c\u5982\u5f39\u6846PopWindow,\u81ea\u5b9a\u4e49\u63a7\u4ef6\uff0c\u81ea\u5b9a\u4e49ToggleButton,\u56de\u8c03\u673a\u5236.<\/p>\n<p>\u5b9e\u73b0\u6548\u679c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-1060\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/12\/ExpandTab.gif\" alt=\"ExpandTab\" width=\"344\" height=\"541\" \/><\/p>\n<p>\u770b\u4e86\u6548\u679c\u8fd8\u662f\u6709\u5174\u8da3\u5427\uff0c\u90a3\u4e48\u6211\u4eec\u6765\u770b\u4e0b\u5982\u4f55\u4f7f\u7528<\/p>\n<p><strong>\u7b2c\u4e00\u6b65\u51c6\u5907\u6570\u636e\u6e90<\/strong><\/p>\n<p>\u4ef7\u683c\uff0c\u6392\u5e8f\uff0c\u4f18\u60e0\u5206\u522b\u5bf9\u5e943\u4e2aList\u96c6\u5408<\/p>\n<pre>private List&lt;KeyValueBean&gt; mPriceLists; \/\/\u4ef7\u683c\r\nprivate List&lt;KeyValueBean&gt; mSortLists;  \/\/\u6392\u5e8f\r\nprivate List&lt;KeyValueBean&gt; mFavorLists; \/\/\u4f18\u60e0\r\n\u533a\u57df\u6d89\u53ca\u5230\u6709\u4e8c\u7ea7\u9700\u8981\u5b9a\u4e49\u4e24\u4e2aList\u96c6\u5408<\/pre>\n<pre>private List&lt;KeyValueBean&gt; mParentLists = new ArrayList&lt;&gt;();\/\/\u7236\u533a\u57df\r\nprivate List&lt;ArrayList&lt;KeyValueBean&gt;&gt; mChildrenListLists = new ArrayList&lt;&gt;();\/\/\u5b50\u533a\u57df\r\n\u6ce8:KeyValueBean\u5bf9\u8c61\u5b9a\u4e49\u5982\u4e0b\r\nclass KeyValueBean {\r\n    private String key;\r\n    private String value;\r\n}\r\n<strong>\u7b2c\u4e8c\u6b65 \u5f15\u5165android-expandpoptab-libary\u5305<\/strong>\r\n\u7b2c\u4e09\u65b9\u5305\u4e0b\u8f7d\u8bf7\u79fb\u6b65\u8fd9\u91cc<a href=\"https:\/\/github.com\/yihu0817\/ExpandPopTabView\/tree\/master\/android-expandpoptab-library\">DownLoad<\/a>.\r\n\u5728\u4f60\u7684Activity\u5e03\u5c40\u6587\u4ef6\u4e2d\u4f7f\u7528\u81ea\u5b9a\u4e49\u63a7\u4ef6ExpandPopTabView<\/pre>\n<p>[java]&lt;com.warmtel.expandtab.ExpandPopTabView<br \/>\n        android:id=&quot;@+id\/expandtab_view&quot;<br \/>\n        android:layout_width=&quot;match_parent&quot;<br \/>\n        android:layout_height=&quot;wrap_content&quot; \/&gt;<br \/>\n[\/java]<\/p>\n<p><strong>\u7b2c\u4e09\u6b65 \u5236\u4f5c\u9700\u8981\u5f39\u51fa\u7684View\uff0c\u8fd9\u91cc\u4f7f\u7528\u7b2c\u4e09\u65b9\u5305\u4e2d\u9ed8\u8ba4\u5b9e\u73b0View\uff0cPopOneListView\u548cPopTwoListView<\/strong><\/p>\n<p>[java]<br \/>\nPopOneListView popOneListView= new PopOneListView(this);<br \/>\nPopTwoListView popTwoListView = new PopTwoListView(this);<br \/>\n[\/java]<\/p>\n<p><strong>\u7b2c\u56db\u6b65 ExpandPopTabView\u5173\u8054\u6570\u636e\u6e90\u548c\u5f39\u51faView<\/strong><\/p>\n<p>[java]<br \/>\npopOneListView.setCallBackAndData(lists, expandTabView, new PopOneListView.OnSelectListener() {<br \/>\n    @Override<br \/>\n    public void getValue(String key, String value) {<br \/>\n        \/\/\u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5<br \/>\n    }<br \/>\n});<br \/>\nexpandTabView.addItemToExpandTab(defaultShowText, popViewOne);<\/p>\n<p>popTwoListView.setCallBackAndData(expandTabView, parentLists, childrenListLists, new PopTwoListView.OnSelectListener() {<br \/>\n      @Override<br \/>\n      public void getValue(String showText, String parentKey, String childrenKey) {<br \/>\n          \/\/\u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5<br \/>\n} });<br \/>\nexpandTabView.addItemToExpandTab(defaultShowText, distanceView);[\/java]<\/p>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u5f39\u51fa\u83dc\u5355\u9ed8\u8ba4\u9009\u4e2d\u9879<\/p>\n<p>[java]popOneListView.setDefaultSelectByValue(defaultSelect);<br \/>\npopTwoListView.setDefaultSelectByValue(defaultParentSelect, defaultChildSelect);[\/java]<\/p>\n<p>\u6700\u540e\u6211\u4eec\u6765\u5bf9\u4ee3\u7801\u5c01\u88c5\u4e0b\u6dfb\u52a0\u4e24\u4e2a\u65b9\u6cd5<\/p>\n<p>[java]<br \/>\npublic void addItem(ExpandPopTabView expandTabView, List&lt;KeyValueBean&gt; lists, String defaultSelect, String defaultShowText) {<br \/>\n        PopOneListView popOneListView = new PopOneListView(this);<br \/>\n        popOneListView.setDefaultSelectByValue(defaultSelect);<br \/>\n       \/\/popViewOne.setDefaultSelectByKey(defaultSelect);<br \/>\n        popOneListView.setCallBackAndData(lists, expandTabView, new PopOneListView.OnSelectListener() {<br \/>\n            @Override<br \/>\n            public void getValue(String key, String value) {<br \/>\n                 \/\/\u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5<br \/>\n            }<br \/>\n        });<br \/>\n        expandTabView.addItemToExpandTab(defaultShowText, popOneListView);<br \/>\n    }<\/p>\n<p>    public void addItem(ExpandPopTabView expandTabView, List&lt;KeyValueBean&gt; parentLists,<br \/>\n                        List&lt;ArrayList&lt;KeyValueBean&gt;&gt; childrenListLists, String defaultParentSelect, String defaultChildSelect, String defaultShowText) {<br \/>\n        PopTwoListView popTwoListView = new PopTwoListView(this);<br \/>\n        popTwoListView.setDefaultSelectByValue(defaultParentSelect, defaultChildSelect);<br \/>\n        \/\/distanceView.setDefaultSelectByKey(defaultParent, defaultChild);<br \/>\n        popTwoListView.setCallBackAndData(expandTabView, parentLists, childrenListLists, new PopTwoListView.OnSelectListener() {<br \/>\n            @Override<br \/>\n            public void getValue(String showText, String parentKey, String childrenKey) {<br \/>\n                 \/\/\u5f39\u51fa\u6846\u9009\u9879\u70b9\u51fb\u9009\u4e2d\u56de\u8c03\u65b9\u6cd5<br \/>\n            }<br \/>\n        });<br \/>\n        expandTabView.addItemToExpandTab(defaultShowText, popTwoListView);<br \/>\n    }<br \/>\n[\/java]<\/p>\n<p>\u8c03\u7528\u65b9\u5f0f<\/p>\n<p>[java]<br \/>\n ExpandPopTabView expandTabView = (ExpandPopTabView) findViewById(R.id.expandtab_view);<br \/>\n addItem(expandTabView, mPriceLists, &quot;&quot;, &quot;\u4ef7\u683c&quot;);<br \/>\n addItem(expandTabView, mFavorLists, &quot;\u9ed8\u8ba4&quot;, &quot;\u6392\u5e8f&quot;);<br \/>\n addItem(expandTabView, mSortLists, &quot;\u4f18\u60e0\u6700\u591a&quot;, &quot;\u4f18\u60e0&quot;);<br \/>\n addItem(expandTabView, mParentLists, mChildrenListLists, &quot;\u9526\u6c5f\u533a&quot;, &quot;\u5408\u6c5f\u4ead&quot;, &quot;\u533a\u57df&quot;);<br \/>\n[\/java]<\/p>\n<p>\u5bf9\u4e0a\u8ff0\u4f7f\u7528\u65b9\u5f0f\u8fd8\u4e0d\u6e05\u695a\u7684\u540c\u5b66\u53ef\u4ee5\u5230\u8fd9\u91cc\u4e0b\u8f7d\u6e90\u7801Demo<br \/>\n<a href=\"https:\/\/github.com\/yihu0817\/ExpandPopTabView\">\u6e90\u7801\u4e0b\u8f7d<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7f8e\u56e2\uff0c\u5927\u4f17\u70b9\u8bc4\u7b49\u591a\u6b3eAPP\u4e2d\u90fd\u6d89\u53ca\u5230\u4e8c\u7ea7\u4e0b\u62c9\u5217\u8868\u83dc\u5355\u6548\u679c\uff0c\u7f51\u4e0a\u4e5f\u6709\u5f88\u591a\u5b9e\u73b0\u5982ExpandTabView\uff0cGih [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[69],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1059"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1059"}],"version-history":[{"count":8,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions"}],"predecessor-version":[{"id":1069,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/1059\/revisions\/1069"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}