Search in sources :

Example 1 with ReviewerCustomFonts

use of com.ichi2.anki.reviewer.ReviewerCustomFonts in project AnkiChinaAndroid by ankichinateam.

the class AbstractFlashcardViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    Timber.d("onCreate()");
    preferences = restorePreferences();
    mCardAppearance = CardAppearance.create(new ReviewerCustomFonts(this.getBaseContext()), preferences);
    super.onCreate(savedInstanceState);
    setContentView(getContentViewAttr(mPrefFullscreenReview));
    // Make ACTION_PROCESS_TEXT for in-app searching possible on > Android 4.0
    getDelegate().setHandleNativeActionModesEnabled(true);
    // initNavigationDrawer(mainView);
    Toolbar toolbar = findViewById(R.id.toolbar);
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        // enable ActionBar app icon to behave as action to toggle nav drawer
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
        // int[] attrs = new int[] {
        // R.attr.reviewStatusBarColor,
        // };
        // TypedArray ta = obtainStyledAttributes(attrs);
        // toolbar.setBackground(ta.getDrawable(0));
        mTitle = toolbar.findViewById(R.id.toolbar_title);
        mTitle.setVisibility(View.VISIBLE);
    // Decide which action to take when the navigation button is tapped.
    // toolbar.setNavigationOnClickListener(v -> onNavigationPressed());
    }
    mShortAnimDuration = getResources().getInteger(android.R.integer.config_shortAnimTime);
    mFreeVipCount = preferences.getInt("speak_count", 0);
    mVip = preferences.getBoolean(Consts.KEY_IS_VIP, false);
    mFreeOnlineEngineCount = preferences.getInt(Consts.KEY_REST_ONLINE_SPEAK_COUNT, 1000);
    // mFreeVipRecordDay = preferences.getInt("speak_count_day", 0);
    // Calendar calendar = Calendar.getInstance();
    // if (mFreeVipRecordDay != calendar.get(Calendar.DAY_OF_YEAR)) {//已经不是记录里的同一天
    // mFreeVipCount = 0;
    // preferences.edit().putInt("speak_count", mFreeVipCount)
    // .putInt("speak_count_day", calendar.get(Calendar.DAY_OF_YEAR)).apply();
    // }
    mainHandler = new Handler();
}
Also used : ReviewerCustomFonts(com.ichi2.anki.reviewer.ReviewerCustomFonts) Handler(android.os.Handler) MissingImageHandler(com.ichi2.anki.cardviewer.MissingImageHandler) Toolbar(androidx.appcompat.widget.Toolbar)

Aggregations

Handler (android.os.Handler)1 Toolbar (androidx.appcompat.widget.Toolbar)1 MissingImageHandler (com.ichi2.anki.cardviewer.MissingImageHandler)1 ReviewerCustomFonts (com.ichi2.anki.reviewer.ReviewerCustomFonts)1