本文整理汇总了Java中com.odoo.core.utils.OControls.setText方法的典型用法代码示例。如果您正苦于以下问题:Java OControls.setText方法的具体用法?Java OControls.setText怎么用?Java OControls.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.odoo.core.utils.OControls
的用法示例。
在下文中一共展示了OControls.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void init() {
TextView recordName = (TextView) findViewById(R.id.recordName);
parent = (View) recordName.getParent().getParent();
ODataRow record = mModel.browse(mModel.selectRowId(server_id));
String name = record.getString(mModel.getDefaultNameColumn());
findViewById(R.id.dialogHeader)
.setBackgroundColor(OStringColorUtil.getStringColor(this, name));
if (mType == MessageType.Message) {
edtSubject.setText("Re: " + name);
recordName.setText(String.format(OResource.string(this, R.string.message_to), name));
} else {
recordName.setText(R.string.add_internal_note);
edtSubject.setVisibility(View.GONE);
edtBody.setHint(R.string.internal_note_hint);
OControls.setText(parent, R.id.btnSend, R.string.label_log_note);
}
edtBody.requestFocus();
}
示例2: bindProduct
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void bindProduct() {
if (!productTemplate.getString("image").equals("false")) {
OControls.setImage(getContainer(), R.id.productImage, BitmapUtils.getBitmapImage(getContext(),
productTemplate.getString("image")));
}
OControls.setText(getContainer(), R.id.productName, productTemplate.getString("name"));
if (productTemplate.getFloat("warranty") > 0) {
OControls.setText(getContainer(), R.id.productWarranty, String.format(
OResource.string(getContext(), R.string.product_warranty), productTemplate.getString("warranty")
));
}
calculatePrice();
bindPaymentAndDelivery();
toggleFavIcon(favouriteProducts.isFavourite(product_tmpl_id));
findViewById(R.id.toggleFavorite).setOnClickListener(this);
findViewById(R.id.addToCart).setOnClickListener(this);
bindOptions();
}
示例3: calculatePrice
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void calculatePrice() {
float price_extra = 0;
for (String key : price_extra_list.keySet()) {
price_extra += price_extra_list.get(key);
}
float discountPrice = productTemplate.getFloat("price");
double list_price = Float.parseFloat(productTemplate.getString("list_price"));
if (discountPrice != productTemplate.getFloat("list_price")) {
findViewById(R.id.layoutDiscount).setVisibility(View.VISIBLE);
OControls.setTextViewStrikeThrough(getContainer(), R.id.productOriginalPrice);
OControls.setText(getContainer(), R.id.productOriginalPrice, getPriceWithCurrency((list_price + price_extra) + ""));
double percent = Math.ceil(100 - (discountPrice / productTemplate.getFloat("list_price") * 100));
OControls.setText(getContainer(), R.id.productDiscount, percent + "% OFF");
double discount = ((list_price + price_extra) * percent) / 100;
list_price = (list_price + price_extra) - discount;
OControls.setVisible(getContainer(), R.id.productSavedPrice);
OControls.setText(getContainer(), R.id.productSavedPrice,
String.format(OResource.string(getContext(), R.string.you_saved), getPriceWithCurrency(discount + ""))
);
}
OControls.setText(getContainer(), R.id.finalProductPrice, getPriceWithCurrency((list_price) + ""));
}
示例4: generateView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void generateView(View view, OUser user) {
OControls.setText(view, R.id.accountName, user.getName());
OControls.setText(view, R.id.accountURL, (user.isOAuthLogin()) ? user.getInstanceURL() : user.getHost());
OControls.setImage(view, R.id.profile_image, R.drawable.avatar);
if (!user.getAvatar().equals("false")) {
Bitmap bmp = BitmapUtils.getBitmapImage(this, user.getAvatar());
if (bmp != null)
OControls.setImage(view, R.id.profile_image, bmp);
}
if (user.isActive()) {
OControls.setVisible(view, R.id.btnLogout);
OControls.setGone(view, R.id.btnLogin);
} else {
OControls.setGone(view, R.id.btnLogout);
OControls.setVisible(view, R.id.btnLogin);
}
view.findViewById(R.id.btnLogin).setTag(user);
view.findViewById(R.id.btnLogout).setTag(user);
view.findViewById(R.id.btnRemoveAccount).setTag(user);
view.findViewById(R.id.btnLogout).setOnClickListener(this);
view.findViewById(R.id.btnLogin).setOnClickListener(this);
view.findViewById(R.id.btnRemoveAccount).setOnClickListener(this);
}
示例5: getCustomView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
public View getCustomView(Context context, SliderItem item, ViewGroup parent) {
View view = LayoutInflater.from(context).inflate(R.layout.base_intro_slider_view, parent, false);
OControls.setText(view, R.id.big_title, item.getTitle());
OControls.setImage(view, R.id.slider_image, item.getImagePath());
OControls.setText(view, R.id.sub_title, item.getExtras().get("sub_title").toString());
OControls.setText(view, R.id.description, item.getContent());
return view;
}
示例6: addAttachment
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void addAttachment(OValues values) {
View attachmentView = LayoutInflater.from(this)
.inflate(R.layout.base_attachment_item, horizontalScrollView, false);
String fileName = values.getString("name");
String type = values.getString("file_type");
ImageView imgPreview = (ImageView) attachmentView.findViewById(R.id.attachmentPreview);
if (type.contains("image")) {
OLog.log(values.getString("file_uri"));
imgPreview.setImageURI(Uri.parse(values.getString("file_uri")));
} else if (type.contains("audio")) {
imgPreview.setImageResource(R.drawable.audio);
} else if (type.contains("video")) {
imgPreview.setImageResource(R.drawable.video);
} else {
imgPreview.setImageResource(R.drawable.file);
}
OControls.setText(attachmentView, R.id.attachmentFileName, fileName);
attachmentView.setTag(values);
attachmentView.findViewById(R.id.btnRemoveAttachment)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
horizontalScrollView.removeView(
(View) v.getParent()
);
}
});
horizontalScrollView.addView(attachmentView);
}
示例7: generateView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void generateView(int position, View view, OUser user) {
BezelImageView imgView = (BezelImageView) view.findViewById(R.id.imgInstance);
if (user.getAvatar().equals("false")) {
imgView.setImageResource(R.drawable.avatar);
} else {
imgView.setImageBitmap(BitmapUtils.getBitmapImage(mContext, user.getAvatar()));
}
imgView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imgView.autoSetMaskDrawable();
OControls.setText(view, R.id.txvInstanceName, user.getName());
OControls.setText(view, R.id.txvInstanceUrl, (user.isOAuthLogin()) ? user.getInstanceURL() : user.getHost());
}
示例8: init
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void init() {
recordName = (TextView) findViewById(R.id.recordName);
parent = (View) recordName.getParent();
ODataRow row = mailMessage.browse(extra.getInt(OColumn.ROW_ID));
attachments.addAll(row.getM2MRecord("attachment_ids").browseEach());
if (attachments.size() > 0) {
loadAttachments = new LoadAttachments();
loadAttachments.execute();
}
horizontalScrollView = (LinearLayout) findViewById(R.id.attachmentsList);
baseModel = OModel.get(this, row.getString("model"), mailMessage.getUser().getAndroidName());
ODataRow record = baseModel.browse(baseModel.selectRowId(row.getInt("res_id")));
String name = record.getString(baseModel.getDefaultNameColumn());
recordName.setText(name);
recordName.setBackgroundColor(OStringColorUtil.getStringColor(this, name));
if (!row.getString("subject").equals("false"))
OControls.setText(parent, R.id.messageSubject, row.getString("subject"));
else
OControls.setGone(parent, R.id.messageSubject);
WebView messageBody = (WebView) findViewById(R.id.messageBody);
messageBody.setBackgroundColor(Color.TRANSPARENT);
messageBody.loadData(row.getString("body"), "text/html; charset=UTF-8", "UTF-8");
Bitmap author_image = BitmapUtils.getAlphabetImage(this, row.getString("author_name"));
String author_img = mailMessage.getAuthorImage(row.getInt(OColumn.ROW_ID));
if (!author_img.equals("false")) {
author_image = BitmapUtils.getBitmapImage(this, author_img);
}
OControls.setImage(parent, R.id.author_image, author_image);
OControls.setText(parent, R.id.authorName, row.getString("author_name"));
String date = ODateUtils.convertToDefault(row.getString("date"),
ODateUtils.DEFAULT_FORMAT, "MMM dd, yyyy hh:mm a");
OControls.setText(parent, R.id.messageDate, date);
}
示例9: getView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private View getView() {
View view = LayoutInflater.from(mContext)
.inflate(R.layout.base_account_ask_pass, null, false);
String avatar = mUser.getAvatar();
Bitmap bitmap;
if (avatar.equals("false")) {
bitmap = BitmapUtils.getAlphabetImage(mContext, mUser.getName());
} else {
bitmap = BitmapUtils.getBitmapImage(mContext, avatar);
}
OControls.setImage(view, R.id.userAvatar, bitmap);
OControls.setText(view, R.id.txvUsername, mUser.getName());
edtPassword = (EditText) view.findViewById(R.id.edtPassword);
return view;
}
示例10: getView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
public View getView(int position, View view, ViewGroup parent) {
ODataRow row = (ODataRow) chatterItems.get(position);
if (row.getString("subtype_id").equals("false")) {
view.setBackgroundResource(R.color.base_chatter_view_note_background);
} else {
view.setBackgroundColor(Color.WHITE);
}
view.findViewById(R.id.imgAttachments).setVisibility(
(row.getBoolean("has_attachments")) ?
View.VISIBLE :
View.GONE
);
if (row.getString("subject").equals("false")) {
OControls.setGone(view, R.id.chatterSubject);
} else {
OControls.setVisible(view, R.id.chatterSubject);
OControls.setText(view, R.id.chatterSubject, row.getString("subject"));
}
String date = ODateUtils.convertToDefault(row.getString("date"),
ODateUtils.DEFAULT_FORMAT, "MMM dd hh:mm a");
OControls.setText(view, R.id.chatterDate, date);
OControls.setText(view, R.id.chatterBody, StringUtils.htmlToString(row.getString("body")));
OControls.setText(view, R.id.chatterAuthor, row.getString("author_name"));
String author_image = mailMessage.getAuthorImage(row.getInt(OColumn.ROW_ID));
if (!author_image.equals("false")) {
Bitmap author = BitmapUtils.getBitmapImage(mContext, author_image);
OControls.setImage(view, R.id.authorImage, author);
} else {
OControls.setImage(view, R.id.authorImage, R.drawable.avatar);
}
view.setTag(row);
view.setOnClickListener(this);
return view;
}
示例11: bindOptions
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void bindOptions() {
optionsView.removeAllViews();
for (ODataRow val : mAttrValues) {
LinearLayout item = (LinearLayout) LayoutInflater.from(mContext).inflate(R.layout.shop_cart_attr_option_value_item, optionsView, false);
OControls.setText(item, R.id.attrValueName, val.getString("name"));
item.setTag(val);
item.setOnClickListener(this);
optionsView.addView(item);
}
}
示例12: generateView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void generateView(int position, View view, OdooInstance instance) {
OControls.setText(view, R.id.txvInstanceUrl, instance.getUrl());
OControls.setText(view, R.id.txvInstanceName, instance.getCompanyName());
String imageURL = instance.getUrl() + "/web/binary/company_logo?dbname=" + instance.getDbName();
ImageLoader imageLoader = new ImageLoader(position, imageURL, R.id.imgInstance);
imageLoaderLists.add(imageLoader);
imageLoader.execute();
}
示例13: generateView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private View generateView(int position, View convertView,
ViewGroup parent) {
View v = convertView;
if (v == null)
v = LayoutInflater.from(mContext).inflate(
android.R.layout.simple_list_item_1, parent, false);
ODataRow row = getItem(position);
OControls.setText(v, android.R.id.text1, row.getString(mModel.getDefaultNameColumn()));
return v;
}
示例14: bindView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void bindView(View view) {
OUser user = OUser.current(mContext);
String avatar = user.getAvatar();
if (!avatar.equals("false")) {
Bitmap img = BitmapUtils.getBitmapImage(mContext, avatar);
OControls.setImage(view, R.id.userAvatar, img);
}
OControls.setText(view, R.id.userName, "Hello " + user.getName());
}
示例15: fillDrawerItemValue
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
public static View fillDrawerItemValue(View view, ODrawerItem item) {
if (item.isGroupTitle()) {
OControls.setText(view, R.id.group_title, item.getTitle());
} else {
if (item.getIcon() > 0)
OControls.setImage(view, R.id.icon, item.getIcon());
else
view.findViewById(R.id.icon).setVisibility(View.GONE);
OControls.setText(view, R.id.title, item.getTitle());
if (item.getCounter() > 0) {
OControls.setText(view, R.id.counter, item.getCounter() + "");
}
}
return view;
}