原创 Gradle For Android(8)--建立持續集成

介紹Continuous Integration(CI)持續集成可以在團隊中每天構建非常多次。每一次自動構建都可以驗證最新Push到主倉庫的提交。這種方式可以幫助我們很快的解決問題,也可以提高我們的開發效率,提升代碼質量。對於Android

原创 dex-method-counts的配置與使用

背景由於aapt打包的時候,方法數不能超過65535,所以需要使用該工具來檢測apk方法數Dex-Method-Counts的配置GitHub鏈接:https://github.com/mihaip/dex-method-counts 由

原创 LinearLayout中resolveSizeAndState解析

resolveSizeAndStateresolveSizeAndState方法說明: Utility to reconcile a desired size and state, with constraints imposed by a

原创 Android-LinearLayout中getChildMeasureSpec解析

getChildMeasureSpecgetChildMeasureSpec源碼該函數的註釋是:執行最難的一步:測量子View大小,測量出指定的MeasureSpec 給一個單獨的子View,這個方法要計算出子View正確的HeightMe

原创 LinearLayout.onMeasure-Weight屬性的轉換

// Either expand children with weight to take up available space or // shrink them if they extend beyond our current

原创 LinearLayout.onMeasure-設置LinearLayout的高度

if (!allFillParent && widthMode != MeasureSpec.EXACTLY) { maxWidth = alternativeMaxWidth; } max

原创 LinearLayout.onMeasure-聲明變量

mTotalLength = 0; int maxWidth = 0; int childState = 0; int alternativeMaxWidth = 0; int weightedMaxWidth = 0; boo

原创 LinearLayout.onMeasure-獲取子View總高度

for (int i = 0; i < count; ++i) { final View child = getVirtualChildAt(i); if (child == null) {

原创 Android-VideoView中的一些問題

VideoView中遺留的問題VideoView是直接繼承SurfaceViewVideoView中的openVideo可能會ANRVideoView中的release,stopPlayBack都會導致ANR,因爲這些方法都是同步執行的,並

原创 LinearLayout中的OnMeasure解析

onMeasure-measureVertical方法該方法會進行下面的幾個步驟聲明使用變量獲取子View總高度計算LinearLayout的高度將子View中的Weight屬性轉換成高度,再重新measure對應的子View設置Linea

原创 LinearLayout.onMesaure-計算LinearLayout的高度

if (useLargestChild && (heightMode == MeasureSpec.AT_MOST || heightMode == MeasureSpec.UNSPECIFIED)) {

原创 Thread.join解析

Blocks the current Thread (<code>Thread.currentThread()</code>) until the receiver finishes its execution and dies. @t

原创 Object.wait以及notify註解

wait()* Causes the calling thread to wait until another thread calls the {@code * notify()} or {@code notifyAll()}

原创 LinearLayout.onMeasure--事例說明

將LinearLayout中代碼Copy了一份存在本地,然後再在裏面加了幾個子View,打印出來LinearLayout.onMeasure中的那些變量的值 如下圖所示,LinearLayout中有4個子View 示例

原创 Java線程池---execute函數解析

public void execute(Runnable command) { if (command == null) throw new NullPointerException(); /*