
技术
forwordlove
这个作者很懒,什么都没留下…
展开
-
AndroidStudio上使用NDK(Jni)的配置
AndroidStudio上使用NDK(Jni)的配置第一步就是去官方下载个NDK包就可以了,存放地址随意(自己记得就行))第二步 就是就是直接写代码了(NDK怎么和AS工程关联,也就是一行配置的问题)内容步骤讲解:在AS中新建一个Project,然后再新建一个class为NDKUtil(名字随意),在内部声明native方法(jni使用的定义,后面系列教程会细说)。package com.ex原创 2016-06-30 16:41:24 · 338 阅读 · 0 评论 -
自定义的广告轮播 --(三)(无限循环)
先做一些准备的工作自定义的圆点package widget;/** * 一个接口定义ViewFlow和之间的合同FlowIndicator * FlowIndicator负责节目的视觉指示器的总观点 * 数量和当前视图可见。 */public interface FlowIndicator extends ViewFlow.ViewSwitchListener { /**原创 2016-10-10 11:31:04 · 829 阅读 · 0 评论 -
自定义的广告轮播---(二)(无限循环)
准备工作自定义的水平滚动类package widget;import android.content.Context;import android.os.Handler;import android.os.Message;import android.support.v4.view.MotionEventCompat;import android.support.v4.view.Page原创 2016-10-09 20:34:36 · 962 阅读 · 0 评论 -
调用系统自带的通信录
添加读取的权限 <uses-permission android:name="android.permission.READ_CONTACTS"/>xml文件<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"原创 2016-09-22 12:18:08 · 429 阅读 · 0 评论 -
顶部提示的悬浮窗
主要的类/** * 头部提示的悬浮窗 */public class TopSnackBar { public static final int LENGTH_LONG = 3500; public static final int LENGTH_SHORT = 1500; private static final int MSG_HIDE = 0; privat原创 2016-10-12 20:27:24 · 1615 阅读 · 0 评论 -
ViewPager 和 GridView 结合实现左右滑动
仿美团主页的分类,实现左右滑动的功能节省空间主页面的布局<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layou原创 2016-10-21 20:21:03 · 1963 阅读 · 1 评论 -
自定义的通讯录实现方式一
准备工作/** * A~Z检索的list */public class MyListView extends View { // 触摸事件 OnTouchingLetterChangedListener onTouchingLetterChangedListener; String[] b = {"#", "A", "B", "C", "D", "E", "F", "G原创 2016-09-23 12:03:41 · 1402 阅读 · 0 评论 -
App启动页--实现一
使用补间动画xml布局:<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+i原创 2016-09-26 16:57:40 · 960 阅读 · 0 评论 -
App启动页--实现二
使用线程Xml布局:<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/原创 2016-09-26 17:10:48 · 368 阅读 · 0 评论 -
Snackbars从顶部滑出的实现
需要多个类的帮助,有需要的直接下载代码记住需要先导入依赖包:compile ‘com.android.support:design:23.0.0’主要代码的帮助类帮助类1import java.lang.ref.WeakReference;/** * Snackbar的管理者 */class SnackbarManager { private static final int MSG_原创 2016-09-29 20:36:25 · 3449 阅读 · 4 评论 -
Material Design学习之FloatingActionButton(FAB)
FloatingActionButton是继承至ImageView,所以FloatingActionButton拥有ImageView的所有属性。FloatingActionButton属性的学习 :<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app=原创 2016-09-30 16:19:15 · 694 阅读 · 0 评论 -
Checkbox的多选简单实现(-)
需要的布局文件<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width原创 2016-10-18 15:02:44 · 1073 阅读 · 0 评论 -
AndroidStudio一键生成MVP的使用
首先将这个MVPHelper插件安装,如下开始使用首先要新建一个 contract 的包名 ,然后在里面新建一个接口 TypeContract(按自己的来)类。使用快键键 Alt +Insert 就能看到 MVPHelper这选项,点击就ok,如下原创 2016-10-19 17:53:27 · 2241 阅读 · 0 评论 -
Android性能优化一:布局优化
减少嵌套,尽量保持布局层级的扁平化在不影响层级深度的情况下,使用LinearLayout而不是RelativeLayout。因为RelativeLayout会让子View调用2次onMeasure,LinearLayout 在有weight时,才会让子View调用2次onMeasure。Measure的耗时越长那么绘制效率就低。如果非要是嵌套,那么尽量避免RelativeLayout嵌套Rela原创 2016-11-09 18:08:15 · 426 阅读 · 0 评论 -
ViewPager实现广告轮播---(一)(无限循环)
Viewpager实现的广告轮播,有文本、有点的联动效果布局文件<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"原创 2016-10-09 17:55:42 · 515 阅读 · 0 评论 -
自定义可清除内容的EditText
主代码/** * 删除文本框内容 */public class ClearEditText extends EditText implements OnFocusChangeListener, TextWatcher { /** * 删除按钮的引用 */ private Drawable mClearDrawable; /** * 控件是原创 2016-09-23 16:01:23 · 411 阅读 · 0 评论 -
TimePicker、TimePickerDialog的使用
布局文件<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="ma原创 2016-09-07 19:43:16 · 1900 阅读 · 0 评论 -
android studio怎样隐藏标题栏
同时隐藏标题栏和通知栏//方法-:在清单文件中 <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" a原创 2016-07-22 19:57:25 · 1256 阅读 · 0 评论 -
AndroidStudio CalendarView的属性介绍
//在xml文件中的属性: <CalendarView android:id="@+id/calendarView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/view"原创 2016-07-27 13:59:10 · 8611 阅读 · 0 评论 -
CalendarView的使用
布局文件<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="ma原创 2016-09-09 11:47:20 · 4079 阅读 · 0 评论 -
TabLayout属性的学习
XML文件属性学习: <android.support.design.widget.TabLayout android:id="@+id/tabs" //控件的ID android:layout_width="wrap_content" //控件的宽 android:layout_height="wrap_content" //控件的高原创 2016-09-10 17:09:54 · 574 阅读 · 0 评论 -
一张图片的不同颜色的实现
xml中的实现<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width=原创 2016-09-12 20:20:28 · 747 阅读 · 0 评论 -
Tablayout与ViewPager的结合使用
主Activity的布局 <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools=原创 2016-09-12 16:04:23 · 492 阅读 · 0 评论 -
Button英文字符自动大写
原因 <style name="Base.TextAppearance.AppCompat.Button"> <item name="android:textSize">@dimen/abc_text_size_button_material</item> <item name="textAllCaps">true</item> //此处设置为true的原因原创 2016-08-11 11:52:31 · 463 阅读 · 0 评论 -
EditText的学习
<EditText android:id="@+id/et_tel" //id android:layout_width="match_parent" // 宽度 android:layout_height="match_parent" //高度 android:layout_marginLeft="30dp" //左边外边距原创 2016-09-03 16:43:53 · 270 阅读 · 0 评论 -
AndroidStudio中使用的dependencies的含义:
compile 'com.zhy:autolayout:1.3.6' //屏幕适配 compile 'com.jakewharton:butterknife:7.0.1' //一键生成findViewbyid和ViewHodler compile 'com.facebook.fresco:fresco:0.12.0' //一个加载图片的框架 compile 'com.facebook.fresc原创 2016-08-31 14:02:05 · 2722 阅读 · 0 评论 -
自定义导航栏与ViewPager的结合使用
首先在res的values文件夹下生成 attrs.xml ,drawable文件夹下生成background_tab.xml . 如下内容 :<declare-styleable name="PagerSlidingTabStrip"> <attr name="pstsIndicatorColor" format="color"/> <attr name=原创 2016-09-19 14:28:28 · 447 阅读 · 0 评论 -
普通结合导航栏与Viewpager的使用
主页面的布局<?xml version="1.0" encoding="utf-8"?><!--主布局--><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:l原创 2016-09-20 20:38:04 · 312 阅读 · 0 评论 -
简单的ViewPager实现
内容比较简单,之间代码Xml布局文件<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:la原创 2016-10-09 15:40:47 · 301 阅读 · 0 评论 -
DatePicker、DatePickerDialog的使用
布局文件 : <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width原创 2016-09-07 17:40:27 · 451 阅读 · 0 评论 -
Android 计算日期差
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");//显示的时间的格式 try { Date d1 = df.parse(mTvStart.getText().toString());//得到第一个时间 Date d2 = df.parse(mTvOver.getText().toSt原创 2016-10-20 15:52:58 · 1105 阅读 · 0 评论