Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: nobnago/Anki-Android
...
head fork: nobnago/Anki-Android
  • 6 commits
  • 12 files changed
  • 0 commit comments
  • 2 contributors
View
BIN  res/drawable-mdpi/white_btn_check_on.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 res/layout/studyoptions_congrats.xml
@@ -16,14 +16,14 @@
android:gravity="center"
android:id="@+id/studyoptions_congrats_open_other_deck"
android:text="@string/studyoptions_congrats_open_other_deck" />
-<!-- <Button
+ <Button
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center"
android:id="@+id/studyoptions_congrats_learnmore"
android:text="@string/studyoptions_congrats_learnmore" />
- <Button
- android:layout_height="wrap_content"
+<!-- <Button
+ android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="center"
android:id="@+id/studyoptions_congrats_reviewearly"
View
69 res/layout/styled_learn_more_dialog.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* //device/apps/common/res/layout/alert_dialog.xml
+**
+** Copyright 2006, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:gravity="center"
+ android:orientation="vertical">
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <TextView
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="4"
+ android:layout_marginLeft="4dip"
+ android:text="@string/learnmore_extend_new_limit"
+ android:textSize="16dip"/>
+ <EditText android:id="@+id/learnmore_extend_new_limit"
+ android:layout_width="0dip"
+ android:layout_height="38dip"
+ android:layout_weight="1"
+ android:layout_marginRight="4dip"
+ android:gravity="center"
+ android:inputType="number"
+ android:lines="1"
+ android:text="10"/>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <TextView
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="4"
+ android:layout_marginLeft="4dip"
+ android:text="@string/learnmore_extend_rev_limit"
+ android:textSize="16dip"/>
+ <EditText android:id="@+id/learnmore_extend_rev_limit"
+ android:layout_width="0dip"
+ android:layout_height="38dip"
+ android:layout_weight="1"
+ android:layout_marginRight="4dip"
+ android:gravity="center"
+ android:inputType="number"
+ android:lines="1"
+ android:text="50"/>
+ </LinearLayout>
+</LinearLayout>
View
1  res/values/02-strings.xml
@@ -43,6 +43,7 @@
<string name="suspend_leeches">Suspend Leeches</string>
<string name="leech_suspend_notification">Card marked as leech and suspended</string>
<string name="leech_notification">Card marked as leech</string>
+<string name="corrupt_font">Corrupt font file %s</string>
<!--Card Editor-->
View
3  res/values/03-dialogs.xml
@@ -71,5 +71,8 @@
<string name="intent_aedict_empty">Category \'default\' is empty</string>
<string name="intent_aedict_category">To add cards to AnkiDroid remove all Notepad categories or add one named \'default\'</string>
+<string name="learnmore_title">Extend Limits</string>
+<string name="learnmore_extend_new_limit">New limit by</string>
+<string name="learnmore_extend_rev_limit">Review limit by</string>
</resources>
View
53 res/xml/cram_deck_options.xml
@@ -17,41 +17,36 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/deck_conf_cram_filter">
-
- <ListPreference
- android:title="@string/deck_conf_cram_preset"
- android:key="preset"/>
- <EditTextPreference
- android:title="@string/deck_conf_cram_search"
- android:key="search" />
-
- <EditTextPreference
- android:title="@string/deck_conf_cram_limit"
- android:numeric="integer"
- android:key="limit" />
- <ListPreference
- android:title="@string/deck_conf_cram_order"
- android:key="order"/>
-
- </PreferenceCategory>
-
- <PreferenceCategory android:title="@string/deck_conf_cram_options">
+ <ListPreference
+ android:title="@string/deck_conf_cram_preset"
+ android:key="preset"/>
+ <EditTextPreference
+ android:title="@string/deck_conf_cram_search"
+ android:key="search" />
+ <EditTextPreference
+ android:title="@string/deck_conf_cram_limit"
+ android:numeric="integer"
+ android:key="limit" />
+ <ListPreference
+ android:title="@string/deck_conf_cram_order"
+ android:key="order"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/deck_conf_cram_options">
<CheckBoxPreference
android:title="@string/deck_conf_cram_reschedule"
android:defaultValue="true"
android:summary="@string/deck_conf_cram_reschedule_summ"
android:key="resched" />
- <CheckBoxPreference
+ <CheckBoxPreference
android:title="@string/deck_conf_cram_steps"
android:defaultValue="true"
- android:disableDependentsState="false"
- android:summary="@string/deck_conf_separate_summ"
+ android:disableDependentsState="false"
+ android:summary="@string/deck_conf_cram_steps_summ"
android:key="stepsOn" />
- <EditTextPreference
- android:title="@string/deck_conf_cram_steps"
- android:dependency="stepsOn"
-
- android:key="steps" />
-
- </PreferenceCategory>
+ <EditTextPreference
+ android:title="@string/deck_conf_cram_steps"
+ android:dependency="stepsOn"
+ android:key="steps" />
+ </PreferenceCategory>
</PreferenceScreen>
View
111 src/com/ichi2/anki/AnkiFont.java
@@ -1,62 +1,89 @@
package com.ichi2.anki;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Typeface;
+import android.util.Log;
+import android.widget.Toast;
import com.ichi2.libanki.Utils;
import java.io.File;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
public class AnkiFont {
private String mName;
private String mFamily;
- private List<String> mAttributes = new ArrayList<String>();
+ private List<String> mAttributes;
private String mPath;
private static final String fAssetPathPrefix = "/android_asset/fonts/";
+ private static Set<String> corruptFonts = new HashSet<String>();
- public AnkiFont(Context ctx, String path, boolean fromAssets) {
+ private AnkiFont(String name, String family, List<String> attributes, String path) {
+ mName = name;
+ mFamily = family;
+ mAttributes = attributes;
mPath = path;
- File fontfile = new File(mPath);
- mName = Utils.removeExtension(fontfile.getName());
- mFamily = mName;
+ }
+
+ /**
+ * Factory for AnkiFont creation.
+ * Creates a typeface wrapper from a font file representing.
+ * @param ctx Activity context, needed to access assets
+ * @param path Path to typeface file, needed when this is a custom font.
+ * @param fromAssets True if the font is to be found in assets of application
+ * @return A new AnkiFont object or null if the file can't be interpreted as typeface.
+ */
+ public static AnkiFont createAnkiFont(Context ctx, String path, boolean fromAssets) {
+ File fontfile = new File(path);
+ String name = Utils.removeExtension(fontfile.getName());
+ String family = name;
+ List<String> attributes = new ArrayList<String>();
if (fromAssets) {
- mPath = fAssetPathPrefix.concat(fontfile.getName());
+ path = fAssetPathPrefix.concat(fontfile.getName());
+ }
+ Typeface tf = getTypeface(ctx, path);
+ if (tf == null) {
+ // unable to create typeface
+ return null;
}
- Typeface tf = getTypeface(ctx, mPath);
- if (tf.isBold() || mName.toLowerCase().contains("bold")) {
- mAttributes.add("font-weight: bolder;");
- mFamily = mFamily.replaceFirst("(?i)-?Bold", "");
- } else if (mName.toLowerCase().contains("light")) {
- mAttributes.add("font-weight: lighter;");
- mFamily = mFamily.replaceFirst("(?i)-?Light", "");
+ if (tf.isBold() || name.toLowerCase().contains("bold")) {
+ attributes.add("font-weight: bolder;");
+ family = family.replaceFirst("(?i)-?Bold", "");
+ } else if (name.toLowerCase().contains("light")) {
+ attributes.add("font-weight: lighter;");
+ family = family.replaceFirst("(?i)-?Light", "");
} else {
- mAttributes.add("font-weight: normal;");
+ attributes.add("font-weight: normal;");
}
- if (tf.isItalic() || mName.toLowerCase().contains("italic")) {
- mAttributes.add("font-style: italic;");
- mFamily = mFamily.replaceFirst("(?i)-?Italic", "");
- } else if (mName.toLowerCase().contains("oblique")) {
- mAttributes.add("font-style: oblique;");
- mFamily = mFamily.replaceFirst("(?i)-?Oblique", "");
+ if (tf.isItalic() || name.toLowerCase().contains("italic")) {
+ attributes.add("font-style: italic;");
+ family = family.replaceFirst("(?i)-?Italic", "");
+ } else if (name.toLowerCase().contains("oblique")) {
+ attributes.add("font-style: oblique;");
+ family = family.replaceFirst("(?i)-?Oblique", "");
} else {
- mAttributes.add("font-style: normal;");
+ attributes.add("font-style: normal;");
}
- if (mName.toLowerCase().contains("condensed") || mName.toLowerCase().contains("narrow")) {
- mAttributes.add("font-stretch: condensed;");
- mFamily = mFamily.replaceFirst("(?i)-?Condensed", "");
- mFamily = mFamily.replaceFirst("(?i)-?Narrow(er)?", "");
- } else if (mName.toLowerCase().contains("expanded") || mName.toLowerCase().contains("wide")) {
- mAttributes.add("font-stretch: expanded;");
- mFamily = mFamily.replaceFirst("(?i)-?Expanded", "");
- mFamily = mFamily.replaceFirst("(?i)-?Wide(r)?", "");
+ if (name.toLowerCase().contains("condensed") || name.toLowerCase().contains("narrow")) {
+ attributes.add("font-stretch: condensed;");
+ family = family.replaceFirst("(?i)-?Condensed", "");
+ family = family.replaceFirst("(?i)-?Narrow(er)?", "");
+ } else if (name.toLowerCase().contains("expanded") || name.toLowerCase().contains("wide")) {
+ attributes.add("font-stretch: expanded;");
+ family = family.replaceFirst("(?i)-?Expanded", "");
+ family = family.replaceFirst("(?i)-?Wide(r)?", "");
} else {
- mAttributes.add("font-stretch: normal;");
+ attributes.add("font-stretch: normal;");
}
- mFamily = mFamily.replaceFirst("(?i)-?Regular", "");
+ family = family.replaceFirst("(?i)-?Regular", "");
+ return new AnkiFont(name, family, attributes, path);
}
+
public String getDeclaration() {
StringBuilder sb = new StringBuilder("@font-face {");
sb.append(getCSS()).append(" src: url(\"file://").append(mPath).append("\");}");
@@ -76,10 +103,24 @@ public String getPath() {
return mPath;
}
public static Typeface getTypeface(Context ctx, String path) {
- if (path.startsWith(fAssetPathPrefix)) {
- return Typeface.createFromAsset(ctx.getAssets(), path.replaceFirst("/android_asset/", ""));
- } else {
- return Typeface.createFromFile(path);
+ try {
+ if (path.startsWith(fAssetPathPrefix)) {
+ return Typeface.createFromAsset(ctx.getAssets(), path.replaceFirst("/android_asset/", ""));
+ } else {
+ return Typeface.createFromFile(path);
+ }
+ } catch (RuntimeException e) {
+ Log.w(AnkiDroidApp.TAG, "AnkiFont.getTypeface: " + e.getMessage() + " - File: " + path);
+ if (!corruptFonts.contains(path)) {
+ // Show warning toast
+ String name = new File(path).getName();
+ Resources res = AnkiDroidApp.getAppResources();
+ Toast toast = Toast.makeText(ctx, res.getString(R.string.corrupt_font, name), Toast.LENGTH_LONG);
+ toast.show();
+ // Don't warn again in this session
+ corruptFonts.add(path);
+ }
+ return null;
}
}
}
View
86 src/com/ichi2/anki/Reviewer.java
@@ -335,6 +335,9 @@
private GestureDetector gestureDetector;
View.OnTouchListener gestureListener;
+ private boolean mIsXScrolling = false;
+ private boolean mIsYScrolling = false;
+
/**
* Gesture Allocation
*/
@@ -2079,7 +2082,7 @@ private void setInterface() {
}
if (mCurrentSimpleInterface) {
if (mSimpleCard == null) {
- mSimpleCard = new TextView(this);
+ mSimpleCard = new ScrollTextView(this);
Themes.setRegularFont(mSimpleCard);
mSimpleCard.setTextSize(mSimpleCard.getTextSize() * mDisplayFontSize / 100);
mSimpleCard.setGravity(Gravity.CENTER);
@@ -3112,12 +3115,36 @@ public boolean onCheckIsTextEditor() {
return super.onCheckIsTextEditor();
}
}
+
+ @Override
+ protected void onScrollChanged (int horiz, int vert, int oldHoriz, int oldVert) {
+ super.onScrollChanged(horiz, vert, oldHoriz, oldVert);
+ if (Math.abs(horiz - oldHoriz) > Math.abs(vert - oldVert)) {
+ mIsXScrolling = true;
+ scrollHandler.removeCallbacks(scrollXRunnable);
+ scrollHandler.postDelayed(scrollXRunnable, 300);
+ } else {
+ mIsYScrolling = true;
+ scrollHandler.removeCallbacks(scrollYRunnable);
+ scrollHandler.postDelayed(scrollYRunnable, 300);
+ }
+ }
+
+ private final Handler scrollHandler = new Handler();
+ private final Runnable scrollXRunnable = new Runnable() {
+ public void run() {
+ mIsXScrolling = false;
+ }
+ };
+ private final Runnable scrollYRunnable = new Runnable() {
+ public void run() {
+ mIsYScrolling = false;
+ }
+ };
+
}
class MyGestureDetector extends SimpleOnGestureListener {
- private boolean mIsXScrolling = false;
- private boolean mIsYScrolling = false;
-
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
@@ -3146,8 +3173,6 @@ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float ve
// left
executeCommand(mGestureSwipeLeft);
}
- mIsXScrolling = false;
- mIsYScrolling = false;
} catch (Exception e) {
Log.e(AnkiDroidApp.TAG, "onFling Exception = " + e.getMessage());
}
@@ -3212,21 +3237,6 @@ public boolean onSingleTapConfirmed(MotionEvent e) {
}
return false;
}
-
-
- @Override
- public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
- if (!mCurrentSimpleInterface && mCard != null) {
- if (mCard.getScrollY() != 0) {
- mIsYScrolling = true;
- }
- if (mCard.getScrollX() != 0) {
- mIsXScrolling = true;
- }
- }
- return super.onScroll(e1, e2, distanceX, distanceY);
- }
-
}
@@ -3238,4 +3248,38 @@ public boolean onTouchEvent(MotionEvent event) {
return false;
}
+ class ScrollTextView extends TextView {
+
+ public ScrollTextView(Context context) {
+ super(context);
+ }
+
+ @Override
+ protected void onScrollChanged (int horiz, int vert, int oldHoriz, int oldVert) {
+ super.onScrollChanged(horiz, vert, oldHoriz, oldVert);
+ if (Math.abs(horiz - oldHoriz) > Math.abs(vert - oldVert)) {
+ mIsXScrolling = true;
+ scrollHandler.removeCallbacks(scrollXRunnable);
+ scrollHandler.postDelayed(scrollXRunnable, 300);
+ } else {
+ mIsYScrolling = true;
+ scrollHandler.removeCallbacks(scrollYRunnable);
+ scrollHandler.postDelayed(scrollYRunnable, 300);
+ }
+ }
+
+ private final Handler scrollHandler = new Handler();
+ private final Runnable scrollXRunnable = new Runnable() {
+ public void run() {
+ mIsXScrolling = false;
+ }
+ };
+ private final Runnable scrollYRunnable = new Runnable() {
+ public void run() {
+ mIsYScrolling = false;
+ }
+ };
+
+ }
+
}
View
49 src/com/ichi2/anki/StudyOptionsFragment.java
@@ -17,6 +17,7 @@
import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@@ -35,6 +36,7 @@
import android.view.ViewGroup.LayoutParams;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.Button;
+import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -82,6 +84,7 @@
public static final int CONTENT_CONGRATS = 1;
private static final int DIALOG_STATISTIC_TYPE = 0;
+ private static final int DIALOG_LEARN_MORE = 1;
private HashMap<Integer, StyledDialog> mDialogs = new HashMap<Integer, StyledDialog>();
@@ -127,9 +130,11 @@
* UI elements for "Congrats" view
*/
private View mCongratsView;
+ private View mLearnMoreView;
private TextView mTextCongratsMessage;
private Button mButtonCongratsOpenOtherDeck;
private Button mButtonCongratsFinish;
+ private Button mButtonCongratsLearnMore;
/**
* Swipe Detection
@@ -192,6 +197,9 @@ public void onClick(View v) {
case R.id.studyoptions_congrats_open_other_deck:
closeStudyOptions();
return;
+ case R.id.studyoptions_congrats_learnmore:
+ showDialog(DIALOG_LEARN_MORE);
+ return;
case R.id.studyoptions_congrats_finish:
finishCongrats();
return;
@@ -554,6 +562,8 @@ private void initAllContentViews(LayoutInflater inflater) {
// The view that shows the congratulations view.
mCongratsView = inflater.inflate(R.layout.studyoptions_congrats, null);
+ // The view that shows the learn more options
+ mLearnMoreView = inflater.inflate(R.layout.styled_learn_more_dialog, null);
Themes.setWallpaper(mCongratsView);
@@ -561,8 +571,7 @@ private void initAllContentViews(LayoutInflater inflater) {
Themes.setTextViewStyle(mTextCongratsMessage);
mTextCongratsMessage.setOnClickListener(mButtonClickListener);
- // mButtonCongratsLearnMore = (Button) mCongratsView
- // .findViewById(R.id.studyoptions_congrats_learnmore);
+ mButtonCongratsLearnMore = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_learnmore);
// mButtonCongratsReviewEarly = (Button) mCongratsView
// .findViewById(R.id.studyoptions_congrats_reviewearly);
mButtonCongratsOpenOtherDeck = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_open_other_deck);
@@ -571,7 +580,7 @@ private void initAllContentViews(LayoutInflater inflater) {
}
mButtonCongratsFinish = (Button) mCongratsView.findViewById(R.id.studyoptions_congrats_finish);
- // mButtonCongratsLearnMore.setOnClickListener(mButtonClickListener);
+ mButtonCongratsLearnMore.setOnClickListener(mButtonClickListener);
// mButtonCongratsReviewEarly.setOnClickListener(mButtonClickListener);
mButtonCongratsOpenOtherDeck.setOnClickListener(mButtonClickListener);
mButtonCongratsFinish.setOnClickListener(mButtonClickListener);
@@ -593,6 +602,8 @@ private void onPrepareDialog(int id, StyledDialog styledDialog) {
protected StyledDialog onCreateDialog(int id) {
StyledDialog dialog = null;
+ Resources res = getResources();
+ StyledDialog.Builder builder = new StyledDialog.Builder(this.getActivity());
switch (id) {
@@ -606,6 +617,38 @@ public void onClick(DialogInterface dialog, int which) {
}, mFragmented);
break;
+ case DIALOG_LEARN_MORE:
+ builder.setTitle(res.getString(R.string.learnmore_title));
+ //builder.setIcon(android.R.drawable.ic_menu_sort_by_size);
+ builder.setContentView(mLearnMoreView);
+ builder.setCancelable(true);
+ builder.setNegativeButton(R.string.cancel, null);
+ builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ if (AnkiDroidApp.colIsOpen()) {
+ try {
+ int n = Integer.parseInt(((EditText) mLearnMoreView.findViewById(R.id.learnmore_extend_new_limit)).getText().toString());
+ int r = Integer.parseInt(((EditText) mLearnMoreView.findViewById(R.id.learnmore_extend_rev_limit)).getText().toString());
+ Collection col = AnkiDroidApp.getCol();
+ JSONObject deck = col.getDecks().current();
+ deck.put("extendNew", n);
+ deck.put("extendRev", r);
+ col.getDecks().save(deck);
+ col.getSched().extendLimits(n, r);
+ finishCongrats();
+ resetAndUpdateValuesFromDeck();
+ } catch (NumberFormatException e) {
+ // ignore non numerical values
+ } catch (JSONException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ });
+ dialog = builder.create();
+ break;
+
default:
dialog = null;
}
View
2  src/com/ichi2/libanki/Sched.java
@@ -372,7 +372,7 @@ public void _updateStats(Card card, String type, int cnt) {
}
- private void extendLimits(int newc, int rev) {
+ public void extendLimits(int newc, int rev) {
JSONObject cur = mCol.getDecks().current();
ArrayList<JSONObject> decks = new ArrayList<JSONObject>();
decks.add(cur);
View
4 src/com/ichi2/libanki/Storage.java
@@ -88,7 +88,7 @@ private static int _upgradeSchema(AnkiDb db) {
_addSchema(db, false);
db.execute("insert into cards select id, nid, did, ord, mod, usn, type, queue, due, ivl, factor, reps, lapses, left, edue, 0, flags, data from cards2");
db.execute("DROP TABLE cards2");
- db.execute("UPDATE col SET var = 2");
+ db.execute("UPDATE col SET ver = 2");
_updateIndices(db);
}
// remove did from notes
@@ -97,7 +97,7 @@ private static int _upgradeSchema(AnkiDb db) {
_addSchema(db, false);
db.execute("insert into notes select id, guid, mid, mod, usn, tags, flds, sfld, csum, flags, data from notes2");
db.execute("DROP TABLE notes2");
- db.execute("UPDATE col SET var = 3");
+ db.execute("UPDATE col SET ver = 3");
_updateIndices(db);
}
return ver;
View
10 src/com/ichi2/libanki/Utils.java
@@ -1072,10 +1072,16 @@ public static String removeInvalidDeckNameCharacters(String name) {
}
List<AnkiFont> fonts = new ArrayList<AnkiFont>();
for (int i = 0; i < fontsCount; i++) {
- fonts.add(new AnkiFont(null, fontsList[i].getAbsolutePath(), false));
+ AnkiFont font = AnkiFont.createAnkiFont(context, fontsList[i].getAbsolutePath(), false);
+ if (font != null) {
+ fonts.add(font);
+ }
}
for (int i = 0; i < ankiDroidFonts.length; i++) {
- fonts.add(new AnkiFont(context, ankiDroidFonts[i], true));
+ AnkiFont font = AnkiFont.createAnkiFont(context, ankiDroidFonts[i], true);
+ if (font != null) {
+ fonts.add(font);
+ }
}
return fonts;

No commit comments for this range

Something went wrong with that request. Please try again.