Skip to content

Commit

Permalink
- fix sample code for new method
Browse files Browse the repository at this point in the history
  • Loading branch information
Rifqi Fardi committed Jan 30, 2018
1 parent e61ca18 commit 827bc01
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
20 changes: 15 additions & 5 deletions sample/src/main/java/com/jboxx/bottomsheetdialog/JavaActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand All @@ -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()
}

Expand Down

0 comments on commit 827bc01

Please sign in to comment.