上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 29 下一页
摘要: 左右滑动切换是几乎所有应用中都会用到的功能。在这里将相关资源进行总结(1)viewflipper结合手势检测进行左右滑动。http://www.cnblogs.com/hanyonglu/archive/2012/02/13/2349827.html这种方法很简单,但是大概效果不是很理想(不过自己感觉还行)。具体的改进网上资源有很多,可以在用到的时候再搜索(2)viewflipper渐显按钮实现图片切换。http://www.cnblogs.com/hanyonglu/archive/2012/02/13/2350171.html这个示例中实现了,当按下屏幕时候,出现向左向右两个按钮,点击对应 阅读全文
posted @ 2013-07-15 20:38 bobo的学习笔记 阅读(1519) 评论(0) 推荐(0) 编辑
摘要: 数据库三个范式:1,第一范式:每一列都是不可分割的数据项,即列不可重复2,第二范式:每一个实例的非主属性都依赖于主属性,每一行都是一个单独的尸体。3,第三范式:属性不依赖于非主属性。数据库引擎:1,innoDB(支持事务和外键)2,ISAM(查询速度快,但是不支持事务机制)第一部分(DDL)一、查看... 阅读全文
posted @ 2013-07-15 16:26 bobo的学习笔记 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 1,要善于运用0dp结合layout_weight来填充剩余空间2,对于高度,其实很多时候不需要高度必须为wrap_content;可以直接规定为具体数值3,多使用这个属性: android:gravity="center_vertical";这个结合上一条在很多时候很好用4,在listview、gridview等控件中,记得加上这个属性: android:cacheColorHint="@null"5,只有父标签为relativelayout的时候,控件才具有以下属性:android:layout_below、android:layout_alignP 阅读全文
posted @ 2013-07-12 17:31 bobo的学习笔记 阅读(171) 评论(0) 推荐(0) 编辑
摘要: package com.ctbri.weather.utils.calendar;/** * Created by IntelliJ IDEA. * User: zhouxin@easier.cn * 字符串的处理�? * Date: 12-11-22 * Time: 下午4:35 * To change this template use File | Settings | File Templates. */public class StringUtil { /** * 判断是否为null或空�? * * @param str String * @re... 阅读全文
posted @ 2013-07-12 09:51 bobo的学习笔记 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 代码依旧非常简单,只不过因为这个方法极为常用,因此体现的还是封装的思想。package com.ctbri.weather.utils;import java.text.SimpleDateFormat;import java.util.Date;public class TimeUtil { public static String notifTimeFormat(long milliseconds) { SimpleDateFormat dateFormat = new SimpleDateFormat("h:mm a"); Date date = new... 阅读全文
posted @ 2013-07-12 09:48 bobo的学习笔记 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 之前碰到过这样的问题,sp文件只能够append,或者清空。其实一个键值,通过,分割,或者替代可以实现多条信息的存储。下面是一个举例:package com.ctbri.weather.utils;import android.content.SharedPreferences;public class StringUtil { public static String addIndex(SharedPreferences sp,String oldIndexs,String insertIndex) { if(oldIndexs.contains(insertIndex)... 阅读全文
posted @ 2013-07-12 09:43 bobo的学习笔记 阅读(949) 评论(0) 推荐(0) 编辑
摘要: 这个工具类非常简单,但是将显示dialog的方法统一封装,能够大大减少代码重复package com.ctbri.weather.utils;import android.app.AlertDialog;import android.app.Dialog;import android.app.ProgressDialog;import android.content.Context;public class ShowDialogActivity{ public static void showDialog(Context con){ Dialog dialog = new ... 阅读全文
posted @ 2013-07-12 09:38 bobo的学习笔记 阅读(554) 评论(0) 推荐(0) 编辑
摘要: 该类的目的主要是判断设备的联网状态检测设备是否连接了网络package com.wotlab.home.moneyplantairs.utils;import android.content.Context;import android.net.ConnectivityManager;import android.net.NetworkInfo;public class NetUtil { /** * 这个主要是判断当前用户设备的手机状态是否可用 * * @param context * @return */ public static b... 阅读全文
posted @ 2013-07-12 09:27 bobo的学习笔记 阅读(457) 评论(0) 推荐(0) 编辑
摘要: 封装的目的在于,只有处于调试状态的情况下,才进行日志的打印package com.ctbri.weather.utils;import android.util.Log;/** * 日志打印工具类,如果软件处于调试状态,允许打印相关日志,否则不允许, * 这也是很多api中设置setDebugMode的原因吧 * @author Tao * */public class LogUtil { public static boolean isDebug = true; public static void i(String tag, String message) { ... 阅读全文
posted @ 2013-07-12 09:25 bobo的学习笔记 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 经验一,将几个页面公用的数据,和方法进行封装,形成一个baseActivity的类:package com.ctbri.weather.control;import java.util.ArrayList;import java.util.HashMap;import com.ctbri.weather.domain.AirInfo;import com.ctbri.weather.domain.AlertInfos;import com.ctbri.weather.domain.LifeIndex;import com.ctbri.weather.domain.MainData;import 阅读全文
posted @ 2013-07-12 09:18 bobo的学习笔记 阅读(1450) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 29 下一页