Skip to content

Commit

Permalink
Add AndroidX support
Browse files Browse the repository at this point in the history
  • Loading branch information
ximsfei committed Sep 30, 2018
1 parent 9bd3b57 commit 3b4f28a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,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.")) {
if ("androidx.coordinatorlayout.widget.CoordinatorLayout".equals(name)) {
return new SkinMaterialCoordinatorLayout(context, attrs);
}
if (!name.startsWith("com.google.android.material.")) {
return null;
}
View view = null;
switch (name) {
case "com.google.android.material.appbar.AppBarLayout":
view = new SkinMaterialAppBarLayout(context, attrs);
Expand All @@ -48,9 +51,6 @@ public View createView(@NonNull Context context, final String name, @NonNull Att
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;
Expand Down

0 comments on commit 3b4f28a

Please sign in to comment.