Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

How to add dictionary on word search ? 7 years 1 month ago #12019

  • rachnasagar
  • rachnasagar's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 69
  • Thank you received: 0
I want to add button in popup where highlighter underline is howing .
And on click there my text to speech will open and start working .

So I jut want to add feature in that popup and on click there my method will start work?
Last edit: by rachnasagar.
The topic has been locked.

How to add dictionary on word search ? 7 years 1 month ago #12021

  • rachnasagar
  • rachnasagar's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 69
  • Thank you received: 0
i have done that but when we play tech it works but show toast "add annotation failed!".

I have done this in OnPDFSelectEnd method
if( rad_group.getCheckedRadioButtonId() == R.id.rad_copy )
{
// Toast.makeText(PDFViewAct.this, "todo copy text:" + sel_text, Toast.LENGTH_SHORT).show();

android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData.newPlainText("RACHNA SAGAR", sel_text);
clipboard.setPrimaryClip(clip);
}
else if( m_doc.CanSave() )
{
boolean ret = false;
if( rad_group.getCheckedRadioButtonId() == R.id.rad_copy )
{
// Toast.makeText(PDFViewAct.this, "todo copy text:" + sel_text, Toast.LENGTH_SHORT).show();
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData.newPlainText("RACHNA SAGAR", sel_text);
clipboard.setPrimaryClip(clip);
}
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_highlight )
ret = m_view.PDFSetSelMarkup(0);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_underline )
ret = m_view.PDFSetSelMarkup(1);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_strikeout )
ret = m_view.PDFSetSelMarkup(2);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_squiggly )
ret = m_view.PDFSetSelMarkup(4);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_Text_to_Speech )
{
txtText=sel_text;
speakOut();
}

if( !ret )
Toast.makeText(PDFViewAct.this, "add annotation failed!", Toast.LENGTH_SHORT).show();
}
else
Toast.makeText(PDFViewAct.this, "can't write or encrypted!", Toast.LENGTH_SHORT).show();
The topic has been locked.

How to add dictionary on word search ? 7 years 1 month ago #12022

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
You see the toast, because ret is not set in case of TTS (text to speech).
To solve this, you can:
  1. Initialize ret with true:
    boolean ret = true;
  2. OR set ret = true; inside:
    else if( rad_group.getCheckedRadioButtonId() == R.id.rad_Text_to_Speech ) {
         ret = true; 
         txtText=sel_text;
         speakOut();
    }
Last edit: by nermeen.
The topic has been locked.
  • Page:
  • 1
  • 2
Powered by Kunena Forum