From 04f51bd392b6bc0ceaae031c8319f149564a4343 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 17 Oct 2012 07:10:08 -0700 Subject: [PATCH] add haveDict() --- .../src/org/eehouse/android/xw4/DictLangCache.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictLangCache.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictLangCache.java index d29ba24e9..3e535bc71 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictLangCache.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictLangCache.java @@ -121,6 +121,19 @@ public class DictLangCache { return result; } + public static boolean haveDict( Context context, int code, String name ) + { + boolean found = false; + DictInfo[] infos = getInfosHaveLang( context, code ); + for ( DictInfo info : infos ) { + if ( info.name.equals( name ) ) { + found = true; + break; + } + } + return found; + } + private static String[] getHaveLang( Context context, int code, Comparator comp, boolean withCounts )