I am trying to create a rich text editor by embedding webview in scrollview of android's relative layout. The webview displays a html file with editable divs.
<html>
<body>
<div id="editor" contentEditable="true"></div>
</body>
</html>
The layout file:-
<ScrollView
android:id="@+id/blog_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="30dp"
android:clipToPadding="false"
android:layout_above="@+id/Footer"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
>
<RelativeLayout
android:id="@+id/rlContent"
android:layout_width="match_parent"
android:layout_height="200px">
<com.medicodesk.ionapp.utils.editor.RichEditor
android:id="@+id/editor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</RelativeLayout>
</ScrollView>
<LinearLayout
android:id="@+id/Footer"
android:layout_width="match_parent"
android:layout_height="45dp"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:visibility="invisible">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/black"
android:layout_above="@+id/blog_content"
android:id="@+id/blog_editor_toolbar"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageButton
android:id="@+id/action_undo"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/undo"
/>
<ImageButton
android:id="@+id/action_blockquote"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@null"
android:contentDescription="@null"
android:src="@drawable/blockquote"
/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
The RichEditor layout is weblayout child, and interacts with html by invoking javascript.
The problem is that i am not able to set the editor window height to fit into android mobile layout size. The editor will be in display mode showing all the content the user has entered or will be in editing mode where the keyboard layout pops from bottom. The editor should be scrollable vertically only. It is not clear for me whether i should rely on html scroll or android scroll view to get smooth scrolling.
Please help me.