什么叫企业文化碎片化ID

Q哥Q妹Ⅲ级
TA的帖子:
发表于 08:35:42
查看: 64988
登录来看看吧
才可以下载或查看,没有帐号?
微信公众帐号实名认证.jpg (0 Bytes, 下载次数: 2)
08:20 上传
  广大微信手机端个人用户请注意:这里说的微信是指微信公众帐号,而非大家安装在手机上的微信。
  文/潘越飞@钱江晚报记者
  年关将近,风声变紧,微信也是。
  “你拍身份证没”,恐怕是微信公众大号们今晚集体的问候语。不过,营销号们,洗洗睡吧。
  想搬微博那一套玩法——“站街”定位啊、装寂寞欲女啊、插科打诨骗来各种粉,臆想着到时候扔个广告单有百分百的到达率,百分之九十的购物转化率——眼看着九成是没戏了。
  要你拍照发身份证,这是主人家意志坚定地赶你出门呢。
  我邪恶的想着,今晚祖国大地的各处办公室里,若干魁梧大汉齐齐回头问老板,一脸幽怨,“我写的是黑丝美女俱乐部,现在把我秃顶的身份证照片弄上去,会不会马上被封号啊,三十万粉丝怎么办”,老板一咬牙,掏出红纸,冲向楼下的KTV,结果发现门前已经排起长队。
  看到微信公众账号登陆页的口号没:再小的个体,也有自己的品牌。
  首先是个体,其次要有品,否则谁受得了手机上轰炸一般的公众号推送的消息。
  估计媒体的微信大号管理员们都要哭了,找大领导拍张手持身份证的照片?话没说完就得被治一个大不敬罪了,你当拍犯人啊。自己拍张手持身份证的照片?这哥们嘀咕,过完年我就辞职了,到时候岂不连累媒体大号被封,罪过罪过。
  微信这一招呢,营销大号和利益公司必受冲击,就算不死,也是心惊胆战。因为正宫娘娘说了,哀家不喜欢你们。
  劝微信营销号们,放弃吧,风紧扯呼啊~~~~~~
  附一个月前写的旧文
  “我们想放弃微信了!”
  前两天,微信公众平台后台弹出了一个公告,大意是,要治理通过朋友圈加粉的做法。
  好吧,又一个低成本推粉模式也被傍上了枷锁。
  虽然现在力捧微信的人满天飞,甚至认为是“到了动刀子的时候”,但是除了那几个微信营销账号、那几个开发下API接口出来摆个POSE后没音讯的创新账号、那几个商家偶尔用用的微信会员卡,其他真没什么成功案例。
  我们是最早使用微信公众账号的都市类媒体(作者单位是《钱江晚报》),最早突破万人大关的平面媒体账号,最早尝试报纸微信互动,一切走得比别人都快一步,我们也比别人更快一步的摸到了微信发展天花板。经过近半年的试水,也许我们该反思下,是不是要放弃微信,至少是打入冷宫一段时间了……
  5个月,百万级报纸,收获1万粉丝
  《钱江晚报》是浙江省一份百万级发行量的都市类媒体,地方老大。
  7月16日,钱江晚报微信升级为认证账号。7月25日,钱江晚报微信正式对外推出。7月27日,开通两天,订阅人数达1200人。8月6日,开始进行定时微信推送,每日三条。9月23日,开通两个月,微信好友粉丝4033人。10月28日,开通三个月,微信粉丝8360人。2个月后,再到今天,粉丝11000多人,猛增势头下降,每日新增用户出现个位数甚至是负数。与此同时,同城一省级广播媒体,由于广播与语音的天热亲近性,在2个月前就已经是5万粉丝,但如今还是这个数字。
  目前,全国各大媒体的微信账号,过一万者寥寥,在一个全国媒体扎堆的QQ群里,偶尔有人跑出来喊声,我们破万了,就会收到各种“求交流”、“求学习”、“太牛了”的回应。
  也就是说,虽然外面吵得沸沸扬扬,但对于微信最早试水的一批来说,已经摸到了天花板。
  我们是腾讯内部的微信经典用户
  我们并非眼睁睁看着这个情况出现的。
  创新,我们一直在创新。
  10月5日,第一次做内容引导。我们在报纸上报道了武林门女装街用微信招揽客户,配上了两个名人微信和自己的微信二维码,通过报道引导尝鲜者成为我们的粉丝,这一招吸引了600个粉丝,算是第一次爆点。
  10月15日,第一次做语音。我们首次尝试明星语音模式——我们把作家九把刀的语音问候直接发送,引来上百条回复,这是在正常新闻资讯难以引起用户回馈时,最有效的方式。之后,我们让延参法师、成龙、白先勇、华少等十余名人都开过金口。最火的一次,是严参法师,300条回复,不过9成都是来问,“这家伙普通话不标准居然还能被拉出来?”。
  10月20日,第一次做活动。“用微信玩一回‘浙江方言好声优’”,趁“元芳你怎么看”大热,呼吁网友一起用方言来念这段话,有效回复300条。也就是这次,让我们内部狂喜,这到达率,这转化率,比微博高了不知多少,必须力推。
  于是我们特地跨部门成立运营团队(业内人知道,跨部门有多难),资讯组3人,负责策划推广和后台推送,目标是每次发送有10%的回复率,应答组2人,负责查看和回复粉丝消息,目标是保证100%的回复率。
  我们把这一套体系和玩法理清后,发展势头不错。
  10月28日,我们还主动发起了一场微信沙龙。邀请了腾讯、电信天翼阅读、省旅游局、天下网商、传媒梦工场、FM93等当时探索得最好的一帮兄弟,这应该是国内最早的微信沙龙,沙龙上分享的演讲《微信:如何挖掘大数据金矿》、《半成品微信会员卡:应从多多益善走向朝朝暮暮》整理成文字后,在网上引起了很大的反响。
  而广播业的朋友更是开心,微信给广播业带去的优势十分明显,5万用户每天用微信语音带去的内容,让电台播出节目时的内容来源一下子增色不少,都是原汁原汁的读者声音,形成一个超级热线中心。
  一切看上去都很美。
  腾讯内部把我们列为典型用户,做内部分享时也拿我们的案例当成绩在谈。我们也幻想着说不定它能超越我们的官方微博,成为低成本、高到达、快速铺开的新渠道……
  试水微信,碰到4个问题
  问题出现在每日新增订阅人数呈负数那一天,那是大约一周前。
  负数从未出现过。为什么?平日有0.5%的退订率是全国报纸、杂志媒体的正常数值,但自然增长率总是大于这个数字的。
  难道是我们自身的问题?我们的修补工作马上开始。
  豆腐块大小的引导式报道篇幅不够,那就做半个版的;纯微信互动游戏没人玩那就送饰品、送餐券;偶尔才搞活动那就每周都做;分栏式新闻不够好,那就单条精选新闻,如果这也嫌烦那就纯文本式。
  为了让微信用户有的体验,我们做了各种尝试。
  结果用户的反馈还是让我们失望——我点开了今天的实时消息页面,其中爆料的有2人,发送“不转发就死的”内容有4个,发现报纸错字的有1个,参加互动活动的有12人,刷屏骂脏话的有1人、询问生活常识的有2人。这些互动,能为媒体提供良性内容的实在太少。特别是报道评论就远低于我们的想象,其实也不难理解,在网易新闻客户端上,发条有才评论可以被大家力捧,在私密性见长的微信上发条评论,这效果对读者来说基本就是自娱自乐,毫无动力。
  传统媒体试水新媒体,说到底是想要更高的曝光率和传播率,关于报道的良性反馈以及用户的个人数据。但微信能给我们的没那么多。
  现在的微信更像一份成本低廉的彩信手机报,仅此而已。
  网上盛传了好几种微信想象空间,例如青龙老贼《微信这一年,改变世界》中提及了微信叫车、叫餐、微信家校通,LOMO自助印、微信会员卡、HTML5游戏、搜索、账号代运营等,但对于媒体来说,并没有那么乐观。
  虽然为了推动公众平台的发展,腾讯的人主动到处登门拜访,在微信首先引入了明星和媒体的资源。但在把大家框进去之后,针对媒体需求的开发并不多,基本都是停留在自身平台的清毒过程中,打击营销账号。
  我刚参加了新浪浙江微博营销大会,他们在推广自己产品时说的重点是,多少新闻热点在我这里发送,阅读时间有多少。而我接触到的微信,经常的表态是,不能骚扰用户、产品要好玩、要做成闭环——这就是区别,媒体公司和通讯公司的区别。
  基于这样的区别,都市类媒体的在微信试水时发现了这样的问题:
  1、同质化竞争开始严重。大家新闻判断相似因为推送的内容相似,每天发点多条式新闻、偶尔来点微信互动游戏、有机会卖萌就卖个萌——大家的玩法也是相似的,偶尔有兄弟媒体搞个新奇点的内容,全国兄弟都会迅速复制,就像我们那个微信说方言活动被拷贝了好几个版本一样。
  因此,在微信上关注A媒体还B媒体,基本就是很艰难的选择。同样是综合类媒体,要在微信这样一个界面过于简约、内容限制强烈的载体上呈现出自己的媒体特征,实在很困难。最后对消费者来说,所有媒体都是千人一面。
  2、好奇心红利开始消退。新华社中国新华电视总编辑陆小华在新媒体领袖班上讲过这么一段话,大意是报纸到广播、广播到电视、电视到门户网站、门户网站到手机报、手机报到手机电视、手机电视到微博、微博到微信,新产品的更迭速度越来越快。
  以我自己为例,公众账号刚出来,看到什么新奇账号我就扫码关注,现在我每天睡醒,基本就是300条以上的未读信息,信息过载,我一点阅读的欲望都没有。对我来说,36氪、虎嗅网、雷锋网的微信账号内容,多看一条少看一条没有本质区别。
  对普通用户来说也一样,从好奇到厌烦只是一步之差,没有本质变化。而且微信本身过于低廉的运营成本,会比当年的彩信手机报还要容易造成信息泛滥,相信过不了半年,就会出现微信账号的大洗牌。
  3、微信骨子里不爱媒体。毕竟天生基因是做社交通讯的,媒体这块真不是微信的目标。来自腾讯内的声音称,为了避免骚扰用户,连媒体公共账号都可能被缩减为每天只能群发送—条——瞅瞅,骨子里就是为了让用户把微信当做一个私密社交工具,点对点互动,不扰清梦的。
  听说,张小龙当初做完微信,拿到一堆妹子里做介绍,免费聊天?妹子们都没兴趣,省钱而已,没意思。加附近陌生人好友?可以被搭讪?妹子们说,这个好玩,这个段子在腾讯内部流传甚广,从侧面体现出了,微信始终是围绕社交这个点做的,而媒体做的是一对多的事情,两者有天然的矛盾。
  圈内还流传的一张截图,张小龙在朋友圈发了条内容,以极客公园微信账号为例,说“rss阅读以另外一种方式回来了”。RSS阅读是什么?当年邮箱功能的一个附属功能,简陋的阅读体验,从未成为核心功能。
  4、微信账号难有爆发式增长。无法爆发式增长,是抛开营销账号说的。单就一个路边餐馆、一本杂志、一份报纸、一家电视台这样有明显的用户边界的发送者来说,微信账号的关注者其实是来自原先忠诚用户中的微信使用者,同时满足两个条件的话,我估计比例在1%——10%。
  关注比例最高的是广播,广播是媒体,但也是一个声音载体,和微信和亲近性。据我了解,浙江省级广播做得好一点的话,10万订阅是做得到的,他们的天花板比平面媒体更高一点。不过他们也很明白,这10万订阅者是来自此前热线电话的使用者,是用户的平移而已。
  就目前的产品功能来说,关注微信的难度比微博大多了,我在关注一个微博账号前,会翻一下他之前的内容合不合我的口味,两页看下来神清气爽的话,我就会关注,反之则无视。而微信一关注,上来的是简单问候,以前的内容无法查询,也就是微信的口味是否相合很难了解。再者,微信本就是熟人社交平台,在公共账号选择上,也是选的熟悉账号,假设你从未听说过“星巴克”,那再卖力诱导你关注都是无济于事的,除非用些小礼品吸引一部分人群,但这些人对媒体来说价值一般。
  5、公众平台太粗糙。现有的公众平台看起来,很是粗糙。每日微信用户增减只有一条简单的曲线,具体新增了谁,退订了谁,能不能告诉我?每个用户的个人信息差看不到,他是谁,居住在,用什么终端,看过我哪些内容,经常点击我们发送的什么内容,能不能告诉我?每天用户什么时候阅读内容,高峰期是什么时候,低谷期是什么时候,不告诉我的话,怎么判断什么时候发送内容才不让人反感啊?每条内容被点击的情况如何,哪些人做了二次转发,信息有没有形成爆发点,能不能多告诉我一些?连这些功能都没有的话,谈什么媒体平台。
  所以我们在想,也许在微信上内容推送,和用网易云阅读开放平台做内容管理是一样的,只是多一个渠道而已。对于原本缺乏渠道的商家、个人来说,微信公众账号的产生和微博的诞生一样,多了一个可以撒泼打诨的新地方,但对于原本就拥有渠道的媒体来说,微信的重要性不需要拔那么高。
  一位地级市媒体的领导和我聊起微信,说他们提了不少功能需求给腾讯,一个月下来半点回应都没,他大怒,“少了微信我们又不是不能活了”。
  也许碎片化是枚良药
  少了微信,的确不会死,只是这个样子很难看。
  就像全国所有人当年都扑在微博上,如果你不玩,就会被嘲笑落伍,微信也一样,这个势头放在那里,完全忽视它是不可能。在微博式微的时候,微信是最佳替代品,毕竟媒体的口味已经被微博养刁了,没有网友围观的信息群发太无聊了。
  我们想放弃微信了,说这话,是因为我们看到了微博运营那套在微信上效果一般,必须放弃早先我们熟悉的那套运营模式,放弃连腾讯内部都没信心说肯定成的推广模式,必须选择以一种新的形态尽量去贴合微信的特点:
  1、碎片化。微信的使用是碎片化时间,一天点亮屏幕200次的话,应该有一半是因为微信新消息提醒。
  因此碎片的化使用习惯对应的该是碎片化内容。垂直化的内容更适合微信,大而全吃不开。
  微博运营的时候,大家的习惯是刷屏,要的一个信息量,淘宝购物的时候,大家的习惯是刷宝贝,要的是一个逛街的感觉,微信使用的时候,大家的习惯是快速完成对话,“对话即服务”。
  因此,你告诉我这是个讲笑话的地方,那我会关注,你告诉这是个看房地产资讯的地方,我会关注,你告诉我是个适合杭州吃货折腾的地方,我会关注,但你告诉这是个讲述浙江新闻、娱乐、政治、民生的地方,我就会犹豫一下了。因此像是某某日报这样的账号就放着简单点运营,某某美食、某某旅游、某某娱乐这样的账号多推推,应该效果会不错。
  碎片化的内容还需要碎片化的推广渠道,集中在某个媒介的推广是否上升瓶颈的。如果在美食街贴上美食类微信二维码账号,号称只要关注即可获得一张优惠券,或者在售楼处贴上房产类微信账号,号称只要关注即可打9.8折,那有效粉丝会上升。
  看到新闻,有人在微信上做了个法律实时咨询的账号,这种切口小、贴合微信通讯本质的做法,我觉得很不错。
  2、私人化。在互动方面,我关注你,是潜意识把你当做我通讯录的某个好友,一个有点唠叨定时抽风的好友,你可以给我提供资讯,但你也要为我解困解惑。
  你应该知道我经常在哪些地方出没、我给自己贴什么标签、我喜欢什么的游戏活动、叫得出我的名字、知道我的脾气。你是旅游俱乐部,你就不要把汽车的广告推送给我,你既然知道我决定元旦去新马泰玩,就别发海南的旅游信息过来了。
  3、轻阅读。一则5000字的文章就别发了,删减成500字给我吧,既然大家都懂得一天只能发三条,那也该明白这是“微信”不是“长信”,长阅读就别来。为了获取更多用户数据所以做了两三层跳转页面,这种活动不参加也罢,一个页面能说完的就别用两个页面。
  微信的使用规则本身就在混乱中。腾讯微博花了近两年时间,把这个新玩法做到了成熟,作为被微博洗礼过一遍的媒体,应该有自己的判断。现在微信每次阅读要点两次已经是很2的决定了,大家不要一起2。
  以上三点万一奏效,也许会让媒体在微信公共账号里玩出点水花,不过这成本、这收益,有待仔细算过。同样的投入,应是个人用户得到更多,传统媒体高昂的人工成本,估计有点亏,毕竟企鹅一直擅长是面向C端而不是B端。
  对于媒体来说,渠道当然越多越好,但前提是可控的渠道要占有一定比例。当年新浪、网易等门户网站靠从媒体免费拿内容养大自己后,自己吃肉媒体喝汤,现在微博、微信更狠,让媒体免费主动打工,以大环境如此的理由绑架媒体上自己的船。长此以往,移动互联网这个媒体最后的翻身机会,都会被巨头们拿走。
  微信不是万能药
  传媒梦工场前段时间给张小龙颁了奖,叫做社会化影响力。年度影响力科技人物,称他“已经成为移动端应用产品研发者的偶像。”这是张小龙开发完微信后,无数光环中的一个,其他还有百度颠覆者、微博颠覆者、运营商颠覆者种种“恐怖”叫法。
  老子说,欲先取之,必先予之。我们已经给了微信及张小龙太多,是时候回过头来看看,微信不是万能药,什么都能治。
  也许微信是极客们的好玩具,什么机器人对话、语义识别、实时路况,都是好看的创意;也许微信是商家的发财之道,至少比广告更容易获取单子,订个餐、定个房,成为升级版12580;也许微信是流量入口,推个HTML5游戏、弄个客户端下载,转化率比网盟广告要低不少……
  但是,对于媒体来说,它的颠覆性没那么强,作为骨子里缺乏媒体基因的产品,它应该只是众多推送渠道之一,其长期价值远不如媒体去做个产品。
  广大微信手机端个人用户请注意:这里说的微信是指微信公众帐号,而非大家安装在手机上的微信。
