WisdowsBlog 
  • Home
  • Archives
  • Categories
  • Tags
  • About
  •     

可折叠的ToolBar+抽屉菜单NavigationView+浮动按钮FloatButton

使用Material Design风格的ToolBar和抽屉导航 先看个简单的运行效果 主要记录下布局的写法 1 用到的Google Design依赖和V7包依赖compile 'com.android.support:cardview-v7:25.0.0' compile 'com.android.support:recyclerview-v7:25.0.0' compile 'com.android.support:design:25.0.0' compile 'com.android.support:appcompat-v7:25.0.0'2 主布局结构 3 主布局内容<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_main" android:lay
 2019-11-16   Android    布局 

走着官方的教程入门Material-Design

又到期末了,学习下Google的材料设计。写下此文记录自己的同时,分享给需要的同学,若发现文中有什么问题和不对,欢迎指出 使用 Material Design 创建新应用首先需要使用材料主题 如果是在5.0及以上的系统,可以直接使用材料主题。否则,就需要做5.0之前系统的兼容 引用Google官方的话: 您可对您的应用进行配置,使应用能够在支持它的设备上使用材料主题,并且能够在运行早期版本 Android 的设备上还原至早期版本的主题 具体操作就是: 定义备用样式 style和v-21的style 提供备用布局 xx布局.xml和v-21的xx布局.xml 使用支持内容库 使用v7支持库 定义备用样式 定义一个从 res/values/styles.xml 中的早期版本主题(例如 Holo)继承的主题。 定义一个从 res/values-v21/styles.xml 中的材料主题继承且拥有相同名称的主题。 在清单文件中将此主题设置为您的应用主题。 //5.0以上系统使用的主题(res\values-v21文件夹中) <style name="AppT
 2019-11-16   Android    Material 

git配置sshkey

之前一直使用git提供的http链接来推送代码, 不过今天mac的sourcetree炸了,不能保存密码. 网上查了很多方法都不能解决, 最后决定改用ssh登录. ...
 2019-11-12   git    ssh密钥 

Spring容器加载过程源码解析之自定义标签解析

在上文 Spring容器加载过程源码解析之默认标签解析 中,我们学习了默认标签的解析,今天我们来看看自定义的标签和属性是如何解析的。 提醒:本文是基于Spring 3.0.0.RELEASE 版本进行讲解的,其他版本可能稍有差异,在贴源码的时候,部分不影响流程的代码也在本文省略了 1. 常用的自定义标签和属性自定义标签:<context:annotation-config/>, <context:component-scan base-package="com.xx.xx"/>, <mvc:annotation-driven>, <aop:aspectj-autoproxy/>等等都是自定义的标签; 自定义属性见得比较少,不过也有,如带 “p” 前缀的属性,是在spring-beansjar包中。 12345678910111213141516171819202122<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframe
 2019-11-01   spring    spring 

Spring容器加载过程源码解析之默认标签解析

在上文 Spring容器加载过程源码解析之Resource解析流程 中,我们已经了解了整个解析流程,今天我们来具体分析下默认标签的解析。 提醒:本文是基于Spring 3.0.0.RELEASE 版本进行讲解的,其他版本可能稍有差异,在贴源码的时候,部分不影响流程的代码也在本文省略了 1.什么是默认标签和自定义标签12345678910111213141516171819202122232425262728293031323334353637383940414243protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate) { // 判断是否为默认命名空间下的标签 if (delegate.isDefaultNamespace(delegate.getNamespaceURI(root))) { // 循环遍历 解析默认标签 NodeList nl = root.getChildNodes(); for (i
 2019-10-27   spring    spring 

Spring容器加载过程源码解析之Resource解析流程

在上文 Spring容器加载过程源码解析之Resource定位加载 中,我们已经将资源路径解析为Resource了,今天我们来分析下整个解析流程。 提醒:本文是基于Spring 3.0.0.RELEASE 版本进行讲解的,其他版本可能稍有差异,在贴源码的时候,部分不影响流程的代码也在本文省略了 1. XmlBeanDefinitionReader 分析12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697public int loadBeanDefinitions(String location, Set<Resource> actualResources) throws BeanDefinitionStoreException { Resource
 2019-10-21   spring    spring 

Spring容器加载过程源码解析之Resource定位加载

在上文 如何手动启动Spring容器 中,我们知道了可以通过传入资源文件来启动容器,如果将applicationContext.xml替换为绝对路径就启动不了,报错。 12345678910111213141516171819//启动容器ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml")//更换为绝对路径,启动失败ApplicationContext context = new ClassPathXmlApplicationContext( "E:\\IDEA_workspace\\SpringLearningDemo\\spring-java\\src\\main\\resources\\applicationContext.xml");//报 FileNotFoundException:Caused by: java.io.FileNotFoundException: class path resource [E:/IDE
 2019-10-18   spring    spring 

如何手动启动Spring容器

工作中,我想大家最熟悉的Spring容器启动方法,就是在web环境下,通过在web.xml中配置如下代码进行启动。 1234567<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:/applicationContext.xml</param-value></context-param><listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener> 那么,离开了web环境,想单独的启动一个Spring容器该怎么做呢,其实也很简单,有两种方式,直接看代码: 1. 手动启动目录结构: pom.xml 123456789101112131415161718192021222324252
 2019-10-12   spring    spring 

略谈函数式编程

相对于面向对象编程(Object-oriented programming)关注的是数据而言,函数式编程关注的则是动作,其是一种过程抽象的思维,就是对当前的动作去进行抽象。 函数式编程的好处 使代码更简洁,优雅 便于后期的代码维护 能够大大提升开发效率 函数式编程的特点 函数是第一等公民 函数是纯函数 无副作用 同输出同输入 无副作用即函数运行时内部的操作不会对外部产生影响 12345678910// 无副作用的纯函数function addf(x,y){ return x + y;}//不是纯函数,调用了外部的不确定值,带有副作用,var msg = 'hello world'function print(){ return msg} 将多个函数合并成一个函数运行 函数合成/高级函数(compose) 123456789function addf(x,y){ return x + y;}function print(_msg){ return _msg;}//函数addf(1,2)是print函数的_msg参数var msg = p
 2019-10-12   函数式编程 

spring-boot-data-elasticsearch

spring-boot-data-elasticsearch前言:网上很多人说spring-boot-data-elasticsearch支持es版本过低不推荐使用,我在官网只找到如下版本对应说明,没有关于spring-boot-data对应版本说明就点开本地pom看了下 spring-data-elasticsearch elasticsearch 3.1.x 6.2.2 3.0.x 5.5.0 2.1.x 2.4.0 2.0.x 2.2.0 1.3.x 1.5.2 ...
 2019-10-11   spring   
1…34567…28

搜索

Hexo Fluid
 总访问量 次   总访客数 人