Search in sources :

Example 1 with BookCreate

use of com.orgzly.android.usecase.BookCreate in project orgzly-android by orgzly.

the class MainActivity method onSimpleOneLinerDialogValue.

// TODO: Implement handlers when dialog is created
@Override
public void onSimpleOneLinerDialogValue(int id, String value, Bundle userData) {
    switch(id) {
        case DIALOG_NEW_BOOK:
            mSyncFragment.run(new BookCreate(value));
            break;
        case DIALOG_IMPORT_BOOK:
            Uri uri = Uri.parse(userData.getString("uri"));
            /* We are assuming it's an Org file. */
            mSyncFragment.run(new BookImportFromUri(value, BookFormat.ORG, uri));
            break;
    }
}
Also used : BookImportFromUri(com.orgzly.android.usecase.BookImportFromUri) BookCreate(com.orgzly.android.usecase.BookCreate) Uri(android.net.Uri) BookImportFromUri(com.orgzly.android.usecase.BookImportFromUri) BookExportToUri(com.orgzly.android.usecase.BookExportToUri)

Aggregations

Uri (android.net.Uri)1 BookCreate (com.orgzly.android.usecase.BookCreate)1 BookExportToUri (com.orgzly.android.usecase.BookExportToUri)1 BookImportFromUri (com.orgzly.android.usecase.BookImportFromUri)1