首页 移动开发 Android     /    Android实现仿QQ5.0的侧滑效果(博客源码)

Android实现仿QQ5.0的侧滑效果(博客源码)

上传者: pfe_nova | 上传时间:2025/1/12 11:44:01 | 文件大小:2.49MB | 文件类型:7z
Android实现仿QQ5.0的侧滑效果(博客源码)
博客地址http://blog.csdn.net/pfe_nova/article/details/40921097整体思路:两个界面本质是一个View,左右排列,通过一个水平滚动条来实现(示例中自定义了一个View继承自HorizontalScrollView)。
起始状态滚动条在靠近中间的位置,这样就显示出了内容区域。
当从内容区向左侧滑时,滑到一定的范围就直接将滚动条设置到最左边,这样就看到了左边的菜单。
向右侧滑也是类似。
为了达到在菜单边界露出内容区域的效果,需要设置菜单的宽度比屏幕宽度小一些(小的宽度就是露出内容区域的宽度)。
需要的知识点如下:1.自定义View的onMeasure事件与onLayout事件;
2.onTouchEvent事件;
3.获取屏幕的宽度和高度;
4.获取和设置滚动条的偏移量并实现切换的动画;
5.单位换算;
6.设置不显示标题。
本软件ID:8135737

文件下载

资源详情

[{"title":"(60个子文件2.49MB)Android实现仿QQ5.0的侧滑效果(博客源码)","children":[{"title":"QQ1024","children":[{"title":".project <span style='color:#111;'>842B</span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'>563B</span>","children":null,"spread":false},{"title":"src","children":[{"title":"com","children":[{"title":"example","children":[{"title":"qq1024","children":[{"title":"MainActivity.java <span style='color:#111;'>288B</span>","children":null,"spread":false},{"title":"SlidingMenu.java <span style='color:#111;'>2.15KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'>868B</span>","children":null,"spread":false},{"title":"res","children":[{"title":"drawable-ldpi","children":null,"spread":false},{"title":"drawable-hdpi","children":[{"title":"forth_menu.png <span style='color:#111;'>15.53KB</span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'>7.48KB</span>","children":null,"spread":false},{"title":"third_menu.png <span style='color:#111;'>5.08KB</span>","children":null,"spread":false},{"title":"qq_main.png <span style='color:#111;'>92.35KB</span>","children":null,"spread":false},{"title":"second_menu.png <span style='color:#111;'>12.66KB</span>","children":null,"spread":false},{"title":"first_menu.png <span style='color:#111;'>7.84KB</span>","children":null,"spread":false},{"title":"left_menu.png <span style='color:#111;'>545.19KB</span>","children":null,"spread":false}],"spread":true},{"title":"values-v11","children":[{"title":"styles.xml <span style='color:#111;'>334B</span>","children":null,"spread":false}],"spread":true},{"title":"menu","children":[{"title":"main.xml <span style='color:#111;'>368B</span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'>3.69KB</span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"left_menulayout.xml <span style='color:#111;'>4.18KB</span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'>948B</span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'>24.20KB</span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'>12.22KB</span>","children":null,"spread":false}],"spread":true},{"title":"values-w820dp","children":[{"title":"dimens.xml <span style='color:#111;'>381B</span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'>223B</span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'>697B</span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'>220B</span>","children":null,"spread":false}],"spread":false},{"title":"values-v14","children":[{"title":"styles.xml <span style='color:#111;'>391B</span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'>177B</span>","children":null,"spread":false}],"spread":true},{"title":"assets","children":null,"spread":false},{"title":"gen","children":[{"title":"com","children":[{"title":"example","children":[{"title":"qq1024","children":[{"title":"BuildConfig.java <span style='color:#111;'>160B</span>","children":null,"spread":false},{"title":"R.java <span style='color:#111;'>3.14KB</span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'>633.13KB</span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'>475B</span>","children":null,"spread":false},{"title":"proguard-project.txt <span style='color:#111;'>781B</span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'>50.19KB</span>","children":null,"spread":false},{"title":"bin","children":[{"title":"resources.ap_ <span style='color:#111;'>587.54KB</span>","children":null,"spread":false},{"title":"classes","children":[{"title":"com","children":[{"title":"example","children":[{"title":"qq1024","children":[{"title":"R$layout.class <span style='color:#111;'>442B</span>","children":null,"spread":false},{"title":"R$style.class <span style='color:#111;'>431B</span>","children":null,"spread":false},{"title":"R$dimen.class <span style='color:#111;'>461B</span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'>345B</span>","children":null,"spread":false},{"title":"R$drawable.class <span style='color:#111;'>608B</span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'>340B</span>","children":null,"spread":false},{"title":"SlidingMenu.class <span style='color:#111;'>2.77KB</span>","children":null,"spread":false},{"title":"R$id.class <span style='color:#111;'>526B</span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'>673B</span>","children":null,"spread":false},{"title":"R$string.class <span style='color:#111;'>472B</span>","children":null,"spread":false},{"title":"R$menu.class <span style='color:#111;'>388B</span>","children":null,"spread":false},{"title":"MainActivity.class <span style='color:#111;'>517B</span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'>868B</span>","children":null,"spread":false},{"title":"dexedLibs","children":[{"title":"android-support-v4-a000c70b4690be11404f14db74d1912f.jar <span style='color:#111;'>236.50KB</span>","children":null,"spread":false},{"title":"annotations-83bcbca307526a8b641f5efb2d1ea108.jar <span style='color:#111;'>943B</span>","children":null,"spread":false}],"spread":false},{"title":"jarlist.cache <span style='color:#111;'>120B</span>","children":null,"spread":false},{"title":"res","children":[{"title":"crunch","children":[{"title":"drawable-hdpi","children":[{"title":"forth_menu.png <span style='color:#111;'>10.29KB</span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'>5.82KB</span>","children":null,"spread":false},{"title":"third_menu.png <span style='color:#111;'>4.07KB</span>","children":null,"spread":false},{"title":"qq_main.png <span style='color:#111;'>110.44KB</span>","children":null,"spread":false},{"title":"second_menu.png <span style='color:#111;'>9.42KB</span>","children":null,"spread":false},{"title":"first_menu.png <span style='color:#111;'>5.68KB</span>","children":null,"spread":false},{"title":"left_menu.png <span style='color:#111;'>405.29KB</span>","children":null,"spread":false}],"spread":false},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'>3.04KB</span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'>17.47KB</span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'>9.14KB</span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"QQ1024.apk <span style='color:#111;'>828.99KB</span>","children":null,"spread":false},{"title":"classes.dex <span style='color:#111;'>699.39KB</span>","children":null,"spread":false}],"spread":true}],"spread":false}],"spread":true}]

评论信息

  • _HERO_:
    很不错,对我有用2016-06-01
  • 悲弩天弓:
    效果挺不错2015-12-14
  • 疯狂D乌牛:
    很不错,对我有用2015-11-20
  • 窝似尼巴巴:
    下载了,效果不错,但对我的项目用处不大2015-10-13
  • sjh821314:
    效果不错,赞一个2015-09-15

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明