Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple calls to onViewCreated and add missing break statement #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,6 @@ public View onActivityCreateView(View parent, View view, String name, Context co
return mCalligraphyFactory.onViewCreated(createCustomViewInternal(parent, view, name, context, attrs), context, attrs);
}

/**
* The LayoutInflater onCreateView is the fourth port of call for LayoutInflation.
* BUT only for none CustomViews.
*/
@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected View onCreateView(View parent, String name, AttributeSet attrs) throws ClassNotFoundException {
return mCalligraphyFactory.onViewCreated(super.onCreateView(parent, name, attrs),
getContext(), attrs);
}

/**
* The LayoutInflater onCreateView is the fourth port of call for LayoutInflation.
* BUT only for none CustomViews.
Expand All @@ -162,11 +151,11 @@ protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoun
for (String prefix : sClassPrefixList) {
try {
view = createView(name, prefix, attrs);
if (view != null) break;
} catch (ClassNotFoundException ignored) {
}
}
// In this case we want to let the base class take a crack
// at it.
// In this case we want to let the base class take a crack at it.
if (view == null) view = super.onCreateView(name, attrs);

return mCalligraphyFactory.onViewCreated(view, view.getContext(), attrs);
Expand Down