This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbf79b2
commit 21d9dbe
Showing
5 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
import com.franmontiel.attributionpresenter.entities.Attribution; | ||
import com.franmontiel.attributionpresenter.entities.Library; | ||
import com.franmontiel.attributionpresenter.entities.License; | ||
import com.webianks.easy_feedback.EasyFeedback; | ||
|
||
/** | ||
* Created by Gokul Swaminathan on 2/22/2018. | ||
|
@@ -36,7 +37,9 @@ protected MaterialAboutList getMaterialAboutList(@NonNull Context context) { | |
buildAuthor(authorBuilder, context); | ||
MaterialAboutCard.Builder openBuilder = new MaterialAboutCard.Builder(); | ||
buildOpenLicenses(openBuilder, context); | ||
return new MaterialAboutList(appBuilder.build(), authorBuilder.build(), openBuilder.build()); | ||
MaterialAboutCard.Builder rateBuilder = new MaterialAboutCard.Builder(); | ||
buildRateAndReview(rateBuilder, context); | ||
return new MaterialAboutList(appBuilder.build(), authorBuilder.build(), openBuilder.build(), rateBuilder.build()); | ||
|
||
} | ||
|
||
|
@@ -137,6 +140,7 @@ public void onClick() { | |
.build()); | ||
appBuilder.addItem(new MaterialAboutActionItem.Builder() | ||
.text(R.string.open_license) | ||
.subText(R.string.open_license_desc) | ||
.icon(R.drawable.document_icon) | ||
.setOnClickAction(new MaterialAboutItemOnClickAction() { | ||
@Override | ||
|
@@ -158,6 +162,39 @@ public void onClick() { | |
.build()); | ||
} | ||
|
||
private void buildRateAndReview(MaterialAboutCard.Builder appBuilder, final Context context){ | ||
appBuilder.title(R.string.rateReview_title); | ||
appBuilder.addItem(new MaterialAboutActionItem.Builder() | ||
.text(R.string.rate) | ||
.icon(R.drawable.star) | ||
.setOnClickAction(new MaterialAboutItemOnClickAction() { | ||
@Override | ||
public void onClick() { | ||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=com.gsnathan.pdfviewer"))); | ||
} | ||
}) | ||
.build()); | ||
appBuilder.addItem(new MaterialAboutActionItem.Builder() | ||
.text(R.string.review) | ||
.icon(R.drawable.message_draw) | ||
.setOnClickAction(new MaterialAboutItemOnClickAction() { | ||
@Override | ||
public void onClick() { | ||
showReviewPage(); | ||
} | ||
}) | ||
.build()); | ||
} | ||
|
||
private void showReviewPage() | ||
{ | ||
new EasyFeedback.Builder(this) | ||
.withEmail("[email protected]") | ||
.withSystemInfo() | ||
.build() | ||
.start(); | ||
} | ||
|
||
private void showLibs() | ||
{ | ||
AttributionPresenter attributionPresenter = new AttributionPresenter.Builder(this) | ||
|
@@ -192,39 +229,46 @@ private void showLibs() | |
) | ||
.addAttributions( | ||
new Attribution.Builder("material-intro") | ||
.addCopyrightNotice("Copyright (c) 2017 Jan Heinrich Reimer") | ||
.addCopyrightNotice("Copyright 2017 Jan Heinrich Reimer") | ||
.addLicense(License.MIT) | ||
.setWebsite("https://github.com/heinrichreimer/material-intro") | ||
.build() | ||
) | ||
.addAttributions( | ||
new Attribution.Builder("Android Open Source Project") | ||
.addCopyrightNotice("Copyright (c) 2016 The Android Open Source Project") | ||
.addCopyrightNotice("Copyright 2016 The Android Open Source Project") | ||
.addLicense(License.APACHE) | ||
.setWebsite("http://developer.android.com/tools/support-library/index.html") | ||
.build() | ||
) | ||
.addAttributions( | ||
new Attribution.Builder("Android Support Libraries") | ||
.addCopyrightNotice("Copyright (c) 2016 The Android Open Source Project") | ||
.addCopyrightNotice("Copyright 2016 The Android Open Source Project") | ||
.addLicense(License.APACHE) | ||
.setWebsite("http://developer.android.com/tools/support-library/index.html") | ||
.build() | ||
) | ||
.addAttributions( | ||
new Attribution.Builder("HtmlTextView for Android") | ||
.addCopyrightNotice("Copyright (c) 2013 Dominik Schürmann") | ||
.addCopyrightNotice("Copyright 2013 Dominik Schürmann") | ||
.addLicense(License.APACHE) | ||
.setWebsite("https://github.com/PrivacyApps/html-textview") | ||
.build() | ||
) | ||
.addAttributions( | ||
new Attribution.Builder("LicenseTextView") | ||
.addCopyrightNotice("Copyright 2016 JGabrielFreitas\n") | ||
.addCopyrightNotice("Copyright 2016 JGabrielFreitas") | ||
.addLicense(License.APACHE) | ||
.setWebsite("https://github.com/jgabrielfreitas/LicenseTextView") | ||
.build() | ||
) | ||
.addAttributions( | ||
new Attribution.Builder("EasyFeedback") | ||
.addCopyrightNotice("Copyright 2017 Ramankit Singh") | ||
.addLicense(License.APACHE) | ||
.setWebsite("https://github.com/webianks/EasyFeedback") | ||
.build() | ||
) | ||
.build(); | ||
|
||
//show license dialogue | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- drawable/message_draw.xml --> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:height="24dp" | ||
android:width="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path android:fillColor="#09C" android:pathData="M18,14H10.5L12.5,12H18M6,14V11.5L12.88,4.64C13.07,4.45 13.39,4.45 13.59,4.64L15.35,6.41C15.55,6.61 15.55,6.92 15.35,7.12L8.47,14M20,2H4A2,2 0 0,0 2,4V22L6,18H20A2,2 0 0,0 22,16V4C22,2.89 21.1,2 20,2Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- drawable/star.xml --> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:height="24dp" | ||
android:width="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path android:fillColor="#09C" android:pathData="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters