- 浏览: 5778719 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (890)
- WindowsPhone (0)
- android (88)
- android快速迭代 (17)
- android基础 (34)
- android进阶 (172)
- android高级 (0)
- android拾遗 (85)
- android动画&效果 (68)
- Material Design (13)
- LUA (5)
- j2me (32)
- jQuery (39)
- spring (26)
- hibernate (20)
- struts (26)
- tomcat (9)
- javascript+css+html (62)
- jsp+servlet+javabean (14)
- java (37)
- velocity+FCKeditor (13)
- linux+批处理 (9)
- mysql (19)
- MyEclipse (9)
- ajax (7)
- wap (8)
- j2ee+apache (24)
- 其他 (13)
- phonegap (35)
最新评论
-
Memories_NC:
本地lua脚本终于执行成功了,虽然不是通过redis
java中调用lua脚本语言1 -
ZHOU452840622:
大神://处理返回的接收状态 这个好像没有监听到 遇 ...
android 发送短信的两种方式 -
PXY:
拦截部分地址,怎么写的for(int i=0;i<lis ...
判断是否登录的拦截器SessionFilter -
maotou1988:
Android控件之带清空按钮(功能)的AutoComplet ...
自定义AutoCompleteTextView -
yangmaolinpl:
希望有表例子更好。。。,不过也看明白了。
浅谈onInterceptTouchEvent、onTouchEvent与onTouch
网上借的
整个工程:
package com.ql.app; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.ListView; public class ChatActivity extends Activity { private ChattingAdapter adapter; private List<ChatMessage> messages = new ArrayList<ChatMessage>(); private ListView listView; private Button btn_send; private EditText textEditor; private ImageView btn_insert; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); messages.add(new ChatMessage(ChatMessage.MESSAGE_FROM, "hello,android.")); messages.add(new ChatMessage(ChatMessage.MESSAGE_TO, "hello,java.")); messages.add(new ChatMessage(ChatMessage.MESSAGE_FROM, "请教高手,怎么可以给gridview设置边框啊,现在这个显示效果实在太难看了。")); messages.add(new ChatMessage(ChatMessage.MESSAGE_TO, "那就加点背景,加点属性什么的不就行了吗")); messages.add(new ChatMessage(ChatMessage.MESSAGE_FROM, "在主题中,将gridview的cssclass设置为gridview")); messages.add(new ChatMessage(ChatMessage.MESSAGE_TO, "谢谢")); listView=(ListView)findViewById(R.id.listView); adapter = new ChattingAdapter(this, messages); listView.setAdapter(adapter); btn_send = (Button) findViewById(R.id.btn_send); textEditor = (EditText) findViewById(R.id.text_editor); btn_insert=(ImageView) findViewById(R.id.btn_insert); btn_send.setOnClickListener(listener); btn_insert.setOnClickListener(listener); } private View.OnClickListener listener = new View.OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_send: String str = textEditor.getText().toString(); String sendStr=str.trim(); if(!sendStr.equals("")){ sendMessage(sendStr); } textEditor.setText(""); break; case R.id.btn_insert: Intent i = new Intent(); i.setType("image/*"); i.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(i, Activity.DEFAULT_KEYS_SHORTCUT); // Intent it = new Intent("android.media.action.IMAGE_CAPTURE"); // startActivityForResult(it, Activity.DEFAULT_KEYS_DIALER); break; default: break; } } // 模拟发送消息 private void sendMessage(String sendStr) { messages.add(new ChatMessage(ChatMessage.MESSAGE_TO, sendStr)); adapter.notifyDataSetChanged(); } }; }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:focusable="false" android:focusableInTouchMode="false" android:background="@drawable/nav_page" android:gravity="center_horizontal" > <ListView android:id="@+id/listView" android:background="@null" android:scrollbars="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:listSelector="@null" android:transcriptMode="alwaysScroll" android:cacheColorHint="#00000000" android:divider="@null" android:layout_weight="1.0" /> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/txt_msg_bg" android:paddingRight="7.0dip" > <ImageView android:id="@+id/btn_insert" android:layout_gravity="center_vertical" android:paddingLeft="15.0dip" android:paddingTop="5.0dip" android:paddingRight="7.0dip" android:paddingBottom="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/sms_insert" /> <EditText android:id="@+id/text_editor" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:background="@drawable/sms_embeded_text_editor_bg" android:focusable="true" android:nextFocusRight="@+id/send_button" android:layout_marginLeft="7.0dip" android:layout_marginTop="5.0dip" android:layout_marginRight="7.0dip" android:layout_marginBottom="5.0dip" android:minHeight="34.0dip" android:hint="输入消息" android:maxLines="8" android:maxLength="2000" android:capitalize="sentences" android:autoText="true" android:layout_weight="1.0" android:inputType="textCapSentences|textAutoCorrect|textMultiLine|textShortMessage" android:imeOptions="actionSend|flagNoEnterAction" /> <Button android:id="@+id/btn_send" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_gravity="center_vertical" android:background="@drawable/sms_send_button_bg" android:paddingLeft="11.0dip" android:paddingRight="11.0dip" android:nextFocusLeft="@id/text_editor" /> </LinearLayout> </LinearLayout>
整个工程:
发表评论
-
利用广播实现强制下线功能
2016-12-28 10:45 1425最近一口气买 ... -
Android百分比布局Percent支持库
2015-09-02 11:08 3106虽然有很多的布局可以在 Android 应用程序开发的世界供我 ... -
ViewDragHelper行为测试
2015-08-12 17:36 2698只是简单记录一下 以后可能会实现一些效果 import ... -
android5.x之Palette调色板
2015-07-17 10:30 3296Palette类可以分析一张图片,取出这张图片的特征色,然后为 ... -
使用ClipboardManager剪贴板实现复制粘贴功能
2015-04-10 14:39 3740经常要使用复制粘贴的功能,比如长安一个TextView弹出一个 ... -
LocationListener监听位置变化,当进入到某一距离内时发出提醒
2014-08-19 15:03 7633项目中需要这样的要求: 启动一个服务一直在背后监听当前位置变化 ... -
Android下集成FacebookSDk到项目并发表评论
2013-08-28 14:36 4836项目中需要发表自己的评论到Facebook,需要集成Faceb ... -
MediaRecorder录音,MediaPlayer播放
2013-05-23 09:53 7475直接看代码 import java.io.DataOutp ... -
Notification的基本用法
2013-05-22 11:52 5919android4.0以前: private static ... -
android音频、视频、拍照基础操作
2013-03-27 11:55 2769播放音乐和视频用的是类:MediaPlayer 刻录声音和视 ... -
tabhost通过手势滑动切换activity
2013-02-18 17:59 11107package com.mars.mp3player; ... -
VideoView简单视频播放
2013-02-17 17:17 9249只是上上手而已的例子。 package com.chen ... -
android 再按一次后退键退出应用程序
2012-06-15 21:51 4067private static Boolean isExit ... -
AlarmManager全局定时器/闹钟
2012-02-01 10:11 5825http://407827531.iteye.com/blog ... -
倒计时的CountDownTimer
2011-12-23 13:06 31152直接看这里吧,我只是搬运工。 定时执行在一段时候后停止的倒计 ... -
Android流量统计TrafficStats类的使用
2011-12-06 16:25 26397对于Android流量统计来说在2.2版中新加入了Traffi ... -
ScrollView当显示超出当前页面时自动移动到最底端
2011-09-01 09:42 16953卷轴视图(ScrollView)是指当拥有很多内容,一屏显示不 ... -
在SurfaceView上拖动一架飞机
2011-08-23 12:40 2885接上一篇在SurfaceView上拖动一张小图片 什么叫拖动飞 ... -
在SurfaceView上拖动一张小图片
2011-08-22 18:20 5195用手指随便拖。这里采用了线程去绘制,其实也可以在onTouch ... -
用getIdentifier()获取资源Id
2011-07-28 22:36 10727做项目过程中遇到一个问题,从数据库里读取图片名称,然后调用图片 ...
相关推荐
实现类似于iphone手机桌面图片切换效果,简单使用!
仿path效果 类似iphone 我也模仿了Path效果,效果更接近iphone
类似iphone密码输入效果,该效果模仿了我们现在的iphone手机密码输入的的,在我们还没有输入密码的效果时,就会显示未输之前是“-”,当我们输入密码之后就会变成“.”这样的效果的。
NULL 博文链接:https://edison-cool911.iteye.com/blog/1141874
jquery UI渐变提示效果类似iphone日历效果.zip
收集的类似IPHONE界面设计的png图标
类似Iphone AssistiveTouch的快捷键按钮
wpf仿iphone桌面翻页效果,不满足翻页条件则回滚当页,另外增加了左右翻页按钮。
VC实现的类似IPHONE的软键盘,采用图片双缓冲交叠显示,支持键盘换肤扩展
类似iphone的android版本的选择时间,会有时间框选择,很实用,一个小工具,大家可以借鉴,很方便
基于jQuery的类似iphone的密码输入效果的实现代码.zip
找了下没有,就自己写了一个例子.仿IPhone抖动的小例子,有兴趣的可以试试
基于UIControl 实现iphone 滑动解锁效果控件
iphone页面翻转效果,适合电子杂志类开发,未使用私有api,比较通用
iphone跑马灯效果,可以实现简单的跑马灯效果。其实跑马灯可以通过多种方法实现。
3中iPhone很炫的动态效果,有源代码
iPhone 拖动效果 flash
iPhone滑动解锁效果 iPhone滑动解锁效果 iPhone滑动解锁效果