368 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
			
		
		
	
	
			368 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Smali
		
	
	
	
	
	
| .class Lcom/google/android/material/datepicker/YearGridAdapter;
 | |
| .super Landroidx/recyclerview/widget/RecyclerView$Adapter;
 | |
| .source "YearGridAdapter.java"
 | |
| 
 | |
| 
 | |
| # annotations
 | |
| .annotation system Ldalvik/annotation/MemberClasses;
 | |
|     value = {
 | |
|         Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;
 | |
|     }
 | |
| .end annotation
 | |
| 
 | |
| .annotation system Ldalvik/annotation/Signature;
 | |
|     value = {
 | |
|         "Landroidx/recyclerview/widget/RecyclerView$Adapter<",
 | |
|         "Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;",
 | |
|         ">;"
 | |
|     }
 | |
| .end annotation
 | |
| 
 | |
| 
 | |
| # instance fields
 | |
| .field private final materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
|     .annotation system Ldalvik/annotation/Signature;
 | |
|         value = {
 | |
|             "Lcom/google/android/material/datepicker/MaterialCalendar<",
 | |
|             "*>;"
 | |
|         }
 | |
|     .end annotation
 | |
| .end field
 | |
| 
 | |
| 
 | |
| # direct methods
 | |
| .method public constructor <init>(Lcom/google/android/material/datepicker/MaterialCalendar;)V
 | |
|     .locals 0
 | |
|     .annotation system Ldalvik/annotation/Signature;
 | |
|         value = {
 | |
|             "(",
 | |
|             "Lcom/google/android/material/datepicker/MaterialCalendar<",
 | |
|             "*>;)V"
 | |
|         }
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V
 | |
| 
 | |
|     .line 2
 | |
|     iput-object p1, p0, Lcom/google/android/material/datepicker/YearGridAdapter;->materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public static synthetic access$000(Lcom/google/android/material/datepicker/YearGridAdapter;)Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
|     .locals 0
 | |
| 
 | |
|     .line 1
 | |
|     iget-object p0, p0, Lcom/google/android/material/datepicker/YearGridAdapter;->materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
| 
 | |
|     return-object p0
 | |
| .end method
 | |
| 
 | |
| .method private createYearClickListener(I)Landroid/view/View$OnClickListener;
 | |
|     .locals 1
 | |
|     .annotation build Landroidx/annotation/NonNull;
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     new-instance v0, Lcom/google/android/material/datepicker/YearGridAdapter$1;
 | |
| 
 | |
|     invoke-direct {v0, p0, p1}, Lcom/google/android/material/datepicker/YearGridAdapter$1;-><init>(Lcom/google/android/material/datepicker/YearGridAdapter;I)V
 | |
| 
 | |
|     return-object v0
 | |
| .end method
 | |
| 
 | |
| 
 | |
| # virtual methods
 | |
| .method public getItemCount()I
 | |
|     .locals 1
 | |
| 
 | |
|     .line 1
 | |
|     iget-object v0, p0, Lcom/google/android/material/datepicker/YearGridAdapter;->materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
| 
 | |
|     invoke-virtual {v0}, Lcom/google/android/material/datepicker/MaterialCalendar;->getCalendarConstraints()Lcom/google/android/material/datepicker/CalendarConstraints;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-virtual {v0}, Lcom/google/android/material/datepicker/CalendarConstraints;->getYearSpan()I
 | |
| 
 | |
|     move-result v0
 | |
| 
 | |
|     return v0
 | |
| .end method
 | |
| 
 | |
| .method public getPositionForYear(I)I
 | |
|     .locals 1
 | |
| 
 | |
|     .line 1
 | |
|     iget-object v0, p0, Lcom/google/android/material/datepicker/YearGridAdapter;->materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
| 
 | |
|     invoke-virtual {v0}, Lcom/google/android/material/datepicker/MaterialCalendar;->getCalendarConstraints()Lcom/google/android/material/datepicker/CalendarConstraints;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-virtual {v0}, Lcom/google/android/material/datepicker/CalendarConstraints;->getStart()Lcom/google/android/material/datepicker/Month;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     iget v0, v0, Lcom/google/android/material/datepicker/Month;->year:I
 | |
| 
 | |
|     sub-int/2addr p1, v0
 | |
| 
 | |
|     return p1
 | |
| .end method
 | |
| 
 | |
| .method public getYearForPosition(I)I
 | |
|     .locals 1
 | |
| 
 | |
|     .line 1
 | |
|     iget-object v0, p0, Lcom/google/android/material/datepicker/YearGridAdapter;->materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
| 
 | |
