Beispiel #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>();
 }
Beispiel #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();
 }
Beispiel #3
0
 public void onDictionariesRefresh() {
   dicts = availableDictionaries.getList();
   uiThreadHandler.post(refreshDictsList());
 }
Beispiel #4
0
 private void deleteDictionaries() {
   for (Integer i : dictsToDelete) availableDictionaries.deleteDictionary(mAdapter.getItem(i));
 }