-
Android 手势监听和图片放大缩小功能实例
Android 手势监听和图片放大缩小功能实例,安卓手机系统控制实例。关键代码分享如下:
ImageView myImageView = (ImageView) v;
switch (event.getAction() & MotionEvent.ACTION_MASK) {
// 设置拖拉模式
case MotionEvent.ACTION_DOWN:
matrix.set(myImageView.getImageMatrix());
savedMatrix.set(matrix);
start.set(event.getX(), event.getY());
mode = DRAG;
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP:
mode = NONE;
break;
case MotionEvent.ACTION_POINTER_DOWN:
oldDist = spacing(event);
if (oldDist > 10f) {
savedMatrix.set(matrix);
midPoint(mid, event);
mode = ZOOM;
}
// 若为DRAG模式,则点击移动图片
case MotionEvent.ACTION_MOVE:
if (mode == DRAG) {
matrix.set(savedMatrix);
matrix.postTranslate(event.getX() - start.x, event.getY()
- start.y);
} // 若为ZOOM模式,则点击触摸缩放
else if (mode == ZOOM) {
float newDist = spacing(event);
if (newDist > 10f) {
matrix.set(savedMatrix);
float scale = newDist / oldDist;
// 设置缩放比例和图片的中点位置
matrix.post
- 2022-04-20 06:24:10下载
- 积分:1
-
安卓出租车
应用背景世界上许多出租车应用程序都存在,但没有开源代码。我的应用程序是一个完整的开源。我只贴出代码,但几天我会发布iOS源代码。关键技术使用我的应用程序,你可以找到知识如何操作出租车支持系统。你也可以找到如何使用actionbarsherlock和谷歌Android游戏服务。感谢。
- 2022-05-25 07:21:16下载
- 积分:1
-
AuthenticatorDescription
A Parcelable value type that contains information about an account authenticator for Andriod.
- 2013-10-21 16:23:50下载
- 积分:1
-
Android-for-Qt_GPS
基于qt开发的GPS功能应用程序,可在android平台上运行;需要在necessitas开发环境下编译。(Qt-based application developed by the GPS function, you can run on android platform need necessitas development environment compiler.)
- 2013-10-09 11:31:27下载
- 积分:1
-
android 猜扑克 洗牌小游戏 实例 附完整源码下载
android 猜扑克牌游戏 猜中有鼓励 供大家学习哦
- 2013-03-16下载
- 积分:1
-
CH06
Android sdk开发范例大全(第二版)第6章节
- 2013-08-02 11:12:28下载
- 积分:1
-
Android实现二维码扫描和生成
Android实现的二维码扫描功能和生成功能,导入ZXing。
- 2023-01-12 04:15:05下载
- 积分:1
-
Android 编程经典200例 附源代码
Android 编程经典200例 附源代码
Android programming classic 200 cases with source code
- 2022-03-13 09:44:15下载
- 积分:1
-
listviewheSQLitezhishi
注意:本项目是基于android studio开发的,eclipse可能无法直接使用。
本项目是一个简单的基于安卓的记事本项目源码,添加或删除数据的时候会出现显示bug(实际数据不会受到影响),bug体现在添加或删除一条数据以后会在listview里面会展示复制一遍操作后的数据。而不会清除原有的列表文本。新手朋友可以拿这个项目来试试手感,顺便看看能不能独立解决这个问题。
本项目涉及的知识点有:
1、SQLite的基本使用,增删查改
2、listview,adapeter的基本使用
3、activity生命周期
4、intent、bundle传递参数
5、AlertDialog的基本使用(Note: this project is based on the development of studio eclipse, Android may not be able to directly use.
This project is a simple Notepad program source code based on Android, add or delete data will appear when the display bug (actual data will not be affected), bug reflected in add or remove a data will be in inside the listview will show copy again after the operation data. And will not clear the original list of text. Novice friends can take this project to try to feel, by the way to solve this problem can not be solved independently.
The knowledge points involved in this project are:
1, the basic use of SQLite, CRUD
2, listview, the basic use of adapeter
3, activity life cycle
4, intent, bundle transfer parameters
5, the basic use of AlertDialog)
- 2016-07-25 11:25:09下载
- 积分:1
-
ListView分页异步加载数据
ListView分页异步加载数据
- 2014-01-08下载
- 积分:1