package skin.support.design.app;

import android.content.Context;
import androidx.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;

import skin.support.app.SkinLayoutInflater;
import skin.support.design.widget.SkinMaterialAppBarLayout;
import skin.support.design.widget.SkinMaterialBottomNavigationView;
import skin.support.design.widget.SkinMaterialCollapsingToolbarLayout;
import skin.support.design.widget.SkinMaterialCoordinatorLayout;
import skin.support.design.widget.SkinMaterialFloatingActionButton;
import skin.support.design.widget.SkinMaterialNavigationView;
import skin.support.design.widget.SkinMaterialTabLayout;
import skin.support.design.widget.SkinMaterialTextInputEditText;
import skin.support.design.widget.SkinMaterialTextInputLayout;

/**
 * Created by ximsfei on 2017/1/13.
 */
public class SkinMaterialViewInflater implements SkinLayoutInflater {
    @Override
    public View createView(@NonNull Context context, final String name, @NonNull AttributeSet attrs) {
        View view = null;
        if (!name.startsWith("android.support.design.widget.")) {
            return null;
        }
        switch (name) {
            case "com.google.android.material.appbar.AppBarLayout":
                view = new SkinMaterialAppBarLayout(context, attrs);
                break;
            case "com.google.android.material.tabs.TabLayout":
                view = new SkinMaterialTabLayout(context, attrs);
                break;
            case "com.google.android.material.textfield.TextInputLayout":
                view = new SkinMaterialTextInputLayout(context, attrs);
                break;
            case "com.google.android.material.textfield.TextInputEditText":
                view = new SkinMaterialTextInputEditText(context, attrs);
                break;
            case "com.google.android.material.navigation.NavigationView":
                view = new SkinMaterialNavigationView(context, attrs);
                break;
            case "com.google.android.material.floatingactionbutton.FloatingActionButton":
                view = new SkinMaterialFloatingActionButton(context, attrs);
                break;
            case "com.google.android.material.bottomnavigation.BottomNavigationView":
                view = new SkinMaterialBottomNavigationView(context, attrs);
                break;
            case "androidx.coordinatorlayout.widget.CoordinatorLayout":
                view = new SkinMaterialCoordinatorLayout(context, attrs);
                break;
            case "com.google.android.material.appbar.CollapsingToolbarLayout":
                view = new SkinMaterialCollapsingToolbarLayout(context, attrs);
                break;
            default:
                break;
        }
        return view;
    }
}

@@ -1023,25 +1023,161 @@
     
-View view = null;
+if (%22androidx.coordinatorlayout.widget.CoordinatorLayout%22.equals(name)) %7B%0A            return new SkinMaterialCoordinatorLayout(context, attrs);%0A        %7D
 %0A   
@@ -1207,37 +1207,35 @@
 th(%22
-android.support.design.widget
+com.google.android.material
 .%22))
@@ -1264,32 +1264,58 @@
 null;%0A        %7D%0A
+        View view = null;%0A
         switch (
@@ -2524,177 +2524,8 @@
 ak;%0A
-            case %22androidx.coordinatorlayout.widget.CoordinatorLayout%22:%0A                view = new SkinMaterialCoordinatorLayout(context, attrs);%0A                break;%0A
     

Add AndroidX support