Home | History | Annotate | Download | only in utils
      1 /*
      2  * Copyright (C) 2013 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.inputmethod.latin.utils;
     18 
     19 import com.android.inputmethod.dictionarypack.DictionarySettingsFragment;
     20 import com.android.inputmethod.latin.about.AboutPreferences;
     21 import com.android.inputmethod.latin.settings.AdditionalSubtypeSettings;
     22 import com.android.inputmethod.latin.settings.DebugSettings;
     23 import com.android.inputmethod.latin.settings.SettingsFragment;
     24 import com.android.inputmethod.latin.spellcheck.SpellCheckerSettingsFragment;
     25 import com.android.inputmethod.latin.userdictionary.UserDictionaryAddWordFragment;
     26 import com.android.inputmethod.latin.userdictionary.UserDictionaryList;
     27 import com.android.inputmethod.latin.userdictionary.UserDictionaryLocalePicker;
     28 import com.android.inputmethod.latin.userdictionary.UserDictionarySettings;
     29 import com.android.inputmethod.research.FeedbackFragment;
     30 
     31 import java.util.HashSet;
     32 
     33 public class FragmentUtils {
     34     private static final HashSet<String> sLatinImeFragments = new HashSet<String>();
     35     static {
     36         sLatinImeFragments.add(DictionarySettingsFragment.class.getName());
     37         sLatinImeFragments.add(AboutPreferences.class.getName());
     38         sLatinImeFragments.add(AdditionalSubtypeSettings.class.getName());
     39         sLatinImeFragments.add(DebugSettings.class.getName());
     40         sLatinImeFragments.add(SettingsFragment.class.getName());
     41         sLatinImeFragments.add(SpellCheckerSettingsFragment.class.getName());
     42         sLatinImeFragments.add(UserDictionaryAddWordFragment.class.getName());
     43         sLatinImeFragments.add(UserDictionaryList.class.getName());
     44         sLatinImeFragments.add(UserDictionaryLocalePicker.class.getName());
     45         sLatinImeFragments.add(UserDictionarySettings.class.getName());
     46         sLatinImeFragments.add(FeedbackFragment.class.getName());
     47     }
     48 
     49     public static boolean isValidFragment(String fragmentName) {
     50         return sLatinImeFragments.contains(fragmentName);
     51     }
     52 }
     53