package com.ikea.kompis.products;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import com.google.gson.Gson;
import com.ikea.kompis.util.PriceUtil;
import com.ikea.kompis.util.UiUtil;
import com.ikea.shared.AppConfigData;
import com.ikea.shared.AppConfigManager;
import com.ikea.shared.config.model.Country;
import com.ikea.shared.products.model.RetailItemCommunication;
import com.ikea.shared.products.model.RetailItemImage.Size;
import com.ikea.shared.products.model.RetailItemImageList;
import java.util.List;

public class ProductListViewHolder extends RecyclerView.ViewHolder
{
  public View mBTILeft;
  public View mBTIRight;
  public View mFamilyPriceGroup;
  public TextView mFamilyPriceUnit;
  public TextView mFamilyPriceValidTime;
  public TextView mFamilyPriceValue;
  public ImageView mNLP;
  public TextView mNLPText;
  public ImageView mNew;
  public TextView mNewText;
  public View mPreviousPriceGroup;
  public TextView mPreviousPriceText;
  public TextView mPreviousPriceUnit;
  public TextView mPreviousPriceValue;
  public TextView mRegPriceValidTime;
  public View mRegularPriceGroup;
  public TextView mRegularPriceUnit;
  public TextView mRegularPriceValue;
  public ImageView product_icon;
  public TextView product_measurement;
  public TextView product_name;
  public TextView product_name_local;
  public TextView product_type;
  public TextView product_weee_fee;

  public ProductListViewHolder(View paramView)
  {
    super(paramView);
  }

  private void showFeeDialog(Fragment paramFragment, RetailItemCommunication paramRetailItemCommunication)
  {
    FeeDialogFragment.newInstance(new Gson().toJson(paramRetailItemCommunication)).show(paramFragment.getChildFragmentManager(), "");
  }

  public void initProductCardValue(final RetailItemCommunication paramRetailItemCommunication, ProductListViewHolder paramProductListViewHolder, final Fragment paramFragment, Context paramContext)
  {
    int i;
    String str1;
    if ((paramRetailItemCommunication != null) && (paramProductListViewHolder != null) && (paramFragment != null))
    {
      if (paramRetailItemCommunication.getProductTypeName() != null)
        paramProductListViewHolder.product_type.setText(paramRetailItemCommunication.getProductTypeName().trim());
      if (paramRetailItemCommunication.getProductName() != null)
        paramProductListViewHolder.product_name.setText(paramRetailItemCommunication.getProductName().trim());
      paramProductListViewHolder.product_measurement.setText(paramRetailItemCommunication.getMeasurement(paramContext));
      if (paramRetailItemCommunication.getProoductNameGlobal() != null)
      {
        TextView localTextView = paramProductListViewHolder.product_name_local;
        if (paramRetailItemCommunication.getProoductNameGlobal().length() <= 0)
          break label328;
        i = 0;
        localTextView.setVisibility(i);
        paramProductListViewHolder.product_name_local.setText(paramRetailItemCommunication.getProoductNameGlobal());
      }
      PriceUtil.refreshPrice(paramRetailItemCommunication, paramProductListViewHolder, paramContext, false);
      str1 = "";
      if ((paramRetailItemCommunication.getRetailItemImageList() != null) && (paramRetailItemCommunication.getRetailItemImageList().getRetailItemImage() != null) && (paramRetailItemCommunication.getRetailItemImageList().getRetailItemImage().size() > 0))
        str1 = UiUtil.getImageURL(RetailItemImage.Size.S3, paramRetailItemCommunication.getRetailItemImageList().getRetailItemImage());
      if (!str1.isEmpty())
        break label335;
      UiUtil.loadImageAsync(paramContext, paramProductListViewHolder.product_icon, 2130837837);
    }
    while (true)
    {
      if ((AppConfigManager.i(paramContext).getAppConfigData() != null) && (AppConfigManager.i(paramContext).getAppConfigData().getConfig() != null) && (!AppConfigManager.i(paramContext).getAppConfigData().getConfig().isNwpSupproted()))
      {
        String str2 = AppConfigManager.i(paramContext).getAppConfigData().getNewLogoUrl(paramContext.getApplicationContext());
        if ((str2 != null) && (!str2.isEmpty()))
          UiUtil.loadImageAsync(paramContext, paramProductListViewHolder.mNew, str2);
        String str3 = AppConfigManager.i(paramContext).getAppConfigData().getNewLowerPriceLogoUrl();
        if ((str3 != null) && (!str3.isEmpty()))
          UiUtil.loadImageAsync(paramContext, paramProductListViewHolder.mNLP, str3);
      }
      paramProductListViewHolder.product_weee_fee.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          ProductListViewHolder.this.showFeeDialog(paramFragment, paramRetailItemCommunication);
        }
      });
      return;
      label328: i = 8;
      break;
      label335: UiUtil.loadImageAsync(paramContext, paramProductListViewHolder.product_icon, str1);
    }
  }

  public void initProductCardView(View paramView)
  {
    this.product_measurement = ((TextView)paramView.findViewById(2131624194));
    this.product_icon = ((ImageView)paramView.findViewById(2131624241));
    this.product_type = ((TextView)paramView.findViewById(2131624191));
    this.product_name = ((TextView)paramView.findViewById(2131624192));
    this.product_name_local = ((TextView)paramView.findViewById(2131624246));
    this.product_weee_fee = ((TextView)paramView.findViewById(2131624225));
    this.mNew = ((ImageView)paramView.findViewById(2131624244));
    this.mNewText = ((TextView)paramView.findViewById(2131624245));
    this.mNLP = ((ImageView)paramView.findViewById(2131624242));
    this.mNLPText = ((TextView)paramView.findViewById(2131624243));
    this.mRegularPriceGroup = paramView.findViewById(2131624219);
    this.mRegularPriceValue = ((TextView)paramView.findViewById(2131624221));
    this.mRegularPriceUnit = ((TextView)paramView.findViewById(2131624223));
    this.mRegPriceValidTime = ((TextView)paramView.findViewById(2131624224));
    this.mFamilyPriceGroup = paramView.findViewById(2131624214);
    this.mFamilyPriceValue = ((TextView)paramView.findViewById(2131624215));
    this.mFamilyPriceUnit = ((TextView)paramView.findViewById(2131624216));
    this.mFamilyPriceValidTime = ((TextView)paramView.findViewById(2131624218));
    this.mPreviousPriceGroup = paramView.findViewById(2131624226);
    this.mPreviousPriceText = ((TextView)paramView.findViewById(2131624227));
    this.mPreviousPriceValue = ((TextView)paramView.findViewById(2131624228));
    this.mPreviousPriceUnit = ((TextView)paramView.findViewById(2131624229));
    this.mBTILeft = paramView.findViewById(2131624220);
    this.mBTIRight = paramView.findViewById(2131624222);
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.ikea.kompis.products.ProductListViewHolder
 * JD-Core Version:    0.6.2
 */