155 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
			
		
		
	
	
			155 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
| .class Lcom/google/android/material/transition/FitModeEvaluators;
 | |
| .super Ljava/lang/Object;
 | |
| .source "FitModeEvaluators.java"
 | |
| 
 | |
| 
 | |
| # static fields
 | |
| .field private static final HEIGHT:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
| .field private static final WIDTH:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
| 
 | |
| # direct methods
 | |
| .method public static constructor <clinit>()V
 | |
|     .locals 1
 | |
| 
 | |
|     .line 1
 | |
|     new-instance v0, Lcom/google/android/material/transition/FitModeEvaluators$1;
 | |
| 
 | |
|     invoke-direct {v0}, Lcom/google/android/material/transition/FitModeEvaluators$1;-><init>()V
 | |
| 
 | |
|     sput-object v0, Lcom/google/android/material/transition/FitModeEvaluators;->WIDTH:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
|     .line 2
 | |
|     new-instance v0, Lcom/google/android/material/transition/FitModeEvaluators$2;
 | |
| 
 | |
|     invoke-direct {v0}, Lcom/google/android/material/transition/FitModeEvaluators$2;-><init>()V
 | |
| 
 | |
|     sput-object v0, Lcom/google/android/material/transition/FitModeEvaluators;->HEIGHT:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method private constructor <init>()V
 | |
|     .locals 0
 | |
| 
 | |
|     .line 1
 | |
|     invoke-direct {p0}, Ljava/lang/Object;-><init>()V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public static get(IZLandroid/graphics/RectF;Landroid/graphics/RectF;)Lcom/google/android/material/transition/FitModeEvaluator;
 | |
|     .locals 0
 | |
| 
 | |
|     if-eqz p0, :cond_2
 | |
| 
 | |
|     const/4 p1, 0x1
 | |
| 
 | |
|     if-eq p0, p1, :cond_1
 | |
| 
 | |
|     const/4 p1, 0x2
 | |
| 
 | |
|     if-ne p0, p1, :cond_0
 | |
| 
 | |
|     .line 1
 | |
|     sget-object p0, Lcom/google/android/material/transition/FitModeEvaluators;->HEIGHT:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
|     return-object p0
 | |
| 
 | |
|     .line 2
 | |
|     :cond_0
 | |
|     new-instance p1, Ljava/lang/IllegalArgumentException;
 | |
| 
 | |
|     const-string p2, "Invalid fit mode: "
 | |
| 
 | |
|     invoke-static {p2, p0}, Landroid/support/v4/media/b;->a(Ljava/lang/String;I)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object p0
 | |
| 
 | |
|     invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
 | |
| 
 | |
|     throw p1
 | |
| 
 | |
|     .line 3
 | |
|     :cond_1
 | |
|     sget-object p0, Lcom/google/android/material/transition/FitModeEvaluators;->WIDTH:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
|     return-object p0
 | |
| 
 | |
|     .line 4
 | |
|     :cond_2
 | |
|     invoke-static {p1, p2, p3}, Lcom/google/android/material/transition/FitModeEvaluators;->shouldAutoFitToWidth(ZLandroid/graphics/RectF;Landroid/graphics/RectF;)Z
 | |
| 
 | |
|     move-result p0
 | |
| 
 | |
|     if-eqz p0, :cond_3
 | |
| 
 | |
|     sget-object p0, Lcom/google/android/material/transition/FitModeEvaluators;->WIDTH:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     :cond_3
 | |
|     sget-object p0, Lcom/google/android/material/transition/FitModeEvaluators;->HEIGHT:Lcom/google/android/material/transition/FitModeEvaluator;
 | |
| 
 | |
|     :goto_0
 | |
|     return-object p0
 | |
| .end method
 | |
| 
 | |
| .method private static shouldAutoFitToWidth(ZLandroid/graphics/RectF;Landroid/graphics/RectF;)Z
 | |
|     .locals 4
 | |
| 
 | |
|     .line 1
 | |
|     invoke-virtual {p1}, Landroid/graphics/RectF;->width()F
 | |
| 
 | |
|     move-result v0
 | |
| 
 | |
|     .line 2
 | |
|     invoke-virtual {p1}, Landroid/graphics/RectF;->height()F
 | |
| 
 | |
|     move-result p1
 | |
| 
 | |
|     .line 3
 | |
|     invoke-virtual {p2}, Landroid/graphics/RectF;->width()F
 | |
| 
 | |
|     move-result v1
 | |
| 
 | |
|     .line 4
 | |
|     invoke-virtual {p2}, Landroid/graphics/RectF;->height()F
 | |
| 
 | |
|     move-result p2
 | |
| 
 | |
|     mul-float v2, p2, v0
 | |
| 
 | |
|     div-float/2addr v2, v1
 | |
| 
 | |
|     mul-float/2addr v1, p1
 | |
| 
 | |
|     div-float/2addr v1, v0
 | |
| 
 | |
|     const/4 v0, 0x1
 | |
| 
 | |
|     const/4 v3, 0x0
 | |
| 
 | |
|     if-eqz p0, :cond_0
 | |
| 
 | |
|     cmpl-float p0, v2, p1
 | |
| 
 | |
|     if-ltz p0, :cond_1
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     :cond_0
 | |
|     cmpl-float p0, v1, p2
 | |
| 
 | |
|     if-ltz p0, :cond_1
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     :cond_1
 | |
|     move v0, v3
 | |
| 
 | |
|     :goto_0
 | |
|     return v0
 | |
| .end method
 |