本文整理汇总了Java中com.sonyericsson.extras.liveware.extension.util.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.sonyericsson.extras.liveware.extension.util包,在下文中一共展示了R类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SmartWatchNotificationWidgetImage
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Create notification widget image.
*
* @param context The context.
* @param event The event.
*/
public SmartWatchNotificationWidgetImage(final Context context,
final NotificationWidgetEvent event) {
super(context);
setInnerLayoutResourceId(R.layout.smart_watch_notification_widget);
setBadgeCount(event.getCount());
mEvent = event;
}
示例2: applyInnerLayout
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
@Override
protected void applyInnerLayout(LinearLayout innerLayout) {
Bitmap backgroundBitmap = mEvent.getImage();
if (null != backgroundBitmap) {
((ImageView)innerLayout
.findViewById(R.id.smart_watch_notification_widget_background))
.setImageBitmap(backgroundBitmap);
((ImageView)innerLayout
.findViewById(R.id.smart_watch_notification_widget_text_background))
.setVisibility(View.VISIBLE);
}
// set title
((TextView)innerLayout.findViewById(R.id.smart_watch_notification_widget_text_title))
.setText(mEvent.getTitle());
// set time stamp
String time = ExtensionUtils.getFormattedTime(mEvent.getTime());
((TextView)innerLayout.findViewById(R.id.smart_watch_notification_widget_text_time))
.setText(time);
// set name
((TextView)innerLayout.findViewById(R.id.smart_watch_notification_widget_text_name))
.setText(mEvent.getName());
}
示例3: SmartWatchWidgetImage
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Initiate the SmartWatch widget image.
*
* @param context The context.
*/
public SmartWatchWidgetImage(final Context context) {
mContext = context;
mText = null;
mIconBitmap = null;
mInnerLayoutResid = 0;
mBadgeCount = 0;
mOuterWidth = mContext.getResources().getDimensionPixelSize(
R.dimen.smart_watch_widget_width_outer);
mOuterHeight = mContext.getResources().getDimensionPixelSize(
R.dimen.smart_watch_widget_height_outer);
mInnerWidth = mContext.getResources().getDimensionPixelSize(
R.dimen.smart_watch_widget_width_inner);
mInnerHeight = mContext.getResources().getDimensionPixelSize(
R.dimen.smart_watch_widget_height_inner);
mBitmap = Bitmap.createBitmap(mOuterWidth, mOuterHeight, Bitmap.Config.ARGB_8888);
// Set the density to default to avoid scaling.
mBitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
mCanvas = new Canvas(mBitmap);
// Options to avoid scaling.
mBitmapOptions = new BitmapFactory.Options();
mBitmapOptions.inDensity = DisplayMetrics.DENSITY_DEFAULT;
mBitmapOptions.inTargetDensity = DisplayMetrics.DENSITY_DEFAULT;
mBitmapOptions.inScaled = false;
}
示例4: draw
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Apply Set custom text. Typically used when only a text shall be
* displayed, and no specific layout is needed.
*
* @param text The text.
*
* @return this.
*/
private void draw() {
LinearLayout root = new LinearLayout(mContext);
root.setLayoutParams(new LayoutParams(mOuterWidth, mOuterHeight));
LinearLayout linearLayout = (LinearLayout)LinearLayout.inflate(mContext,
R.layout.smart_watch_widget, root);
if (mBadgeCount > 0) {
TextView badgeText = (TextView)linearLayout
.findViewById(R.id.smart_watch_widget_event_counter_text);
badgeText.setText(Integer.toString(mBadgeCount));
badgeText.setVisibility(View.VISIBLE);
ImageView badgeBackground = (ImageView)linearLayout
.findViewById(R.id.smart_watch_widget_event_counter_badge);
badgeBackground.setVisibility(View.VISIBLE);
}
ImageView icon = (ImageView)linearLayout.findViewById(R.id.smart_watch_widget_icon);
icon.setImageBitmap(mIconBitmap);
if (null != mText) {
TextView textView = (TextView)linearLayout
.findViewById(R.id.smart_watch_widget_custom_text_view);
textView.setText(mText);
}
ImageView customImage = (ImageView)linearLayout
.findViewById(R.id.smart_watch_widget_custom_image);
customImage.setImageBitmap(getInnerBitmap());
linearLayout.measure(mOuterWidth, mOuterHeight);
linearLayout
.layout(0, 0, linearLayout.getMeasuredWidth(), linearLayout.getMeasuredHeight());
linearLayout.draw(mCanvas);
}
示例5: getSupportedWidgetWidth
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get supported widget width.
*
* @param context The context.
* @return the width.
*/
public static int getSupportedWidgetWidth(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.smart_watch_widget_width_outer);
}
示例6: getSupportedWidgetHeight
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get supported widget height.
*
* @param context The context.
* @return the height.
*/
public static int getSupportedWidgetHeight(Context context) {
return context.getResources()
.getDimensionPixelSize(R.dimen.smart_watch_widget_height_outer);
}
示例7: getSmartWatch2Width
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get SmartWatch 2 screen width.
*
* @param context The context.
* @return width.
*/
private static int getSmartWatch2Width(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_width);
}
示例8: getSmartWatch2Height
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get SmartWatch 2 screen height.
*
* @param context The context.
* @return height.
*/
private static int getSmartWatch2Height(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_height);
}
示例9: getSmartWatch2Width
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get SmartWatch 2 screen width.
*
* @param context The context.
* @return width.
*/
private static int getSmartWatch2Width(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_width);
}
示例10: getSmartWatch2Height
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get SmartWatch 2 screen height.
*
* @param context The context.
* @return height.
*/
private static int getSmartWatch2Height(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.smart_watch_2_control_height);
}
示例11: getSmartEyeglassWidth
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get SmartEyeglass screen width.
*
* @param context The context.
* @return width.
*/
public static int getSmartEyeglassWidth(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.smarteyeglass_control_width);
}
示例12: getSmartEyeglassHeight
import com.sonyericsson.extras.liveware.extension.util.R; //导入依赖的package包/类
/**
* Get SmartEyeglass screen height.
*
* @param context The context.
* @return height.
*/
public static int getSmartEyeglassHeight(Context context) {
return context.getResources().getDimensionPixelSize(R.dimen.smarteyeglass_control_height);
}