Search in sources :

Example 1 with TagsDialogFactory

use of com.ichi2.anki.dialogs.tags.TagsDialogFactory in project Anki-Android by ankidroid.

the class AbstractFlashcardViewer method onCreate.

// ----------------------------------------------------------------------------
// ANDROID METHODS
// ----------------------------------------------------------------------------
@Override
protected void onCreate(Bundle savedInstanceState) {
    Timber.d("onCreate()");
    restorePreferences();
    mTagsDialogFactory = new TagsDialogFactory(this).attachToActivity(this);
    super.onCreate(savedInstanceState);
    setContentView(getContentViewAttr(mPrefFullscreenReview));
    // Make ACTION_PROCESS_TEXT for in-app searching possible on > Android 4.0
    getDelegate().setHandleNativeActionModesEnabled(true);
    View mainView = findViewById(android.R.id.content);
    initNavigationDrawer(mainView);
    mPreviousAnswerIndicator = new PreviousAnswerIndicator(findViewById(R.id.choosen_answer));
    mShortAnimDuration = getResources().getInteger(android.R.integer.config_shortAnimTime);
}
Also used : PreviousAnswerIndicator(com.ichi2.anki.reviewer.PreviousAnswerIndicator) TagsDialogFactory(com.ichi2.anki.dialogs.tags.TagsDialogFactory) View(android.view.View) WebView(android.webkit.WebView)

Example 2 with TagsDialogFactory

use of com.ichi2.anki.dialogs.tags.TagsDialogFactory in project Anki-Android by ankidroid.

the class NoteEditor method onCreate.

// ----------------------------------------------------------------------------
// ANDROID METHODS
// ----------------------------------------------------------------------------
@Override
protected void onCreate(Bundle savedInstanceState) {
    if (showedActivityFailedScreen(savedInstanceState)) {
        return;
    }
    Timber.d("onCreate()");
    mTagsDialogFactory = new TagsDialogFactory(this).attachToActivity(this);
    mMediaRegistration = new MediaRegistration(this);
    super.onCreate(savedInstanceState);
    mFieldState.setInstanceState(savedInstanceState);
    setContentView(R.layout.note_editor);
    Intent intent = getIntent();
    if (savedInstanceState != null) {
        mCaller = savedInstanceState.getInt("caller");
        mAddNote = savedInstanceState.getBoolean("addNote");
        mCurrentDid = savedInstanceState.getLong("did");
        mSelectedTags = savedInstanceState.getStringArrayList("tags");
        mReloadRequired = savedInstanceState.getBoolean("reloadRequired");
        mPastedImageCache = (HashMap<String, String>) savedInstanceState.getSerializable("imageCache");
        mToggleStickyText = (HashMap<Integer, String>) savedInstanceState.getSerializable("toggleSticky");
        mChanged = savedInstanceState.getBoolean("changed");
    } else {
        mCaller = intent.getIntExtra(EXTRA_CALLER, CALLER_NOCALLER);
        if (mCaller == CALLER_NOCALLER) {
            String action = intent.getAction();
            if ((ACTION_CREATE_FLASHCARD.equals(action) || ACTION_CREATE_FLASHCARD_SEND.equals(action) || ACTION_PROCESS_TEXT.equals(action))) {
                mCaller = CALLER_CARDEDITOR_INTENT_ADD;
            }
        }
    }
    startLoadingCollection();
    mOnboarding.onCreate();
}
Also used : Intent(android.content.Intent) TagsDialogFactory(com.ichi2.anki.dialogs.tags.TagsDialogFactory)

Aggregations

TagsDialogFactory (com.ichi2.anki.dialogs.tags.TagsDialogFactory)2 Intent (android.content.Intent)1 View (android.view.View)1 WebView (android.webkit.WebView)1 PreviousAnswerIndicator (com.ichi2.anki.reviewer.PreviousAnswerIndicator)1