DepthUtils.smali

.class public Lcom/cleanmaster/util/DepthUtils;
.super Ljava/lang/Object;
.source "DepthUtils.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/cleanmaster/util/DepthUtils$DepthClass;
    }
.end annotation


# static fields
.field public static ACTIVITY_LAYOUT_DEPTH_LIMIT:I


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 12
    const/4 v0, 0x6

    sput v0, Lcom/cleanmaster/util/DepthUtils;->ACTIVITY_LAYOUT_DEPTH_LIMIT:I

    return-void
.end method

.method public constructor <init>()V
    .registers 1

    .prologue
    .line 11
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static getActivityDepth(Landroid/app/Activity;)I
    .registers 5

    .prologue
    const/4 v1, 0x0

    .line 15
    const v0, 0x1020002

    invoke-virtual {p0, v0}, Landroid/app/Activity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    .line 16
    const/4 v2, 0x0

    .line 17
    instance-of v3, v0, Landroid/view/ViewGroup;

    if-eqz v3, :cond_1d

    .line 18
    check-cast v0, Landroid/view/ViewGroup;

    .line 21
    :goto_f
    if-nez v0, :cond_13

    move v0, v1

    .line 28
    :goto_12
    return v0

    :cond_13
    new-instance v2, Lcom/cleanmaster/util/DepthUtils$DepthClass;

    invoke-direct {v2, v1}, Lcom/cleanmaster/util/DepthUtils$DepthClass;-><init>(I)V

    invoke-static {v0, v1, v2}, Lcom/cleanmaster/util/DepthUtils;->getDepthFromViewGroup(Landroid/view/ViewGroup;ILcom/cleanmaster/util/DepthUtils$DepthClass;)I

    move-result v0

    goto :goto_12

    :cond_1d
    move-object v0, v2

    goto :goto_f
.end method

.method private static getDepthFromViewGroup(Landroid/view/ViewGroup;ILcom/cleanmaster/util/DepthUtils$DepthClass;)I
    .registers 7

    .prologue
    .line 32
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v2

    .line 33
    if-eqz v2, :cond_13

    .line 34
    add-int/lit8 p1, p1, 0x1

    .line 35
    invoke-virtual {p2}, Lcom/cleanmaster/util/DepthUtils$DepthClass;->getDepth()I

    move-result v0

    invoke-static {v0, p1}, Ljava/lang/Math;->max(II)I

    move-result v0

    invoke-virtual {p2, v0}, Lcom/cleanmaster/util/DepthUtils$DepthClass;->setDepth(I)V

    .line 39
    :cond_13
    const/4 v0, 0x0

    move v1, v0

    :goto_15
    if-ge v1, v2, :cond_28

    .line 40
    invoke-virtual {p0, v1}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 43
    instance-of v3, v0, Landroid/view/ViewGroup;

    if-eqz v3, :cond_24

    .line 44
    check-cast v0, Landroid/view/ViewGroup;

    .line 45
    invoke-static {v0, p1, p2}, Lcom/cleanmaster/util/DepthUtils;->getDepthFromViewGroup(Landroid/view/ViewGroup;ILcom/cleanmaster/util/DepthUtils$DepthClass;)I

    .line 39
    :cond_24
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_15

    .line 49
    :cond_28
    invoke-virtual {p2}, Lcom/cleanmaster/util/DepthUtils$DepthClass;->getDepth()I

    move-result v0

    return v0
.end method