Search in sources :

Example 16 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class RecommentContactListUI method onClick.

@Override
public void onClick(View v) {
    super.onClick(v);
    switch(v.getId()) {
        case R.id.toAdd:
            final String tempGxb = "tempGxb";
            boolean flag = MySharedPrefs.readBooleanNormal(RecommentContactListUI.this, MySharedPrefs.FILE_USER, tempGxb);
            if (flag) {
                startActivity(new Intent(RecommentContactListUI.this, AddContactFriendsNewUI.class));
                Utils.openNewActivityAnim(RecommentContactListUI.this, false);
            } else {
                MyViewDialogFragment mdf = new MyViewDialogFragment();
                mdf.setTitleAndContentText(getString(R.string.notif), getString(R.string.contact_smt_accect));
                mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

                    @Override
                    public void okBtn() {
                        /**
                         *Send the address book to monitor radio
                         */
                        Intent intent = new Intent(LoadDataService.ACTION_START_CONTACT_LISTENER);
                        Utils.sendBroadcastReceiver(RecommentContactListUI.this, intent, false);
                        MySharedPrefs.writeBoolean(RecommentContactListUI.this, MySharedPrefs.FILE_USER, tempGxb, true);
                        startActivity(new Intent(RecommentContactListUI.this, AddContactFriendsNewUI.class));
                        Utils.openNewActivityAnim(RecommentContactListUI.this, false);
                    }
                });
                mdf.show(getSupportFragmentManager(), "mdf");
            }
            break;
        default:
            break;
    }
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment) Intent(android.content.Intent)

Aggregations

MyViewDialogFragment (com.lingtuan.firefly.util.MyViewDialogFragment)16 Intent (android.content.Intent)4 ChatMsg (com.lingtuan.firefly.vo.ChatMsg)2 FragmentManager (android.support.v4.app.FragmentManager)1 CaptureActivity (com.lingtuan.firefly.quickmark.CaptureActivity)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1