广大微信手机端个人用户请注意:这里说的微信是指微信公众帐号,而非大家安装在手机上的微信。
{:soso_e136:}
微信公众平台!
终身大事必须实名制
張三瘋 发表于
终身大事必须实名制
{:soso_e179:}
未来。 发表于
{:soso_e151:}
張三瘋 发表于
你不是孩子都几岁了{:soso_e144:}
未来。 发表于
你不是孩子都几岁了
谁跟你说的啊?我怎么都不知道咧?
張三瘋 发表于
谁跟你说的啊?我怎么都不知道咧?
我记得是这样的阿,当时你的QQ头像是个小吖 你自己说的好吧.
Copyright & 1998 - 2015 Tencent Inc.7018人阅读
&&&&其实一种好的UI布局,可以使用户感到更加的亲切与方便。最近非常流行的莫过于侧边栏了,其实我也做过很多侧边栏的应用,但是那些侧边栏的使用我都不是很满意,现在重新整理,重新写了一个相对来说我比较满意的侧边栏,其中运用的就是android3.0版本之后新加的Fragment碎片化,碎片化的使用将来也是一个趋势,所以通过我这个程序你既可以学到侧边栏,也能让你更加熟悉碎片化的使用,一举两得的事。哈哈……废话不多说了,直接上图。图片如下:
①、自定义一个View,把左侧边栏视图,中间内容视图,右侧边栏视图放在里面,这里给这个View起名叫:SlidingMenu.java
代码如下:
package net.loonggg.
import android.content.C
import android.util.AttributeS
import android.view.V
import android.widget.RelativeL
public class SlidingMenu extends RelativeLayout {
private SlidingView mSlidingV
private View mMenuV
private View mDetailV
public SlidingMenu(Context context) {
super(context);
public SlidingMenu(Context context, AttributeSet attrs) {
super(context, attrs);
public SlidingMenu(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
public void addViews(View left, View center, View right) {
setLeftView(left);
setRightView(right);
setCenterView(center);
* 添加左侧边栏的view
* @param view
@SuppressWarnings(&deprecation&)
public void setLeftView(View view) {
LayoutParams behindParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.FILL_PARENT);
behindParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);// 在父控件的左边
addView(view, behindParams);
mMenuView =
* 添加右侧边栏的view
* @param view
@SuppressWarnings(&deprecation&)
public void setRightView(View view) {
LayoutParams behindParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.FILL_PARENT);
behindParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);// 在父控件的右边
addView(view, behindParams);
mDetailView =
* 添加中间内容的view
* @param view
@SuppressWarnings(&deprecation&)
public void setCenterView(View view) {
LayoutParams aboveParams = new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT);
mSlidingView = new SlidingView(getContext());
mSlidingView.setView(view);
addView(mSlidingView, aboveParams);
mSlidingView.setMenuView(mMenuView);
mSlidingView.setDetailView(mDetailView);
mSlidingView.invalidate();
public void showLeftView() {
mSlidingView.showLeftView();
public void showRightView() {
mSlidingView.showRightView();
②、通过一个中间的View,去控制左右侧边栏的滑进与滑出,这个也是自定义的一个View,名字叫:SlidingView.java
代码如下:
package net.loonggg.
import android.content.C
import android.graphics.C
import android.util.AttributeS
import android.util.L
import android.view.MotionE
import android.view.VelocityT
import android.view.V
import android.view.ViewC
import android.view.ViewG
import android.widget.FrameL
import android.widget.S
public class SlidingView extends ViewGroup {
private FrameLayout mC
private Scroller mS
private VelocityTracker mVelocityT
private int mTouchS
private float mLastMotionX;
private float mLastMotionY;
private static final int SNAP_VELOCITY = 1000;
private View mMenuV
private View mDetailV
public SlidingView(Context context) {
super(context);
public SlidingView(Context context, AttributeSet attrs) {
super(context, attrs);
public SlidingView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mContainer.measure(widthMeasureSpec, heightMeasureSpec);
protected void onLayout(boolean changed, int l, int t, int r, int b) {
final int width = r -
final int height = b -
mContainer.layout(0, 0, width, height);
private void init() {
mContainer = new FrameLayout(getContext());
mContainer.setBackgroundColor(0xff000000);
mScroller = new Scroller(getContext());
mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
super.addView(mContainer);
public void setView(View v) {
if (mContainer.getChildCount() & 0) {
mContainer.removeAllViews();
mContainer.addView(v);
public void scrollTo(int x, int y) {
super.scrollTo(x, y);
postInvalidate();
public void computeScroll() {
if (!mScroller.isFinished()) {
if (puteScrollOffset()) {
int oldX = getScrollX();
int oldY = getScrollY();
int x = mScroller.getCurrX();
int y = mScroller.getCurrY();
if (oldX != x || oldY != y) {
scrollTo(x, y);
// Keep on drawing until the animation has finished.
invalidate();
clearChildrenCache();
clearChildrenCache();
private boolean mIsBeingD
public boolean onInterceptTouchEvent(MotionEvent ev) {
final int action = ev.getAction();
final float x = ev.getX();
final float y = ev.getY();
switch (action) {
case MotionEvent.ACTION_DOWN:
mLastMotionX =
mLastMotionY =
mIsBeingDragged =
case MotionEvent.ACTION_MOVE:
final float dx = x - mLastMotionX;
final float xDiff = Math.abs(dx);
final float yDiff = Math.abs(y - mLastMotionY);
if (xDiff & mTouchSlop && xDiff & yDiff) {
mIsBeingDragged =
mLastMotionX =
return mIsBeingD
public boolean onTouchEvent(MotionEvent ev) {
if (mVelocityTracker == null) {
mVelocityTracker = VelocityTracker.obtain();
mVelocityTracker.addMovement(ev);
final int action = ev.getAction();
final float x = ev.getX();
final float y = ev.getY();
switch (action) {
case MotionEvent.ACTION_DOWN:
if (!mScroller.isFinished()) {
mScroller.abortAnimation();
mLastMotionX =
mLastMotionY =
if (getScrollX() == -getMenuViewWidth()
&& mLastMotionX & getMenuViewWidth()) {
if (getScrollX() == getDetailViewWidth()
&& mLastMotionX & getMenuViewWidth()) {
case MotionEvent.ACTION_MOVE:
if (mIsBeingDragged) {
enableChildrenCache();
final float deltaX = mLastMotionX -
mLastMotionX =
float oldScrollX = getScrollX();
float scrollX = oldScrollX + deltaX;
if (deltaX & 0 && oldScrollX & 0) { // left view
final float leftBound = 0;
final float rightBound = -getMenuViewWidth();
if (scrollX & leftBound) {
scrollX = leftB
} else if (scrollX & rightBound) {
scrollX = rightB
// mDetailView.setVisibility(View.INVISIBLE);
// mMenuView.setVisibility(View.VISIBLE);
} else if (deltaX & 0 && oldScrollX & 0) { // right view
final float rightBound = getDetailViewWidth();
final float leftBound = 0;
if (scrollX & leftBound) {
scrollX = leftB
} else if (scrollX & rightBound) {
scrollX = rightB
// mDetailView.setVisibility(View.VISIBLE);
// mMenuView.setVisibility(View.INVISIBLE);
scrollTo((int) scrollX, getScrollY());
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mIsBeingDragged) {
final VelocityTracker velocityTracker = mVelocityT
puteCurrentVelocity(1000);
int velocityX = (int) velocityTracker.getXVelocity();
velocityX = 0;
Log.e(&ad&, &velocityX == & + velocityX);
int oldScrollX = getScrollX();
int dx = 0;
if (oldScrollX & 0) {
if (oldScrollX & -getMenuViewWidth() / 2
|| velocityX & SNAP_VELOCITY) {
dx = -getMenuViewWidth() - oldScrollX;
} else if (oldScrollX &= -getMenuViewWidth() / 2
|| velocityX & -SNAP_VELOCITY) {
dx = -oldScrollX;
if (oldScrollX & getDetailViewWidth() / 2
|| velocityX & -SNAP_VELOCITY) {
dx = getDetailViewWidth() - oldScrollX;
} else if (oldScrollX &= getDetailViewWidth() / 2
|| velocityX & SNAP_VELOCITY) {
dx = -oldScrollX;
smoothScrollTo(dx);
clearChildrenCache();
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker =
private int getMenuViewWidth() {
if (mMenuView == null) {
return mMenuView.getWidth();
private int getDetailViewWidth() {
if (mDetailView == null) {
return mDetailView.getWidth();
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
public View getDetailView() {
return mDetailV
public void setDetailView(View mDetailView) {
this.mDetailView = mDetailV
public View getMenuView() {
return mMenuV
public void setMenuView(View mMenuView) {
this.mMenuView = mMenuV
// void toggle() {
// int menuWidth = mMenuView.getWidth();
// int oldScrollX = getScrollX();
// if (oldScrollX == 0) {
// smoothScrollTo(-menuWidth);
// } else if (oldScrollX == -menuWidth) {
// smoothScrollTo(menuWidth);
* 左侧边栏的关闭与显示
public void showLeftView() {
int menuWidth = mMenuView.getWidth();
int oldScrollX = getScrollX();
if (oldScrollX == 0) {
smoothScrollTo(-menuWidth);
} else if (oldScrollX == -menuWidth) {
smoothScrollTo(menuWidth);
* 右侧边栏的关闭与显示
public void showRightView() {
int menuWidth = mDetailView.getWidth();
int oldScrollX = getScrollX();
if (oldScrollX == 0) {
smoothScrollTo(menuWidth);
} else if (oldScrollX == menuWidth) {
smoothScrollTo(-menuWidth);
void smoothScrollTo(int dx) {
int duration = 500;
int oldScrollX = getScrollX();
mScroller.startScroll(oldScrollX, getScrollY(), dx, getScrollY(),
duration);
invalidate();
void enableChildrenCache() {
final int count = getChildCount();
for (int i = 0; i & i++) {
final View layout = (View) getChildAt(i);
layout.setDrawingCacheEnabled(true);
void clearChildrenCache() {
final int count = getChildCount();
for (int i = 0; i & i++) {
final View layout = (View) getChildAt(i);
layout.setDrawingCacheEnabled(false);
③、在MainActivity的布局文件中,引用咱们自定义的侧边栏View,MainActivity的布局文件代码如下:activity_main.xml:
&?xml version=&1.0& encoding=&utf-8&?&
&net.loonggg.view.SlidingMenu xmlns:android=&/apk/res/android&
android:id=&@+id/slidingMenu&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent& /&
④、MainActivity继承碎片化FragmentActivity,其代码如下:
package net.loonggg.
import net.loonggg.view.SlidingM
import android.content.I
import android.os.B
import android.support.v4.app.FragmentA
import android.support.v4.app.FragmentT
import android.view.V
import android.view.W
public class MainActivity extends FragmentActivity {
private SlidingMenu mSlidingM// 侧边栏的view
private LeftFragment leftF // 左侧边栏的碎片化view
private RightFragment rightF // 右侧边栏的碎片化view
private SampleListFragment centerF// 中间内容碎片化的view
private FragmentT // 碎片化管理的事务
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 去标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
mSlidingMenu = (SlidingMenu) findViewById(R.id.slidingMenu);
mSlidingMenu.setLeftView(getLayoutInflater().inflate(
R.layout.left_frame, null));
mSlidingMenu.setRightView(getLayoutInflater().inflate(
R.layout.right_frame, null));
mSlidingMenu.setCenterView(getLayoutInflater().inflate(
R.layout.center_frame, null));
ft = this.getSupportFragmentManager().beginTransaction();
leftFragment = new LeftFragment();
rightFragment = new RightFragment();
ft.replace(R.id.left_frame, leftFragment);
ft.replace(R.id.right_frame, rightFragment);
centerFragment = new SampleListFragment();
ft.replace(R.id.center_frame, centerFragment);
ft.commit();
public void llronclick(View v) {
switch (v.getId()) {
case R.id.llr_energy_management:
Intent intent = new Intent(this, DetailsActivity.class);
startActivity(intent);
public void showLeft() {
mSlidingMenu.showLeftView();
public void showRight() {
mSlidingMenu.showRightView();
⑤、左中右,左侧边栏,中间内容部分,右侧边栏,分别用Fragment代替,呈现出你想要的界面,这里我们只需要写Fragment就可以了,中间部分我们用SampleListFragment代替其中间内容部分,SampleListFragment的代码如下:
package net.loonggg.
import java.util.ArrayL
import java.util.HashM
import java.util.L
import java.util.M
import android.content.I
import android.os.B
import android.support.v4.app.ListF
import android.util.L
import android.view.LayoutI
import android.view.V
import android.view.View.OnClickL
import android.view.ViewG
import android.widget.ImageV
import android.widget.ListV
import android.widget.SimpleA
public class SampleListFragment extends ListFragment {
private ImageView lv_
private ImageView iv_
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View mView = inflater.inflate(R.layout.list, null);
lv_left = (ImageView) mView.findViewById(R.id.iv_left);
iv_right = (ImageView) mView.findViewById(R.id.iv_right);
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Map&String, Object& item1 = new HashMap&String, Object&();
item1.put(&list_title&, getString(R.string.title1));
item1.put(&list_image&, R.drawable.p1);
item1.put(&list_contect&, getString(R.string.test));
Map&String, Object& item2 = new HashMap&String, Object&();
item2.put(&list_title&, getString(R.string.title1));
item2.put(&list_image&, R.drawable.p2);
item2.put(&list_contect&, getString(R.string.test));
Map&String, Object& item3 = new HashMap&String, Object&();
item3.put(&list_title&, getString(R.string.title1));
item3.put(&list_image&, R.drawable.p3);
item3.put(&list_contect&, getString(R.string.test));
Map&String, Object& item4 = new HashMap&String, Object&();
item4.put(&list_title&, getString(R.string.title1));
item4.put(&list_image&, R.drawable.p4);
item4.put(&list_contect&, getString(R.string.test));
Map&String, Object& item5 = new HashMap&String, Object&();
item5.put(&list_title&, getString(R.string.title1));
item5.put(&list_image&, R.drawable.p5);
item5.put(&list_contect&, getString(R.string.test));
Map&String, Object& item6 = new HashMap&String, Object&();
item6.put(&list_title&, getString(R.string.title1));
item6.put(&list_image&, R.drawable.p6);
item6.put(&list_contect&, getString(R.string.test));
Map&String, Object& item7 = new HashMap&String, Object&();
item7.put(&list_title&, getString(R.string.title1));
item7.put(&list_image&, R.drawable.p7);
item7.put(&list_contect&, getString(R.string.test));
List&Map&String, Object&& data = new ArrayList&Map&String, Object&&();
data.add(item1);
data.add(item2);
data.add(item3);
data.add(item4);
data.add(item5);
data.add(item6);
data.add(item7);
String[] from = new String[] { &list_title&, &list_image&,
&list_contect& };
int[] to = new int[] { R.id.list_title, R.id.list_image,
R.id.list_contect };
SimpleAdapter adapter = new SimpleAdapter(getActivity(), data,
R.layout.list_item, from, to);
setListAdapter(adapter);
lv_left.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
((MainActivity) getActivity()).showLeft();
iv_right.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
((MainActivity) getActivity()).showRight();
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Intent intent = new Intent(getActivity(), DetailsActivity.class);
startActivity(intent);
其相应的布局文件代码如下:list.xml:
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout xmlns:android=&/apk/res/android&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:background=&#fff&
android:orientation=&vertical& &
&LinearLayout
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:background=&@drawable/banner_unit&
android:padding=&7dip& &
&ImageView
android:id=&@+id/iv_left&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_weight=&0.1&
android:clickable=&true&
android:src=&@drawable/booklist_menu_normal& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center_vertical&
android:gravity=&center_horizontal&
android:textColor=&#000&
android:layout_weight=&0.8&
android:text=&Fragment&
android:textSize=&17dp& /&
&ImageView
android:id=&@+id/iv_right&
android:clickable=&true&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&right&
android:layout_weight=&0.1&
android:src=&@drawable/back_normal& /&
&/LinearLayout&
android:id=&@android:id/list&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent& &
&/ListView&
&/LinearLayout&
⑥、左侧边栏的View用LeftFragment替代,LeftFragment代码如下:
package net.loonggg.
import android.os.B
import android.support.v4.app.F
import android.support.v4.app.FragmentT
import android.view.LayoutI
import android.view.V
import android.view.ViewG
import android.widget.LinearL
public class LeftFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.left_fragment, null);
LinearLayout userLayout = (LinearLayout) view
.findViewById(R.id.userLayout);
userLayout.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
UserFragment user = new UserFragment();
FragmentTransaction ft = getActivity()
.getSupportFragmentManager().beginTransaction();
ft.replace(R.id.center_frame, user);
ft.commit();
((MainActivity) getActivity()).showLeft();
LinearLayout mainPage = (LinearLayout) view.findViewById(R.id.mainPage);
mainPage.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
FragmentTransaction ft = getActivity()
.getSupportFragmentManager().beginTransaction();
ft.replace(R.id.center_frame, new SampleListFragment());
ft.commit();
((MainActivity) getActivity()).showLeft();
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
其对应的布局文件代码如下:left_fragment.xml:
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout xmlns:android=&/apk/res/android&
android:id=&@+id/mlist&
android:layout_width=&wrap_content&
android:layout_height=&fill_parent&
android:orientation=&vertical& &
&LinearLayout
android:id=&@+id/mainPage&
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:background=&@drawable/oper_title2&
android:gravity=&center&
android:orientation=&vertical& &
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:text=&主页&
android:textColor=&#000&
android:textSize=&17dip& /&
&/LinearLayout&
&LinearLayout
android:layout_width=&wrap_content&
android:layout_height=&fill_parent&
android:background=&@drawable/booklist_menu_bg_unit2&
android:orientation=&vertical& &
&LinearLayout
android:id=&@+id/userLayout&
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:layout_weight=&0.2&
android:clickable=&true&
android:orientation=&vertical&
android:padding=&5dip& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:src=&@drawable/booklist_menu_user& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:text=&用户&
android:textColor=&#000& /&
&/LinearLayout&
&LinearLayout
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:layout_weight=&0.2&
android:clickable=&true&
android:orientation=&vertical&
android:padding=&5dip& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:src=&@drawable/booklist_menu_synchronize& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:text=&收藏&
android:textColor=&#000& /&
&/LinearLayout&
&LinearLayout
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:layout_weight=&0.2&
android:clickable=&true&
android:orientation=&vertical&
android:padding=&5dip& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:src=&@drawable/booklist_menu_std& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:text=&标准&
android:textColor=&#000& /&
&/LinearLayout&
&LinearLayout
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:layout_weight=&0.2&
android:clickable=&true&
android:orientation=&vertical&
android:padding=&5dip& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:src=&@drawable/booklist_menu_help& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:text=&帮助&
android:textColor=&#000& /&
&/LinearLayout&
&LinearLayout
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:layout_weight=&0.2&
android:clickable=&true&
android:orientation=&vertical&
android:padding=&5dip& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:src=&@drawable/booklist_menu_about& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:text=&关于&
android:textColor=&#000& /&
&/LinearLayout&
&/LinearLayout&
&/LinearLayout&
⑦、右侧边栏的View用RightFragment替代,RightFragment代码如下:
package net.loonggg.
import android.os.B
import android.support.v4.app.F
import android.view.LayoutI
import android.view.V
import android.view.ViewG
public class RightFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.right_fragment, null);
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
其对应的布局文件代码如下:right_fragment.xml:
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout xmlns:android=&/apk/res/android&
android:layout_width=&wrap_content&
android:layout_height=&match_parent&
android:orientation=&vertical& &
&LinearLayout
android:layout_width=&match_parent&
android:layout_height=&wrap_content&
android:background=&@drawable/oper_title&
android:gravity=&center&
android:orientation=&vertical& &
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:gravity=&center&
android:text=&服
android:textColor=&#000&
android:textSize=&17dip& /&
&/LinearLayout&
&ScrollView
android:layout_width=&wrap_content&
android:layout_height=&fill_parent&
android:background=&@drawable/booklist_menu_bg_unit& &
&LinearLayout
android:layout_width=&wrap_content&
android:layout_height=&fill_parent&
android:orientation=&vertical&
android:padding=&5dip& &
&LinearLayout
android:id=&@+id/llr_energy_management&
android:layout_width=&match_parent&
android:layout_height=&60dp&
android:clickable=&true&
android:onClick=&llronclick& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:src=&@drawable/lxqg& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.8&
android:text=&能源管理&
android:textColor=&#000& /&
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:gravity=&center&
android:src=&@drawable/arrow_to_right& /&
&/LinearLayout&
&ImageView
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_gravity=&center&
android:src=&@drawable/line_read_option& /&
&LinearLayout
android:id=&@+id/llr_hr_management&
android:layout_width=&match_parent&
android:layout_height=&60dp&
android:clickable=&true&
android:onClick=&llronclick& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:src=&@drawable/lxqg& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.8&
android:text=&人力管理&
android:textColor=&#000& /&
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:gravity=&center&
android:src=&@drawable/arrow_to_right& /&
&/LinearLayout&
&ImageView
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_gravity=&center&
android:src=&@drawable/line_read_option& /&
&LinearLayout
android:id=&@+id/llr_business_management&
android:layout_width=&match_parent&
android:layout_height=&60dp&
android:clickable=&true&
android:onClick=&llronclick& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:src=&@drawable/lxqg& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.8&
android:text=&商务管理&
android:textColor=&#000& /&
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:gravity=&center&
android:src=&@drawable/arrow_to_right& /&
&/LinearLayout&
&ImageView
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_gravity=&center&
android:src=&@drawable/line_read_option& /&
&LinearLayout
android:id=&@+id/llr_financial_management&
android:layout_width=&match_parent&
android:layout_height=&60dp&
android:clickable=&true&
android:onClick=&llronclick& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:src=&@drawable/lxqg& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.8&
android:text=&金融管理&
android:textColor=&#000& /&
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:gravity=&center&
android:src=&@drawable/arrow_to_right& /&
&/LinearLayout&
&ImageView
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_gravity=&center&
android:src=&@drawable/line_read_option& /&
&LinearLayout
android:id=&@+id/llr_purchasing_management&
android:layout_width=&match_parent&
android:layout_height=&60dp&
android:clickable=&true&
android:onClick=&llronclick& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:src=&@drawable/lxqg& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.8&
android:text=&采购管理&
android:textColor=&#000& /&
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:gravity=&center&
android:src=&@drawable/arrow_to_right& /&
&/LinearLayout&
&ImageView
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_gravity=&center&
android:src=&@drawable/line_read_option& /&
&LinearLayout
android:id=&@+id/llr_supply_management&
android:layout_width=&match_parent&
android:layout_height=&60dp&
android:clickable=&true&
android:onClick=&llronclick& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:src=&@drawable/lxqg& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.8&
android:text=&供应管理&
android:textColor=&#000& /&
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:gravity=&center&
android:src=&@drawable/arrow_to_right& /&
&/LinearLayout&
&ImageView
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_gravity=&center&
android:src=&@drawable/line_read_option& /&
&LinearLayout
android:id=&@+id/llr_project_management&
android:layout_width=&match_parent&
android:layout_height=&60dp&
android:clickable=&true&
android:onClick=&llronclick& &
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:src=&@drawable/lxqg& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.8&
android:text=&项目管理&
android:textColor=&#000& /&
&ImageView
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center&
android:layout_weight=&0.1&
android:gravity=&center&
android:src=&@drawable/arrow_to_right& /&
&/LinearLayout&
&ImageView
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:layout_gravity=&center&
android:src=&@drawable/line_read_option& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:text=&说明我是宽度自适应的...& /&
&/LinearLayout&
&/ScrollView&
&/LinearLayout&
⑧、在左侧边栏中有一个点击事件,点击用户,进入用户界面,这里的用户界面也是一个Fragment,点击事件的具体代码在⑥中已经有了,现在我把用户界面的Fragment代码贴出来:UserFragment.java:
package net.loonggg.
import android.os.B
import android.support.v4.app.F
import android.view.LayoutI
import android.view.V
import android.view.ViewG
import android.widget.ImageV
public class UserFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.user, null);
ImageView left = (ImageView) view.findViewById(R.id.iv_user_left);
left.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
((MainActivity) getActivity()).showLeft();
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
其对应的布局代码如下:user.xml:
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout xmlns:android=&/apk/res/android&
android:layout_width=&match_parent&
android:layout_height=&match_parent&
android:background=&#ffffff&
android:orientation=&vertical& &
&LinearLayout
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:background=&@drawable/banner_unit&
android:padding=&7dip& &
&ImageView
android:id=&@+id/iv_user_left&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_weight=&0.1&
android:clickable=&true&
android:src=&@drawable/booklist_menu_normal& /&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&center_vertical&
android:layout_weight=&0.8&
android:gravity=&center_horizontal&
android:text=&Fragment&
android:textColor=&#000&
android:textSize=&17dp& /&
&ImageView
android:id=&@+id/iv_right&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:layout_gravity=&right&
android:layout_weight=&0.1&
android:clickable=&true&
android:src=&@drawable/back_normal& /&
&/LinearLayout&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:gravity=&center&
android:text=&用户管理&
android:textColor=&#000000&
android:textSize=&24sp& /&
&/LinearLayout&
⑨、其他不重要的代码如下:
DetailsActivity.java:
package net.loonggg.
import android.app.A
import android.os.B
public class DetailsActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.details);
其对应的布局文件代码如下:details.xml:
&LinearLayout xmlns:android=&/apk/res/android&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:background=&#fff&
android:orientation=&vertical& &
&ImageView
android:layout_width=&match_parent&
android:layout_height=&200dp&
android:scaleType=&fitXY&
android:src=&@drawable/p1& /&
&/LinearLayout&
还有就是string.xml的代码如下:
&?xml version=&1.0& encoding=&utf-8&?&
&resources&
&string name=&app_name&&碎片化侧边栏&/string&
&string name=&action_settings&&Settings&/string&
&string name=&title1&&这种导弹的平均航速为5倍音速&/string&
&string name=&title2&&这种导弹的平均航速为5倍音速&/string&
&string name=&title3&&这种导弹的平均航速为5倍音速&/string&
&string name=&title4&&这种导弹的平均航速为5倍音速&/string&
&string name=&title5&&这种导弹的平均航速为5倍音速&/string&
&string name=&title6&&这种导弹的平均航速为5倍音速&/string&
&string name=&title7&&这种导弹的平均航速为5倍音速&/string&
&string name=&test&&美国《空军》杂志、西班牙《世界报》等媒体报道,美军计划在今年内多次试射高超音速导弹,从而将其作为威慑中俄的强力武器。有外媒指出,解放军已开发出可拦截高速导弹的防控系统,而且有潜力进一步开发拦截高超音速导弹的防空武器。
美国《空军》杂志报道,美军将在2013年继续试射高超音速巡航导弹,这种导弹的平均航速为5倍音速,最高瞬时航速达到7倍音速。对于目前全球所有的防卫系统来说,它都是无法防御的导弹。美国《防务新闻》更是声称,美军的“高超音速攻击时代”即将来临,目前各国军队尚无能力对这种高速攻击目标进行有效拦截,任何导弹防御系统在它面前都形同虚设。
西班牙《世界报》报道,从2013年3月到12月,美军可能进行3次重要的实验,如果一切顺利,美军可能于2014年尝试装备少量的高超音速导弹,这种导弹有望在未来5年内形成战斗力。
报道认为,美军高超音速导弹所形成的威胁以及对世界格局的影响难以估量。美国可能在一些“敏感区域”部署这种导弹,例如东亚地区,而朝鲜和伊朗的核设施也可能成为它的攻击目标。报道强调,美军高超音速导弹的主要作用是对其他军事大国实施威慑,主要是中国和俄罗斯。
据俄罗斯《军工信使》周刊指出,解放军在防范超音速导弹攻击方面“已经追赶上来”,中国某国防工业公开发的代号为LD-2000的陆基防空系统,已经被证实具备实战能力。这种防空系统可为高价值目标,包括指挥所、弹道导弹发射装置等提供保护。LD-2000防空系统发射的导弹拦截高速飞行的导弹和飞机,尤其擅长对付雷达反射面积较小的隐身巡航导弹及高速巡航导弹。报道揣测,它可以准确拦截飞行速度超过两倍音速的超音速导弹。通过改进其控制软件,该系统还可用来拦截高速火箭弹和迫击炮弹。
报道称,LD-2000系统可加装在军用卡车底盘上,从而实现机动部署,在需要它的地方构建防范超音速导弹的密集导弹阵。这种导弹集群的火力可与美军著名的“密集阵”(专门防御来袭空中目标的防空导弹集群)媲美。
报道称,LD-2000是一款针对出口市场的产品,解放军肯定同步开发了自用型号,而且其性能必然优于LD-2000,应该可以防范速度更快的来袭目标,例如航速达到三四倍音速的巡航导弹。报道认为,这表明解放军有能力开发用来对付美军高超音速导弹的防御系统。&/string&
&/resources&
到这里就基本完成了。可能你现在没有看懂,我把源码放出来,供大家参考。源代码下载地址如下:
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:236305次
积分:3037
积分:3037
排名:第5259名
原创:55篇
转载:16篇
评论:243条
(3)(1)(1)(2)(1)(4)(14)(7)(1)(2)(1)(1)(9)(18)(1)(3)(5)}

我要回帖

更多关于 什么叫id号 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信