Home | History | Annotate | Download | only in calllog
      1 /*
      2  * Copyright (C) 2015 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 package com.android.dialer.calllog;
     17 
     18 import com.android.dialer.R;
     19 
     20 import android.support.v7.widget.CardView;
     21 import android.support.v7.widget.RecyclerView;
     22 import android.view.View;
     23 
     24 /**
     25  * View holder class for a promo card which will appear in the voicemail tab.
     26  */
     27 public class PromoCardViewHolder extends RecyclerView.ViewHolder {
     28     public static PromoCardViewHolder create(View rootView) {
     29         return new PromoCardViewHolder(rootView);
     30     }
     31 
     32     /**
     33      * The "Settings" button view.
     34      */
     35     private View mSettingsTextView;
     36 
     37     /**
     38      * The "Ok" button view.
     39      */
     40     private View mOkTextView;
     41 
     42     /**
     43      * Creates an instance of the {@link ViewHolder}.
     44      *
     45      * @param rootView The root view.
     46      */
     47     private PromoCardViewHolder(View rootView) {
     48         super(rootView);
     49 
     50         mSettingsTextView = rootView.findViewById(R.id.settings_action);
     51         mOkTextView = rootView.findViewById(R.id.ok_action);
     52     }
     53 
     54     /**
     55      * Retrieves the "Settings" button.
     56      *
     57      * @return The view.
     58      */
     59     public View getSettingsTextView() {
     60         return mSettingsTextView;
     61     }
     62 
     63     /**
     64      * Retrieves the "Ok" button.
     65      *
     66      * @return The view.
     67      */
     68     public View getOkTextView() {
     69         return mOkTextView;
     70     }
     71 }
     72