Android Canvas (Part 2): Clipping

Canvas clipping limits the drawing region: only content within the clipped area is visible. ...

October 3, 2014 · 2 min · haoxiqiang

Android Canvas (Part 1)

A View renders its content by “drawing” — using a canvas (Canvas) and a paintbrush (Paint). The Canvas obtained through the onDraw method is directly composited onto the View. ...

October 2, 2014 · 4 min · haoxiqiang

Android Custom View (Part 2): Measurement Modes

...

October 1, 2014 · 1 min · haoxiqiang

Android Custom View (Part 1)

When you first start writing custom Views in Android, it’s common to feel unsure where to begin. Generally, there are two approaches: From scratch: Extend View and implement the appearance entirely through calculation and drawing. Extend an existing View: Add child views to an existing component, or override methods to change its behavior. ...

October 1, 2014 · 3 min · haoxiqiang

Building a Blog with Jekyll

This is the first post of this blog. I referenced many Jekyll templates at the time, adapted a custom theme inspired by Pure, and hosted it on GitHub. Source code: haoxiqiang-template Jekyll Overview Jekyll is a static site generator that converts plain text (Markdown, Liquid templates) into a complete static website without requiring a database. Combined with GitHub Pages, it provides free blog hosting. Features Code Highlighting Jekyll has built-in syntax highlighting powered by Rouge: 1 2 3 4 5 def print_hi(name) puts "Hi, #{name}" end print_hi('Tom') #=> prints 'Hi, Tom' LaTeX Math Rendering Set latex: true in the page front matter to enable MathJax rendering: $$ \begin{aligned} \dot{x} &= \sigma(y-x) \ \dot{y} &= \rho x - y - xz \ \dot{z} &= -\beta z + xy \end{aligned} $$ $$ a^2 + b^2 = c^2 $$ When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$. Excerpt Separator Use ` ...

December 21, 2013 · 1 min · haoxiqiang