本文整理汇总了Java中com.odoo.core.utils.BitmapUtils.getAlphabetImage方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapUtils.getAlphabetImage方法的具体用法?Java BitmapUtils.getAlphabetImage怎么用?Java BitmapUtils.getAlphabetImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.odoo.core.utils.BitmapUtils
的用法示例。
在下文中一共展示了BitmapUtils.getAlphabetImage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTitle
import com.odoo.core.utils.BitmapUtils; //导入方法依赖的package包/类
private void setTitle(Toolbar toolbar) {
CollapsingToolbarLayout collapsing_toolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsing_toolbar.setTitle(category.getString("name"));
toolbar.setTitle(category.getString("name"));
Bitmap cover;
if (category.getString("image_medium").equals("false")) {
cover = BitmapUtils.getAlphabetImage(getContext(), category.getString("name"));
} else {
cover = BitmapUtils.getBitmapImage(getContext(), category.getString("image_medium"));
}
Palette.Builder paletteBuilder = new Palette.Builder(cover);
Palette palette = paletteBuilder.generate();
ImageView imageView = (ImageView) findViewById(R.id.image);
imageView.setImageBitmap(cover);
if (palette != null) {
int color = palette.getDarkVibrantColor(_c(R.color.theme_secondary_dark));
imageView.setBackgroundColor(color);
}
}
示例2: init
import com.odoo.core.utils.BitmapUtils; //导入方法依赖的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);
}
示例3: onViewBind
import com.odoo.core.utils.BitmapUtils; //导入方法依赖的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")));
}
示例4: onCreate
import com.odoo.core.utils.BitmapUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.base_profile);
OAppBarUtils.setAppBar(this, true);
OUser user = OUser.currentUser(this);
OForm form = (OForm) findViewById(R.id.profileDetails);
int color = OStringColorUtil.getStringColor(this, user.getName());
form.setIconTintColor(color);
ODataRow userData = new ODataRow();
userData.put("name", user.getName());
userData.put("user_login", user.getUsername());
userData.put("server_url", (user.isOAuthLogin()) ? user.getInstanceURL() : user.getHost());
userData.put("database", (user.isOAuthLogin()) ? user.getInstanceDatabase() : user.getDatabase());
userData.put("version", user.getOdooVersion().getServerSerie());
userData.put("timezone", user.getTimezone());
form.initForm(userData);
CollapsingToolbarLayout collapsing_toolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsing_toolbar.setTitle(userData.getString("name"));
setTitle(userData.getString("name"));
Bitmap avatar;
if (user.getAvatar().equals("false")) {
avatar = BitmapUtils.getAlphabetImage(this, user.getName());
} else {
avatar = BitmapUtils.getBitmapImage(this, user.getAvatar());
}
ImageView imageView = (ImageView) findViewById(R.id.image);
imageView.setImageBitmap(avatar);
}
示例5: updatePassword
import com.odoo.core.utils.BitmapUtils; //导入方法依赖的package包/类
private void updatePassword() {
userAvatar = (ImageView) findViewById(R.id.userAvatar);
Bitmap userImage = BitmapUtils.getAlphabetImage(this, user.getName());
if (!user.getAvatar().equals("false")) {
userImage = BitmapUtils.getBitmapImage(this, user.getAvatar());
}
userAvatar.setImageBitmap(userImage);
txvName = (TextView) findViewById(R.id.userName);
txvName.setText(user.getName());
}
示例6: getView
import com.odoo.core.utils.BitmapUtils; //导入方法依赖的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;
}
示例7: onCreate
import com.odoo.core.utils.BitmapUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.base_profile);
OAppBarUtils.setAppBar(this, true);
OUser user = OUser.current(this);
OForm form = (OForm) findViewById(R.id.profileDetails);
int color = OStringColorUtil.getStringColor(this, user.getName());
form.setIconTintColor(color);
ODataRow userData = new ODataRow();
userData.put("name", user.getName());
userData.put("user_login", user.getUsername());
userData.put("server_url", (user.isOAuthLogin()) ? user.getInstanceURL() : user.getHost());
userData.put("database", (user.isOAuthLogin()) ? user.getInstanceDatabase() : user.getDatabase());
userData.put("version", user.getOdooVersion().getServerSerie());
userData.put("timezone", user.getTimezone());
form.initForm(userData);
CollapsingToolbarLayout collapsing_toolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsing_toolbar.setTitle(userData.getString("name"));
setTitle(userData.getString("name"));
Bitmap avatar;
if (user.getAvatar().equals("false")) {
avatar = BitmapUtils.getAlphabetImage(this, user.getName());
} else {
avatar = BitmapUtils.getBitmapImage(this, user.getAvatar());
}
ImageView imageView = (ImageView) findViewById(R.id.image);
imageView.setImageBitmap(avatar);
}