本文整理汇总了Java中com.yotadevices.sdk.utils.EinkUtils类的典型用法代码示例。如果您正苦于以下问题:Java EinkUtils类的具体用法?Java EinkUtils怎么用?Java EinkUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EinkUtils类属于com.yotadevices.sdk.utils包,在下文中一共展示了EinkUtils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdate
import com.yotadevices.sdk.utils.EinkUtils; //导入依赖的package包/类
/**
* When widget is loaded or updated
*
* @param context Context
* @param appWidgetManager AppWidgetManager
* @param appWidgetIds Widget IDs
*/
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
super.onUpdate(context, appWidgetManager, appWidgetIds);
// Store a context
if (BSWidget.context == null) {
BSWidget.context = context;
}
RemoteViews views;
//update all widgets
for (int widgetId : appWidgetIds) {
//create remote view for widget
views = new RemoteViews(context.getPackageName(), R.layout.bs_widget);
//set waveform and dithering - maybe useless?
EinkUtils.setRemoteViewsWaveformAndDithering(views, R.layout.bs_widget, Drawer.Waveform.WAVEFORM_GC_FULL, Drawer.Dithering.DITHER_DEFAULT);
//get preferences
String bigText = Utilities.getPrefsString(Utilities.prefPrefixText + widgetId, context.getString(R.string.text_default));
int rotationAngle = Utilities.getRotationAngleByPosition(Utilities.getPrefsInt(Utilities.prefPrefixRotation + widgetId, 0));
boolean centerText = Utilities.getPrefsBoolean(Utilities.prefPrefixCenterText, true);
try {
//generate and set text as image/bitmap
Bitmap textBitmap = Utilities.createTextBitmap(bigText, Utilities.defaultTextSize, rotationAngle, centerText);
views.setImageViewBitmap(R.id.bigText, textBitmap);
//update UI for current widget
appWidgetManager.updateAppWidget(widgetId, views);
Log.d(TAG, "Widget " + widgetId + " updated.");
} catch (Exception e) {
//bitmap update error? just ignore it
}
}
}
示例2: setViews
import com.yotadevices.sdk.utils.EinkUtils; //导入依赖的package包/类
private void setViews() {
mMainLayout = (RelativeLayout) findViewById(R.id.main_layout);
mNotifLayout = (FrameLayout) findViewById(R.id.notification_layout);
mOK = (TextView) findViewById(R.id.button_ok);
mDotLine = findViewById(R.id.dot_line);
mOK.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
EinkUtils.setViewWaveform(mMainLayout, Drawer.Waveform.WAVEFORM_GC_PARTIAL);
}
示例3: addBSParentView
import com.yotadevices.sdk.utils.EinkUtils; //导入依赖的package包/类
/**
* @hide only for inner usage
* @param initialWaveform
* @param initialDithering
*/
@Override
public synchronized void addBSParentView(Waveform initialWaveform, Dithering initialDithering) {
if (!isShowBSParentView()) {
WindowManager wm = getWindowManager();
LayoutParams lp = getDefaultLayoutParams();
BSActivity activity = mActivity.get();
if (activity != null) {
activity.onPrepareLayoutParams(lp);
applySystemIUVisibility(lp, activity.getSytemBSUiVisibility());
}
EinkUtils.setViewDithering(mParentView, initialDithering);
EinkUtils.setViewWaveform(mParentView, initialWaveform);
wm.addView(mParentView, lp);
//EinkUtils.setViewDithering(mParentView, Dithering.DITHER_DEFAULT);
//EinkUtils.setViewWaveform(mParentView, Waveform.WAVEFORM_DEFAULT);
// When BS layout is added we perform FULL update to remove all
// ghosting
// from previous BSActivity
//EinkUtils.performSingleUpdate(mParentView, initialWaveform, initialDithering, 0);
isShowEpdView = true;
if (isShowBlankView) {
hideBlankView();
}
}
}