Skip to content

Commit

Permalink
Updating build scripts, and fixing build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kpmmmurphy committed Jan 28, 2021
1 parent 9f3ce09 commit bbd155b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.tapadoo.alerter.Alerter
import kotlinx.android.synthetic.main.layout_modal_bottom_sheet.btnAlertColoured
Expand All @@ -14,35 +13,24 @@ import kotlinx.android.synthetic.main.layout_modal_bottom_sheet.btnAlertDefault

class CustomBottomSheetDialogFragment : BottomSheetDialogFragment() {

var appCompatDialog: AppCompatDialog? = null

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.layout_modal_bottom_sheet, container, false)
}

override fun setupDialog(dialog: Dialog, style: Int) {
super.setupDialog(dialog, style)
if (dialog is AppCompatDialog) {

// If the dialog is an AppCompatDialog, we'll handle it
appCompatDialog = dialog
}
}

override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)

btnAlertDefault.setOnClickListener {
//handle click event
showAlertDefault(appCompatDialog)
showAlertDefault(dialog)
}
btnAlertColoured.setOnClickListener {
//handle click event
showAlertColoured(appCompatDialog)
showAlertColoured(dialog)
}
btnAlertCustomIcon.setOnClickListener {
//handle click event
showAlertWithIcon(appCompatDialog)
showAlertWithIcon(dialog)
}
}

Expand Down Expand Up @@ -76,12 +64,4 @@ class CustomBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
}

override fun onDestroy() {
appCompatDialog = null
super.onDestroy()
}

companion object {
const val TAG = "CustomBottomSheetDialogFragment"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class KotlinDemoActivity : AppCompatActivity() {

btnBottomSheetModal.setOnClickListener {
CustomBottomSheetDialogFragment().apply {
show(supportFragmentManager, CustomBottomSheetDialogFragment.TAG)
show(supportFragmentManager, CustomBottomSheetDialogFragment::class.java.canonicalName)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext {
compileSdkVersion = 29
compileSdkVersion = 30
minSdkVersion = 14
targetSdkVersion = 29
targetSdkVersion = 30

kotlin_version = '1.3.50'
kotlin_version = '1.4.21'

buildToolsVersion = '29.0.2'
buildToolsVersion = '30.0.3'

sourceCompatibilityVersion = JavaVersion.VERSION_1_8
targetCompatibilityVersion = JavaVersion.VERSION_1_8
Expand All @@ -23,7 +23,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Sep 18 09:18:06 IST 2019
#Thu Jan 28 11:18:06 GMT 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
30 changes: 0 additions & 30 deletions quality.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//noinspection GrPackage
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'pmd'

final String QUALITY_DIR = "quality"
Expand Down Expand Up @@ -40,35 +39,6 @@ task checkstyle(type: Checkstyle) {
classpath = files()
}

/*
* Find Bugs - a program which uses static analysis to look for bugs in Java code.
*/
task findbugs(type: FindBugs) {
ignoreFailures = false
effort = "max"
reportLevel = "high"
excludeFilter = new File("${project.rootDir}/${QUALITY_DIR}/findbugs/findbugs-filter.xml")
classes = files("${project.buildDir}/intermediates/classes")

source SOURCE
include INCLUDE_JAVA
exclude EXCLUDE_GENERATED

reports {
xml.enabled = false
html.enabled = true

xml {
destination new File("$project.buildDir/reports/findbugs/findbugs.xml")
}
html {
destination new File("$project.buildDir/reports/findbugs/findbugs.html")
}
}

classpath = files()
}

/*
* Programming Mistake Detector - a source code analyzer. It finds common programming flaws.
*/
Expand Down

0 comments on commit bbd155b

Please sign in to comment.