You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
666 lines
15 KiB
666 lines
15 KiB
.class public Lcom/viatech/util/SystemBarTintManager$SystemBarConfig; |
|
.super Ljava/lang/Object; |
|
.source "SystemBarTintManager.java" |
|
|
|
|
|
# annotations |
|
.annotation system Ldalvik/annotation/EnclosingClass; |
|
value = Lcom/viatech/util/SystemBarTintManager; |
|
.end annotation |
|
|
|
.annotation system Ldalvik/annotation/InnerClass; |
|
accessFlags = 0x9 |
|
name = "SystemBarConfig" |
|
.end annotation |
|
|
|
|
|
# static fields |
|
.field private static final NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME:Ljava/lang/String; = "navigation_bar_height_landscape" |
|
|
|
.field private static final NAV_BAR_HEIGHT_RES_NAME:Ljava/lang/String; = "navigation_bar_height" |
|
|
|
.field private static final NAV_BAR_WIDTH_RES_NAME:Ljava/lang/String; = "navigation_bar_width" |
|
|
|
.field private static final SHOW_NAV_BAR_RES_NAME:Ljava/lang/String; = "config_showNavigationBar" |
|
|
|
.field private static final STATUS_BAR_HEIGHT_RES_NAME:Ljava/lang/String; = "status_bar_height" |
|
|
|
|
|
# instance fields |
|
.field private final mActionBarHeight:I |
|
|
|
.field private final mHasNavigationBar:Z |
|
|
|
.field private final mInPortrait:Z |
|
|
|
.field private final mNavigationBarHeight:I |
|
|
|
.field private final mNavigationBarWidth:I |
|
|
|
.field private final mSmallestWidthDp:F |
|
|
|
.field private final mStatusBarHeight:I |
|
|
|
.field private final mTranslucentNavBar:Z |
|
|
|
.field private final mTranslucentStatusBar:Z |
|
|
|
|
|
# direct methods |
|
.method private constructor <init>(Landroid/app/Activity;ZZ)V |
|
.locals 4 |
|
|
|
.prologue |
|
const/4 v2, 0x0 |
|
|
|
const/4 v1, 0x1 |
|
|
|
.line 397 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
.line 398 |
|
invoke-virtual {p1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v3 |
|
|
|
.line 399 |
|
invoke-virtual {v3}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration; |
|
|
|
move-result-object v0 |
|
|
|
iget v0, v0, Landroid/content/res/Configuration;->orientation:I |
|
|
|
if-ne v0, v1, :cond_0 |
|
|
|
move v0, v1 |
|
|
|
:goto_0 |
|
iput-boolean v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mInPortrait:Z |
|
|
|
.line 400 |
|
invoke-direct {p0, p1}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->getSmallestWidthDp(Landroid/app/Activity;)F |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mSmallestWidthDp:F |
|
|
|
.line 401 |
|
const-string v0, "status_bar_height" |
|
|
|
invoke-direct {p0, v3, v0}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->getInternalDimensionSize(Landroid/content/res/Resources;Ljava/lang/String;)I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mStatusBarHeight:I |
|
|
|
.line 402 |
|
invoke-direct {p0, p1}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->getActionBarHeight(Landroid/content/Context;)I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mActionBarHeight:I |
|
|
|
.line 403 |
|
invoke-direct {p0, p1}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->getNavigationBarHeight(Landroid/content/Context;)I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mNavigationBarHeight:I |
|
|
|
.line 404 |
|
invoke-direct {p0, p1}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->getNavigationBarWidth(Landroid/content/Context;)I |
|
|
|
move-result v0 |
|
|
|
iput v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mNavigationBarWidth:I |
|
|
|
.line 405 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mNavigationBarHeight:I |
|
|
|
if-lez v0, :cond_1 |
|
|
|
:goto_1 |
|
iput-boolean v1, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mHasNavigationBar:Z |
|
|
|
.line 406 |
|
iput-boolean p2, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mTranslucentStatusBar:Z |
|
|
|
.line 407 |
|
iput-boolean p3, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mTranslucentNavBar:Z |
|
|
|
.line 408 |
|
return-void |
|
|
|
:cond_0 |
|
move v0, v2 |
|
|
|
.line 399 |
|
goto :goto_0 |
|
|
|
:cond_1 |
|
move v1, v2 |
|
|
|
.line 405 |
|
goto :goto_1 |
|
.end method |
|
|
|
.method synthetic constructor <init>(Landroid/app/Activity;ZZLcom/viatech/util/SystemBarTintManager$1;)V |
|
.locals 0 |
|
|
|
.prologue |
|
.line 379 |
|
invoke-direct {p0, p1, p2, p3}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;-><init>(Landroid/app/Activity;ZZ)V |
|
|
|
return-void |
|
.end method |
|
|
|
.method private getActionBarHeight(Landroid/content/Context;)I |
|
.locals 4 |
|
.annotation build Landroid/annotation/TargetApi; |
|
value = 0xe |
|
.end annotation |
|
|
|
.prologue |
|
.line 412 |
|
const/4 v0, 0x0 |
|
|
|
.line 413 |
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I |
|
|
|
const/16 v2, 0xe |
|
|
|
if-lt v1, v2, :cond_0 |
|
|
|
.line 414 |
|
new-instance v0, Landroid/util/TypedValue; |
|
|
|
invoke-direct {v0}, Landroid/util/TypedValue;-><init>()V |
|
|
|
.line 415 |
|
invoke-virtual {p1}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme; |
|
|
|
move-result-object v1 |
|
|
|
const v2, 0x10102eb |
|
|
|
const/4 v3, 0x1 |
|
|
|
invoke-virtual {v1, v2, v0, v3}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z |
|
|
|
.line 416 |
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v1 |
|
|
|
iget v0, v0, Landroid/util/TypedValue;->resourceId:I |
|
|
|
invoke-virtual {v1, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I |
|
|
|
move-result v0 |
|
|
|
.line 418 |
|
:cond_0 |
|
return v0 |
|
.end method |
|
|
|
.method private getInternalDimensionSize(Landroid/content/res/Resources;Ljava/lang/String;)I |
|
.locals 3 |
|
|
|
.prologue |
|
.line 470 |
|
const/4 v0, 0x0 |
|
|
|
.line 471 |
|
const-string v1, "dimen" |
|
|
|
const-string v2, "android" |
|
|
|
invoke-virtual {p1, p2, v1, v2}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
move-result v1 |
|
|
|
.line 472 |
|
if-lez v1, :cond_0 |
|
|
|
.line 473 |
|
invoke-virtual {p1, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I |
|
|
|
move-result v0 |
|
|
|
.line 475 |
|
:cond_0 |
|
return v0 |
|
.end method |
|
|
|
.method private getNavigationBarHeight(Landroid/content/Context;)I |
|
.locals 4 |
|
.annotation build Landroid/annotation/TargetApi; |
|
value = 0xe |
|
.end annotation |
|
|
|
.prologue |
|
.line 423 |
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v1 |
|
|
|
.line 424 |
|
const/4 v0, 0x0 |
|
|
|
.line 425 |
|
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I |
|
|
|
const/16 v3, 0xe |
|
|
|
if-lt v2, v3, :cond_0 |
|
|
|
.line 426 |
|
invoke-direct {p0, p1}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->hasNavBar(Landroid/content/Context;)Z |
|
|
|
move-result v2 |
|
|
|
if-eqz v2, :cond_0 |
|
|
|
.line 428 |
|
iget-boolean v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mInPortrait:Z |
|
|
|
if-eqz v0, :cond_1 |
|
|
|
.line 429 |
|
const-string v0, "navigation_bar_height" |
|
|
|
.line 433 |
|
:goto_0 |
|
invoke-direct {p0, v1, v0}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->getInternalDimensionSize(Landroid/content/res/Resources;Ljava/lang/String;)I |
|
|
|
move-result v0 |
|
|
|
.line 436 |
|
:cond_0 |
|
return v0 |
|
|
|
.line 431 |
|
:cond_1 |
|
const-string v0, "navigation_bar_height_landscape" |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method private getNavigationBarWidth(Landroid/content/Context;)I |
|
.locals 4 |
|
.annotation build Landroid/annotation/TargetApi; |
|
value = 0xe |
|
.end annotation |
|
|
|
.prologue |
|
.line 441 |
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v1 |
|
|
|
.line 442 |
|
const/4 v0, 0x0 |
|
|
|
.line 443 |
|
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I |
|
|
|
const/16 v3, 0xe |
|
|
|
if-lt v2, v3, :cond_0 |
|
|
|
.line 444 |
|
invoke-direct {p0, p1}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->hasNavBar(Landroid/content/Context;)Z |
|
|
|
move-result v2 |
|
|
|
if-eqz v2, :cond_0 |
|
|
|
.line 445 |
|
const-string v0, "navigation_bar_width" |
|
|
|
invoke-direct {p0, v1, v0}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->getInternalDimensionSize(Landroid/content/res/Resources;Ljava/lang/String;)I |
|
|
|
move-result v0 |
|
|
|
.line 448 |
|
:cond_0 |
|
return v0 |
|
.end method |
|
|
|
.method private getSmallestWidthDp(Landroid/app/Activity;)F |
|
.locals 3 |
|
.annotation build Landroid/annotation/SuppressLint; |
|
value = { |
|
"NewApi" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 480 |
|
new-instance v0, Landroid/util/DisplayMetrics; |
|
|
|
invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V |
|
|
|
.line 481 |
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I |
|
|
|
const/16 v2, 0x10 |
|
|
|
if-lt v1, v2, :cond_0 |
|
|
|
.line 482 |
|
invoke-virtual {p1}, Landroid/app/Activity;->getWindowManager()Landroid/view/WindowManager; |
|
|
|
move-result-object v1 |
|
|
|
invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, v0}, Landroid/view/Display;->getRealMetrics(Landroid/util/DisplayMetrics;)V |
|
|
|
.line 487 |
|
:goto_0 |
|
iget v1, v0, Landroid/util/DisplayMetrics;->widthPixels:I |
|
|
|
int-to-float v1, v1 |
|
|
|
iget v2, v0, Landroid/util/DisplayMetrics;->density:F |
|
|
|
div-float/2addr v1, v2 |
|
|
|
.line 488 |
|
iget v2, v0, Landroid/util/DisplayMetrics;->heightPixels:I |
|
|
|
int-to-float v2, v2 |
|
|
|
iget v0, v0, Landroid/util/DisplayMetrics;->density:F |
|
|
|
div-float v0, v2, v0 |
|
|
|
.line 489 |
|
invoke-static {v1, v0}, Ljava/lang/Math;->min(FF)F |
|
|
|
move-result v0 |
|
|
|
return v0 |
|
|
|
.line 485 |
|
:cond_0 |
|
invoke-virtual {p1}, Landroid/app/Activity;->getWindowManager()Landroid/view/WindowManager; |
|
|
|
move-result-object v1 |
|
|
|
invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display; |
|
|
|
move-result-object v1 |
|
|
|
invoke-virtual {v1, v0}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method private hasNavBar(Landroid/content/Context;)Z |
|
.locals 6 |
|
.annotation build Landroid/annotation/TargetApi; |
|
value = 0xe |
|
.end annotation |
|
|
|
.prologue |
|
const/4 v1, 0x1 |
|
|
|
const/4 v0, 0x0 |
|
|
|
.line 453 |
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; |
|
|
|
move-result-object v2 |
|
|
|
.line 454 |
|
const-string v3, "config_showNavigationBar" |
|
|
|
const-string v4, "bool" |
|
|
|
const-string v5, "android" |
|
|
|
invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I |
|
|
|
move-result v3 |
|
|
|
.line 455 |
|
if-eqz v3, :cond_1 |
|
|
|
.line 456 |
|
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getBoolean(I)Z |
|
|
|
move-result v2 |
|
|
|
.line 458 |
|
const-string v3, "1" |
|
|
|
invoke-static {}, Lcom/viatech/util/SystemBarTintManager;->access$100()Ljava/lang/String; |
|
|
|
move-result-object v4 |
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z |
|
|
|
move-result v3 |
|
|
|
if-eqz v3, :cond_0 |
|
|
|
.line 465 |
|
:goto_0 |
|
return v0 |
|
|
|
.line 460 |
|
:cond_0 |
|
const-string v0, "0" |
|
|
|
invoke-static {}, Lcom/viatech/util/SystemBarTintManager;->access$100()Ljava/lang/String; |
|
|
|
move-result-object v3 |
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_3 |
|
|
|
move v0, v1 |
|
|
|
.line 461 |
|
goto :goto_0 |
|
|
|
.line 465 |
|
:cond_1 |
|
invoke-static {p1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration; |
|
|
|
move-result-object v2 |
|
|
|
invoke-virtual {v2}, Landroid/view/ViewConfiguration;->hasPermanentMenuKey()Z |
|
|
|
move-result v2 |
|
|
|
if-nez v2, :cond_2 |
|
|
|
:goto_1 |
|
move v0, v1 |
|
|
|
goto :goto_0 |
|
|
|
:cond_2 |
|
move v1, v0 |
|
|
|
goto :goto_1 |
|
|
|
:cond_3 |
|
move v0, v2 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public getActionBarHeight()I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 518 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mActionBarHeight:I |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public getNavigationBarHeight()I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 537 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mNavigationBarHeight:I |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public getNavigationBarWidth()I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 547 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mNavigationBarWidth:I |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public getPixelInsetBottom()I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 566 |
|
iget-boolean v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mTranslucentNavBar:Z |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
invoke-virtual {p0}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->isNavigationAtBottom()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
.line 567 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mNavigationBarHeight:I |
|
|
|
.line 569 |
|
:goto_0 |
|
return v0 |
|
|
|
:cond_0 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public getPixelInsetRight()I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 579 |
|
iget-boolean v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mTranslucentNavBar:Z |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
invoke-virtual {p0}, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->isNavigationAtBottom()Z |
|
|
|
move-result v0 |
|
|
|
if-nez v0, :cond_0 |
|
|
|
.line 580 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mNavigationBarWidth:I |
|
|
|
.line 582 |
|
:goto_0 |
|
return v0 |
|
|
|
:cond_0 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public getPixelInsetTop(Z)I |
|
.locals 2 |
|
|
|
.prologue |
|
const/4 v0, 0x0 |
|
|
|
.line 557 |
|
iget-boolean v1, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mTranslucentStatusBar:Z |
|
|
|
if-eqz v1, :cond_1 |
|
|
|
iget v1, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mStatusBarHeight:I |
|
|
|
:goto_0 |
|
if-eqz p1, :cond_0 |
|
|
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mActionBarHeight:I |
|
|
|
:cond_0 |
|
add-int/2addr v0, v1 |
|
|
|
return v0 |
|
|
|
:cond_1 |
|
move v1, v0 |
|
|
|
goto :goto_0 |
|
.end method |
|
|
|
.method public getStatusBarHeight()I |
|
.locals 1 |
|
|
|
.prologue |
|
.line 509 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mStatusBarHeight:I |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public hasNavigtionBar()Z |
|
.locals 1 |
|
|
|
.prologue |
|
.line 527 |
|
iget-boolean v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mHasNavigationBar:Z |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public isNavigationAtBottom()Z |
|
.locals 2 |
|
|
|
.prologue |
|
.line 500 |
|
iget v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mSmallestWidthDp:F |
|
|
|
const/high16 v1, 0x44160000 # 600.0f |
|
|
|
cmpl-float v0, v0, v1 |
|
|
|
if-gez v0, :cond_0 |
|
|
|
iget-boolean v0, p0, Lcom/viatech/util/SystemBarTintManager$SystemBarConfig;->mInPortrait:Z |
|
|
|
if-eqz v0, :cond_1 |
|
|
|
:cond_0 |
|
const/4 v0, 0x1 |
|
|
|
:goto_0 |
|
return v0 |
|
|
|
:cond_1 |
|
const/4 v0, 0x0 |
|
|
|
goto :goto_0 |
|
.end method
|
|
|