Search in sources :

Example 1 with MyInfoAdapter

use of com.yuxuan.admin.expression.adapter.MyInfoAdapter in project expression by happy-yuxuan.

the class MyInfoFragment method findView.

// 初始化布局
private void findView(View view) {
    dialog = new CustomDialog(getActivity(), WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT, R.layout.dialog_photo, R.style.Theme_dialog, Gravity.BOTTOM, R.style.pop_anim_style);
    dialog.setCancelable(true);
    dialog.setCanceledOnTouchOutside(true);
    listview = (ListView) view.findViewById(R.id.list_myinfo);
    cv_head = (CircleImageView) view.findViewById(R.id.cv_head);
    cv_head.setBorderColor(Color.BLUE);
    cv_head.setOnClickListener(this);
    // 初始化头像
    initImgHead();
    btn_cancel = (Button) dialog.findViewById(R.id.btn_cancel);
    btn_cancel.setOnClickListener(this);
    btn_camera = (Button) dialog.findViewById(R.id.btn_camera);
    btn_camera.setOnClickListener(this);
    btn_picture = (Button) dialog.findViewById(R.id.btn_picture);
    btn_picture.setOnClickListener(this);
    listview.setAdapter(new MyInfoAdapter(getData(), getActivity()));
    // 设置listview Item 点击事件
    listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            String itemTextString = data.get(arg2).getTv_item_myinfo();
            switch(itemTextString) {
                // 我的订单
                case "我的订单":
                    startActivity(new Intent(getActivity(), UMyOrdersActivity.class));
                    break;
                // 我的信息
                case "我的信息":
                    startActivity(new Intent(getActivity(), UMyInfomationActivity.class));
                    break;
                // 我去派件
                case "我去派件":
                    startActivity(new Intent(getActivity(), UMyPaiJianActivity.class));
                    break;
                // 历史订单
                case "历史订单":
                    startActivity(new Intent(getActivity(), UHistoryRecordActivity.class));
                    break;
                // 关于我们
                case "关于我们":
                    startActivity(new Intent(getActivity(), UAboutWeActivity.class));
                    break;
                // 设置
                case "设置":
                    startActivity(new Intent(getActivity(), USetingActivity.class));
                    break;
                default:
                    break;
            }
        }
    });
}
Also used : MyInfoAdapter(com.yuxuan.admin.expression.adapter.MyInfoAdapter) CustomDialog(com.yuxuan.admin.expression.view.CustomDialog) AdapterView(android.widget.AdapterView) Intent(android.content.Intent) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Aggregations

Intent (android.content.Intent)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 MyInfoAdapter (com.yuxuan.admin.expression.adapter.MyInfoAdapter)1 CustomDialog (com.yuxuan.admin.expression.view.CustomDialog)1 CircleImageView (de.hdodenhof.circleimageview.CircleImageView)1