• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AppearanceConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.android.apps.dashclock.configuration.AppearanceConfig的典型用法代码示例。如果您正苦于以下问题:Java AppearanceConfig类的具体用法?Java AppearanceConfig怎么用?Java AppearanceConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AppearanceConfig类属于com.google.android.apps.dashclock.configuration包,在下文中一共展示了AppearanceConfig类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: enableDisableMultiplexerOnlyMode

import com.google.android.apps.dashclock.configuration.AppearanceConfig; //导入依赖的package包/类
private void enableDisableMultiplexerOnlyMode(Context context, boolean multiplexerOnlyMode) {
    ComponentName[] components = {
            new ComponentName(context, DaydreamService.class),
            new ComponentName(context, ConfigurationActivity.class),
            new ComponentName(context, WidgetProvider.class)
    };

    PackageManager pm = context.getPackageManager();
    for (ComponentName componentName : components) {
        pm.setComponentEnabledSetting(componentName,
                multiplexerOnlyMode
                        ? PackageManager.COMPONENT_ENABLED_STATE_DISABLED
                        : PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
                PackageManager.DONT_KILL_APP);
    }

    pm.setComponentEnabledSetting(
            new ComponentName(
                    context.getPackageName(),
                    ConfigurationActivity.LAUNCHER_ACTIVITY_NAME),
            (!multiplexerOnlyMode && AppearanceConfig.shouldLauncherSettingsBeShown(context))
                    ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                    : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
            PackageManager.DONT_KILL_APP);
}
 
开发者ID:mridang,项目名称:dashbar,代码行数:26,代码来源:MultiplexerOnlyModeReceiver.java


示例2: getViewAt

import com.google.android.apps.dashclock.configuration.AppearanceConfig; //导入依赖的package包/类
public RemoteViews getViewAt(int position) {
    if (position >= mVisibleExtensions.size()) {
        // TODO: trap this better
        // See note on synchronization below.
        return null;
    }

    WidgetRenderer renderer = new WidgetRenderer(mContext);
    DashClockRenderer.Options options = new DashClockRenderer.Options();
    options.target = mTarget;
    options.foregroundColor = AppearanceConfig.getForegroundColor(mContext, mTarget);
    renderer.setOptions(options);
    ExtensionManager.ExtensionWithData ewd = getItemAtProtected(position);
    return (RemoteViews) (mIsMini
            ? renderer.renderCollapsedExtension(null, null, true, ewd)
            : renderer.renderExpandedExtension(null, null, true, ewd));
}
 
开发者ID:mridang,项目名称:dashbar,代码行数:18,代码来源:WidgetRemoteViewsFactoryService.java


示例3: onAttachedToWindow

import com.google.android.apps.dashclock.configuration.AppearanceConfig; //导入依赖的package包/类
@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    mExtensionManager = ExtensionManager.getInstance(this);
    mExtensionManager.addOnChangeListener(this);

    // Update extensions and ensure the periodic refresh is set up.
    PeriodicExtensionRefreshReceiver.updateExtensionsAndEnsurePeriodicRefresh(this);

    mAttached = true;
    setInteractive(true);
    setFullscreen(true);

    // Read preferences
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
    mForegroundColor = sp.getInt(PREF_DAYDREAM_COLOR,
            AppearanceConfig.DEFAULT_WIDGET_FOREGROUND_COLOR);

    String animation = sp.getString(PREF_DAYDREAM_ANIMATION, "");
    if ("none".equals(animation)) {
        mAnimation = ANIMATION_NONE;
    } else if ("slide".equals(animation)) {
        mAnimation = ANIMATION_SLIDE;
    } else if ("fade".equals(animation)) {
        mAnimation = ANIMATION_FADE;
    } else {
        mAnimation = ANIMATION_PENDULUM;
    }

    setScreenBright(!sp.getBoolean(PREF_DAYDREAM_NIGHT_MODE, true));

    // Begin daydream
    layoutDream();
}
 
开发者ID:mridang,项目名称:dashbar,代码行数:35,代码来源:DaydreamService.java


示例4: renderWidgets

import com.google.android.apps.dashclock.configuration.AppearanceConfig; //导入依赖的package包/类
/**
 * Renders the DashClock UI to the given app widget IDs.
 */
public static void renderWidgets(Context context, int[] appWidgetIds) {
    final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);

    WidgetRenderer renderer = new WidgetRenderer(context);
    for (int appWidgetId : appWidgetIds) {
        Options options = new Options();
        options.appWidgetId = appWidgetId;
        options.target = Options.TARGET_HOME_SCREEN;
        options.minWidthDp= Integer.MAX_VALUE;
        options.minHeightDp = Integer.MAX_VALUE;
        Bundle widgetOptions = appWidgetManager.getAppWidgetOptions(appWidgetId);
        if (widgetOptions != null) {
            options.minWidthDp = widgetOptions
                    .getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH);
            options.minHeightDp = widgetOptions
                    .getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT);
            options.target = (AppWidgetProviderInfo.WIDGET_CATEGORY_KEYGUARD ==
                    widgetOptions.getInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY))
                    ? Options.TARGET_LOCK_SCREEN : Options.TARGET_HOME_SCREEN;
        }
        options.foregroundColor = AppearanceConfig.getForegroundColor(context, options.target);

        renderer.setOptions(options);
        appWidgetManager.updateAppWidget(appWidgetId,
                (RemoteViews) renderer.renderWidget(null));

        // During an update to an existing expanded widget, setRemoteAdapter does nothing,
        // so we need to explicitly call notifyAppWidgetViewDataChanged to update data.
        appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetId,
                R.id.expanded_extensions);
    }
}
 
开发者ID:mridang,项目名称:dashbar,代码行数:36,代码来源:WidgetRenderer.java



注:本文中的com.google.android.apps.dashclock.configuration.AppearanceConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XMLStreamException类代码示例发布时间:2022-05-23
下一篇:
Java PreKeyRecord类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap