Fragment生命周期与重建
FragementManager fm = activity.getFragmentManager();
activity -> fragmentController -> fragmentManager -> fragment
FragementManager fm = activity.getFragmentManager();
activity -> fragmentController -> fragmentManager -> fragment
Tips
#flex-box
##Properties for the Parent(flex container)
####1. display
This defines a flex container; inline or block depending on the given value. It enables a flex context for all its direct children.
|
|
####2. flex-direction
This establishes the main-axis, thus defining the direction flex items are placed in the flex container. Flexbox is (aside from optional wrapping) a single-direction layout concept. Think of flex items as primarily laying out either in horizontal rows or vertical columns.
|
|
SASS & SCSS
###Variables
We can declare variables in our file that we can reuse throughout our document. This is common for colours and font stacks, and is probably one of the most handy uses of variables off the bat. Here’s the SCSS:
|
|
And here’s the compiled CSS:
|
|
#Introduction to CSS
#How CSS works
>
####What is CSS?
CSS is a language for specifying how documents are presented to users — how they are styled, laid out, etc.
####How does CSS affect HTML?
A CSS rule is formed from:
####A quick CSS example
a stylesheet is applied to the HTML using a element
#CSS layout
#Introduction to CSS Layout
###The flow
Each elements in the document alters the flow of text in various ways:
####Elements display categories
The element behavior is defined using the property display
. This property can take tons of values but let's focus on the four most important:
#HTML
#Introduction
####markup
markup: a language with specific syntax that instructs a Web browser how to display a page
###Element
Some tags are self-closing and do not contain any content.
###Tags
###Attributes
Attributes usually consist of 2 parts:
A few attributes can only have one value. They are Boolean attributes and may be shortened by only specifying the attribute name or leaving the attribute value empty. Thus, the following 3 examples have the same meaning:
|
|
###Named character references
Four common named character references:
#Style CSS
#Style text
##Fundamental text and font styling
Two categories:
###Fonts
####Color
The color
property sets the color of the foreground content of the selected elements (which is usually the text, but can also include a couple of other things, such as an underline or overline placed on text using the text-decoration
property).
|
|
#Objects
###Object Usage and Properties
Everything in JavaScript acts like an object, with the only two exceptions being null
and undefined
.
####Accessing Properties
The properties of an object can be accessed in two ways, via either the dot notation or the square bracket notation.
|
|
The notations work almost identically, with the only difference being that the square bracket notation allows for dynamic setting of properties and the use of property names that would otherwise lead to a syntax error.
#JavaScript
#1. JavaScript简介
###1.2 JavaScript实现
JavaScript的实现包括了三部分:
#2. 在HTML中使用JavaScript
###2.1 <script>
元素
HTML4.01中<script>
的6个属性:
async
:可选。表示应该立即下载脚本,但不应妨碍页面中的其他操作,比如下载其他资源或等待加载其他脚本。只对外部脚本文件有效。
charset
:可选。表示通过src属性指定的代码的字符集。由于大多数浏览器户忽略它的值,因此这个属性很少有人用。
defer
: 可选。表示脚本可以延迟到文档完全被解析和显示之后再执行。只对外部脚本文件有效。IE7及更早版本对嵌入脚本也支持这个属性。
language
:已废弃。原来用于表示编写代码使用的脚本语言(如JavaScript、JavaScript1.2或者VBScript)。大多数浏览器会忽略这个属性,因此也没有必要再使用了。
src
:可选。表示包含要执行代码的外部文件。
App研发录
#1.重构
将业务与逻辑分离,建立包结构。
###1.4 实体化编程
#####1.4.1使用fastJSON或GSON
坑:代码混淆时带来的混乱
|
|
###1.5 Adapter模板
使用ViewHolder机制