// Path: app/src/main/java/ee/ioc/phon/android/speak/fragment/K6neleListFragment.java
// public abstract class K6neleListFragment extends ListFragment {
// 
//     protected void toast(String message) {
//         Toast.makeText(getActivity(), message, Toast.LENGTH_LONG).show();
//     }
// 
//     protected void setEmptyView(String text) {
//         ListView lv = getListView();
//         TextView emptyView = (TextView) getActivity().getLayoutInflater().inflate(R.layout.empty_list, null);
//         emptyView.setText(text);
//         emptyView.setVisibility(View.GONE);
//         ((ViewGroup) lv.getParent()).addView(emptyView);
//         lv.setEmptyView(emptyView);
//     }
// }
// 
// Path: app/src/main/java/ee/ioc/phon/android/speak/model/RecService.java
// public class RecService {
// 
//     private final String mLabel;
//     private final String mDesc;
//     private String mSettingsActivity;
//     private final ComponentName mComponentName;
// 
//     public RecService(Context context, String id) {
//         String mDesc1 = "";
//         // Can return <null, "">
//         Pair<ComponentName, String> pair = RecognitionServiceManager.unflattenFromString(id);
//         mComponentName = pair.first;
// 
//         mLabel = RecognitionServiceManager.getServiceLabel(context, mComponentName);
//         ServiceInfo si = RecognitionServiceManager.getServiceInfo(context, mComponentName);
//         int resId = si.descriptionRes;
//         if (resId != 0) {
//             try {
//                 PackageManager manager = context.getPackageManager();
//                 mDesc1 = manager.getResourcesForApplication(mComponentName.getPackageName()).getString(resId);
//             } catch (PackageManager.NameNotFoundException e) {
//                 // Should not happen
//             }
//         }
//         mDesc = mDesc1;
//         try {
//             mSettingsActivity = RecognitionServiceManager.getSettingsActivity(context, si);
//             Log.i(mSettingsActivity);
//         } catch (XmlPullParserException | IOException e) {
//             mSettingsActivity = null;
//         }
//     }
// 
//     public String getService() {
//         return mLabel;
//     }
// 
//     public String getDesc() {
//         return mDesc;
//     }
// 
//     public Drawable getIcon(Context context) {
//         return RecognitionServiceManager.getServiceIcon(context, mComponentName);
//     }
// 
//     public ComponentName getComponentName() {
//         return mComponentName;
//     }
// 
//     public Intent getSettingsIntent() {
//         if (mSettingsActivity == null) {
//             return null;
//         }
//         Intent intent = new Intent();
//         intent.setClassName(mComponentName.getPackageName(), mSettingsActivity);
//         return intent;
//     }
// }


import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import java.util.List;
import ee.ioc.phon.android.speak.R;
import ee.ioc.phon.android.speak.fragment.K6neleListFragment;
import ee.ioc.phon.android.speak.model.RecService;
package ee.ioc.phon.android.speak.adapter;





public class RecServiceAdapter extends ArrayAdapter<RecService> {

    private final List<RecService> list;
    private final Activity context;

// Path: app/src/main/java/ee/ioc/phon/android/speak/fragment/K6neleListFragment.java
// public abstract class K6neleListFragment extends ListFragment {
// 
//     protected void toast(String message) {
//         Toast.makeText(getActivity(), message, Toast.LENGTH_LONG).show();
//     }
// 
//     protected void setEmptyView(String text) {
//         ListView lv = getListView();
//         TextView emptyView = (TextView) getActivity().getLayoutInflater().inflate(R.layout.empty_list, null);
//         emptyView.setText(text);
//         emptyView.setVisibility(View.GONE);
//         ((ViewGroup) lv.getParent()).addView(emptyView);
//         lv.setEmptyView(emptyView);
//     }
// }
// 
// Path: app/src/main/java/ee/ioc/phon/android/speak/model/RecService.java
// public class RecService {
// 
//     private final String mLabel;
//     private final String mDesc;
//     private String mSettingsActivity;
//     private final ComponentName mComponentName;
// 
//     public RecService(Context context, String id) {
//         String mDesc1 = "";
//         // Can return <null, "">
//         Pair<ComponentName, String> pair = RecognitionServiceManager.unflattenFromString(id);
//         mComponentName = pair.first;
// 
//         mLabel = RecognitionServiceManager.getServiceLabel(context, mComponentName);
//         ServiceInfo si = RecognitionServiceManager.getServiceInfo(context, mComponentName);
//         int resId = si.descriptionRes;
//         if (resId != 0) {
//             try {
//                 PackageManager manager = context.getPackageManager();
//                 mDesc1 = manager.getResourcesForApplication(mComponentName.getPackageName()).getString(resId);
//             } catch (PackageManager.NameNotFoundException e) {
//                 // Should not happen
//             }
//         }
//         mDesc = mDesc1;
//         try {
//             mSettingsActivity = RecognitionServiceManager.getSettingsActivity(context, si);
//             Log.i(mSettingsActivity);
//         } catch (XmlPullParserException | IOException e) {
//             mSettingsActivity = null;
//         }
//     }
// 
//     public String getService() {
//         return mLabel;
//     }
// 
//     public String getDesc() {
//         return mDesc;
//     }
// 
//     public Drawable getIcon(Context context) {
//         return RecognitionServiceManager.getServiceIcon(context, mComponentName);
//     }
// 
//     public ComponentName getComponentName() {
//         return mComponentName;
//     }
// 
//     public Intent getSettingsIntent() {
//         if (mSettingsActivity == null) {
//             return null;
//         }
//         Intent intent = new Intent();
//         intent.setClassName(mComponentName.getPackageName(), mSettingsActivity);
//         return intent;
//     }
// }


// Path: app/src/main/java/ee/ioc/phon/android/speak/adapter/RecServiceAdapter.java
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import java.util.List;
import ee.ioc.phon.android.speak.R;
import ee.ioc.phon.android.speak.fragment.K6neleListFragment;
import ee.ioc.phon.android.speak.model.RecService;

package ee.ioc.phon.android.speak.adapter;





public class RecServiceAdapter extends ArrayAdapter<RecService> {

    private final List<RecService> list;
    private final Activity context;

    public RecServiceAdapter(K6neleListFragment context, List<RecService> list) {