Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Update dpes.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaobozhen committed Aug 12, 2023
1 parent 5158dc1 commit e944db4
Show file tree
Hide file tree
Showing 40 changed files with 1,958 additions and 32 deletions.
43 changes: 22 additions & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ plugins {
id("com.android.application")
kotlin("android")
id("com.google.devtools.ksp")
id("com.ke.gson.plugin")
id("kotlin-parcelize")
id("sdk-editor")
id("dev.rikka.tools.materialthemebuilder")
}

val verName = "2.5.4"
val verCode = 2050400

android {
compileSdk = 33
compileSdk = 34
ndkVersion = "25.0.8775105"

defaultConfig {
Expand All @@ -40,6 +38,8 @@ android {
}

buildFeatures {
aidl = true
buildConfig = true
viewBinding = true
}

Expand Down Expand Up @@ -68,8 +68,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

androidComponents.onVariants { v ->
Expand All @@ -89,7 +89,7 @@ android {
}
}

packagingOptions {
packaging {
resources {
excludes += "META-INF/**"
excludes += "okhttp3/**"
Expand Down Expand Up @@ -118,7 +118,7 @@ repositories {
mavenCentral()
}

val optimizeReleaseRes = task("optimizeReleaseRes").doLast {
val optimizeReleaseRes: Task = task("optimizeReleaseRes").doLast {
val aapt2 = File(
androidComponents.sdkComponents.sdkDirectory.get().asFile,
"build-tools/${project.android.buildToolsVersion}/aapt2"
Expand Down Expand Up @@ -147,7 +147,7 @@ val optimizeReleaseRes = task("optimizeReleaseRes").doLast {
}
}

tasks.whenTaskAdded {
tasks.configureEach {
if (name == "optimizeReleaseResources") {
finalizedBy(optimizeReleaseRes)
}
Expand All @@ -162,10 +162,10 @@ configurations.all {
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))

implementation(files("libs/color-picker.aar"))
implementation(project(":color-picker"))
implementation(files("libs/IceBox-SDK-1.0.6.aar"))

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")

implementation("com.github.zhaobozhen.libraries:me:1.1.4")
implementation("com.github.zhaobozhen.libraries:utils:1.1.4")
Expand All @@ -186,20 +186,20 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-common-java8:${lifecycleVersion}")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:${lifecycleVersion}")

implementation("androidx.browser:browser:1.5.0")
implementation("androidx.browser:browser:1.6.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0")
implementation("androidx.viewpager2:viewpager2:1.1.0-beta01")
implementation("androidx.recyclerview:recyclerview:1.3.0")
implementation("androidx.viewpager2:viewpager2:1.1.0-beta02")
implementation("androidx.recyclerview:recyclerview:1.3.1")
implementation("androidx.drawerlayout:drawerlayout:1.2.0")

//KTX
implementation("androidx.collection:collection-ktx:1.2.0")
implementation("androidx.activity:activity-ktx:1.7.2")
implementation("androidx.fragment:fragment-ktx:1.6.0")
implementation("androidx.fragment:fragment-ktx:1.6.1")
implementation("androidx.palette:palette-ktx:1.0.0")
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.preference:preference-ktx:1.2.1")

//Google
implementation("com.google.android.material:material:1.9.0")
Expand All @@ -209,23 +209,24 @@ dependencies {
ksp("com.github.bumptech.glide:compiler:4.15.1")

implementation("com.google.code.gson:gson:2.9.0")
implementation("com.google.zxing:core:3.5.1")
implementation("com.google.zxing:core:3.5.2")
implementation("com.blankj:utilcodex:1.31.1")
implementation("com.tencent:mmkv-static:1.3.0")
implementation("com.tencent:mmkv-static:1.3.1")
implementation("com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.11")
implementation("com.github.heruoxin.Delegated-Scopes-Manager:client:master-SNAPSHOT")
implementation("com.github.topjohnwu.libsu:core:5.1.0")
implementation("com.github.topjohnwu.libsu:core:5.2.0")
implementation("com.github.thegrizzlylabs:sardine-android:0.8")
implementation("com.jonathanfinerty.once:once:1.3.1")
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:4.3")
implementation("com.jakewharton.timber:timber:5.0.1")

//UX
implementation("com.drakeet.about:about:2.5.2")
implementation("com.drakeet.multitype:multitype:4.3.0")
implementation("com.drakeet.drawer:drawer:1.0.3")
implementation("com.github.sephiroth74:android-target-tooltip:2.0.4")
implementation("com.leinardi.android:speed-dial:3.3.0")
implementation("me.zhanghai.android.fastscroll:library:1.2.0")
implementation("me.zhanghai.android.fastscroll:library:1.3.0")

val shizukuVersion = "12.2.0"
// required by Shizuku and Sui
Expand All @@ -236,7 +237,7 @@ dependencies {
implementation("dev.rikka.rikkax.appcompat:appcompat:1.6.1")
implementation("dev.rikka.rikkax.core:core:1.4.1")
implementation("dev.rikka.rikkax.material:material:2.7.0")
implementation("dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.3.1")
implementation("dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.3.2")
implementation("dev.rikka.rikkax.widget:borderview:1.1.0")
implementation("dev.rikka.rikkax.preference:simplemenu-preference:1.0.3")
implementation("dev.rikka.rikkax.insets:insets:1.3.0")
Expand All @@ -247,7 +248,7 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
implementation("com.squareup.okio:okio:3.3.0")
implementation("com.squareup.okio:okio:3.5.0")

//Rx
implementation("io.reactivex.rxjava2:rxandroid:2.1.1")
Expand Down
Binary file removed app/libs/color-picker.aar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.absinthe.anywhere_.adapter.applist

import android.graphics.Color
import android.view.View
import androidx.core.content.ContextCompat
import com.absinthe.anywhere_.R
import com.absinthe.anywhere_.constants.Const
Expand Down Expand Up @@ -88,7 +89,7 @@ class AppListAdapter(mode: Int) :
fun onClick(bean: AppListBean, which: Int)
}

override fun getPopupText(position: Int): String {
override fun getPopupText(view: View, position: Int): CharSequence {
return data[position].appName.ifEmpty { " " }.first().toString()
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.absinthe.anywhere_.adapter.cloud

import android.view.View
import com.absinthe.anywhere_.R
import com.absinthe.anywhere_.model.cloud.RuleEntity
import com.chad.library.adapter.base.BaseQuickAdapter
Expand All @@ -15,7 +16,7 @@ class CloudRulesAdapter :
holder.setText(R.id.tv_contributor, item.contributor)
}

override fun getPopupText(position: Int): String {
override fun getPopupText(view: View, position: Int): CharSequence {
return data[position].name.ifEmpty { " " }.first().toString()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.absinthe.anywhere_.utils.handler.URLSchemeHandler
import com.absinthe.anywhere_.utils.manager.DialogManager.showDebugDialog
import com.absinthe.anywhere_.utils.manager.URLManager
import com.absinthe.libraries.me.Absinthe
import com.absinthe.libraries.utils.utils.UiUtils
import com.blankj.utilcode.util.AppUtils
import com.drakeet.about.*
import com.drakeet.about.provided.GlideImageLoader
Expand Down Expand Up @@ -292,6 +293,7 @@ class AboutActivity : AbsAboutActivity() {

private fun initView() {
findViewById<Toolbar>(R.id.toolbar)?.background = null
UiUtils.setSystemBarStyle(window)
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
import com.flask.colorpicker.renderer.ColorWheelRenderer;
import com.flask.colorpicker.slider.AlphaSlider;
import com.flask.colorpicker.slider.LightnessSlider;
import com.iwhys.sdkeditor.domain.ReplaceClass;

@ReplaceClass("colorpicker:0.0.15")
public class ColorPickerDialogBuilder {
private final AnywhereDialogBuilder builder;
private final LinearLayout pickerContainer;
Expand Down
9 changes: 4 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ buildscript {
maven("https://jitpack.io")
}
dependencies {
classpath("com.android.tools.build:gradle:7.4.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22")
classpath("com.google.devtools.ksp:symbol-processing-gradle-plugin:1.8.22-1.0.11")
classpath("com.github.iwhys:sdk-editor-plugin:1.1.7")
classpath("com.github.LianjiaTech:gson-plugin:2.1.0")
classpath("com.android.tools.build:gradle:8.1.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
classpath("com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.0-1.0.13")
classpath("dev.rikka.tools.materialthemebuilder:gradle-plugin:1.4.0")
}
}
Expand All @@ -20,6 +18,7 @@ allprojects {
repositories {
google()
maven("https://jitpack.io")
mavenCentral()
}
}

Expand Down
1 change: 1 addition & 0 deletions color-picker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
24 changes: 24 additions & 0 deletions color-picker/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: 'com.android.library'

android {
compileSdk 34

defaultConfig {
namespace "com.flask.colorpicker"
minSdkVersion 23
targetSdkVersion 33
versionCode 18
versionName "0.0.16"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'androidx.appcompat:appcompat:1.1.0'
}
17 changes: 17 additions & 0 deletions color-picker/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/flask/Documents/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
54 changes: 54 additions & 0 deletions color-picker/src/main/java/com/flask/colorpicker/ColorCircle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.flask.colorpicker;

import android.graphics.Color;

public class ColorCircle {
private float x, y;
private float[] hsv = new float[3];
private float[] hsvClone;
private int color;

public ColorCircle(float x, float y, float[] hsv) {
set(x, y, hsv);
}

public double sqDist(float x, float y) {
double dx = this.x - x;
double dy = this.y - y;
return dx * dx + dy * dy;
}

public float getX() {
return x;
}

public float getY() {
return y;
}

public float[] getHsv() {
return hsv;
}

public float[] getHsvWithLightness(float lightness) {
if (hsvClone == null)
hsvClone = hsv.clone();
hsvClone[0] = hsv[0];
hsvClone[1] = hsv[1];
hsvClone[2] = lightness;
return hsvClone;
}

public void set(float x, float y, float[] hsv) {
this.x = x;
this.y = y;
this.hsv[0] = hsv[0];
this.hsv[1] = hsv[1];
this.hsv[2] = hsv[2];
this.color = Color.HSVToColor(this.hsv);
}

public int getColor() {
return color;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.flask.colorpicker;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;

import com.flask.colorpicker.builder.PaintBuilder;

public class ColorCircleDrawable extends ColorDrawable {
private float strokeWidth;
private Paint strokePaint = PaintBuilder.newPaint().style(Paint.Style.STROKE).stroke(strokeWidth).color(0xff9e9e9e).build();
private Paint fillPaint = PaintBuilder.newPaint().style(Paint.Style.FILL).color(0).build();
private Paint fillBackPaint = PaintBuilder.newPaint().shader(PaintBuilder.createAlphaPatternShader(26)).build();

public ColorCircleDrawable(int color) {
super(color);
}

@Override
public void draw(Canvas canvas) {
canvas.drawColor(0);

int width = canvas.getWidth();
float radius = width / 2f;
strokeWidth = radius / 8f;

this.strokePaint.setStrokeWidth(strokeWidth);
this.fillPaint.setColor(getColor());
canvas.drawCircle(radius, radius, radius - strokeWidth, fillBackPaint);
canvas.drawCircle(radius, radius, radius - strokeWidth, fillPaint);
canvas.drawCircle(radius, radius, radius - strokeWidth, strokePaint);
}

@Override
public void setColor(int color) {
super.setColor(color);
invalidateSelf();
}
}
Loading

0 comments on commit e944db4

Please sign in to comment.