Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Display introductory tutorial only on first run
Browse files Browse the repository at this point in the history
Fixes #1942
  • Loading branch information
M66B committed Aug 30, 2014
1 parent b459316 commit c141db8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Version 3.x will be available with a [pro license](http://www.xprivacy.eu/) only
* Changed settings dialog to settings activity ([pull request](/../../issues/1938))
* Moved flush button to expert mode section ([issue](/../../issues/1934))
* Added category merge/reset ([issue](/../../issues/1909))
* Display introductory tutorial only on first run after *About* ([issue](/../../issues/1942))
* Updated simplified Chinese translation

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
Expand Down
36 changes: 22 additions & 14 deletions src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ public void onClick(View view) {
if (PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFirstRun, true)) {
showChangelog = false;
optionAbout();
PrivacyManager.setSetting(userId, PrivacyManager.cSettingFirstRun, Boolean.FALSE.toString());
}

// Tutorial
Expand Down Expand Up @@ -1126,20 +1125,29 @@ private void optionAbout() {
((TextView) dlgAbout.findViewById(R.id.build_id)).setText(Build.ID);

dlgAbout.setCancelable(true);
dlgAbout.show();
dlgAbout.setOnDismissListener(new DialogInterface.OnDismissListener() {

@Override
public void onDismiss(DialogInterface dialog) {
Dialog dlgUsage = new Dialog(ActivityMain.this);
dlgUsage.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dlgUsage.setTitle(R.string.app_name);
dlgUsage.setContentView(R.layout.usage);
dlgUsage.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));
dlgUsage.setCancelable(true);
dlgUsage.show();
}
});
final int userId = Util.getUserId(Process.myUid());
if (PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingFirstRun, true))
dlgAbout.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
Dialog dlgUsage = new Dialog(ActivityMain.this);
dlgUsage.requestWindowFeature(Window.FEATURE_LEFT_ICON);
dlgUsage.setTitle(R.string.app_name);
dlgUsage.setContentView(R.layout.usage);
dlgUsage.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));
dlgUsage.setCancelable(true);
dlgUsage.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
PrivacyManager.setSetting(userId, PrivacyManager.cSettingFirstRun, Boolean.FALSE.toString());
}
});
dlgUsage.show();
}
});

dlgAbout.show();
}

// Tasks
Expand Down

0 comments on commit c141db8

Please sign in to comment.