mirror of
https://github.com/ethauvin/android-about-box.git
synced 2025-04-25 02:37:11 -07:00
Added logic to show Guide only when html page is provided (Close #18)
This commit is contained in:
parent
cf5d7e3750
commit
7d339c9cf6
1 changed files with 15 additions and 12 deletions
|
@ -5,6 +5,7 @@ import android.content.ActivityNotFoundException;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.danielstone.materialaboutlibrary.MaterialAboutActivity;
|
||||
|
@ -43,19 +44,21 @@ public class AboutActivity extends MaterialAboutActivity {
|
|||
|
||||
|
||||
MaterialAboutCard.Builder supportCardBuilder = new MaterialAboutCard.Builder();
|
||||
supportCardBuilder.addItem(new MaterialAboutActionItem.Builder()
|
||||
.text(R.string.egab_guide)
|
||||
.icon(R.drawable.ic_help_green)
|
||||
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
openHTMLPage(config.guideHtmlPath);
|
||||
if (config.analytics != null) {
|
||||
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.egab_guide));
|
||||
if (!TextUtils.isEmpty(config.guideHtmlPath)) {
|
||||
supportCardBuilder.addItem(new MaterialAboutActionItem.Builder()
|
||||
.text(R.string.egab_guide)
|
||||
.icon(R.drawable.ic_help_green)
|
||||
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
openHTMLPage(config.guideHtmlPath);
|
||||
if (config.analytics != null) {
|
||||
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.egab_guide));
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.build());
|
||||
})
|
||||
.build());
|
||||
}
|
||||
supportCardBuilder.addItem(new MaterialAboutActionItem.Builder()
|
||||
.text(R.string.egab_contact_support)
|
||||
.icon(R.drawable.ic_email_black)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue