- 学习Android的第十九天
Java'
Android学习android
目录AndroidExpandableListView分组列表ExpandableListView属性ExpandableListView事件ExpandableListView的Adapter范例参考文档AndroidViewFlipper翻转视图ViewFlipper属性ViewFlipper方法为ViewFlipper加入View例子:全屏幕可以滑动的引导页参考文档AndroidExpand
- expandableListView刷新数据问题
Leoxhmm
一开始调用了notifyDataSetChanged();发现数据有问题,翻了下百度发现expandableListView单单调用notifyDataSetChanged还不够还需要把它关闭在打开,加入后完美刷新数据适配器setDataactivity中调用
- Android ExpandableListView列表全部展开与全部收缩
静静的程序小狗
常用方法Android
AndroidExpandableListView列表全部展开与全部收缩的解决方法:列表全部展开代码:for(inti=0;i<adapter.getGroupCount();i++){elistview.expandGroup(i);}列表全部收缩代码:for(inti=0;i<adapter.getGroupCount();i++){elistview.collapseGroup(i);}
- Android中的二级列表-ExpandableListView
橙子的博客
android
Android中的二级下拉列表,类似于某Q的分组,采用ExpandableListView实现,适配器方法如下。先看效果图:有四个分组,每个分组下都有一些子条目,可以跟着父条目展开而显示实现代码:一级列表是一个ArrayList,二级列表是一个HashMap。//添加一级数据项存储一级菜单的名字ArrayListfirstLevelMenuList=SeatModelManager.getInst
- 我会的android技术总结
yue31313
1,侧滑删除,2,ExpandableListView二级列表3,(滑动开关)滑动开关按钮4,MD5+base64加密====新浪微盾5,动态密码动画效果,6,倒计时动画效果7,OTP一次性口令8,获取设备的IMEI9,捕获全局异常Thread.UncaughtExceptionHandler10,项目管理工具SVN11,jira测试,改bug12,二维码扫描13,有盟统计//友盟14,判断锁屏1
- android可扩展列表-ExpandableListView
quanCN
简介ExpandableListView可扩展列表,或者称其为二级列表,它能够完美的实现二级列表的显示和隐藏官网声明javaBean首先声明需要用的数据类,及其关联类publicclassPerson{privateListhobbies;privateStringname;/***morecode...*/}publicclassHobby{privateStringname;/***morec
- Android : ExpandableListView(折叠列表) +BaseExpandableListAdapter-简单应用
javaGHui
Android相关androidstudioandroid
示例图:实体类DemoData.javapackagecom.example.myexpandablelistview.entity;publicclassDemoData{privateStringcontent;privateintimg;publicDemoData(Stringcontent,intimg){this.content=content;this.img=img;}public
- Android:解决ExpandableListView中添加button后item项点击事件问题
mapleSeriesX
在ExpandableListView中添加button后item项不能点击,获取不到点击事件。原因:button按钮抢占了ExpandableListView的焦点解决方法:为button按钮添加android:focusable="false"属性,关闭button获取焦点,ExpandableListView中的项目即可点击
- [随手记]ScrollView嵌套ExpandableListView展开问题
风华是一指流砂
随手记Android例子
太懒,直接上代码:publicstaticvoidsetListViewHeightBasedOnChildren(ExpandableListViewlistView){//获取ListView对应的AdapterListAdapterlistAdapter=listView.getAdapter();if(listAdapter==null){//pre-conditionreturn;}in
- Android——基本控件(下)(二十)
毛栗子201105
Android开发语言androidgitee
1.树型组件:ExpandableListView1.1知识点(1)掌握树型组件的定义;(2)可以使用事件对树操作进行监听。2.具体内容既然这个组件可以完成列表的功能,肯定就需要一个可以操作的数据,那么这里也是使用setAdapter()这个方法完成数据的设置,可以大家可以发现,setAdapter方法中可以接受数据类型:publicvoidsetAdapter(ExpandableListAda
- Recyclerview实现展开、折叠分组,多种布局,多种divider
万剑
使用方式compile'com.wanjian:expandable-recyclerview:0.0.1'分组RecyclerView支持多种group布局和多种child布局[图片上传失败...(image-d09ed6-1518181457487)]继承NestedAdapter,实现下列方法即可,跟使用ExpandableListview类似,getGroupItemViewType可以和
- 2020-03-25
先生_7857
1,二级列表(ExpandableListView)创建布局,找控件1.创建布局,找控件2.获取数据:网络数据,死数据3.创建适配器:10个方法,两个优化(ViewHolder避免重复找id,ContentView存放已创建的布局,方便复用)4.设置适配器5.父项,子项点击事件(——》前提如下图:)2,ListView手动,自动加载更多(1)listView1.创建布局,找控件2.获取网络数据3.
- Android 可分组的RecyclerViewAdapter
__素颜__
需求image.png用listView有分组的展示是ExpandableListView,但是现在都已经不用listview做列表展示了,RecyclerView也有分组展示的AdapterRecyclerViewAdapter。同时也支持头部悬浮吸顶功能1、引入依赖在Project的build.gradle在添加以下代码allprojects{repositories{...maven{url
- ExpandableListView 设置布局中view visibility="gone"引发的高度异常问题
OyeAndroid
ExpandableListView可展示折叠列表,由于父布局和子布局中某些控件只有在需要时才显示,所以根据条件设置目标控件Viewvisibility="gone"后,初始化显示正常,可是点击展开后,时不时出现已不可见的view仍然占有着空间,排查发现父布局和子布局的根布局使用的是ConstraintLayout,导致visibility="gone"后布局高度异常.将根布局换成LinearLa
- 二级列表简单实现
命运的撑船人
ExpandableListView:就是一种用于垂直滚动展示二级列表的视图,组可以单独展开。这些数据是通过ExpandableListView关联的。一、使用1.定义布局文件2.定义要显示的数据//group数据privateArrayListGroutList;//item数据privateArrayList>ItemSet;privatevoidinitData(){GropList=new
- Android ExpandableRecyclerView使用小结
drawthink
代码github地址Android学习交流QQ群:103267029因为工作需要一个二级树结构View,所以借鉴ExpandableListView自己写了个ExpandableRecyclerView。1.目前只支持两级结构。2.支持所有组同时全部展开,支持同一时间只能展开一组。3.GroupView,ChildView高度自定义。4.支持初始化数据时,指定展开某组数据。5.支持GroupIte
- canScroll方法完美解决ViewPager内部控件滑动冲突问题
IT键盘侠
代码结构1.最外层是一个ViewPager2.ViewPager的每个item又是一个ExpandableListview3.ExpandableListview的childItem是一个单行的ViewPager问题描述滑动最底层的ViewPager时,很容易引起最外层的ViewPager滑动截图.png解决思路1.分析最外层ViewPager的onIntercepterTouchEvent方法的
- Android中的二级列表(用数组方法实现)
我挺平凡
二级列表.png1.在activity_main.xml文件中定义ExpandableListView控件2.定义组视图layout_group.xml3.定义子视图layout_child.xml4.在MainActivity中的代码privateExpandableListViewlv;publicString[]groupArray=newString[]{"武侠类","惊悚/恐怖类","影
- 记录软键盘将底部布局顶起来的解决办法
MRYDM
RecyclerView和EditText一起使用会将布局顶起来,但是ListView或者是ExpandableListView与EditText一起使用则不会。解决办法:在RecyclerView的layout中加上以下两个属性1.android:descendantFocusability="beforeDescendants"2.android:fastScrollEnabled="fals
- java 增强for循环数组越界_解决在for循环中remove list报错越界的问题
杰克波比
java增强for循环数组越界
最近在搞一个购物车的功能,里面有一个批量删除的操作,采用的是ExpandableListView以及BaseExpandableListAdapter。视乎跟本篇无关紧要,主要是为了记录一个java基础。迭代器iterator的使用一、错误代码(主要就是购物车的批量删除)/***删除选中的*/publicvoiddelSelect(){intgroupSize;if(mGropBeens!=nul
- Android 商城购物车模块 ShoppingCar
StormFeng
最近公司要搞一个商城APP出来,购物车当然是必不可少的一个模块,看似简单的购物车,里边逻辑错综复杂。后来在逛论坛和QQ交流群的时候经常听到小伙伴们交流这一块,不知道如何下手,索性就把自己做的购物车单独抽出来抛砖引玉,希望各位不吝赐教废话不多说,先上效果图:因为这里的商品要分店家分类,一个父item下边可以有子item,所以这里选择使用ExpandableListView(可展开的列表组件)总体的思
- Android通用Adapter的封装
Geek_yang
一个快速进行适配器编写的库,适用于RecyclerView、ListView、GridView、ViewPager、ViewPager2、ExpandableListView、Spinner等,可大大减少样板代码,简化Adapter的编写。github地址
- Android UI 之实现多级列表TreeView
如毛毛风
AndroidUI整理TreeViewListViewBaseAdapterAndroidViewHolder
所谓TreeView就是在Windows中常见的多级列表树,在Android中系统只默认提供了ListView和ExpandableListView两种列表,最多只支持到二级列表的实现,所以如果想要实现三级和更多层次的列表,就需要我们自己来做一些处理了。其实这个效果很久以前就有人想办法实现了,但是实现的效果有一些问题,我的实现思路主要也是来自于网络,但是在其基础上修正了逻辑上的一些错误,做了一些优
- 实现多级列表(二级列表嵌套)
躲起来的一只熊
效果图:实现步骤:ExpandableListView布局文件2.写适配器3适配器//嵌套的ExpandableListViewAdapter自定义ExpandableListView条目显示不全的问题//2级的适配器//设置父标题//子条目//设置字体//适配器布局android:clickable="false"android:focusable="false"android:focusabl
- 简单使用ExpandableListView
吃葡萄丶不吐西瓜皮
一、大体步骤1.整体布局main.xml2.一级标题布局group.xml3.二级标题布局child.xml4.java代码二、具体实施1.main.xmlhttp://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.
- ExpandableListView的展开子项默认展示
芒鞋胜马
1、ExpandableListView在设置展开的时候,当你的展开项在最下方的时候,点击展开,如果你没有其他提示是否展开的动画效果,在不手动滑动的时候,很难发现是否已经展开。publicbooleanexpandGroup(intgroupPos,booleananimate)这里面的animate就是设置是否有展开动画效果,如果没有写默认为false,只有设置成true的时候才会出现动画效果。
- Android ExpandableListView使用方法案例详解
目录一、前言二、实现的功能三、具体代码1、主xml代码2、父布局xml代码3、子布局xml代码4、主activity代码5、adapter代码一、前言“好记性不如烂笔头”,再次验证了这句话是真的很有道理啊,一个月前看了一下ExpandableListView的使用,今天再看居然忘了这个是干啥的了,今天就详细讲解一下ExpandableListView的使用方法,感觉对于二级条目显示功能都可以实现。
- 2020-03-18
小摩托ay
1.二级列表(ExpandableListView)①创建布局、找控件②获取数据:死数据、网络数据③创建适配器:重写10个方法④设置适配器⑤父项、子项点击事件2.ListView手动加载、自动加载(1)ListView①创建布局、找控件②获取网络数据③创建适配器:两个优化④设置适配器(2)ListView手动加载①创建布局、找控件②获取网络数据③创建适配器:两个优化④设置适配器⑤给ListView
- ExpandableListView(QQ好友列表)
码农耕
ExpandableListView,就是可折叠的列表,它是ListView的子类,在ListView的基础上它把应用中的列表项分为几组,每组里又可包含多个列表项。ExpandableListView用法和Listview差不多,设置适配器,适配器里面设置数据。1.我们先在控制器的布局文件中添加一个ExpandableListView2.ExpandableListView中分为组头和组里的每一个
- ExpandableListView全选功能
tommy_yong
expandlist.setOnGroupExpandListener(newExpandableListView.OnGroupExpandListener(){@OverridepublicvoidonGroupExpand(intgroupPosition){//只展开一个for(inti=0,count=expandlist.getCount();i0){for(inti=0;ifor(i
- 强大的销售团队背后 竟然是大数据分析的身影
蓝儿唯美
数据分析
Mark Roberge是HubSpot的首席财务官,在招聘销售职位时使用了大量数据分析。但是科技并没有挤走直觉。
大家都知道数理学家实际上已经渗透到了各行各业。这些热衷数据的人们通过处理数据理解商业流程的各个方面,以重组弱点,增强优势。
Mark Roberge是美国HubSpot公司的首席财务官,HubSpot公司在构架集客营销现象方面出过一份力——因此他也是一位数理学家。他使用数据分析
- Haproxy+Keepalived高可用双机单活
bylijinnan
负载均衡keepalivedhaproxy高可用
我们的应用MyApp不支持集群,但要求双机单活(两台机器:master和slave):
1.正常情况下,只有master启动MyApp并提供服务
2.当master发生故障时,slave自动启动本机的MyApp,同时虚拟IP漂移至slave,保持对外提供服务的IP和端口不变
F5据说也能满足上面的需求,但F5的通常用法都是双机双活,单活的话还没研究过
服务器资源
10.7
- eclipse编辑器中文乱码问题解决
0624chenhong
eclipse乱码
使用Eclipse编辑文件经常出现中文乱码或者文件中有中文不能保存的问题,Eclipse提供了灵活的设置文件编码格式的选项,我们可以通过设置编码 格式解决乱码问题。在Eclipse可以从几个层面设置编码格式:Workspace、Project、Content Type、File
本文以Eclipse 3.3(英文)为例加以说明:
1. 设置Workspace的编码格式:
Windows-&g
- 基础篇--resources资源
不懂事的小屁孩
android
最近一直在做java开发,偶尔敲点android代码,突然发现有些基础给忘记了,今天用半天时间温顾一下resources的资源。
String.xml 字符串资源 涉及国际化问题
http://www.2cto.com/kf/201302/190394.html
string-array
- 接上篇补上window平台自动上传证书文件的批处理问卷
酷的飞上天空
window
@echo off
: host=服务器证书域名或ip,需要和部署时服务器的域名或ip一致 ou=公司名称, o=公司名称
set host=localhost
set ou=localhost
set o=localhost
set password=123456
set validity=3650
set salias=s
- 企业物联网大潮涌动:如何做好准备?
蓝儿唯美
企业
物联网的可能性也许是无限的。要找出架构师可以做好准备的领域然后利用日益连接的世界。
尽管物联网(IoT)还很新,企业架构师现在也应该为一个连接更加紧密的未来做好计划,而不是跟上闸门被打开后的集成挑战。“问题不在于物联网正在进入哪些领域,而是哪些地方物联网没有在企业推进,” Gartner研究总监Mike Walker说。
Gartner预测到2020年物联网设备安装量将达260亿,这些设备在全
- spring学习——数据库(mybatis持久化框架配置)
a-john
mybatis
Spring提供了一组数据访问框架,集成了多种数据访问技术。无论是JDBC,iBATIS(mybatis)还是Hibernate,Spring都能够帮助消除持久化代码中单调枯燥的数据访问逻辑。可以依赖Spring来处理底层的数据访问。
mybatis是一种Spring持久化框架,要使用mybatis,就要做好相应的配置:
1,配置数据源。有很多数据源可以选择,如:DBCP,JDBC,aliba
- Java静态代理、动态代理实例
aijuans
Java静态代理
采用Java代理模式,代理类通过调用委托类对象的方法,来提供特定的服务。委托类需要实现一个业务接口,代理类返回委托类的实例接口对象。
按照代理类的创建时期,可以分为:静态代理和动态代理。
所谓静态代理: 指程序员创建好代理类,编译时直接生成代理类的字节码文件。
所谓动态代理: 在程序运行时,通过反射机制动态生成代理类。
一、静态代理类实例:
1、Serivce.ja
- Struts1与Struts2的12点区别
asia007
Struts1与Struts2
1) 在Action实现类方面的对比:Struts 1要求Action类继承一个抽象基类;Struts 1的一个具体问题是使用抽象类编程而不是接口。Struts 2 Action类可以实现一个Action接口,也可以实现其他接口,使可选和定制的服务成为可能。Struts 2提供一个ActionSupport基类去实现常用的接口。即使Action接口不是必须实现的,只有一个包含execute方法的P
- 初学者要多看看帮助文档 不要用js来写Jquery的代码
百合不是茶
jqueryjs
解析json数据的时候需要将解析的数据写到文本框中, 出现了用js来写Jquery代码的问题;
1, JQuery的赋值 有问题
代码如下: data.username 表示的是: 网易
$("#use
- 经理怎么和员工搞好关系和信任
bijian1013
团队项目管理管理
产品经理应该有坚实的专业基础,这里的基础包括产品方向和产品策略的把握,包括设计,也包括对技术的理解和见识,对运营和市场的敏感,以及良好的沟通和协作能力。换言之,既然是产品经理,整个产品的方方面面都应该能摸得出门道。这也不懂那也不懂,如何让人信服?如何让自己懂?就是不断学习,不仅仅从书本中,更从平时和各种角色的沟通
- 如何为rich:tree不同类型节点设置右键菜单
sunjing
contextMenutreeRichfaces
组合使用target和targetSelector就可以啦,如下: <rich:tree id="ruleTree" value="#{treeAction.ruleTree}" var="node" nodeType="#{node.type}"
selectionChangeListener=&qu
- 【Redis二】Redis2.8.17搭建主从复制环境
bit1129
redis
开始使用Redis2.8.17
Redis第一篇在Redis2.4.5上搭建主从复制环境,对它的主从复制的工作机制,真正的惊呆了。不知道Redis2.8.17的主从复制机制是怎样的,Redis到了2.4.5这个版本,主从复制还做成那样,Impossible is nothing! 本篇把主从复制环境再搭一遍看看效果,这次在Unbuntu上用官方支持的版本。 Ubuntu上安装Red
- JSONObject转换JSON--将Date转换为指定格式
白糖_
JSONObject
项目中,经常会用JSONObject插件将JavaBean或List<JavaBean>转换为JSON格式的字符串,而JavaBean的属性有时候会有java.util.Date这个类型的时间对象,这时JSONObject默认会将Date属性转换成这样的格式:
{"nanos":0,"time":-27076233600000,
- JavaScript语言精粹读书笔记
braveCS
JavaScript
【经典用法】:
//①定义新方法
Function .prototype.method=function(name, func){
this.prototype[name]=func;
return this;
}
//②给Object增加一个create方法,这个方法创建一个使用原对
- 编程之美-找符合条件的整数 用字符串来表示大整数避免溢出
bylijinnan
编程之美
import java.util.LinkedList;
public class FindInteger {
/**
* 编程之美 找符合条件的整数 用字符串来表示大整数避免溢出
* 题目:任意给定一个正整数N,求一个最小的正整数M(M>1),使得N*M的十进制表示形式里只含有1和0
*
* 假设当前正在搜索由0,1组成的K位十进制数
- 读书笔记
chengxuyuancsdn
读书笔记
1、Struts访问资源
2、把静态参数传递给一个动作
3、<result>type属性
4、s:iterator、s:if c:forEach
5、StringBuilder和StringBuffer
6、spring配置拦截器
1、访问资源
(1)通过ServletActionContext对象和实现ServletContextAware,ServletReque
- [通讯与电力]光网城市建设的一些问题
comsci
问题
信号防护的问题,前面已经说过了,这里要说光网交换机与市电保障的关系
我们过去用的ADSL线路,因为是电话线,在小区和街道电力中断的情况下,只要在家里用笔记本电脑+蓄电池,连接ADSL,同样可以上网........
 
- oracle 空间RESUMABLE
daizj
oracle空间不足RESUMABLE错误挂起
空间RESUMABLE操作 转
Oracle从9i开始引入这个功能,当出现空间不足等相关的错误时,Oracle可以不是马上返回错误信息,并回滚当前的操作,而是将操作挂起,直到挂起时间超过RESUMABLE TIMEOUT,或者空间不足的错误被解决。
这一篇简单介绍空间RESUMABLE的例子。
第一次碰到这个特性是在一次安装9i数据库的过程中,在利用D
- 重构第一次写的线程池
dieslrae
线程池 python
最近没有什么学习欲望,修改之前的线程池的计划一直搁置,这几天比较闲,还是做了一次重构,由之前的2个类拆分为现在的4个类.
1、首先是工作线程类:TaskThread,此类为一个工作线程,用于完成一个工作任务,提供等待(wait),继续(proceed),绑定任务(bindTask)等方法
#!/usr/bin/env python
# -*- coding:utf8 -*-
- C语言学习六指针
dcj3sjt126com
c
初识指针,简单示例程序:
/*
指针就是地址,地址就是指针
地址就是内存单元的编号
指针变量是存放地址的变量
指针和指针变量是两个不同的概念
但是要注意: 通常我们叙述时会把指针变量简称为指针,实际它们含义并不一样
*/
# include <stdio.h>
int main(void)
{
int * p; // p是变量的名字, int *
- yii2 beforeSave afterSave beforeDelete
dcj3sjt126com
delete
public function afterSave($insert, $changedAttributes)
{
parent::afterSave($insert, $changedAttributes);
if($insert) {
//这里是新增数据
} else {
//这里是更新数据
}
}
 
- timertask
shuizhaosi888
timertask
java.util.Timer timer = new java.util.Timer(true);
// true 说明这个timer以daemon方式运行(优先级低,
// 程序结束timer也自动结束),注意,javax.swing
// 包中也有一个Timer类,如果import中用到swing包,
// 要注意名字的冲突。
TimerTask task = new
- Spring Security(13)——session管理
234390216
sessionSpring Security攻击保护超时
session管理
目录
1.1 检测session超时
1.2 concurrency-control
1.3 session 固定攻击保护
 
- 公司项目NODEJS实践0.3[ mongo / session ...]
逐行分析JS源代码
mongodbsessionnodejs
http://www.upopen.cn
一、前言
书接上回,我们搭建了WEB服务端路由、模板等功能,完成了register 通过ajax与后端的通信,今天主要完成数据与mongodb的存取,实现注册 / 登录 /
- pojo.vo.po.domain区别
LiaoJuncai
javaVOPOJOjavabeandomain
POJO = "Plain Old Java Object",是MartinFowler等发明的一个术语,用来表示普通的Java对象,不是JavaBean, EntityBean 或者 SessionBean。POJO不但当任何特殊的角色,也不实现任何特殊的Java框架的接口如,EJB, JDBC等等。
即POJO是一个简单的普通的Java对象,它包含业务逻辑
- Windows Error Code
OhMyCC
windows
0 操作成功完成.
1 功能错误.
2 系统找不到指定的文件.
3 系统找不到指定的路径.
4 系统无法打开文件.
5 拒绝访问.
6 句柄无效.
7 存储控制块被损坏.
8 存储空间不足, 无法处理此命令.
9 存储控制块地址无效.
10 环境错误.
11 试图加载格式错误的程序.
12 访问码无效.
13 数据无效.
14 存储器不足, 无法完成此操作.
15 系
- 在storm集群环境下发布Topology
roadrunners
集群stormtopologyspoutbolt
storm的topology设计和开发就略过了。本章主要来说说如何在storm的集群环境中,通过storm的管理命令来发布和管理集群中的topology。
1、打包
打包插件是使用maven提供的maven-shade-plugin,详细见maven-shade-plugin。
<plugin>
<groupId>org.apache.maven.
- 为什么不允许代码里出现“魔数”
tomcat_oracle
java
在一个新项目中,我最先做的事情之一,就是建立使用诸如Checkstyle和Findbugs之类工具的准则。目的是制定一些代码规范,以及避免通过静态代码分析就能够检测到的bug。 迟早会有人给出案例说这样太离谱了。其中的一个案例是Checkstyle的魔数检查。它会对任何没有定义常量就使用的数字字面量给出警告,除了-1、0、1和2。 很多开发者在这个检查方面都有问题,这可以从结果
- zoj 3511 Cake Robbery(线段树)
阿尔萨斯
线段树
题目链接:zoj 3511 Cake Robbery
题目大意:就是有一个N边形的蛋糕,切M刀,从中挑选一块边数最多的,保证没有两条边重叠。
解题思路:有多少个顶点即为有多少条边,所以直接按照切刀切掉点的个数排序,然后用线段树维护剩下的还有哪些点。
#include <cstdio>
#include <cstring>
#include <vector&