Example usage for android.support.v4.view LayoutInflaterFactory LayoutInflaterFactory

List of usage examples for android.support.v4.view LayoutInflaterFactory LayoutInflaterFactory

Introduction

In this page you can find the example usage for android.support.v4.view LayoutInflaterFactory LayoutInflaterFactory.

Prototype

LayoutInflaterFactory

Source Link

Usage

From source file:org.mariotaku.twidere.activity.support.ThemedFragmentActivity.java

@NonNull
@Override/*from   ww w .j a v a  2 s .c  o  m*/
public LayoutInflater getLayoutInflater() {
    final LayoutInflater inflater = super.getLayoutInflater();
    if (inflater.getFactory() == null) {
        LayoutInflaterCompat.setFactory(inflater,
                new ThemedLayoutInflaterFactory(this, new LayoutInflaterFactory() {
                    @Override
                    public View onCreateView(View parent, String name, Context context, AttributeSet attrs) {
                        return ThemedFragmentActivity.this.onCreateView(parent, name, context, attrs);
                    }
                }));
    }
    return inflater;
}