How to make programmatically added annotation sub-view scrollable over keyboard
I want to use annotation on my PDF view.
For loading PDF, I have used AndroidPdfViewer library
Now I have added view programmatically over it.
ScrollView - If I use scrollview
which is having edit text, as soon as my keyboard opens, my custom added scrollview
resizes to the available screen area. Now my PDF view and custom view are not sync and i tried giving custom offset any many other provided solution, but not working in my case. So How can I make both in sync or in other words make both view scroll to same y position.
I am setting android:windowSoftInputMode="adjustResize"
in manifest.
activity_main.xml file.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.barteksc.pdfviewer.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.github.barteksc.pdfviewer.PDFView>
</RelativeLayout>
Programmatically added layout is,
ScrollView scrollView = new ScrollView(this);
scrollView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100000));
scrollView.setBackgroundColor(ContextCompat.getColor(this, R.color.bg2));
EditText et = new EditText(this);
et.setPadding(10, 10, 0, 0);
et.setTextSize(8);
et.setGravity(Gravity.TOP);
et.setBackground(getResources().getDrawable(R.drawable.edittext_border));
scrollview.addView(et);
pdfView.addView(scrollview); // pdfView = findViewById(R.id.pdfView);
So how to make pro-grammatically added annotation sub-view scroll-able over keyboard or make pdf and annotation view scroll in sync while keyboard is open.
android pdf annotations scrollview androidpdfviewer
add a comment |
I want to use annotation on my PDF view.
For loading PDF, I have used AndroidPdfViewer library
Now I have added view programmatically over it.
ScrollView - If I use scrollview
which is having edit text, as soon as my keyboard opens, my custom added scrollview
resizes to the available screen area. Now my PDF view and custom view are not sync and i tried giving custom offset any many other provided solution, but not working in my case. So How can I make both in sync or in other words make both view scroll to same y position.
I am setting android:windowSoftInputMode="adjustResize"
in manifest.
activity_main.xml file.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.barteksc.pdfviewer.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.github.barteksc.pdfviewer.PDFView>
</RelativeLayout>
Programmatically added layout is,
ScrollView scrollView = new ScrollView(this);
scrollView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100000));
scrollView.setBackgroundColor(ContextCompat.getColor(this, R.color.bg2));
EditText et = new EditText(this);
et.setPadding(10, 10, 0, 0);
et.setTextSize(8);
et.setGravity(Gravity.TOP);
et.setBackground(getResources().getDrawable(R.drawable.edittext_border));
scrollview.addView(et);
pdfView.addView(scrollview); // pdfView = findViewById(R.id.pdfView);
So how to make pro-grammatically added annotation sub-view scroll-able over keyboard or make pdf and annotation view scroll in sync while keyboard is open.
android pdf annotations scrollview androidpdfviewer
add a comment |
I want to use annotation on my PDF view.
For loading PDF, I have used AndroidPdfViewer library
Now I have added view programmatically over it.
ScrollView - If I use scrollview
which is having edit text, as soon as my keyboard opens, my custom added scrollview
resizes to the available screen area. Now my PDF view and custom view are not sync and i tried giving custom offset any many other provided solution, but not working in my case. So How can I make both in sync or in other words make both view scroll to same y position.
I am setting android:windowSoftInputMode="adjustResize"
in manifest.
activity_main.xml file.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.barteksc.pdfviewer.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.github.barteksc.pdfviewer.PDFView>
</RelativeLayout>
Programmatically added layout is,
ScrollView scrollView = new ScrollView(this);
scrollView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100000));
scrollView.setBackgroundColor(ContextCompat.getColor(this, R.color.bg2));
EditText et = new EditText(this);
et.setPadding(10, 10, 0, 0);
et.setTextSize(8);
et.setGravity(Gravity.TOP);
et.setBackground(getResources().getDrawable(R.drawable.edittext_border));
scrollview.addView(et);
pdfView.addView(scrollview); // pdfView = findViewById(R.id.pdfView);
So how to make pro-grammatically added annotation sub-view scroll-able over keyboard or make pdf and annotation view scroll in sync while keyboard is open.
android pdf annotations scrollview androidpdfviewer
I want to use annotation on my PDF view.
For loading PDF, I have used AndroidPdfViewer library
Now I have added view programmatically over it.
ScrollView - If I use scrollview
which is having edit text, as soon as my keyboard opens, my custom added scrollview
resizes to the available screen area. Now my PDF view and custom view are not sync and i tried giving custom offset any many other provided solution, but not working in my case. So How can I make both in sync or in other words make both view scroll to same y position.
I am setting android:windowSoftInputMode="adjustResize"
in manifest.
activity_main.xml file.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/parent_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.barteksc.pdfviewer.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.github.barteksc.pdfviewer.PDFView>
</RelativeLayout>
Programmatically added layout is,
ScrollView scrollView = new ScrollView(this);
scrollView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 100000));
scrollView.setBackgroundColor(ContextCompat.getColor(this, R.color.bg2));
EditText et = new EditText(this);
et.setPadding(10, 10, 0, 0);
et.setTextSize(8);
et.setGravity(Gravity.TOP);
et.setBackground(getResources().getDrawable(R.drawable.edittext_border));
scrollview.addView(et);
pdfView.addView(scrollview); // pdfView = findViewById(R.id.pdfView);
So how to make pro-grammatically added annotation sub-view scroll-able over keyboard or make pdf and annotation view scroll in sync while keyboard is open.
android pdf annotations scrollview androidpdfviewer
android pdf annotations scrollview androidpdfviewer
edited Nov 21 '18 at 13:41
Pier Giorgio Misley
3,40821542
3,40821542
asked Nov 21 '18 at 13:31
pratik03pratik03
319416
319416
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413170%2fhow-to-make-programmatically-added-annotation-sub-view-scrollable-over-keyboard%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413170%2fhow-to-make-programmatically-added-annotation-sub-view-scrollable-over-keyboard%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown