handle zoomlevel in landscap mode - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC: handle zoomlevel in landscap mode

handle zoomlevel in landscap mode 3 years 4 months ago #8085

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 100
  • Thank you received: 0
I tried with zoomlevel =8.its working for portrait.But when i use landscape mode it gives me blank screen when i try to zooming continuously. sometime i am getting below exception

12-11 09:38:39.413: E/AndroidRuntime(23134): FATAL EXCEPTION: main
12-11 09:38:39.413: E/AndroidRuntime(23134): Process: com.example.wtest, PID: 23134
12-11 09:38:39.413: E/AndroidRuntime(23134): java.lang.IllegalArgumentException: pointerIndex out of range
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.MotionEvent.nativeGetAxisValue(Native Method)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.MotionEvent.getX(MotionEvent.java:2225)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.support.v4.view.MotionEventCompatEclair.getX(MotionEventCompatEclair.java:32)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.support.v4.view.MotionEventCompat$EclairMotionEventVersionImpl.getX(MotionEventCompat.java:91)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.support.v4.view.MotionEventCompat.getX(MotionEventCompat.java:219)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:1839)
12-11 09:38:39.413: E/AndroidRuntime(23134): at com.sph.custom.ViewPagerWithTapGestreDetection.onInterceptTouchEvent(ViewPagerWithTapGestreDetection.java:126)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2107)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2477)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2209)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2477)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2209)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2477)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2209)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2477)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2209)
12-11 09:38:39.413: E/AndroidRuntime(23134): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2332)
12-11 09:38:39.413: E/AndroidRuntime(23134): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1616)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.app.Activity.dispatchTouchEvent(Activity.java:2665)
12-11 09:38:39.413: E/AndroidRuntime(23134): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2280)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.View.dispatchPointerEvent(View.java:8489)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4890)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4741)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4295)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4349)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4318)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4429)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4326)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4486)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4295)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4349)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4318)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4326)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4295)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6705)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6584)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6555)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6520)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6785)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6758)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6804)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.Choreographer.doCallbacks(Choreographer.java:613)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.Choreographer.doFrame(Choreographer.java:581)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.os.Handler.handleCallback(Handler.java:733)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.os.Handler.dispatchMessage(Handler.java:95)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.os.Looper.loop(Looper.java:146)
12-11 09:38:39.413: E/AndroidRuntime(23134): at android.app.Ac

Please Log in or Create an account to join the conversation.

handle zoomlevel in landscap mode 3 years 4 months ago #8087

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 830
  • Karma: 43
  • Thank you received: 10
PDFReader class fit for small zoom level(3x or 4x based screen size),
because it render whole page in 1 Bitmap objects.
large zoom value takes more memories cost. this may take lack of memories.

for large zoom level, plz using PDFLayoutView, this view render a page in many small Bitmap objects.
and not render bitmaps, out of screen area.
but, this class is not finished all features, because of much works need to do.

Please Log in or Create an account to join the conversation.

Last Edit: by .

handle zoomlevel in landscap mode 3 years 4 months ago #8104

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 100
  • Thank you received: 0
Hi Radaee,
Could you please let me know how to stop zooming problematically ?This should be able as if i used 5 as a maximum zoom Level it doesn't zoom after some extent.So i need to apply that to when i am using zoom Level 8?

Please Log in or Create an account to join the conversation.

handle zoomlevel in landscap mode 3 years 4 months ago #8106

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 830
  • Karma: 43
  • Thank you received: 10
in PDFReader, you can replace these code for onSizeChanged
@Override
protected void onSizeChanged( int w, int h, int oldw, int oldh )
{
super.onSizeChanged(w,h,oldw,oldh);
if( w > h ) Global.zoomLevel = 5;
else Global.zoomLevel = 8;
if( m_view == null || m_status == STA_ANNOT ) return;
if( w <= 0 || h <= 0 )
{
w = getWidth();
h = getHeight();
}
PDFPos pos = m_view.vGetPos(w/2, h/2);
m_view.vResize(w, h);
m_view.vSetScale(0, 0, 0);//fit page while resizing.
if( m_goto_pageno >= 0 )
{
m_view.vGotoPage(m_goto_pageno);
m_goto_pageno = -1;
}
else if( pos != null )
{
m_view.vSetPos(pos, w/2, h/2);
//m_view.vCenterPage(pos.pageno);
}
if( m_scale >= 0 )
{
m_view.vSetScale(m_scale, 0, 0);
m_scale = -1;
}
}

Please Log in or Create an account to join the conversation.

Last Edit: by .

handle zoomlevel in landscap mode 3 years 4 months ago #8148

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 100
  • Thank you received: 0
Thanks Radaee.This seems fine.But still i am getting blank screen when i try to zooming continously in Landscape mode.So i need to stop zooming after pdf comes to some zoomed level.As a example i need to stop zooming after
m_view.vGetScale()=10f.Could you please let me know how to do this ?
I tried with this in onSizeChanged methos,but seems not working yet.

Please Log in or Create an account to join the conversation.

handle zoomlevel in landscap mode 3 years 4 months ago #8151

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 100
  • Thank you received: 0
Hi Radaee,

Could you please give me an answer for this issue

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum