本文整理汇总了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));
}
}
}
示例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);
}
示例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++;
}
}
}
示例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);
}
}
示例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));
}
}
}
示例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);
}
示例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);
}
}
示例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;
}