1 /*
2  * Copyright (C) 2014 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 
17 package android.support.v4.view;
18 
19 import android.content.Context;
20 import android.util.AttributeSet;
21 import android.view.View;
22 
23 /**
24  * Used with {@code LayoutInflaterCompat.setFactory()}. Offers the same API as
25  * {@code LayoutInflater.Factory2}.
26  */
27 public interface LayoutInflaterFactory {
28 
29     /**
30      * Hook you can supply that is called when inflating from a LayoutInflater.
31      * You can use this to customize the tag names available in your XML
32      * layout files.
33      *
34      * @param parent The parent that the created view will be placed
35      * in; <em>note that this may be null</em>.
36      * @param name Tag name to be inflated.
37      * @param context The context the view is being created in.
38      * @param attrs Inflation attributes as specified in XML file.
39      *
40      * @return View Newly created view. Return null for the default
41      *         behavior.
42      */
onCreateView(View parent, String name, Context context, AttributeSet attrs)43     public View onCreateView(View parent, String name, Context context, AttributeSet attrs);
44 
45 }
46