当前位置: 首页>>代码示例>>Java>>正文


Java ReadThemeAdapter类代码示例

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


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

示例1: initAASet

import com.justwayward.reader.ui.easyadapter.ReadThemeAdapter; //导入依赖的package包/类
private void initAASet() {
    curTheme = SettingManager.getInstance().getReadTheme();
    ThemeManager.setReaderTheme(curTheme, mRlBookReadRoot);

    seekbarFontSize.setMax(10);
    //int fontSizePx = SettingManager.getInstance().getReadFontSize(bookId);
    int fontSizePx = SettingManager.getInstance().getReadFontSize();
    int progress = (int) ((ScreenUtils.pxToDpInt(fontSizePx) - 12) / 1.7f);
    seekbarFontSize.setProgress(progress);
    seekbarFontSize.setOnSeekBarChangeListener(new SeekBarChangeListener());

    seekbarLightness.setMax(100);
    seekbarLightness.setOnSeekBarChangeListener(new SeekBarChangeListener());
    seekbarLightness.setProgress(SettingManager.getInstance().getReadBrightness());
    isAutoLightness = ScreenUtils.isAutoBrightness(this);
    if (SettingManager.getInstance().isAutoBrightness()) {
        startAutoLightness();
    } else {
        stopAutoLightness();
    }

    cbVolume.setChecked(SettingManager.getInstance().isVolumeFlipEnable());
    cbVolume.setOnCheckedChangeListener(new ChechBoxChangeListener());

    cbAutoBrightness.setChecked(SettingManager.getInstance().isAutoBrightness());
    cbAutoBrightness.setOnCheckedChangeListener(new ChechBoxChangeListener());

    gvAdapter = new ReadThemeAdapter(this, (themes = ThemeManager.getReaderThemeData(curTheme)), curTheme);
    gvTheme.setAdapter(gvAdapter);
    gvTheme.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (position < themes.size() - 1) {
                changedMode(false, position);
            } else {
                changedMode(true, position);
            }
        }
    });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:41,代码来源:ReadActivity.java

示例2: initAASet

import com.justwayward.reader.ui.easyadapter.ReadThemeAdapter; //导入依赖的package包/类
private void initAASet() {
    curTheme = SettingManager.getInstance().getReadTheme();
    ThemeManager.setReaderTheme(curTheme, mRlBookReadRoot);

    seekbarFontSize.setMax(10);
    //int fontSizePx = SettingManager.getInstance().getReadFontSize(bookId);
    int fontSizePx = SettingManager.getInstance().getReadFontSize();
    int progress = (int) ((ScreenUtils.pxToDpInt(fontSizePx) - 12) / 1.7f);
    seekbarFontSize.setProgress(progress);
    seekbarFontSize.setOnSeekBarChangeListener(new SeekBarChangeListener());

    seekbarLightness.setMax(100);
    seekbarLightness.setOnSeekBarChangeListener(new SeekBarChangeListener());
    seekbarLightness.setProgress(ScreenUtils.getScreenBrightness());
    isAutoLightness = ScreenUtils.isAutoBrightness(this);


    this.getContentResolver().registerContentObserver(Settings.System.getUriFor(Settings.System.SCREEN_BRIGHTNESS), true, Brightness);

    if (SettingManager.getInstance().isAutoBrightness()) {
        startAutoLightness();
    } else {
        stopAutoLightness();
    }

    cbVolume.setChecked(SettingManager.getInstance().isVolumeFlipEnable());
    cbVolume.setOnCheckedChangeListener(new ChechBoxChangeListener());

    cbAutoBrightness.setChecked(SettingManager.getInstance().isAutoBrightness());
    cbAutoBrightness.setOnCheckedChangeListener(new ChechBoxChangeListener());

    gvAdapter = new ReadThemeAdapter(this, (themes = ThemeManager.getReaderThemeData(curTheme)), curTheme);
    gvTheme.setAdapter(gvAdapter);
    gvTheme.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (position < themes.size() - 1) {
                changedMode(false, position);
            } else {
                changedMode(true, position);
            }
        }
    });
}
 
开发者ID:JustWayward,项目名称:BookReader,代码行数:45,代码来源:ReadActivity.java


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