Exemplo n.º 1
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   uiThreadHandler = new Handler();
   mAdapter = new DictionaryArrayAdapter(getActivity(), android.R.id.list);
   availableDictionaries = AvailableDictionaries.getInstance(this.getActivity());
   availableDictionaries.subscribeSettingsFragment(this);
   dictsListListener = createDictsListListener();
   dictsToDelete = new ArrayList<Integer>();
 }
Exemplo n.º 2
0
 @Override
 public void onListItemClick(ListView l, View view, int position, long id) {
   Dictionary dict = mAdapter.getItem(position);
   TextView dictStatusText = (TextView) view.findViewById(R.id.dict_status);
   DictionaryStatus dictStatus = new DictionaryStatus(getActivity(), dictStatusText);
   if (dict.isActive()) {
     availableDictionaries.setDictionaryActive(dict, false);
   } else {
     availableDictionaries.setDictionaryActive(dict, true);
   }
   dictStatus.toggle();
 }
Exemplo n.º 3
0
 public void onDictionariesRefresh() {
   dicts = availableDictionaries.getList();
   uiThreadHandler.post(refreshDictsList());
 }
Exemplo n.º 4
0
 private void deleteDictionaries() {
   for (Integer i : dictsToDelete) availableDictionaries.deleteDictionary(mAdapter.getItem(i));
 }