Android
文章平均质量分 85
johnnycmj
这个作者很懒,什么都没留下…
展开
-
Android百度地图定位收索取周边在列表中展示并选择
具体内容如下效果图:1、布局文件,就是一个MapView和ListView,布局文件就是上面是一个百度地图的mapview,下面是一个显示周边位置的ListView<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_原创 2016-04-13 19:25:36 · 11290 阅读 · 5 评论 -
Android 实现拖动按钮效果
思路:首先获取屏幕的宽度和高度,当移动Button 在ACTION_DOWN 的时记录下控件当前的位置坐标,在移动ACTION_MOVE时记录相对上次的坐标,然后算出相对于parent 的View上下左右位置,最后重新layout就可以。public class DraftTest extends Activity { /** Called when the activity...原创 2015-08-13 08:47:59 · 726 阅读 · 1 评论 -
android view OnTouchEvent 中同时处理 onClick,onLongClick,和左右移动事件
欲实现的效果是:当手机按住屏幕时,如果在指定的时间内没有移动(如500毫秒),那么进入长按模式,此时手指在屏幕上移动都算作长按模式。如果手机按住屏幕就立马移动,那么就算作移动模式。如果没有移动也没有超过规定时间内则为单击。 思路:在Down的时候开启一个线程然后延迟500ms(长按触发的时间)后执行,然后再UP的时候判断如果按住的时间没有超过了500ms那么代码长...原创 2015-08-11 09:51:09 · 768 阅读 · 0 评论 -
Android百度地图定位收索取周边在列表中展示并选择
具体内容如下效果图:1、布局文件,就是一个MapView和ListView,布局文件就是上面是一个百度地图的mapview,下面是一个显示周边位置的ListView [html] view plain copy <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andr...原创 2016-04-14 10:08:24 · 383 阅读 · 0 评论 -
上拉刷新和下拉加载更多
一、效果图 二、主要布局文件activity_list.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_paren...原创 2013-11-04 17:03:47 · 147 阅读 · 0 评论 -
滚轮弹出选择框
一、效果图 二、主要布局文件activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="matc...原创 2013-11-01 18:21:45 · 309 阅读 · 0 评论 -
自定义带百分比进度条
一、效果图 二、布局文件activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_p...原创 2013-11-01 17:32:28 · 173 阅读 · 0 评论 -
FlowIndicator 自定义左右图片切换
一、效果图: 二、布局文件header_view.xml<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app1="http://schemas.android.com...原创 2013-10-30 14:16:51 · 179 阅读 · 0 评论 -
Fragment 的应用
最近android项目需要用到Fragment,就抽空要久了一下Fragment,记录下。一、项目效果图 二、整个activity分上下两个Fragment,上面是ListView的列表,下面是详细内容的Fragment。看先看activity_main 的布局:<RelativeLayout xmlns:android="http://schemas.android.c...原创 2013-10-29 09:42:28 · 135 阅读 · 0 评论 -
android 闹钟提醒并且在锁屏下弹出Dialog对话框并播放铃声和震动
android 闹钟提醒并且在锁屏下弹出Dialog对话框并播放铃声和震动 1、先简单设置一个闹钟提醒事件://设置闹钟 mSetting.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) {原创 2016-05-18 15:03:03 · 5494 阅读 · 2 评论 -
android 录音与播放录音 带根据音频大小动态效果
首先来看看效果图 首先是布局文件:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" and原创 2016-05-12 17:44:57 · 2334 阅读 · 0 评论 -
android 自己封装自己所需的Dialog对话框
有时候项目中需要封装自己所需的Dialog对话框。自己写Dialog的layout布局文件布局文件layout_dialog.xml:<?xml version="1.0" encoding="UTF-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"...原创 2015-08-13 10:34:43 · 321 阅读 · 0 评论