215 lines
7.6 KiB
Smali
215 lines
7.6 KiB
Smali
.class public Lcom/miguelgaeta/super_bar/SuperBar;
|
|
.super Landroid/view/View;
|
|
.source "SuperBar.java"
|
|
|
|
# interfaces
|
|
.implements Landroid/animation/ValueAnimator$AnimatorUpdateListener;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/miguelgaeta/super_bar/SuperBar$OnSelectionMoved;,
|
|
Lcom/miguelgaeta/super_bar/SuperBar$OnSelectionChanged;,
|
|
Lcom/miguelgaeta/super_bar/SuperBar$ColorFormatter;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final attrs:Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
.field public final config:Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
.field public final drawer:Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
.field public final paint:Lcom/miguelgaeta/super_bar/SuperBarPainter;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarAttributes;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->attrs:Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarPainter;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarPainter;-><init>(Landroid/view/View;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->paint:Lcom/miguelgaeta/super_bar/SuperBarPainter;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarDrawer;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->drawer:Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarConfig;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->config:Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
invoke-direct {p0}, Lcom/miguelgaeta/super_bar/SuperBar;->init()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0, p1, p2}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarAttributes;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->attrs:Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarPainter;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarPainter;-><init>(Landroid/view/View;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->paint:Lcom/miguelgaeta/super_bar/SuperBarPainter;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarDrawer;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->drawer:Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarConfig;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->config:Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
iget-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->attrs:Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p1, p2, v0}, Lcom/miguelgaeta/super_bar/SuperBarAttributes;->parse(Landroid/util/AttributeSet;I)V
|
|
|
|
invoke-direct {p0}, Lcom/miguelgaeta/super_bar/SuperBar;->init()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarAttributes;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->attrs:Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarPainter;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarPainter;-><init>(Landroid/view/View;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->paint:Lcom/miguelgaeta/super_bar/SuperBarPainter;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarDrawer;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->drawer:Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
new-instance p1, Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
invoke-direct {p1, p0}, Lcom/miguelgaeta/super_bar/SuperBarConfig;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
iput-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->config:Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
iget-object p1, p0, Lcom/miguelgaeta/super_bar/SuperBar;->attrs:Lcom/miguelgaeta/super_bar/SuperBarAttributes;
|
|
|
|
invoke-virtual {p1, p2, p3}, Lcom/miguelgaeta/super_bar/SuperBarAttributes;->parse(Landroid/util/AttributeSet;I)V
|
|
|
|
invoke-direct {p0}, Lcom/miguelgaeta/super_bar/SuperBar;->init()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private init()V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p0, v0, v1}, Landroid/view/View;->setLayerType(ILandroid/graphics/Paint;)V
|
|
|
|
new-instance v0, Lcom/miguelgaeta/super_bar/SuperBar$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/miguelgaeta/super_bar/SuperBar$1;-><init>(Lcom/miguelgaeta/super_bar/SuperBar;)V
|
|
|
|
invoke-virtual {p0, v0}, Landroid/view/View;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getConfig()Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/miguelgaeta/super_bar/SuperBar;->config:Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onAnimationUpdate(Landroid/animation/ValueAnimator;)V
|
|
.locals 0
|
|
|
|
invoke-virtual {p0}, Landroid/view/View;->invalidate()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onDraw(Landroid/graphics/Canvas;)V
|
|
.locals 1
|
|
|
|
invoke-super {p0, p1}, Landroid/view/View;->onDraw(Landroid/graphics/Canvas;)V
|
|
|
|
iget-object v0, p0, Lcom/miguelgaeta/super_bar/SuperBar;->drawer:Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/miguelgaeta/super_bar/SuperBarDrawer;->draw(Landroid/graphics/Canvas;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/miguelgaeta/super_bar/SuperBar;->config:Lcom/miguelgaeta/super_bar/SuperBarConfig;
|
|
|
|
invoke-virtual {v0}, Lcom/miguelgaeta/super_bar/SuperBarConfig;->isTouchEnabled()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-super {p0, p1}, Landroid/view/View;->onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/miguelgaeta/super_bar/SuperBar;->drawer:Lcom/miguelgaeta/super_bar/SuperBarDrawer;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/miguelgaeta/super_bar/SuperBarDrawer;->onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|