- 浏览: 5778602 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (890)
- WindowsPhone (0)
- android (88)
- android快速迭代 (17)
- android基础 (34)
- android进阶 (172)
- android高级 (0)
- android拾遗 (85)
- android动画&效果 (68)
- Material Design (13)
- LUA (5)
- j2me (32)
- jQuery (39)
- spring (26)
- hibernate (20)
- struts (26)
- tomcat (9)
- javascript+css+html (62)
- jsp+servlet+javabean (14)
- java (37)
- velocity+FCKeditor (13)
- linux+批处理 (9)
- mysql (19)
- MyEclipse (9)
- ajax (7)
- wap (8)
- j2ee+apache (24)
- 其他 (13)
- phonegap (35)
最新评论
-
Memories_NC:
本地lua脚本终于执行成功了,虽然不是通过redis
java中调用lua脚本语言1 -
ZHOU452840622:
大神://处理返回的接收状态 这个好像没有监听到 遇 ...
android 发送短信的两种方式 -
PXY:
拦截部分地址,怎么写的for(int i=0;i<lis ...
判断是否登录的拦截器SessionFilter -
maotou1988:
Android控件之带清空按钮(功能)的AutoComplet ...
自定义AutoCompleteTextView -
yangmaolinpl:
希望有表例子更好。。。,不过也看明白了。
浅谈onInterceptTouchEvent、onTouchEvent与onTouch
快速实现一个滑动显示隐藏面板的ListView
基本用法:
在你的item布局文件中需要有ID为expandable_toggle_button的把手,和ID为expandable的面板容器
典型的像下面这样:
如果你嫌上面的做法麻烦:
还有简单的,使用ActionSlideExpandableListView控件,无需指定具体的把手ID和面板ID;
但是我通常不这样做,因为毕竟使用的是ActionSlideExpandableListView,而不是普通的ListView,扩展性可能会受限制。
附件使用的是ActionSlideExpandableListView控件
ExpandableLayout可扩展布局,各种动画效果
http://www.jcodecraeer.com/a/opensource/2015/0909/3431.html
基本用法:
listView = (ListView) view.findViewById(R.id.listView); protected void notifyDataSetChanged() { if (adapter == null) { adapter = new CommonAdapter<T>(context, beans, layoutId) { @Override public void setValues(ViewHolder helper, T item, int position) { createItem(helper, item, position); } }; listView.setAdapter(new SlideExpandableListAdapter(adapter, R.id.expandable_toggle_button, R.id.expandable)); } else { adapter.notifyDataSetChanged(); } }
在你的item布局文件中需要有ID为expandable_toggle_button的把手,和ID为expandable的面板容器
典型的像下面这样:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="8dp" android:paddingRight="8dp" android:orientation="vertical" > <TextView android:id="@+id/item_0" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|start" android:gravity="center" android:singleLine="true" android:text="订单编号" android:textColor="@color/base_black" android:textSize="@dimen/font_middle" /> <TextView android:id="@+id/item_1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:gravity="center" android:paddingBottom="8dp" android:paddingTop="8dp" android:singleLine="true" android:text="进场时间" android:textColor="@color/base_black" android:textSize="@dimen/font_middle" /> </LinearLayout> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="8dp" android:paddingRight="8dp" android:orientation="horizontal" > <TextView android:id="@+id/item_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|start" android:gravity="center" android:singleLine="true" android:text="停车场名称" android:textColor="@color/base_black" android:textSize="@dimen/font_middle" /> <ImageView android:id="@+id/expandable_toggle_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:layout_marginRight="16dp" android:src="@drawable/bg_btn_more" /> </FrameLayout> <LinearLayout android:id="@+id/expandable" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/base_gray" android:orientation="horizontal" > <TextView android:id="@+id/btn_0" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:drawableTop="@drawable/bg_btn_0" android:gravity="center" android:singleLine="true" android:text="取消订单" android:textColor="@android:color/white" android:textSize="@dimen/font_middle" /> <TextView android:id="@+id/btn_1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:drawableTop="@drawable/bg_btn_0" android:gravity="center" android:singleLine="true" android:text="联系对方" android:textColor="@android:color/white" android:textSize="@dimen/font_middle" /> <TextView android:id="@+id/btn_2" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:drawableTop="@drawable/bg_btn_0" android:gravity="center" android:singleLine="true" android:text="退订" android:textColor="@android:color/white" android:textSize="@dimen/font_middle" /> <TextView android:id="@+id/btn_3" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:drawableTop="@drawable/bg_btn_0" android:gravity="center" android:singleLine="true" android:text="进场" android:textColor="@android:color/white" android:textSize="@dimen/font_middle" /> </LinearLayout> </LinearLayout>
如果你嫌上面的做法麻烦:
还有简单的,使用ActionSlideExpandableListView控件,无需指定具体的把手ID和面板ID;
但是我通常不这样做,因为毕竟使用的是ActionSlideExpandableListView,而不是普通的ListView,扩展性可能会受限制。
附件使用的是ActionSlideExpandableListView控件
public class MainActivity extends Activity { @Override public void onCreate(Bundle savedData) { super.onCreate(savedData); // set the content view for this activity, check the content view xml file // to see how it refers to the ActionSlideExpandableListView view. this.setContentView(R.layout.single_expandable_list); // get a reference to the listview, needed in order // to call setItemActionListener on it ActionSlideExpandableListView list = (ActionSlideExpandableListView)this.findViewById(R.id.list); // fill the list with data list.setAdapter(buildDummyData()); // listen for events in the two buttons for every list item. // the 'position' var will tell which list item is clicked list.setItemActionListener(new ActionSlideExpandableListView.OnActionClickListener() { @Override public void onClick(View listView, View buttonview, int position) { /** * Normally you would put a switch * statement here, and depending on * view.getId() you would perform a * different action. */ String actionName = ""; if(buttonview.getId()==R.id.buttonA) { actionName = "buttonA"; } else { actionName = "ButtonB"; } /** * For testing sake we just show a toast */ Toast.makeText( MainActivity.this, "Clicked Action: "+actionName+" in list item "+position, Toast.LENGTH_SHORT ).show(); } // note that we also add 1 or more ids to the setItemActionListener // this is needed in order for the listview to discover the buttons }, R.id.buttonA, R.id.buttonB); } /** * Builds dummy data for the test. * In a real app this would be an adapter * for your data. For example a CursorAdapter */ public ListAdapter buildDummyData() { final int SIZE = 40; String[] values = new String[SIZE]; for(int i=0;i<SIZE;i++) { values[i] = "Item "+i; } return new ArrayAdapter<String>( this, R.layout.expandable_list_item, R.id.text, values ); }
ExpandableLayout可扩展布局,各种动画效果
http://www.jcodecraeer.com/a/opensource/2015/0909/3431.html
发表评论
-
NestedScrollView滚动到顶部固定子View悬停挂靠粘在顶端
2018-10-31 20:45 6811网上有一个StickyScrollView,称之为粘性Scro ... -
自定义Behavior实现AppBarLayout越界弹性效果
2017-03-31 09:33 10235一、继承AppBarLayout.Beha ... -
Android - 一种相似图片搜索算法的实现
2017-03-31 09:33 2570算法 缩小尺寸。 将图片缩小到8x8的尺寸,总共64个 ... -
使用SpringAnimation实现带下拉弹簧动画的 ScrollView
2017-03-30 11:30 2795在刚推出的 Support Library 25.3.0 里面 ... -
Android为应用添加角标(Badge)
2017-03-30 11:21 61041.需求简介 角标是什么意思呢? 看下图即可明了: 可 ... -
Android端与笔记本利用局域网进行FTP通信
2017-03-23 10:17 928先看图 打开前: 打开后: Activity类 ... -
PorterDuffColorFilter 在项目中的基本使用
2017-03-03 10:58 1301有时候标题栏会浮在内容之上,而内容会有颜色的变化,这时候就要求 ... -
ColorAnimationView 实现了滑动Viewpager 时背景色动态变化的过渡效果
2017-02-24 09:41 2172用法在注释中: import android.anima ... -
迷你轻量级全方向完美滑动处理侧滑控件SlideLayout
2017-01-16 16:53 2552纯手工超级迷你轻量级全方向完美滑动处理侧滑控件(比官方 sup ... -
Effect
2017-01-05 09:57 0https://github.com/JetradarMobi ... -
动态主题库Colorful,容易地改变App的配色方案
2016-12-27 14:49 2523Colorful是一个动态主题库,允许您很容易地改变App的配 ... -
对视图的对角线切割DiagonalView
2016-12-27 14:23 1075提供对视图的对角线切割,具有很好的用户定制 基本用法 ... -
仿淘宝京东拖拽商品详情页上下滚动黏滞效果
2016-12-26 16:53 3423比较常用的效果,有现成的,如此甚好!:) import ... -
让任意view具有滑动效果的SlideUp
2016-12-26 09:26 1662基本的类,只有一个: import android.a ... -
AdvancedWebView
2016-12-21 09:44 16https://github.com/delight-im/A ... -
可设置圆角背景边框的按钮, 通过调节色彩明度自动计算按下(pressed)状态颜色
2016-11-02 22:13 1863可设置圆角背景边框的的按钮, 通过调节色彩明度自动计算按下(p ... -
网络请求库相关
2016-10-09 09:35 62https://github.com/amitshekhari ... -
ASimpleCache一个简单的缓存框架
2015-10-26 22:53 2124ASimpleCache 是一个为android制定的 轻量级 ... -
使用ViewDragHelper实现的DragLayout开门效果
2015-10-23 10:55 3337先看一下图,有个直观的了解,向下拖动handle就“开门了”: ... -
保证图片长宽比的同时拉伸图片ImageView
2015-10-16 15:40 3680按比例放大图片,不拉伸失真 import android. ...
相关推荐
主要介绍了微信小程序中的滑动页面隐藏和显示组件功能,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
这是一款使用jQuery和css3制作的滑动显示面板特效插件。当点击了滑动显示按钮,面板从左侧滑出,点击改变按钮或面板外任意位置,面板又滑动收缩回去。
jquery滑动显示和隐藏图片效果更多相关jquery显示jquery滑动滑动特效jquery隐藏
滑动显示隐藏菜单的布局代码库,跟天气主页一样的滑动效果,使用recyclerview代替listview实现,本项目是studio项目
NULL 博文链接:https://xjwolaile.iteye.com/blog/1906805
用户向下滑动view隐藏,向上滑动显示出来poppyview-master.zip
滑动隐藏和显示头部,按照开源的项目改的,根据自己的需求修改
向上滑动listview隐藏标题,向下滑动显示标题,完美解决滑动出现的空白问题。
为智能手机或桌面应用提供滑动翻页功能,将不同主题和子应用分别在不同页面上,还提供隐藏面板,将详细信息隐藏在其中。
Android list列表滑动显示隐藏toolbar(ListView),类似google plus
androidDEmo,手指向上滑动隐藏标题栏,向下滑动显示标题栏,很好的Demo,易懂,适合新手看看。
NULL 博文链接:https://ch0431.iteye.com/blog/855038
根据ScrollView的自定义实现 RelativeLayout跟随手势的上下滑动显示和隐藏顶部标题栏,话不多说 直接上代码
iOS滑动弹出面板示例代码,效果类似Angry bird里面的滑动弹出菜单。
jquery滑动显示和隐藏图片效果
仿UC浏览器,上滑隐藏头部,下滑显示头部。 监听WebView滑动事件,让头部自己滑动。
上滑隐藏标题下拉显示,ListView向上滑动隐藏标题,下拉显示标题栏,完美解决滑动出现的空白问题.
一个自动滑动的左右面板,只需要给一个父元素来存放面板即可
NestedScrollView滑动显示或隐藏Toolbar,相关CSDN博客地址:https://blog.csdn.net/gaoxiaoweiandy/article/details/86598057