From 27a5f1dff264b9e3cfd1cb129932f1ba5f0b14ed Mon Sep 17 00:00:00 2001 From: Ramesh Kumar Date: Wed, 3 Jul 2019 17:26:20 -0700 Subject: [PATCH] Worked on the show tooltip in dialogfragment. Added example too. --- app/build.gradle | 13 +++++- .../com/viewtooltip/DialogFragmentInfo.kt | 41 +++++++++++++++++++ .../github/com/viewtooltip/MainActivity.java | 2 + app/src/main/res/layout/dialog_fragment.xml | 24 +++++++++++ build.gradle | 4 +- .../florent37/viewtooltip/ViewTooltip.java | 8 ++-- 6 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/florent37/github/com/viewtooltip/DialogFragmentInfo.kt create mode 100644 app/src/main/res/layout/dialog_fragment.xml diff --git a/app/build.gradle b/app/build.gradle index 41ed276..89501e9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-android' android { compileSdkVersion project.COMPILE_SDK @@ -15,6 +17,13 @@ android { dependencies { implementation 'androidx.appcompat:appcompat:1.0.2' - implementation 'com.github.florent37:viewtooltip:1.1.8' - //implementation project(path: ':viewtooltip') +// implementation 'com.github.florent37:viewtooltip:1.1.8' + implementation "androidx.core:core-ktx:+" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation project(path: ':viewtooltip') + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + +} +repositories { + mavenCentral() } diff --git a/app/src/main/java/florent37/github/com/viewtooltip/DialogFragmentInfo.kt b/app/src/main/java/florent37/github/com/viewtooltip/DialogFragmentInfo.kt new file mode 100644 index 0000000..7b54a1f --- /dev/null +++ b/app/src/main/java/florent37/github/com/viewtooltip/DialogFragmentInfo.kt @@ -0,0 +1,41 @@ +package florent37.github.com.viewtooltip + +import android.app.Dialog +import android.os.Bundle +import android.util.Log +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Button +import androidx.fragment.app.DialogFragment +import com.github.florent37.viewtooltip.ViewTooltip + +class DialogFragmentInfo : DialogFragment() { + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + val v = inflater.inflate(R.layout.dialog_fragment, container, false).also { + + + it.findViewById