Java 类com.afollestad.materialdialogs.color.CircleView 实例源码

项目:GitHub    文件:MainActivity.java   
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int color) {
    if (dialog.isAccentMode()) {
        accentPreselect = color;
        ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().neutralColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().negativeColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().widgetColor = color;
    } else {
        primaryPreselect = color;
        if (getSupportActionBar() != null)
            getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
            getWindow().setNavigationBarColor(color);
        }
    }
}
项目:mesh-core-on-android    文件:AttributeActivity.java   
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int color) {
    if (dialog.isAccentMode()) {
        accentPreselect = color;
        ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().neutralColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().negativeColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().widgetColor = color;
        Log.i(TAG, "onColorSelection: #"+ Integer.toHexString(color));
        setStateItem(ElementAppItem.APP_TYPE_COLOR, "#"+Integer.toHexString(color));
    } else {
        primaryPreselect = color;
        if (getSupportActionBar() != null) {
            getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
            getWindow().setNavigationBarColor(color);
        }
    }
}
项目:Toutiao    文件:BaseActivity.java   
@Override
protected void onResume() {
    super.onResume();
    int color = SettingUtil.getInstance().getColor();
    int drawable = Constant.ICONS_DRAWABLES[SettingUtil.getInstance().getCustomIconValue()];
    if (getSupportActionBar() != null)
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
        // 最近任务栏上色
        ActivityManager.TaskDescription tDesc = new ActivityManager.TaskDescription(
                getString(R.string.app_name),
                BitmapFactory.decodeResource(getResources(), drawable),
                color);
        setTaskDescription(tDesc);
        if (SettingUtil.getInstance().getNavBar()) {
            getWindow().setNavigationBarColor(CircleView.shiftColorDown(color));
        } else {
            getWindow().setNavigationBarColor(Color.BLACK);
        }
    }
}
项目:Toutiao    文件:SettingActivity.java   
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    if (getSupportActionBar() != null)
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(selectedColor));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        // 状态栏上色
        getWindow().setStatusBarColor(CircleView.shiftColorDown(selectedColor));
        // 最近任务栏上色
        ActivityManager.TaskDescription tDesc = new ActivityManager.TaskDescription(
                getString(R.string.app_name),
                BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_rect),
                selectedColor);
        setTaskDescription(tDesc);
        // 导航栏上色
        if (SettingUtil.getInstance().getNavBar()) {
            getWindow().setNavigationBarColor(CircleView.shiftColorDown(selectedColor));
        } else {
            getWindow().setNavigationBarColor(Color.BLACK);
        }
    }
    if (!dialog.isAccentMode()) {
        SettingUtil.getInstance().setColor(selectedColor);
    }
}
项目:material-dialogs    文件:MainActivity.java   
@Override
public void onColorSelection(ColorChooserDialog dialog, @ColorInt int color) {
  if (dialog.isAccentMode()) {
    accentPreselect = color;
    ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);
    ThemeSingleton.get().neutralColor = DialogUtils.getActionTextStateList(this, color);
    ThemeSingleton.get().negativeColor = DialogUtils.getActionTextStateList(this, color);
    ThemeSingleton.get().widgetColor = color;
  } else {
    primaryPreselect = color;
    if (getSupportActionBar() != null) {
      getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
      getWindow().setNavigationBarColor(color);
    }
  }
}
项目:OpenHub    文件:ColorChooserDialog.java   
@Override
public boolean onLongClick(View v) {
  if (v.getTag() != null) {
    final String[] tag = ((String) v.getTag()).split(":");
    final int color = Integer.parseInt(tag[1]);
    ((CircleView) v).showHint(color);
    return true;
  }
  return false;
}
项目:Daily    文件:BaseActivity.java   
@Override
protected void onResume() {
    super.onResume();
    int color = mSettingHelper.getColor();
    if (getSupportActionBar() != null)
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
        getWindow().setNavigationBarColor(color);
    }
}
项目:Daily    文件:MainActivity.java   
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    if (getSupportActionBar() != null)
        getSupportActionBar().setBackgroundDrawable(new ColorDrawable(selectedColor));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setStatusBarColor(CircleView.shiftColorDown(selectedColor));
        getWindow().setNavigationBarColor(selectedColor);
    }
    if (!dialog.isAccentMode()) {
        mSettingHelper.setColor(selectedColor);
    }
}