diff --git a/sample/src/main/java/com/jboxx/bottomsheetdialog/JavaActivity.java b/sample/src/main/java/com/jboxx/bottomsheetdialog/JavaActivity.java index 886f957..6f66388 100644 --- a/sample/src/main/java/com/jboxx/bottomsheetdialog/JavaActivity.java +++ b/sample/src/main/java/com/jboxx/bottomsheetdialog/JavaActivity.java @@ -33,12 +33,16 @@ public void onClick(View view) { new ShareBottomSheetDialog.Builder(getSupportFragmentManager()) .setCancelable(true) .isFullScreen(true) - .setMessage("Share this link!") + .setMessage(new ShareBottomSheetDialogInterface.OnCustomMessage() { + @Override + public String onChooseApps(ResolveInfo resolveInfo) { + return "Share this link!"; + } + }) .setUrl("https://www.youtube.com/watch?v=2ThFJODUZ_4") - .setUtm("A.O.V", UTMConstants.UTM_TERM) - .setUtm("video-miwon", UTMConstants.UTM_CAMPAIGN) - .addUtmSource(true) - .customUtmSource(new ShareBottomSheetDialogInterface.OnCustomUtmSource() { + .addParameter(UTMConstants.UTM_TERM, "A.O.V") + .addParameter(UTMConstants.UTM_CAMPAIGN, "video-miwon") + .addParameterWithCallback(UTMConstants.UTM_SOURCE, new ShareBottomSheetDialogInterface.OnCustomUtmSource() { @Override public String onChooseApps(ResolveInfo resolveInfo) { String utmSource = ""; @@ -68,6 +72,12 @@ public String onChooseApps(ResolveInfo resolveInfo) { return utmSource; } }) + .addParameterWithCallback(UTMConstants.UTM_CONTENT, new ShareBottomSheetDialogInterface.OnCustomUtmSource() { + @Override + public String onChooseApps(ResolveInfo resolveInfo) { + return "video"; + } + }) .show(); } }); diff --git a/sample/src/main/java/com/jboxx/bottomsheetdialog/MainActivity.kt b/sample/src/main/java/com/jboxx/bottomsheetdialog/MainActivity.kt index c561dfa..dea722b 100644 --- a/sample/src/main/java/com/jboxx/bottomsheetdialog/MainActivity.kt +++ b/sample/src/main/java/com/jboxx/bottomsheetdialog/MainActivity.kt @@ -4,6 +4,7 @@ import android.support.v7.app.AppCompatActivity import android.os.Bundle import android.widget.Button import com.jboxx.sharebottomsheetdialog.ShareBottomSheetDialog +import com.jboxx.sharebottomsheetdialog.ShareBottomSheetDialogInterface import com.jboxx.sharebottomsheetdialog.UTMConstants /** @@ -23,16 +24,14 @@ class MainActivity : AppCompatActivity() { ShareBottomSheetDialog.Builder(supportFragmentManager) .setCancelable(true) .setUrl("https://www.youtube.com/watch?v=QBGaO89cBMI&") - .addUtmSource(false) - .customUtmSource { return@customUtmSource "everywhere" } + .addParameterWithCallback(UTMConstants.UTM_SOURCE, ShareBottomSheetDialogInterface.OnCustomUtmSource { resolveInfo -> "everywhere" }) .show() } shareButton2.setOnClickListener { val shareBottomSheet = ShareBottomSheetDialog.Builder(supportFragmentManager) shareBottomSheet.setUrl("https://code.tutsplus.com/articles/coding-functional-android-apps-in-kotlin-lambdas-null-safety-more--cms-27964") - shareBottomSheet.setUtm("carousel", UTMConstants.UTM_CONTENT) - shareBottomSheet.addUtmSource(true) + shareBottomSheet.addParameter(UTMConstants.UTM_CONTENT,"carousel") shareBottomSheet.show() }