Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import de.dlyt.yanndroid.oneui.widget.ProgressBar;

public abstract class SeslAbsSeekBar extends ProgressBar {
private boolean mIsOneUI4;
public static final boolean IS_BASE_SDK_VERSION;

static {
Expand Down Expand Up @@ -196,6 +197,7 @@ public SeslAbsSeekBar(Context var1, AttributeSet var2, int var3, int var4) {
this.mSetDualColorMode = false;
this.mPreviousHoverPopupType = 0;
this.mIsSeamless = false;
this.mIsOneUI4 = var1.getTheme().obtainStyledAttributes(new int[]{R.attr.isOneUI4}).getBoolean(0, false);
TypedArray var5 = var1.obtainStyledAttributes(var2, R.styleable.SeslAbsSeekBar, var3, var4);
if (Build.VERSION.SDK_INT >= 29) {
this.saveAttributeDataForStyleable(var1, R.styleable.SeslAbsSeekBar, var2, var5, var3, var4);
Expand Down Expand Up @@ -225,9 +227,9 @@ public SeslAbsSeekBar(Context var1, AttributeSet var2, int var3, int var4) {
}

this.mSplitTrack = var5.getBoolean(R.styleable.SeslAbsSeekBar_android_splitTrack, false);
this.mTrackMinWidth = var5.getDimensionPixelSize(R.styleable.SeslAbsSeekBar_seslTrackMinWidth, Math.round(var6.getDimension(R.dimen.sesl_seekbar_track_height)));
this.mTrackMinWidth = var5.getDimensionPixelSize(R.styleable.SeslAbsSeekBar_seslTrackMinWidth, Math.round(var6.getDimension(mIsOneUI4 ? R.dimen.sesl4_seekbar_track_height : R.dimen.sesl_seekbar_track_height)));
this.mTrackMaxWidth = var5.getDimensionPixelSize(R.styleable.SeslAbsSeekBar_seslTrackMaxWidth, Math.round(var6.getDimension(R.dimen.sesl_seekbar_track_height_expand)));
this.mThumbRadius = var5.getDimensionPixelSize(R.styleable.SeslAbsSeekBar_seslThumbRadius, Math.round(var6.getDimension(R.dimen.sesl_seekbar_thumb_radius)));
this.mThumbRadius = var5.getDimensionPixelSize(R.styleable.SeslAbsSeekBar_seslThumbRadius, Math.round(var6.getDimension(mIsOneUI4 ? R.dimen.sesl4_seekbar_thumb_radius : R.dimen.sesl_seekbar_thumb_radius)));
this.setThumbOffset(var5.getDimensionPixelOffset(R.styleable.SeslAbsSeekBar_android_thumbOffset, this.getThumbOffset()));
if (var5.hasValue(R.styleable.SeslAbsSeekBar_seslSeekBarMode)) {
super.mCurrentMode = var5.getInt(R.styleable.SeslAbsSeekBar_seslSeekBarMode, 0);
Expand All @@ -247,11 +249,11 @@ public SeslAbsSeekBar(Context var1, AttributeSet var2, int var3, int var4) {
this.applyTickMarkTint();
this.mScaledTouchSlop = ViewConfiguration.get(var1).getScaledTouchSlop();
this.mIsLightTheme = SeslMisc.isLightTheme(var1);
this.mDefaultNormalProgressColor = this.colorToColorStateList(var6.getColor(R.color.sesl_seekbar_control_color_default, var1.getTheme()));
this.mDefaultNormalProgressColor = this.colorToColorStateList(var6.getColor(mIsOneUI4 ? R.color.sesl4_seekbar_control_color_default : R.color.sesl_seekbar_control_color_default, var1.getTheme()));
this.mDefaultSecondaryProgressColor = this.colorToColorStateList(var6.getColor(R.color.sesl_seekbar_control_color_secondary, var1.getTheme()));
this.mDefaultActivatedProgressColor = this.colorToColorStateList(getColor(var1, R.attr.colorPrimary));
this.mOverlapNormalProgressColor = this.colorToColorStateList(var6.getColor(R.color.sesl_seekbar_overlap_color_default, var1.getTheme()));
this.mOverlapActivatedProgressColor = this.colorToColorStateList(var6.getColor(R.color.sesl_seekbar_overlap_color_activated, var1.getTheme()));
this.mOverlapNormalProgressColor = this.colorToColorStateList(var6.getColor(mIsOneUI4 ? R.color.sesl4_seekbar_overlap_color_default : R.color.sesl_seekbar_overlap_color_default, var1.getTheme()));
this.mOverlapActivatedProgressColor = this.colorToColorStateList(var6.getColor(mIsOneUI4 ? R.color.sesl4_seekbar_overlap_color_activated : R.color.sesl_seekbar_overlap_color_activated, var1.getTheme()));
this.mOverlapActivatedThumbColor = this.mOverlapActivatedProgressColor;
this.mDefaultActivatedThumbColor = this.getThumbTintList();
if (this.mDefaultActivatedThumbColor == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.graphics.Typeface;
import android.os.Build;
import android.provider.Settings;
import android.util.TypedValue;
import android.view.Gravity;
Expand Down Expand Up @@ -189,15 +190,16 @@ private boolean isReduceTransparencySettingsEnabled() {
}

private void setupBlurEffect() {
if (mBlurEffectEnabled) {
if (popupWindow.getContentView() != null && context != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && mBlurEffectEnabled) {
if (popupWindow != null && popupWindow.getContentView() != null) {
Object blurBuilder = SeslSemBlurInfoReflector.semCreateBlurBuilder(0 /* SemBlurInfo.BLUR_MODE_WINDOW */);

if (blurBuilder != null && !isReduceTransparencySettingsEnabled()) {
SeslSemBlurInfoReflector.semSetBuilderBlurRadius(blurBuilder, 120);
SeslSemBlurInfoReflector.semSetBuilderBlurBackgroundColor(blurBuilder, context.getResources().getColor(R.color.sesl_popup_menu_blur_background));
SeslSemBlurInfoReflector.semSetBuilderBlurBackgroundCornerRadius(blurBuilder, context.getResources().getDimension(R.dimen.sesl_menu_popup_corner_radius));
SeslSemBlurInfoReflector.semSetBuilderBlurBackgroundColor(blurBuilder, context.getResources().getColor(R.color.sesl_popup_menu_blur_background, context.getTheme()));
SeslSemBlurInfoReflector.semSetBuilderBlurBackgroundCornerRadius(blurBuilder, context.getResources().getDimension(mIsOneUI4 ? R.dimen.sesl4_menu_popup_corner_radius : R.dimen.sesl_menu_popup_corner_radius));
SeslSemBlurInfoReflector.semBuildSetBlurInfo(blurBuilder, popupWindow.getContentView());

if (listView != null) {
listView.setOverScrollMode(View.OVER_SCROLL_NEVER);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;
import android.util.AttributeSet;

import androidx.annotation.NonNull;

import java.util.ArrayList;
import java.util.Collections;

Expand All @@ -30,6 +33,7 @@ public class ColorPickerPreference extends Preference implements Preference.OnPr
private int mValue = Color.BLACK;
private ArrayList<Integer> mUsedColors = new ArrayList();

private long mLastClickTime;
private boolean mAlphaSliderEnabled = false;
private int mPickerType = CLASSIC;

Expand Down Expand Up @@ -68,8 +72,8 @@ protected Object onGetDefaultValue(TypedArray a, int index) {
}

@Override
protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
onColorSet(restoreValue ? getPersistedInt(mValue) : (Integer) defaultValue);
protected void onSetInitialValue(Object defaultValue) {
onColorSet(defaultValue == null ? getPersistedInt(mValue) : (Integer) defaultValue);
}

private void init(Context context, AttributeSet attrs) {
Expand All @@ -84,7 +88,7 @@ private void init(Context context, AttributeSet attrs) {
}

@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
mViewHolder = holder;
mPreview = (PreferenceImageView) holder.findViewById(R.id.imageview_widget);
Expand Down Expand Up @@ -115,8 +119,12 @@ public void onColorSet(int color) {
}

@Override
public boolean onPreferenceClick(Preference preference) {
showDialog(null);
public boolean onPreferenceClick(@NonNull Preference preference) {
long uptimeMillis = SystemClock.uptimeMillis();
if (uptimeMillis - mLastClickTime > 600L) {
showDialog(null);
}
mLastClickTime = uptimeMillis;
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;

import androidx.annotation.RestrictTo;
Expand All @@ -24,7 +25,6 @@
import java.util.ArrayList;

import de.dlyt.yanndroid.oneui.R;
import de.dlyt.yanndroid.oneui.widget.SeekBar;

public class SeslColorPicker extends LinearLayout {
static final int RECENT_COLOR_SLOT_COUNT = 6;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.widget.SeekBar;

import de.dlyt.yanndroid.oneui.R;
import de.dlyt.yanndroid.oneui.widget.SeekBar;

class SeslOpacitySeekBar extends SeekBar {
private static final int SEEKBAR_MAX_VALUE = 255;
Expand Down Expand Up @@ -49,6 +49,7 @@ void init(Integer var1) {
this.setProgressDrawable(this.mProgressDrawable);
this.setThumb(this.getContext().getResources().getDrawable(R.drawable.sesl_color_picker_seekbar_cursor, getContext().getTheme()));
this.setThumbOffset(0);
this.setSplitTrack(false);
}

void restoreColor(int var1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;

import androidx.core.content.ContextCompat;
Expand All @@ -32,7 +33,6 @@
import java.util.Locale;

import de.dlyt.yanndroid.oneui.R;
import de.dlyt.yanndroid.oneui.widget.SeekBar;

public class SeslColorPicker extends LinearLayout implements View.OnClickListener {
private static final int CURRENT_COLOR_VIEW = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.widget.SeekBar;

import androidx.core.view.ViewCompat;

import de.dlyt.yanndroid.oneui.R;
import de.dlyt.yanndroid.oneui.widget.SeekBar;

@SuppressLint("AppCompatCustomView")
class SeslGradientColorSeekBar extends SeekBar {
Expand Down Expand Up @@ -79,6 +79,7 @@ private void initProgressDrawable() {
private void initThumb() {
setThumb(getContext().getDrawable(R.drawable.sesl_color_picker_seekbar_cursor));
setThumbOffset(0);
setSplitTrack(false);
}

private static Drawable resizeDrawable(Context context, BitmapDrawable bitmapDrawable, int i, int i2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.widget.SeekBar;

import androidx.core.view.ViewCompat;

import de.dlyt.yanndroid.oneui.R;
import de.dlyt.yanndroid.oneui.widget.SeekBar;

@SuppressLint("AppCompatCustomView")
class SeslOpacitySeekBar extends SeekBar {
Expand All @@ -31,6 +31,7 @@ void init(Integer num) {
setProgressDrawable(mProgressDrawable);
setThumb(getContext().getResources().getDrawable(R.drawable.sesl_color_picker_seekbar_cursor));
setThumbOffset(0);
setSplitTrack(false);
}

private void initColor(int i) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator android:interpolator="@android:interpolator/fast_out_slow_in" android:duration="133" android:valueFrom="1.29" android:valueTo="1.176" android:valueType="floatType" android:propertyName="scaleX" />
<objectAnimator android:interpolator="@android:interpolator/fast_out_slow_in" android:duration="133" android:valueFrom="1.29" android:valueTo="1.176" android:valueType="floatType" android:propertyName="scaleY" />
</set>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator android:interpolator="@android:interpolator/fast_out_slow_in" android:duration="533" android:valueFrom="1.176" android:valueTo="1.29" android:valueType="floatType" android:propertyName="scaleX" />
<objectAnimator android:interpolator="@android:interpolator/fast_out_slow_in" android:duration="533" android:valueFrom="1.176" android:valueTo="1.29" android:valueType="floatType" android:propertyName="scaleY" />
</set>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false">
<nine-patch android:src="@drawable/sesl_textfield_default_alpha" android:tint="@color/sesl_edit_text_tint_color_disabled" />
<nine-patch android:src="@drawable/sesl4_textfield_default_alpha" android:tint="@color/sesl_edit_text_tint_color_disabled" />
</item>
<item android:state_focused="true">
<nine-patch android:src="@drawable/sesl_textfield_activated_alpha" android:tint="@color/sesl_edit_text_tint_color" />
<nine-patch android:src="@drawable/sesl4_textfield_activated_alpha" android:tint="@color/sesl_edit_text_tint_color" />
</item>
<item android:state_pressed="true">
<nine-patch android:src="@drawable/sesl_textfield_activated_alpha" android:tint="@color/sesl_edit_text_tint_color" />
<nine-patch android:src="@drawable/sesl4_textfield_activated_alpha" android:tint="@color/sesl_edit_text_tint_color" />
</item>
<item>
<nine-patch android:src="@drawable/sesl_textfield_default_alpha" android:tint="@color/sesl_edit_text_tint_color_unfocused" />
<nine-patch android:src="@drawable/sesl4_textfield_default_alpha" android:tint="@color/sesl_edit_text_tint_color_unfocused" />
</item>
</selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/sesl4_scrubber_control_off_disabled_alpha" android:state_enabled="false" />
<item
android:id="@id/pressed" android:drawable="@drawable/sesl_seekbar_thumb_pressed_to_unpressed" android:state_pressed="true" />
<item
android:id="@id/unpressed" android:drawable="@drawable/sesl4_seekbar_thumb_unpressed_to_pressed" />
<transition
android:toId="@id/pressed" android:fromId="@id/unpressed" android:drawable="@drawable/sesl4_seekbar_thumb_unpressed_to_pressed_anim" />
<transition
android:toId="@id/unpressed" android:fromId="@id/pressed" android:drawable="@drawable/sesl4_seekbar_thumb_pressed_to_unpressed_anim" />
</animated-selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22.0dip" android:height="22.0dip" android:viewportWidth="22.0" android:viewportHeight="22.0">
<group
android:scaleX="1.176" android:scaleY="1.176" android:translateX="11.0" android:translateY="11.0">
<path
android:fillColor="@color/sesl_seekbar_disable_color_activated"
android:pathData="M 0.0,-8.5 c 3.3137084988,0.0 8.5,2.6862915012 8.5,8.5 c 0.0,3.3137084988 -2.6862915012,8.5 -8.5,8.5 c -3.3137084988,0.0 -8.5,-2.6862915012 -8.5,-8.5 c 0.0,-3.3137084988 2.6862915012,-8.5 8.5,-8.5 Z" />
</group>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:gravity="fill_horizontal|center" android:id="@id/background" android:height="@dimen/sesl4_seekbar_track_height">
<nine-patch android:src="@drawable/sesl4_progress_bar" android:tint="@color/sesl4_seekbar_control_color_default" />
</item>
<item android:gravity="fill_horizontal|center" android:id="@id/secondaryProgress" android:height="@dimen/sesl4_seekbar_track_height">
<scale android:scaleWidth="100%">
<nine-patch android:src="@drawable/sesl4_progress_bar" android:tint="@color/control_color_normal" />
</scale>
</item>
<item android:gravity="fill_horizontal|center" android:id="@id/progress" android:height="@dimen/sesl4_seekbar_track_height">
<scale android:scaleWidth="100%">
<nine-patch android:src="@drawable/sesl4_progress_bar" android:tint="?colorPrimary" />
</scale>
</item>
</layer-list>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/sesl_seekbar_thumb_pressed_to_unpressed">
<target
android:name="thumb"
android:animation="@anim/sesl4_seekbar_thumb_pressed_to_unpressed_thumb_anim" />
</animated-vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:name="sesl_seekbar_thumb_unpressed_to_pressed" android:height="22.0dip" android:width="22.0dip" android:viewportWidth="22.0" android:viewportHeight="22.0" android:tint="?colorPrimary">
<group
android:name="thumb_0" android:scaleX="1.176" android:scaleY="1.176" android:translateX="11.0" android:translateY="11.0">
<path
android:name="thumb_path_0" android:fillColor="#ff000000" android:pathData="M 0.0,-8.5 c 3.3137084988,0.0 8.5,2.6862915012 8.5,8.5 c 0.0,3.3137084988 -2.6862915012,8.5 -8.5,8.5 c -3.3137084988,0.0 -8.5,-2.6862915012 -8.5,-8.5 c 0.0,-3.3137084988 2.6862915012,-8.5 8.5,-8.5 Z" />
</group>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/sesl4_seekbar_thumb_unpressed_to_pressed">
<target
android:name="thumb_0"
android:animation="@anim/sesl4_seekbar_thumb_unpressed_to_pressed_thumb_anim" />
</animated-vector>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<shape>
<corners android:radius="@dimen/progress_bar_radius" />
<size android:height="@dimen/progress_bar_height" />
<solid android:color="@color/progress_bar_background_color" />
<solid android:color="@color/sesl4_progress_control_color_normal" />
</shape>
</item>
<item android:id="@android:id/progress">
Expand Down
1 change: 1 addition & 0 deletions yanndroid/oneui/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

<!--Seekbar-->
<color name="sesl_seekbar_disable_color_activated">#ff545454</color>
<color name="sesl4_seekbar_overlap_color_activated">#ffff6021</color>
<color name="sesl_seekbar_overlap_color_default">#ff673724</color>


Expand Down
3 changes: 3 additions & 0 deletions yanndroid/oneui/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@
<!--Seekbar-->
<color name="sesl_seekbar_control_color_normal">@color/sesl_control_color_normal</color>
<color name="sesl_seekbar_control_color_default">@color/sesl_control_color_normal</color>
<color name="sesl4_seekbar_control_color_default">#66cacaca</color>
<color name="sesl_seekbar_control_color_secondary">#ff7ab9cb</color>
<color name="sesl_seekbar_disable_color_activated">#ffd2d2d2</color>
<color name="sesl_seekbar_overlap_color_activated">#ffff6021</color>
<color name="sesl4_seekbar_overlap_color_activated">#ffef5e16</color>
<color name="sesl_seekbar_overlap_color_default">#fffcb69b</color>
<color name="sesl4_seekbar_overlap_color_default">#66cacaca</color>


<!--Spinner-->
Expand Down
3 changes: 3 additions & 0 deletions yanndroid/oneui/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
<dimen name="sesl_text_size_title">20.0sp</dimen>
<dimen name="sesl_toolbar_title_text_size">19.0sp</dimen>
<dimen name="sesl_progress_bar_min_height">16.0dip</dimen>
<dimen name="sesl4_progress_bar_min_height">21.0dip</dimen>

<dimen name="sesl_seekbar_padding_horizontal">16.0dip</dimen>
<dimen name="sesl_seekbar_ripple_radius">16.0dip</dimen>
<dimen name="sesl_seekbar_thumb_radius">8.5dp</dimen>
<dimen name="sesl4_seekbar_thumb_radius">10.0dip</dimen>
<dimen name="sesl_seekbar_track_height">3.0dip</dimen>
<dimen name="sesl4_seekbar_track_height">4.0dip</dimen>
<dimen name="sesl_seekbar_track_height_expand">17.0dip</dimen>

<dimen name="spacing_vertical_small">16.0dip</dimen>
Expand Down
Loading