当前位置: 首页>>代码示例>>Java>>正文


Java OControls.setVisible方法代码示例

本文整理汇总了Java中com.odoo.core.utils.OControls.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java OControls.setVisible方法的具体用法?Java OControls.setVisible怎么用?Java OControls.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.odoo.core.utils.OControls的用法示例。


在下文中一共展示了OControls.setVisible方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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) + ""));
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:23,代码来源:ProductDetail.java

示例2: onPostExecute

import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Void aVoid) {
    super.onPostExecute(aVoid);
    OControls.setGone(getContainer(), R.id.productLoadingLayout);
    OControls.setVisible(getContainer(), R.id.productLayout);
    new AsyncTask<Void, Void, Void>() {

        @Override
        protected Void doInBackground(Void... params) {
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    bindProduct();
                }
            });
            return null;
        }
    }.execute();
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:20,代码来源:ProductDetail.java

示例3: 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);
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:24,代码来源:ManageAccounts.java

示例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;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:38,代码来源:MailChatterView.java

示例5: 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, "");
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:11,代码来源:Customers.java

示例6: onPreExecute

import com.odoo.core.utils.OControls; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
    super.onPreExecute();
    OControls.setGone(getContainer(), R.id.productLayout);
    OControls.setVisible(getContainer(), R.id.productLoadingLayout);
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:7,代码来源:ProductDetail.java


注:本文中的com.odoo.core.utils.OControls.setVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。