當前位置: 首頁>>代碼示例>>Java>>正文


Java EinkUtils類代碼示例

本文整理匯總了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
        }
    }
}
 
開發者ID:munterkofler,項目名稱:YotaTextCover,代碼行數:46,代碼來源:BSWidget.java

示例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);
}
 
開發者ID:crainiarc,項目名稱:yotacast,代碼行數:14,代碼來源:NotificationBSActivity.java

示例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();
        }
    }
}
 
開發者ID:crainiarc,項目名稱:yotacast,代碼行數:33,代碼來源:BSDrawer.java


注:本文中的com.yotadevices.sdk.utils.EinkUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。