Skip to content

Commit

Permalink
Double Click Listener
Browse files Browse the repository at this point in the history
  • Loading branch information
JayantGoel001 committed Jul 30, 2020
1 parent 387ac6b commit dc09b19
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.example.doubleclicklistner

import android.view.View

class DoubleClickListener(private val callback: setOnDoubleClickListener, private val doubleClickTimeLimit:Long=1000) :
class DoubleClickListener(private val callback: Callback,private val doubleClickTimeLimit:Long=1000) :
View.OnClickListener {
private var lastClicked:Long = -1L
override fun onClick(v: View?) {
Expand All @@ -26,11 +26,10 @@ class DoubleClickListener(private val callback: setOnDoubleClickListener, privat
private fun isDoubleClicked():Boolean{
return getTimeDifference(lastClicked,System.currentTimeMillis())<=doubleClickTimeLimit
}
interface setOnDoubleClickListener{
interface Callback{
fun doubleClicked()
}




}

0 comments on commit dc09b19

Please sign in to comment.