ExpandTabView
=============
今天给大家带了一个好用的控件,大众点评的下拉菜单,当然是仿照显示效果实现的。实现下拉菜单我第一个想到的就是popupwindow。是的,我这里确实使用popupwindow实现的。
因为不同的菜单里面的头部tabbar的个数不一样而且样式也可能不一样,有些里面是listview,有些里面是按钮和一些其他的控件,所以我的思路就渐渐清晰了。
首先,我想构造一个基于LinearLayout的控件,里面动态生成下拉菜单的tab的个数,并控制作为下拉菜单的popupwindow显示隐藏动画效果,即ExpandTabView.java(在源码中)这个类。
然后根据每个菜单子项显示的内容不同,构造不同的组件,传入ExpandTabView中,让其接受ExpandTabView的控制。这样可以保证每个菜单子项的独立性,可以进行各自的风格化,达到高内聚低耦合的效果。同时为了每个菜单子项有一些通用的行为,我在这里构造了一个基类ViewBaseAction.java。
再有就是listview在popupwindow中有个奇怪的现象当popupwindow设置为popupWindow.setFocusable(false)的时候,里面的listview的监听事件失效了,我们只能通过自己构造的监听事件来监听listview的onitemclick事件。具体实现方式详见TextAdapter.java这个类。
License
=================
Copyright (C) 2013 yueyueniao
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Android多级下拉列表菜单 (100个子文件)
resources.ap_ 40KB
ExpandTabView.apk 162KB
ExpandTabView.class 8KB
ViewMiddle.class 6KB
TextAdapter.class 5KB
ViewRight.class 4KB
ViewLeft.class 4KB
MainActivity.class 4KB
ExpandTabView$2.class 2KB
ViewMiddle$2.class 1KB
ViewMiddle$1.class 1KB
TextAdapter$1.class 1KB
ViewRight$1.class 1KB
ViewLeft$1.class 1KB
MainActivity$3.class 1KB
MainActivity$1.class 1KB
MainActivity$2.class 1KB
R$drawable.class 943B
ExpandTabView$1.class 830B
R.class 798B
R$layout.class 617B
R$color.class 571B
R$dimen.class 555B
R$string.class 522B
R$style.class 496B
R$id.class 478B
R$anim.class 455B
R$attr.class 361B
BuildConfig.class 359B
TextAdapter$OnItemClickListener.class 281B
ViewRight$OnSelectListener.class 276B
ViewLeft$OnSelectListener.class 273B
ExpandTabView$OnButtonClickListener.class 262B
ViewMiddle$OnSelectListener.class 261B
ViewBaseAction.class 162B
.classpath 364B
classes.dex 352KB
.gitattributes 483B
.gitignore 2KB
android-support-v4.jar 265KB
android-support-v4-632c3cc189c7f7f50207292a8fe8cde0.jar 109KB
annotations-c2a597ad2bb4ce0a27c36079811a5110.jar 943B
ExpandTabView.java 6KB
ViewMiddle.java 5KB
TextAdapter.java 4KB
R.java 4KB
MainActivity.java 3KB
ViewRight.java 2KB
ViewLeft.java 2KB
ViewBaseAction.java 175B
BuildConfig.java 167B
choose_item_selected.jpg 1KB
README.md 2KB
ic_launcher-web.png 54KB
ic_launcher.png 13KB
ic_launcher.png 10KB
ic_launcher.png 8KB
ic_launcher.png 6KB
ic_launcher.png 4KB
ic_launcher.png 3KB
ic_launcher.png 2KB
ic_launcher.png 2KB
choose_item_right.9.png 2KB
choose_item_right.9.png 1KB
choosebar_down.9.png 587B
choosebar_press_up.9.png 585B
choosebar_press_down.9.png 571B
choosebar_press_down.9.png 571B
choosebar_press_up.9.png 567B
choosebar_down.9.png 543B
choosearea_bg_mid.9.png 503B
choosearea_bg_right.9.png 500B
choosearea_bg_left.9.png 499B
choosearea_bg_left.9.png 364B
choosearea_bg_mid.9.png 363B
choosearea_bg_right.9.png 362B
choosebar_line.png 197B
choosebar_line.png 89B
org.eclipse.jdt.core.prefs 177B
org.eclipse.core.resources.prefs 57B
.project 207B
project.properties 562B
proguard-project.txt 781B
view_region.xml 1KB
styles.xml 896B
AndroidManifest.xml 833B
AndroidManifest.xml 833B
view_distance.xml 760B
toggle_button.xml 478B
popshow_anim.xml 469B
pophidden_anim.xml 458B
activity_main.xml 456B
choose_item.xml 420B
expand_tab_selector.xml 394B
colors.xml 311B
strings.xml 290B
dimens.xml 268B
choose_eara_item_selector.xml 260B
choose_plate_item_selector.xml 260B
choose_eara_item_selector.xml 260B
共 100 条
- 1
minimicall
- 粉丝: 399
- 资源: 35
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页