當前位置: 首頁>>代碼示例>>Java>>正文


Java WizardUtils類代碼示例

本文整理匯總了Java中com.csipsimple.wizards.WizardUtils的典型用法代碼示例。如果您正苦於以下問題:Java WizardUtils類的具體用法?Java WizardUtils怎麽用?Java WizardUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WizardUtils類屬於com.csipsimple.wizards包,在下文中一共展示了WizardUtils類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: bindView

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
@Override
public void bindView(View view, Context context, Cursor cursor) {
    AccListItemViewTag tag = (AccListItemViewTag) view.getTag();
    if(tag != null) {
        initIndexes(cursor);
        Long accId = cursor.getLong(INDEX_ID);
        String name = cursor.getString(INDEX_DISPLAY_NAME);
        String wizard = cursor.getString(INDEX_WIZARD);
        
        tag.name.setText(name);
        
        boolean iconSet = false;
        if(accLoader != null) {
           CallHandlerPlugin ch = accLoader.getCallHandlerWithAccountId(accId);
           if(ch != null) {
               tag.icon.setImageBitmap(ch.getIcon());
               iconSet = true;
           }
        }
        
        if(!iconSet){
            tag.icon.setImageResource(WizardUtils.getWizardIconRes(wizard));
        }
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:26,代碼來源:AccountsChooserListFragment.java

示例2: onCreateContextMenu

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    final SipProfile account = profileFromContextMenuInfo(menuInfo);
    if(account == null) {
        return;
    }
    WizardInfo wizardInfos = WizardUtils.getWizardClass(account.wizard);

    // Setup the menu header
    menu.setHeaderTitle(account.display_name);
    if(wizardInfos != null) {
        menu.setHeaderIcon(wizardInfos.icon);
    }
    
    menu.add(0, MENU_ITEM_ACTIVATE, 0, account.active ? R.string.deactivate_account
            : R.string.activate_account);
    menu.add(0, MENU_ITEM_MODIFY, 0, R.string.modify_account);
    menu.add(0, MENU_ITEM_DELETE, 0, R.string.delete_account);
    menu.add(0, MENU_ITEM_WIZARD, 0, R.string.choose_wizard);

}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:AccountsEditListFragment.java

示例3: addAccountInfos

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
/**
 * Apply account information to remote view
 * 
 * @param context application context for resources retrieval
 * @param activeAccountsInfos List of sip profile state to show in this
 *            notification view
 */
public void addAccountInfos(Context context, ArrayList<SipProfileState> activeAccountsInfos) {
    int i = 0;
    for (SipProfileState accountInfo : activeAccountsInfos) {
        // Clamp to max possible notifications in remote view
        if (i < cells.length) {
            setViewVisibility(cells[i], View.VISIBLE);
            WizardInfo wizardInfos = WizardUtils.getWizardClass(accountInfo.getWizard());
            if (wizardInfos != null) {
                CharSequence dName = accountInfo.getDisplayName();

                setImageViewResource(icons[i], wizardInfos.icon);
                if (!TextUtils.isEmpty(dName)) {
                    setTextViewText(texts[i], dName);
                    // setCharSequence(icons[i], "setContentDescription",
                    // dName);
                }
            }
            i++;
        }
    }

}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:30,代碼來源:RegistrationNotification.java

示例4: setAccount

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
/**
 * Set the currently selected account for this widget
 * It will change internal state,
 * Change icon and label of the account
 * @param aAccount
 */
public void setAccount(SipProfile aAccount) {
    account = aAccount;

    if (account == null) {
        if(isInEditMode() || Compatibility.canMakeGSMCall(getContext())) {
            textView.setText(getResources().getString(R.string.gsm));
            imageView.setImageResource(R.drawable.ic_wizard_gsm);
        }else {
            textView.setText(getResources().getString(R.string.acct_inactive));
            imageView.setImageResource(android.R.drawable.ic_dialog_alert);
        }
    } else {
        textView.setText(account.display_name);
        imageView.setImageDrawable(new BitmapDrawable(getResources(), WizardUtils.getWizardBitmap(getContext(),
                account)));
    }
    if (onAccountChange != null) {
        onAccountChange.onChooseAccount(account);
    }

}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:28,代碼來源:AccountChooserButton.java

示例5: bindView

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
@Override
public void bindView(View view, Context context, Cursor cursor) {
    AccListItemViewTag tag = (AccListItemViewTag) view.getTag();
    if(tag != null) {
        initIndexes(cursor);
        long accId = cursor.getLong(INDEX_ID);
        String name = cursor.getString(INDEX_DISPLAY_NAME);
        String wizard = cursor.getString(INDEX_WIZARD);
        String nbr = cursor.getString(INDEX_NBR);
        int color = cursor.getInt(INDEX_STATUS_COLOR);
        boolean enabled = cursor.getInt(INDEX_STATUS_FOR_OUTGOING) == 1;
        
        tag.name.setText(name);
        tag.name.setTextColor(color);
        tag.status.setText(context.getString(R.string.call) + " : " + nbr);
        
        setRowViewAlpha(view, enabled ? 1.0f : 0.3f);

        boolean iconSet = false;
        AccountsLoader accLoader = fragment.getAccountLoader();
        if(accLoader != null) {
           CallHandlerPlugin ch = accLoader.getCallHandlerWithAccountId(accId);
           if(ch != null) {
               tag.icon.setImageBitmap(ch.getIcon());
               iconSet = true;
           }
        }
        
        if(!iconSet){
            tag.icon.setImageResource(WizardUtils.getWizardIconRes(wizard));
        }
    }
    
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:35,代碼來源:OutgoingAccountsAdapter.java

示例6: onCreate

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    String accountName = null;
    String wizard = null;
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        accountId = extras.getLong(SipProfile.FIELD_ID, -1);
        accountName = extras.getString(SipProfile.FIELD_DISPLAY_NAME);
        wizard = extras.getString(SipProfile.FIELD_WIZARD);
    }

    if (accountId == -1) {
        Log.e(THIS_FILE, "You provide an empty account id....");
        finish();
    }
    if(!TextUtils.isEmpty(accountName)) {
        setTitle(getResources().getString(R.string.filters) + " : " + accountName);
    }
    if(!TextUtils.isEmpty(wizard)) {
        ActionBar ab = getSupportActionBar();
        if(ab != null) {
            ab.setIcon(WizardUtils.getWizardIconRes(wizard));
        }
    }

    setContentView(R.layout.account_filters_view);
    listFragment = (AccountFiltersListFragment) getSupportFragmentManager().findFragmentById(R.id.list);
    listFragment.setAccountId(accountId);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:32,代碼來源:AccountFilters.java

示例7: bindView

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
@Override
public void bindView(View view, Context context, Cursor cursor) {
    super.bindView(view, context, cursor);

    AccountListItemViews tagView = (AccountListItemViews) view.getTag();
    if (tagView == null) {
        tagView = tagRowView(view);
    }

    // Get the view object and account object for the row
    final SipProfile account = new SipProfile(cursor);
    AccountRowTag tagIndicator = new AccountRowTag();
    tagIndicator.accountId = account.id;
    tagIndicator.activated = account.active;
    tagView.indicator.setTag(tagIndicator);

    tagView.indicator.setVisibility(draggable ? View.GONE : View.VISIBLE);
    tagView.grabber.setVisibility(draggable ? View.VISIBLE : View.GONE);

    // Get the status of this profile

    tagView.labelView.setText(account.display_name);

    // Update status label and color
    if (account.active) {
        AccountStatusDisplay accountStatusDisplay = AccountListUtils.getAccountDisplay(context,
                account.id);
        tagView.statusView.setText(accountStatusDisplay.statusLabel);
        tagView.labelView.setTextColor(accountStatusDisplay.statusColor);

        // Update checkbox selection
        tagView.activeCheckbox.setChecked(true);
        tagView.barOnOff.setImageResource(accountStatusDisplay.checkBoxIndicator);

    } else {
        tagView.statusView.setText(R.string.acct_inactive);
        tagView.labelView.setTextColor(mContext.getResources().getColor(
                R.color.account_inactive));

        // Update checkbox selection
        tagView.activeCheckbox.setChecked(false);
        tagView.barOnOff.setImageResource(R.drawable.ic_indicator_off);

    }

    // Update account image
    final WizardInfo wizardInfos = WizardUtils.getWizardClass(account.wizard);
    if (wizardInfos != null) {
        tagView.activeCheckbox.setBackgroundResource(wizardInfos.icon);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:52,代碼來源:AccountsEditListAdapter.java

示例8: setAccountRegistration

import com.csipsimple.wizards.WizardUtils; //導入依賴的package包/類
/**
 * Change account registration / adding state
 * 
 * @param account The account to modify registration
 * @param renew if 0 we ask for deletion of this account; if 1 we ask for
 *            registration of this account (and add if necessary)
 * @param forceReAdd if true, we will first remove the account and then
 *            re-add it
 * @return true if the operation get completed without problem
 * @throws SameThreadException
 */
public boolean setAccountRegistration(SipProfile account, int renew, boolean forceReAdd)
        throws SameThreadException {
    int status = -1;
    if (!created || account == null) {
        Log.e(THIS_FILE, "PJSIP is not started here, nothing can be done");
        return false;
    }
    if (account.id == SipProfile.INVALID_ID) {
        Log.w(THIS_FILE, "Trying to set registration on a deleted account");
        return false;
    }


    SipProfileState profileState = getProfileState(account);
    
    // If local account -- Ensure we are not deleting, because this would be
    // invalid
    if (profileState.getWizard().equalsIgnoreCase(WizardUtils.LOCAL_WIZARD_TAG)) {
        if (renew == 0) {
            return false;
        }
    }

    // In case of already added, we have to act finely
    // If it's local we can just consider that we have to re-add account
    // since it will actually just touch the account with a modify
    if (profileState != null && profileState.isAddedToStack()
            && !profileState.getWizard().equalsIgnoreCase(WizardUtils.LOCAL_WIZARD_TAG)) {
        // The account is already there in accounts list
        service.getContentResolver().delete(
                ContentUris.withAppendedId(SipProfile.ACCOUNT_STATUS_URI, account.id), null,
                null);
        Log.d(THIS_FILE, "Account already added to stack, remove and re-load or delete");
        if (renew == 1) {
            if (forceReAdd) {
                status = pjsua.acc_del(profileState.getPjsuaId());
                addAccount(account);
            } else {
                pjsua.acc_set_online_status(profileState.getPjsuaId(),
                        getOnlineForStatus(service.getPresence()));
                status = pjsua.acc_set_registration(profileState.getPjsuaId(), renew);
            }
        } else {
            // if(status == pjsuaConstants.PJ_SUCCESS && renew == 0) {
            Log.d(THIS_FILE, "Delete account !!");
            status = pjsua.acc_del(profileState.getPjsuaId());
        }
    } else {
        if (renew == 1) {
            addAccount(account);
        } else {
            Log.w(THIS_FILE, "Ask to unregister an unexisting account !!" + account.id);
        }

    }
    // PJ_SUCCESS = 0
    return status == 0;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:70,代碼來源:PjSipService.java


注:本文中的com.csipsimple.wizards.WizardUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。