本文整理汇总了Java中com.odoo.core.utils.OControls.setImage方法的典型用法代码示例。如果您正苦于以下问题:Java OControls.setImage方法的具体用法?Java OControls.setImage怎么用?Java OControls.setImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.odoo.core.utils.OControls
的用法示例。
在下文中一共展示了OControls.setImage方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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);
}
示例3: bindCategoryViews
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void bindCategoryViews(ViewGroup container) {
View separator = LayoutInflater.from(this).inflate(R.layout.base_drawer_group_layout, container, false);
OControls.setText(separator, R.id.group_title, R.string.label_shop_by_category);
container.addView(separator);
ProductPublicCategory categories = new ProductPublicCategory(this);
for (ODataRow row : categories.select(null, "parent_id is NULL", new String[]{}, "sequence")) {
View item = LayoutInflater.from(this).inflate(R.layout.base_drawer_category_item, container, false);
if (row.getString("image_medium").equals("false")) {
OControls.setImage(item, R.id.icon, R.drawable.ic_action_add);
} else {
OControls.setImage(item, R.id.icon, BitmapUtils.getBitmapImage(this,
row.getString("image_medium")));
}
OControls.setText(item, R.id.title, row.getString("name"));
item.setTag(row);
item.setOnClickListener(drawerCategoryItemClick);
container.addView(item);
}
}
示例4: 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;
}
示例5: 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);
}
示例6: 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;
}
示例7: onViewBind
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
public void onViewBind(View view, Cursor cursor, ODataRow row) {
Bitmap img;
if (row.getString("image_small").equals("false")) {
img = BitmapUtils.getAlphabetImage(getActivity(), row.getString("name"));
} else {
img = BitmapUtils.getBitmapImage(getActivity(), row.getString("image_small"));
}
OControls.setImage(view, R.id.image_small, img);
OControls.setText(view, R.id.name, row.getString("name"));
OControls.setText(view, R.id.company_name, (row.getString("company_name").equals("false"))
? "" : row.getString("company_name"));
OControls.setText(view, R.id.email, (row.getString("email").equals("false") ? " "
: row.getString("email")));
}
示例8: run
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
public void run() {
OControls.setGone(mView, R.id.loadingProgress);
OControls.setGone(mView, R.id.swipe_container);
OControls.setVisible(mView, R.id.customer_no_items);
setHasSwipeRefreshView(mView, R.id.customer_no_items, Customers.this);
OControls.setImage(mView, R.id.icon, R.drawable.ic_action_customers);
OControls.setText(mView, R.id.title, _s(R.string.label_no_customer_found));
OControls.setText(mView, R.id.subTitle, "");
}
示例9: 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());
}
示例10: 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;
}
示例11: bindView
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
private void bindView(View view) {
OUser user = OUser.currentUser(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());
}
示例12: 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;
}
示例13: onPostExecute
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
if (bmp != null) {
View mView = mGrid.getChildAt(view_pos);
OControls.setImage(mView, image_view, bmp);
}
}
示例14: onViewBind
import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
public void onViewBind(int position, View view, Object data) {
ODataRow row = (ODataRow) data;
if (currency == null && !row.getString("company_id").equals("false")) {
currency = row.getM2ORecord("company_id")
.browse().getM2ORecord("currency_id").browse();
}
if (!row.getString("image_medium").equals("false")) {
OControls.setImage(view, R.id.productImage,
BitmapUtils.getBitmapImage(getActivity(), row.getString("image_medium")));
} else {
OControls.setImage(view, R.id.productImage, R.drawable.no_image);
}
OControls.setText(view, R.id.productName, row.getString("name"));
String price = row.getString("list_price");
float discountPrice = row.getFloat("price");
if (discountPrice != row.getFloat("list_price")) {
view.findViewById(R.id.discountView).setVisibility(View.VISIBLE);
OControls.setTextViewStrikeThrough(view, R.id.productOriginalPrice);
OControls.setText(view, R.id.productOriginalPrice, getPriceWithCurrency(price));
float percent = Math.round(100 - (discountPrice / row.getFloat("list_price") * 100));
OControls.setText(view, R.id.productDiscount, percent + "% off");
price = discountPrice + "";
} else {
view.findViewById(R.id.discountView).setVisibility(View.INVISIBLE);
}
OControls.setText(view, R.id.productPrice, getPriceWithCurrency(price));
toggleFavIcon(favouriteProducts.isFavourite(row.getInt(OColumn.ROW_ID)),
view.findViewById(R.id.favorite_layout));
view.findViewById(R.id.favorite_layout).setTag(row);
view.findViewById(R.id.favorite_layout).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ODataRow r = (ODataRow) v.getTag();
boolean isFav = favouriteProducts.toggleFavourite(r.getInt(OColumn.ROW_ID));
toggleFavIcon(isFav, v);
String message = (isFav) ? _s(R.string.toast_added_to_favourite_list) :
_s(R.string.toast_removed_from_favourite_list);
Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show();
}
});
}