|     invoke-virtual {v0}, Lcom/google/android/material/datepicker/MaterialCalendar;->getCalendarConstraints()Lcom/google/android/material/datepicker/CalendarConstraints;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-virtual {v0}, Lcom/google/android/material/datepicker/CalendarConstraints;->getStart()Lcom/google/android/material/datepicker/Month;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     iget v0, v0, Lcom/google/android/material/datepicker/Month;->year:I
 | |
| 
 | |
|     add-int/2addr v0, p1
 | |
| 
 | |
|     return v0
 | |
| .end method
 | |
| 
 | |
| .method public bridge synthetic onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$a0;I)V
 | |
|     .locals 0
 | |
|     .param p1    # Landroidx/recyclerview/widget/RecyclerView$a0;
 | |
|         .annotation build Landroidx/annotation/NonNull;
 | |
|         .end annotation
 | |
|     .end param
 | |
| 
 | |
|     .line 1
 | |
|     check-cast p1, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;
 | |
| 
 | |
|     invoke-virtual {p0, p1, p2}, Lcom/google/android/material/datepicker/YearGridAdapter;->onBindViewHolder(Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;I)V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public onBindViewHolder(Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;I)V
 | |
|     .locals 7
 | |
|     .param p1    # Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;
 | |
|         .annotation build Landroidx/annotation/NonNull;
 | |
|         .end annotation
 | |
|     .end param
 | |
| 
 | |
|     .line 2
 | |
|     invoke-virtual {p0, p2}, Lcom/google/android/material/datepicker/YearGridAdapter;->getYearForPosition(I)I
 | |
| 
 | |
|     move-result p2
 | |
| 
 | |
|     .line 3
 | |
|     iget-object v0, p1, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;->textView:Landroid/widget/TextView;
 | |
| 
 | |
|     .line 4
 | |
|     invoke-virtual {v0}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     sget v1, Lcom/google/android/material/R$string;->mtrl_picker_navigate_to_year_description:I
 | |
| 
 | |
|     .line 5
 | |
|     invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     .line 6
 | |
|     iget-object v1, p1, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;->textView:Landroid/widget/TextView;
 | |
| 
 | |
|     invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;
 | |
| 
 | |
|     move-result-object v2
 | |
| 
 | |
|     const/4 v3, 0x1
 | |
| 
 | |
