RadaeePDF.com :: Topic: how to bring to normal size after double click (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: how to bring to normal size after double click

how to bring to normal size after double click 2 years 9 months ago #7930

  • asliyanage
  • asliyanage's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 105
  • Karma: 0
I found below method in pdfreader class.

public boolean OnPDFDoubleTapped(float x, float y)
{
if( m_status != STA_NORMAL ) return false;
m_view.vSetScale(m_view.vGetScale() + Global.zoomStep, x, y);
return true;
}

I need to bring the pdf when if double click happens when the pdf is in mazimum size.So how to identify the maximum size ?is there any status like STA_NORMAL for maximum size ?
The administrator has disabled public write access.

how to bring to normal size after double click 2 years 9 months ago #7981

  • nermeen
  • nermeen's Avatar
  • OFFLINE
  • Moderator
  • Posts: 684
  • Thank you received: 40
  • Karma: 18
You can do it like:
if(m_view.vGetScale() == m_view.vGetMaxScale())
       Global.zoomStep *= -1; //this will reverse the zoom behavior
The administrator has disabled public write access.

how to bring to normal size after double click 2 years 9 months ago #7985

  • asliyanage
  • asliyanage's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 105
  • Karma: 0
I change the code as below.Now it maximize if i double clicks the pdf and if i double click it comes to normal size.

public boolean OnPDFDoubleTapped(float x, float y)
{

if(m_view.vGetScale() == m_view.vGetMinScale()){
m_view.vSetScale(m_view.vGetMaxScale(),x,y );
}else{
m_view.vSetScale(m_view.vGetMinScale(),x,y );
}

}
The administrator has disabled public write access.
Powered by Kunena Forum