// Path: fidoclient/src/main/java/com/yalin/fidoclient/asm/api/ASMIntent.java
// public class ASMIntent {
//     public static final String MESSAGE_KEY = "message";
// 
//     public static Intent getASMIntent(){
//         Intent intent = new Intent(Constants.ACTION_FIDO_OPERATION);
//         intent.setType(Constants.FIDO_ASM_INTENT_MIME);
// 
//         return intent;
//     }
// 
//     public static Intent getASMOperationIntent(String asmRequest) {
//         Intent intent = new Intent(Constants.ACTION_FIDO_OPERATION);
//         intent.setType(Constants.FIDO_ASM_INTENT_MIME);
// 
//         Bundle bundle = new Bundle();
//         bundle.putString(MESSAGE_KEY, asmRequest);
//         intent.putExtras(bundle);
//         return intent;
//     }
// 
//     public static Intent getASMOperationResultIntent(String asmResponse) {
//         Intent intent = new Intent();
// 
//         Bundle bundle = new Bundle();
//         bundle.putString(MESSAGE_KEY, asmResponse);
//         intent.putExtras(bundle);
//         return intent;
//     }
// }
// 
// Path: fidoclient/src/main/java/com/yalin/fidoclient/msg/AsmInfo.java
// public class AsmInfo {
//     public String appName;
//     public String pack;
//     public Drawable icon;
// 
//     public AsmInfo appName(String appName) {
//         this.appName = appName;
//         return this;
//     }
// 
//     public AsmInfo pack(String pack) {
//         this.pack = pack;
//         return this;
//     }
// 
//     public AsmInfo icon(Drawable icon) {
//         this.icon = icon;
//         return this;
//     }
// }


import com.yalin.fidoclient.R;
import com.yalin.fidoclient.asm.api.ASMIntent;
import com.yalin.fidoclient.msg.AsmInfo;
import java.util.List;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
        return fragment;
    }

    public static void open(int container, FragmentManager manager, AsmItemPickListener listener) {
        if (manager.findFragmentByTag(TAG) != null) {
            return;
        }
        manager.beginTransaction()
                .add(container, getInstance(listener), TAG)
                .addToBackStack(null)
                .commit();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_asm_list, container, false);
        findView(view);
        initData();
        return view;
    }

    private void findView(View view) {
        tvAsmListPrompt = (TextView) view.findViewById(R.id.tv_asm_list_prompt);
        rvAsmList = (RecyclerView) view.findViewById(R.id.rv_asm_list);

        rvAsmList.setLayoutManager(new LinearLayoutManager(getActivity()));
    }

    private void initData() {
// Path: fidoclient/src/main/java/com/yalin/fidoclient/asm/api/ASMIntent.java
// public class ASMIntent {
//     public static final String MESSAGE_KEY = "message";
// 
//     public static Intent getASMIntent(){
//         Intent intent = new Intent(Constants.ACTION_FIDO_OPERATION);
//         intent.setType(Constants.FIDO_ASM_INTENT_MIME);
// 
//         return intent;
//     }
// 
//     public static Intent getASMOperationIntent(String asmRequest) {
//         Intent intent = new Intent(Constants.ACTION_FIDO_OPERATION);
//         intent.setType(Constants.FIDO_ASM_INTENT_MIME);
// 
//         Bundle bundle = new Bundle();
//         bundle.putString(MESSAGE_KEY, asmRequest);
//         intent.putExtras(bundle);
//         return intent;
//     }
// 
//     public static Intent getASMOperationResultIntent(String asmResponse) {
//         Intent intent = new Intent();
// 
//         Bundle bundle = new Bundle();
//         bundle.putString(MESSAGE_KEY, asmResponse);
//         intent.putExtras(bundle);
//         return intent;
//     }
// }
// 
// Path: fidoclient/src/main/java/com/yalin/fidoclient/msg/AsmInfo.java
// public class AsmInfo {
//     public String appName;
//     public String pack;
//     public Drawable icon;
// 
//     public AsmInfo appName(String appName) {
//         this.appName = appName;
//         return this;
//     }
// 
//     public AsmInfo pack(String pack) {
//         this.pack = pack;
//         return this;
//     }
// 
//     public AsmInfo icon(Drawable icon) {
//         this.icon = icon;
//         return this;
//     }
// }


// Path: fidoclient/src/main/java/com/yalin/fidoclient/ui/fragment/AsmListFragment.java
import com.yalin.fidoclient.R;
import com.yalin.fidoclient.asm.api.ASMIntent;
import com.yalin.fidoclient.msg.AsmInfo;
import java.util.List;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

        return fragment;
    }

    public static void open(int container, FragmentManager manager, AsmItemPickListener listener) {
        if (manager.findFragmentByTag(TAG) != null) {
            return;
        }
        manager.beginTransaction()
                .add(container, getInstance(listener), TAG)
                .addToBackStack(null)
                .commit();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_asm_list, container, false);
        findView(view);
        initData();
        return view;
    }

    private void findView(View view) {
        tvAsmListPrompt = (TextView) view.findViewById(R.id.tv_asm_list_prompt);
        rvAsmList = (RecyclerView) view.findViewById(R.id.rv_asm_list);

        rvAsmList.setLayoutManager(new LinearLayoutManager(getActivity()));
    }

    private void initData() {
        Intent intent = ASMIntent.getASMIntent();