|     new-array v4, v3, [Ljava/lang/Object;
 | |
| 
 | |
|     invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
 | |
| 
 | |
|     move-result-object v5
 | |
| 
 | |
|     const/4 v6, 0x0
 | |
| 
 | |
|     aput-object v5, v4, v6
 | |
| 
 | |
|     const-string v5, "%d"
 | |
| 
 | |
|     invoke-static {v2, v5, v4}, Ljava/lang/String;->format(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object v2
 | |
| 
 | |
|     invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
 | |
| 
 | |
|     .line 7
 | |
|     iget-object v1, p1, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;->textView:Landroid/widget/TextView;
 | |
| 
 | |
|     new-array v2, v3, [Ljava/lang/Object;
 | |
| 
 | |
|     invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
 | |
| 
 | |
|     move-result-object v4
 | |
| 
 | |
|     aput-object v4, v2, v6
 | |
| 
 | |
|     invoke-static {v0, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     invoke-virtual {v1, v0}, Landroid/widget/TextView;->setContentDescription(Ljava/lang/CharSequence;)V
 | |
| 
 | |
|     .line 8
 | |
|     iget-object v0, p0, Lcom/google/android/material/datepicker/YearGridAdapter;->materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
| 
 | |
|     invoke-virtual {v0}, Lcom/google/android/material/datepicker/MaterialCalendar;->getCalendarStyle()Lcom/google/android/material/datepicker/CalendarStyle;
 | |
| 
 | |
|     move-result-object v0
 | |
| 
 | |
|     .line 9
 | |
|     invoke-static {}, Lcom/google/android/material/datepicker/UtcDates;->getTodayCalendar()Ljava/util/Calendar;
 | |
| 
 | |
|     move-result-object v1
 | |
| 
 | |
|     .line 10
 | |
|     invoke-virtual {v1, v3}, Ljava/util/Calendar;->get(I)I
 | |
| 
 | |
|     move-result v2
 | |
| 
 | |
|     if-ne v2, p2, :cond_0
 | |
| 
 | |
|     iget-object v2, v0, Lcom/google/android/material/datepicker/CalendarStyle;->todayYear:Lcom/google/android/material/datepicker/CalendarItemStyle;
 | |
| 
 | |
|     goto :goto_0
 | |
| 
 | |
|     :cond_0
 | |
|     iget-object v2, v0, Lcom/google/android/material/datepicker/CalendarStyle;->year:Lcom/google/android/material/datepicker/CalendarItemStyle;
 | |
| 
 | |
|     .line 11
 | |
|     :goto_0
 | |
|     iget-object v4, p0, Lcom/google/android/material/datepicker/YearGridAdapter;->materialCalendar:Lcom/google/android/material/datepicker/MaterialCalendar;
 | |
| 
 | |
|     invoke-virtual {v4}, Lcom/google/android/material/datepicker/MaterialCalendar;->getDateSelector()Lcom/google/android/material/datepicker/DateSelector;
 | |
| 
 | |
|     move-result-object v4
 | |
| 
 | |
|     invoke-interface {v4}, Lcom/google/android/material/datepicker/DateSelector;->getSelectedDays()Ljava/util/Collection;
 | |
| 
 | |
|     move-result-object v4
 | |
| 
 | |
|     invoke-interface {v4}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
 | |
| 
 | |
|     move-result-object v4
 | |
| 
 | |
|     :cond_1
 | |
|     :goto_1
 | |
|     invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
 | |
| 
 | |
|     move-result v5
 | |
| 
 | |
|     if-eqz v5, :cond_2
 | |
| 
 | |
|     invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
 | |
| 
 | |
|     move-result-object v5
 | |
| 
 | |
|     check-cast v5, Ljava/lang/Long;
 | |
| 
 | |
|     .line 12
 | |
|     invoke-virtual {v5}, Ljava/lang/Long;->longValue()J
 | |
| 
 | |
|     move-result-wide v5
 | |
| 
 | |
|     invoke-virtual {v1, v5, v6}, Ljava/util/Calendar;->setTimeInMillis(J)V
 | |
| 
 | |
|     .line 13
 | |
|     invoke-virtual {v1, v3}, Ljava/util/Calendar;->get(I)I
 | |
| 
 | |
|     move-result v5
 | |
| 
 | |
|     if-ne v5, p2, :cond_1
 | |
| 
 | |
|     .line 14
 | |
|     iget-object v2, v0, Lcom/google/android/material/datepicker/CalendarStyle;->selectedYear:Lcom/google/android/material/datepicker/CalendarItemStyle;
 | |
| 
 | |
|     goto :goto_1
 | |
| 
 | |
|     .line 15
 | |
|     :cond_2
 | |
|     iget-object v0, p1, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;->textView:Landroid/widget/TextView;
 | |
| 
 | |
|     invoke-virtual {v2, v0}, Lcom/google/android/material/datepicker/CalendarItemStyle;->styleItem(Landroid/widget/TextView;)V
 | |
| 
 | |
|     .line 16
 | |
|     iget-object p1, p1, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;->textView:Landroid/widget/TextView;
 | |
| 
 | |
|     invoke-direct {p0, p2}, Lcom/google/android/material/datepicker/YearGridAdapter;->createYearClickListener(I)Landroid/view/View$OnClickListener;
 | |
| 
 | |
|     move-result-object p2
 | |
| 
 | |
|     invoke-virtual {p1, p2}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
 | |
| 
 | |
|     return-void
 | |
| .end method
 | |
| 
 | |
| .method public bridge synthetic onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$a0;
 | |
|     .locals 0
 | |
|     .param p1    # Landroid/view/ViewGroup;
 | |
|         .annotation build Landroidx/annotation/NonNull;
 | |
|         .end annotation
 | |
|     .end param
 | |
|     .annotation build Landroidx/annotation/NonNull;
 | |
|     .end annotation
 | |
| 
 | |
|     .line 1
 | |
|     invoke-virtual {p0, p1, p2}, Lcom/google/android/material/datepicker/YearGridAdapter;->onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     return-object p1
 | |
| .end method
 | |
| 
 | |
| .method public onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;
 | |
|     .locals 2
 | |
|     .param p1    # Landroid/view/ViewGroup;
 | |
|         .annotation build Landroidx/annotation/NonNull;
 | |
|         .end annotation
 | |
|     .end param
 | |
|     .annotation build Landroidx/annotation/NonNull;
 | |
|     .end annotation
 | |
| 
 | |
|     .line 2
 | |
|     invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
 | |
| 
 | |
|     move-result-object p2
 | |
| 
 | |
|     invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
 | |
| 
 | |
|     move-result-object p2
 | |
| 
 | |
|     sget v0, Lcom/google/android/material/R$layout;->mtrl_calendar_year:I
 | |
| 
 | |
|     const/4 v1, 0x0
 | |
| 
 | |
|     .line 3
 | |
|     invoke-virtual {p2, v0, p1, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
 | |
| 
 | |
|     move-result-object p1
 | |
| 
 | |
|     check-cast p1, Landroid/widget/TextView;
 | |
| 
 | |
|     .line 4
 | |
|     new-instance p2, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;
 | |
| 
 | |
|     invoke-direct {p2, p1}, Lcom/google/android/material/datepicker/YearGridAdapter$ViewHolder;-><init>(Landroid/widget/TextView;)V
 | |
| 
 | |
|     return-object p2
 | |
| .end method
 |