Skip to content

Commit f9d48a7

Browse files
committed
gradle upgraded
The bug caused multiple arrow when text changed to multiline, fixed
1 parent 9fa3d71 commit f9d48a7

File tree

5 files changed

+31
-15
lines changed

5 files changed

+31
-15
lines changed

SmartSpinner/build.gradle

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@ apply plugin: 'com.android.library'
22
apply plugin: 'maven-publish'
33
apply plugin: 'signing'
44
android {
5-
compileSdkVersion 29
6-
buildToolsVersion "29.0.3"
7-
namespace 'ir.maktabsoft.smartspinner'
5+
compileSdkVersion 36
6+
namespace 'ir.smartdevelopers.smartspinner'
87
defaultConfig {
98
minSdkVersion 17
10-
targetSdkVersion 29
9+
targetSdkVersion 36
1110
versionCode 4
1211
versionName "1.4"
1312
setProperty("archivesBaseName","smart-spinner")
1413
consumerProguardFiles "consumer-rules.pro"
1514
}
16-
15+
publishing {
16+
singleVariant('release') {
17+
withSourcesJar()
18+
}
19+
}
1720
buildTypes {
1821
release {
1922
minifyEnabled false
@@ -90,7 +93,7 @@ afterEvaluate {
9093

9194

9295
group = 'ir.smartdevelopers'
93-
version = '1.4'
96+
version = '1.5'
9497

9598
signing {
9699
sign configurations.archives

SmartSpinner/src/main/java/ir/smartdevelopers/smartspinner/SmartSpinnerBackgroundDrawable.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
import android.graphics.Paint;
1111
import android.graphics.Path;
1212
import android.graphics.PixelFormat;
13+
import android.graphics.PorterDuff;
1314
import android.graphics.Rect;
1415
import android.graphics.drawable.Drawable;
15-
import android.util.Log;
1616
import android.util.TypedValue;
1717
import android.view.View;
1818

@@ -65,9 +65,9 @@ public SmartSpinnerBackgroundDrawable(Context context) {
6565
paddingTop=paddingBottom;
6666

6767
TypedValue typedValue=new TypedValue();
68-
context.getTheme().resolveAttribute(R.attr.colorControlActivated,typedValue,true);
68+
context.getTheme().resolveAttribute(androidx.appcompat.R.attr.colorControlActivated,typedValue,true);
6969
int defaultPressColor = typedValue.data;
70-
context.getTheme().resolveAttribute(R.attr.colorControlHighlight,typedValue,true);
70+
context.getTheme().resolveAttribute(androidx.appcompat.R.attr.colorControlHighlight,typedValue,true);
7171
int rippleColor = typedValue.data;
7272

7373
//<editor-fold desc="triangle">
@@ -238,21 +238,27 @@ public boolean getPadding(@NonNull Rect padding) {
238238
public ConstantState getConstantState() {
239239
return super.getConstantState();
240240
}
241-
241+
private float cTriangleY;
242+
// private float cTriangleX;
243+
private float startTriangleY;
244+
private float startTriangleX;
245+
private float cx;
242246
@Override
243247
public void draw(@NonNull Canvas canvas) {
248+
// canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.MULTIPLY);
249+
trianglePath.reset();
244250
Rect rect=getBounds();
245251
// Log.v("TTT",rect.toString());
246-
float cTriangleY=((rect.bottom)/2f);
247-
float cTriangleX=(triangleWith/2)+triangleMarginHorizontal;
248-
float startTriangleY=cTriangleY-triangleHeight/2;
249-
float startTriangleX=triangleMarginHorizontal;
252+
cTriangleY=((rect.bottom)/2f);
253+
// cTriangleX=(triangleWith/2)+triangleMarginHorizontal;
254+
startTriangleY=cTriangleY-triangleHeight/2;
255+
startTriangleX=triangleMarginHorizontal;
250256
/*if direction is ltr draw triangle from right side*/
251257
if (mDirection !=View.LAYOUT_DIRECTION_RTL){
252258
startTriangleX=rect.right - triangleMarginHorizontal - triangleWith;
253259

254260
}
255-
float cx=startTriangleX+triangleWith/2;
261+
cx=startTriangleX+triangleWith/2;
256262
canvas.drawCircle(cx, cTriangleY,rippleRadius,ripplePaint);
257263

258264
trianglePath.moveTo(startTriangleX,startTriangleY);

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
plugins {
22
alias(libs.plugins.android.application) apply false
3+
alias(libs.plugins.com.android.application) apply false
34
}

gradle/libs.versions.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ constraintlayout = "2.2.1"
66
androidxcore = "1.17.0"
77
junit = "4.13.2"
88
junitVersion = "1.3.0"
9+
espressoCore = "3.7.0"
10+
activity = "1.11.0"
911

1012
[libraries]
1113
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
@@ -14,6 +16,9 @@ constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayo
1416
androidxcore = { group = "androidx.core", name = "core", version.ref = "androidxcore" }
1517
junit = { group = "junit", name = "junit", version.ref = "junit" }
1618
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
19+
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
20+
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
1721

1822
[plugins]
1923
android-application = { id = "com.android.library", version.ref = "agp" }
24+
com-android-application = { id = "com.android.application", version.ref = "agp" }

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ dependencyResolutionManagement {
2424
include ':SmartSpinner'
2525
include ':app'
2626
rootProject.name = "SmartSpinnerProject"
27+
include ':app:myapplication'

0 commit comments

Comments
 (0)