package com.maniu.mn_vip_jetpack_all;

import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.View;
import androidx.databinding.DataBinderMapper;
import androidx.databinding.DataBindingComponent;
import androidx.databinding.ViewDataBinding;
import com.maniu.mn_vip_jetpack_all.databinding.ActivityLoginBindingImpl;
import com.maniu.mn_vip_jetpack_all.databinding.ActivityMainBindingImpl;
import com.maniu.mn_vip_jetpack_all.databinding.FragmentABindingImpl;
import com.maniu.mn_vip_jetpack_all.databinding.LayoutToolbarBindingImpl;
import java.lang.IllegalArgumentException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.RuntimeException;
import java.lang.String;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class DataBinderMapperImpl extends DataBinderMapper {
  private static final int LAYOUT_ACTIVITYLOGIN = 1;

  private static final int LAYOUT_ACTIVITYMAIN = 2;

  private static final int LAYOUT_FRAGMENTA = 3;

  private static final int LAYOUT_LAYOUTTOOLBAR = 4;

  private static final SparseIntArray INTERNAL_LAYOUT_ID_LOOKUP = new SparseIntArray(4);

  static {
    INTERNAL_LAYOUT_ID_LOOKUP.put(com.maniu.mn_vip_jetpack_all.R.layout.activity_login, LAYOUT_ACTIVITYLOGIN);
    INTERNAL_LAYOUT_ID_LOOKUP.put(com.maniu.mn_vip_jetpack_all.R.layout.activity_main, LAYOUT_ACTIVITYMAIN);
    INTERNAL_LAYOUT_ID_LOOKUP.put(com.maniu.mn_vip_jetpack_all.R.layout.fragment_a, LAYOUT_FRAGMENTA);
    INTERNAL_LAYOUT_ID_LOOKUP.put(com.maniu.mn_vip_jetpack_all.R.layout.layout_toolbar, LAYOUT_LAYOUTTOOLBAR);
  }

  @Override
  public ViewDataBinding getDataBinder(DataBindingComponent component, View view, int layoutId) {
    int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId);
    if(localizedLayoutId > 0) {
      final Object tag = view.getTag();
      if(tag == null) {
        throw new RuntimeException("view must have a tag");
      }
      switch(localizedLayoutId) {
        case  LAYOUT_ACTIVITYLOGIN: {
          if ("layout/activity_login_0".equals(tag)) {
            return new ActivityLoginBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for activity_login is invalid. Received: " + tag);
        }
        case  LAYOUT_ACTIVITYMAIN: {
          if ("layout/activity_main_0".equals(tag)) {
            return new ActivityMainBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for activity_main is invalid. Received: " + tag);
        }
        case  LAYOUT_FRAGMENTA: {
          if ("layout/fragment_a_0".equals(tag)) {
            return new FragmentABindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for fragment_a is invalid. Received: " + tag);
        }
        case  LAYOUT_LAYOUTTOOLBAR: {
          if ("layout/layout_toolbar_0".equals(tag)) {
            return new LayoutToolbarBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for layout_toolbar is invalid. Received: " + tag);
        }
      }
    }
    return null;
  }

  @Override
  public ViewDataBinding getDataBinder(DataBindingComponent component, View[] views, int layoutId) {
    if(views == null || views.length == 0) {
      return null;
    }
    int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId);
    if(localizedLayoutId > 0) {
      final Object tag = views[0].getTag();
      if(tag == null) {
        throw new RuntimeException("view must have a tag");
      }
      switch(localizedLayoutId) {
      }
    }
    return null;
  }

  @Override
  public int getLayoutId(String tag) {
    if (tag == null) {
      return 0;
    }
    Integer tmpVal = InnerLayoutIdLookup.sKeys.get(tag);
    return tmpVal == null ? 0 : tmpVal;
  }

  @Override
  public String convertBrIdToString(int localId) {
    String tmpVal = InnerBrLookup.sKeys.get(localId);
    return tmpVal;
  }

  @Override
  public List<DataBinderMapper> collectDependencies() {
    ArrayList<DataBinderMapper> result = new ArrayList<DataBinderMapper>(2);
    result.add(new androidx.databinding.library.baseAdapters.DataBinderMapperImpl());
    result.add(new com.maniu.lib_cache.DataBinderMapperImpl());
    return result;
  }

  private static class InnerBrLookup {
    static final SparseArray<String> sKeys = new SparseArray<String>(10);

    static {
      sKeys.put(0, "_all");
      sKeys.put(1, "passWord");
      sKeys.put(2, "image");
      sKeys.put(3, "item");
      sKeys.put(4, "u_id");
      sKeys.put(5, "title");
      sKeys.put(6, "account");
      sKeys.put(7, "age");
      sKeys.put(8, "viewModel");
    }
  }

  private static class InnerLayoutIdLookup {
    static final HashMap<String, Integer> sKeys = new HashMap<String, Integer>(4);

    static {
      sKeys.put("layout/activity_login_0", com.maniu.mn_vip_jetpack_all.R.layout.activity_login);
      sKeys.put("layout/activity_main_0", com.maniu.mn_vip_jetpack_all.R.layout.activity_main);
      sKeys.put("layout/fragment_a_0", com.maniu.mn_vip_jetpack_all.R.layout.fragment_a);
      sKeys.put("layout/layout_toolbar_0", com.maniu.mn_vip_jetpack_all.R.layout.layout_toolbar);
    }
  }
}
