Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to page curl for pdf file

Tags:

android

hi i m new in android page curl application, i show the pdf file using mupdf opensource via. here using intent action view, so only scroll is working but i need page curl.if any body know the answer please help this concept. thank you.

@Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        mAlertBuilder = new AlertDialog.Builder(this);

        if (core == null) {
            core = (MuPDFCore)getLastNonConfigurationInstance();

            if (savedInstanceState != null && savedInstanceState.containsKey("FileName")) {
                mFileName = savedInstanceState.getString("FileName");
            }
        }
        if (core == null) {
            Intent intent = getIntent();
            if (Intent.ACTION_VIEW.equals(intent.getAction())) {
                Uri uri = intent.getData();
                if (uri.toString().startsWith("content://media/external/file")) {
                    // Handle view requests from the Transformer Prime's file manager
                    // Hopefully other file managers will use this same scheme, if not
                    // using explicit paths.
                    Cursor cursor = getContentResolver().query(uri, new String[]{"_data"}, null, null, null);
                    if (cursor.moveToFirst()) {
                        uri = Uri.parse(cursor.getString(0));
                    }
                }
                core = openFile(Uri.decode(uri.getEncodedPath()));
            }
            if (core != null && core.needsPassword()) {
                requestPassword(savedInstanceState);
                return;
            }
        }
        if (core == null)
        {
            AlertDialog alert = mAlertBuilder.create();
            alert.setTitle(R.string.open_failed);
            alert.setButton(AlertDialog.BUTTON_POSITIVE, "Dismiss",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            finish();
                        }
                    });
            alert.show();
            return;
        }

        createUI(savedInstanceState);
    }
like image 249
Sathish Kumar Avatar asked May 19 '12 07:05

Sathish Kumar


2 Answers

Get the code from here android_page_curl and link

like image 131
Aerrow Avatar answered Oct 30 '22 13:10

Aerrow


From here you can download the source code for page curl effect.

Check this link for checkout source code from Google Code.

like image 23
Chirag Avatar answered Oct 30 '22 12:10

Chirag