mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-18 16:41:13 +00:00
Merge pull request #6 from xingstarx/feature/new_editor
Fix not show content in EditorFragment
This commit is contained in:
@@ -84,9 +84,9 @@ public class EditorFragment extends Fragment implements Editor.EditorListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(Context context) {
|
public void onAttach(Activity context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
if (getActivity() instanceof EditorFragmentListener) {
|
if (context instanceof EditorFragmentListener) {
|
||||||
mListener = (EditorFragmentListener) getActivity();
|
mListener = (EditorFragmentListener) getActivity();
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Current activity is not the EditorFragmentListener");
|
throw new IllegalArgumentException("Current activity is not the EditorFragmentListener");
|
||||||
@@ -103,8 +103,6 @@ public class EditorFragment extends Fragment implements Editor.EditorListener {
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_editor, container, false);
|
View view = inflater.inflate(R.layout.fragment_editor, container, false);
|
||||||
|
|
||||||
|
|
||||||
Bundle arguments = savedInstanceState == null ? getArguments() : savedInstanceState;
|
Bundle arguments = savedInstanceState == null ? getArguments() : savedInstanceState;
|
||||||
mIsEditingEnabled = arguments.getBoolean(ARG_ENABLE_EDIT, false);
|
mIsEditingEnabled = arguments.getBoolean(ARG_ENABLE_EDIT, false);
|
||||||
boolean isMarkdown = arguments.getBoolean(ARG_IS_MARKDOWN, true);
|
boolean isMarkdown = arguments.getBoolean(ARG_IS_MARKDOWN, true);
|
||||||
@@ -123,6 +121,7 @@ public class EditorFragment extends Fragment implements Editor.EditorListener {
|
|||||||
ButterKnife.bind(this, view);
|
ButterKnife.bind(this, view);
|
||||||
mToolContainer.setVisibility(mIsEditingEnabled ? View.VISIBLE : View.GONE);
|
mToolContainer.setVisibility(mIsEditingEnabled ? View.VISIBLE : View.GONE);
|
||||||
mEditor.init(mWebView);
|
mEditor.init(mWebView);
|
||||||
|
mListener.onInitialized();
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user