Wzystal's Blog

Stay hungry, stay foolish.

ADB实用命令大全

ADB实用命令大全

清除应用数据 adb shell pm clear com.xx.yy 查看前台Activity adb shell dumpsys activity activities / grep ResumedActivity 屏幕截图 adb shell screencap -p /sdcard/xx.png 录制屏幕 adb shell screenrecor...

安卓应用角标那些事儿

聊一聊安卓应用角标适配那些事儿

什么是应用角标?    应用角标最开始是在ios系统中出现的,大概长这样:      不知道从什么时候开始,国内各大安卓手机系统上,也慢慢出现了应用角标的身影,到现在几乎成为了安卓系统的标配,发张图片让大家近距离感受一下:     但是有一点要特别提一下,那就是原生的Android系统,是不支持应用角标的(这也是文章标题叫“安卓角标”而不是“Android角标”的原因)。毕竟应用...

《Android开发艺术探索》读书笔记 - View的工作原理

探一探View的工作原理

1. 初识ViewRoot和DecorView ViewRoot扮演的是View的管理者角色,负责完成View的新建、更新和删除等操作。在代码层面,由ViewRootImpl类具体实现。 View的绘制流程,具体实现在ViewRootImpl.performTraversals()中,代码十分复杂,主要分为measure、layout和draw三大步骤,需要花时间研读。 ...

2017,新博客,心启航!

欢迎来到wzystal的新博客!

2016.onDestory(); 2017.onStart(); 2016就这样过去了,这一年磕磕碰碰,却没有为自己记录些什么,深感遗憾。 2017,新博客,心启航~

LeetCode | Single Number II

Given an array of integers, every element appears three times except for one. Find that single one.

原题描述 Given an array of integers, every element appears three times except for one. Find that single one. 解题思路 方法1 通过一个HashMap来统计数字出现的次数,如果数字出现次数达到3,则将其移出HashMap,那么最终剩下的即为只出现过一次的那个数字。 方法...

LeetCode | Single Number

Given an array of integers, every element appears twice except for one. Find that single one.

原题描述 Given an array of integers, every element appears twice except for one. Find that single one. 解题思路 可以利用异或运算来实现。关于异或运算的几个法则: a ^ a = 0; a ^ 0 = a; a ^ b = b ^ a ; 实现代码 /** * LeetCode...

LeetCode | Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list.

原题描述 A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. 解题思路 本题要复制的对象是带随机指针的单链表...

LeetCode | Word Break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.

原题描述 Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given s = “leetcode”, dict =...

LeetCode | Word Break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences.

原题描述 Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences. For example, give...

LeetCode | Linked List Cycle

判断一个单链表是否有环,若有环的话,返回环的入口点。空间复杂度为O(1)

原题描述 判断一个单链表是否有环,若有环的话,返回环的入口点。空间复杂度为O(1)。 解题思路 快慢指针法。慢指针步长为1,快指针步长为2,两个指针同时从头结点开始扫描,若单链表存在环,则两个指针必定会相遇,而且是在慢指针遍历完环之前。原理解析可以参考:http://blog.csdn.net/loveyou426/article/details/7927297。 那么环的入口点...