Skip to content

Commit f4b9e03

Browse files
Merge pull request #22 from hamzaahmedkhan/develop
Migrate to AndroidX, Codacy workflow modified
2 parents 4a2a25c + 6f3c6a7 commit f4b9e03

File tree

13 files changed

+46
-42
lines changed

13 files changed

+46
-42
lines changed

.github/workflows/codacy-analysis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ name: Codacy Security Scan
1010

1111
on:
1212
push:
13-
branches: [ "master", "main" ]
13+
branches: [ "master", "main", "develop" ]
1414
pull_request:
15-
branches: [ "master", "main" ]
15+
branches: [ "master", "main", "develop" ]
1616

1717
jobs:
1818
codacy-security-scan:
@@ -37,8 +37,8 @@ jobs:
3737
# This will handover control about PR rejection to the GitHub side
3838
max-allowed-issues: 2147483647
3939

40-
# Upload the SARIF file generated in the previous step
41-
- name: Upload SARIF results file
42-
uses: github/codeql-action/upload-sarif@v1
43-
with:
44-
sarif_file: results.sarif
40+
# # Upload the SARIF file generated in the previous step
41+
# - name: Upload SARIF results file
42+
# uses: github/codeql-action/upload-sarif@v1
43+
# with:
44+
# sarif_file: results.sarif

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
targetSdkVersion 28
1313
versionCode 1
1414
versionName "1.2.1"
15-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
}
1717
buildTypes {
1818
release {
@@ -39,11 +39,11 @@ android {
3939
dependencies {
4040
implementation fileTree(dir: 'libs', include: ['*.jar'])
4141
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
42-
implementation 'com.android.support:appcompat-v7:28.0.0'
43-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
42+
implementation 'androidx.appcompat:appcompat:1.0.0'
43+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
4444
testImplementation 'junit:junit:4.12'
45-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
46-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
45+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
46+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
4747
implementation project(path: ':spinnerdialog')
4848

4949
// implementation 'com.github.hamzaahmedkhan:SpinnerDialog:v1.2.0'

app/src/androidTest/java/com/github/hamzaahmedkhan/ExampleInstrumentedTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.github.hamzaahmedkhan
22

3-
import android.support.test.InstrumentationRegistry
4-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
55

66
import org.junit.Test
77
import org.junit.runner.RunWith

app/src/main/java/com/github/hamzaahmedkhan/MainActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.github.hamzaahmedkhan
22

3-
import android.support.v7.app.AppCompatActivity
3+
import androidx.appcompat.app.AppCompatActivity
44
import android.os.Bundle
55
import android.view.ViewGroup
66
import android.widget.Toast
@@ -77,15 +77,15 @@ class MainActivity : AppCompatActivity() {
7777
spinnerSingleSelectDialogFragment.buttonText = "DONE"
7878
spinnerSingleSelectDialogFragment.themeColorResId = resources.getColor(R.color.material_pink500)
7979
spinnerSingleSelectDialogFragment.showSearchBar = true
80-
spinnerSingleSelectDialogFragment.searchbarHint = "type here to search.."
80+
spinnerSingleSelectDialogFragment.searchbarHint = "Type here to search.."
8181
spinnerSingleSelectDialogFragment.setDialogHeight(ViewGroup.LayoutParams.MATCH_PARENT)
8282

8383

8484
// Using optional features for multi select dialog
8585
spinnerMultiSelectDialogFragment.buttonText = "DONE"
8686
spinnerMultiSelectDialogFragment.themeColorResId = resources.getColor(R.color.material_pink500)
8787
spinnerMultiSelectDialogFragment.showSearchBar = true
88-
spinnerMultiSelectDialogFragment.searchbarHint = "type here to search.."
88+
spinnerMultiSelectDialogFragment.searchbarHint = "Type here to search.."
8989
spinnerSingleSelectDialogFragment.setDialogHeight(500.dp)
9090

9191

app/src/main/res/layout/activity_main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<android.support.constraint.ConstraintLayout
2+
<androidx.constraintlayout.widget.ConstraintLayout
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
55
xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -40,4 +40,4 @@
4040
app:layout_constraintRight_toRightOf="parent" android:layout_marginTop="8dp"
4141
app:layout_constraintTop_toBottomOf="@+id/txtShowSingleChoiceSpinner"/>
4242

43-
</android.support.constraint.ConstraintLayout>
43+
</androidx.constraintlayout.widget.ConstraintLayout>

demo/SpinnerDialog.zip

450 KB
Binary file not shown.

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ org.gradle.jvmargs=-Xmx1536m
1313
# org.gradle.parallel=true
1414
# Kotlin code style for this project: "official" or "obsolete":
1515
kotlin.code.style=official
16+
android.useAndroidX=true
17+
android.enableJetifier=true

spinnerdialog/build.gradle

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
versionCode 2
1313
versionName "1.2.2"
1414

15-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616

1717
}
1818

@@ -31,14 +31,12 @@ android {
3131

3232
dependencies {
3333
implementation fileTree(dir: 'libs', include: ['*.jar'])
34+
implementation 'androidx.appcompat:appcompat:1.0.0'
3435

35-
implementation 'com.android.support:appcompat-v7:28.0.0'
3636
testImplementation 'junit:junit:4.12'
37-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
38-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
39-
implementation 'com.android.support:recyclerview-v7:28.0.0'
40-
implementation 'com.jcminarro:RoundKornerLayouts:0.3.1'
41-
implementation 'com.jakewharton:butterknife:8.5.1'
42-
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
37+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
38+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
39+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
40+
implementation 'com.jcminarro:RoundKornerLayouts:0.4.0'
4341
testImplementation 'junit:junit:4.12'
4442
}

spinnerdialog/src/androidTest/java/com/github/hamzaahmedkhan/spinnerdialog/ExampleInstrumentedTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.github.hamzaahmedkhan.spinnerdialog
22

3-
import android.support.test.InstrumentationRegistry
4-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
55
import org.junit.Assert
66
import org.junit.Test
77
import org.junit.runner.RunWith

spinnerdialog/src/main/java/com/github/hamzaahmedkhan/spinnerdialog/ui/SpinnerDialogFragment.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.github.hamzaahmedkhan.spinnerdialog.ui
22

33
import android.os.Bundle
4-
import android.support.v4.app.DialogFragment
5-
import android.support.v7.widget.DefaultItemAnimator
6-
import android.support.v7.widget.LinearLayoutManager
4+
import androidx.fragment.app.DialogFragment
5+
import androidx.recyclerview.widget.DefaultItemAnimator
6+
import androidx.recyclerview.widget.LinearLayoutManager
77
import android.text.Editable
88
import android.text.TextWatcher
99
import android.view.LayoutInflater
@@ -25,7 +25,7 @@ import kotlin.collections.ArrayList
2525
* Created by khanhamza on 21-Feb-17.
2626
*/
2727

28-
class SpinnerDialogFragment : DialogFragment(),
28+
class SpinnerDialogFragment : androidx.fragment.app.DialogFragment(),
2929
OnSpinnerItemClickListener, View.OnClickListener, OnSpinnerItemCheckboxClickListener {
3030

3131
private var singleSelectAdapter: SpinnerDialogSingleSelectAdapter? = null
@@ -134,9 +134,13 @@ class SpinnerDialogFragment : DialogFragment(),
134134
}
135135

136136
private fun bindView() {
137-
val mLayoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
137+
val mLayoutManager = androidx.recyclerview.widget.LinearLayoutManager(
138+
context,
139+
androidx.recyclerview.widget.LinearLayoutManager.VERTICAL,
140+
false
141+
)
138142
recyclerView.layoutManager = mLayoutManager
139-
(recyclerView.itemAnimator as DefaultItemAnimator).supportsChangeAnimations = false
143+
(recyclerView.itemAnimator as androidx.recyclerview.widget.DefaultItemAnimator).supportsChangeAnimations = false
140144
val resId =
141145
R.anim.layout_animation_fall_bottom
142146
val animation = AnimationUtils.loadLayoutAnimation(context, resId)

spinnerdialog/src/main/java/com/github/hamzaahmedkhan/spinnerdialog/ui/multi/SpinnerDialogMultiSelectAdapter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.github.hamzaahmedkhan.spinnerdialog.ui.multi
22

33
import android.app.Activity
44
import android.content.Context
5-
import android.support.v7.widget.RecyclerView
5+
import androidx.recyclerview.widget.RecyclerView
66
import android.view.LayoutInflater
77
import android.view.View
88
import android.view.ViewGroup
@@ -20,7 +20,7 @@ class SpinnerDialogMultiSelectAdapter(
2020
private val context: Context,
2121
var arrData: ArrayList<SpinnerModel>,
2222
private val onItemClick: OnSpinnerItemCheckboxClickListener
23-
) : RecyclerView.Adapter<SpinnerDialogMultiSelectAdapter.ViewHolder>() {
23+
) : androidx.recyclerview.widget.RecyclerView.Adapter<SpinnerDialogMultiSelectAdapter.ViewHolder>() {
2424
override fun onCreateViewHolder(
2525
parent: ViewGroup,
2626
viewType: Int
@@ -63,7 +63,7 @@ class SpinnerDialogMultiSelectAdapter(
6363
return arrData.size
6464
}
6565

66-
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
66+
class ViewHolder(view: View) : androidx.recyclerview.widget.RecyclerView.ViewHolder(view) {
6767
var checkbox: CheckBox
6868
var txtChoice: TextView
6969
var contParentLayout: LinearLayout

spinnerdialog/src/main/java/com/github/hamzaahmedkhan/spinnerdialog/ui/single/SpinnerDialogSingleSelectAdapter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.github.hamzaahmedkhan.spinnerdialog.ui.single
22

33
import android.app.Activity
44
import android.content.Context
5-
import android.support.v7.widget.RecyclerView
5+
import androidx.recyclerview.widget.RecyclerView
66
import android.view.LayoutInflater
77
import android.view.View
88
import android.view.ViewGroup
@@ -21,7 +21,7 @@ class SpinnerDialogSingleSelectAdapter(
2121
private val context: Context,
2222
var arrData: ArrayList<SpinnerModel>,
2323
private val onItemClick: OnSpinnerItemClickListener
24-
) : RecyclerView.Adapter<SpinnerDialogSingleSelectAdapter.ViewHolder>() {
24+
) : androidx.recyclerview.widget.RecyclerView.Adapter<SpinnerDialogSingleSelectAdapter.ViewHolder>() {
2525
override fun onCreateViewHolder(
2626
parent: ViewGroup,
2727
viewType: Int
@@ -60,7 +60,7 @@ class SpinnerDialogSingleSelectAdapter(
6060
}
6161

6262
class ViewHolder(itemView: View) :
63-
RecyclerView.ViewHolder(itemView) {
63+
androidx.recyclerview.widget.RecyclerView.ViewHolder(itemView) {
6464
var radioButton: RadioButton
6565
var txtChoice: TextView
6666
var contParentLayout: LinearLayout

spinnerdialog/src/main/res/layout/fragment_spinner_popup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</LinearLayout>
6969

7070

71-
<android.support.v7.widget.RecyclerView
71+
<androidx.recyclerview.widget.RecyclerView
7272
android:id="@+id/recyclerView"
7373
android:layout_width="match_parent"
7474
android:layout_height="0dp"

0 commit comments

Comments
 (0)