-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open about box with a button #44
Comments
There's nothing special here. It's all standard Android. E.g. you can use standard Android style menus for the launch button, e.g. something like this to setup the menu item (with icon etc): MenuInflater menuInflater = activity.getMenuInflater();
menuInflater.inflate(R.menu.about_screen_menu, menu); and then launch it with: case R.id.open_about:
AboutActivity.launch(activity);
return true; |
Thank you for that but I'm a bit confused here.
|
@Kvaibhav01 I'm afraid these are Android programming questions and really don't have much to do with this library. I'd love to help more, but there are plenty of references for this elsewhere. Good luck! |
So I added the relevant code to do this as:
But when I run the app on emulator, it shows up the following screen when the I have already added more informations like acknowledgements, privacy policy et cetera but it's showing something weird! |
I setup I.e. like this: public class LogicApp extends android.app.Application {
....
@Override
public void onCreate() {
super.onCreate();
...
initAboutBox();
}
...
public void initAboutBox() {
final AboutConfig aboutConfig = AboutConfig.getInstance();
aboutConfig.appName = getString(R.string.app_name);
aboutConfig.appIcon = R.mipmap.ic_launcher;
aboutConfig.version = BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")";
aboutConfig.aboutLabelTitle = getString(R.string.about_egghead_games);
aboutConfig.packageName = getApplicationContext().getPackageName();
aboutConfig.buildType = "google".equalsIgnoreCase(BuildConfig.FLAVOR_appstore)
? AboutConfig.BuildType.GOOGLE : AboutConfig.BuildType.AMAZON;
aboutConfig.logUiEventName = LOG_UI_EVENT_NAME;
aboutConfig.facebookUserName = FACEBOOK_USER_NAME;
aboutConfig.twitterUserName = TWITTER_USER_NAME;
aboutConfig.webHomePage = WEB_HOME_PAGE;
aboutConfig.appPublisher = APP_PUBLISHER;
aboutConfig.guideHtmlPath = GUIDE_HTML_PATH;
aboutConfig.companyHtmlPath = COMPANY_HTML_PATH;
aboutConfig.privacyHtmlPath = PRIVACY_HTML_PATH;
aboutConfig.acknowledgmentHtmlPath = ACKNOWLEDGMENT_HTML_PATH;
aboutConfig.emailAddress = EMAIL_ADDRESS;
aboutConfig.emailSubject = getResources().getString(R.string.app_name) + " Question";
aboutConfig.emailBody = "";
aboutConfig.shareMessage = getString(R.string.share_message);
aboutConfig.sharingTitle = getString(R.string.sharing_title);
aboutConfig.dialog = new IDialog() {
@Override
public void open(AppCompatActivity appCompatActivity, String url, String tag) {
GuideDialog guideDialog = GuideDialog.createDialog(url, tag, true);
guideDialog.show(appCompatActivity.getSupportFragmentManager(), tag);
}
};
} And then I can call it with the code I shared above, i.e. AboutActivity.launch(activity); Hope this helps! |
Take a look at the source code, after you've setup with public static void launch(Activity activity) {
Intent intent = new Intent(activity, AboutActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
activity.startActivity(intent);
} |
Everything is going good, I implemented the above. One thing, every time I open the app the about activity launches instead of main activity. How to solve this? I don't wan't my app users to see the about page every time they open the app, it's quite annoying. |
Sorry, I didn't mean immediately call In the app startup, ONLY do the configuration. Later, when they tap the button, THEN call ``AboutActivity.launch(activity)`. I.e. it is two separate things: configure at app startup, then launch when the user requests it. Good luck! |
It's done! 😃 I removed
Everything works fine now! Thank you 😃. |
I would like to implement the about activity only when the user taps an icon of about (or in a drop-down-the three dots menu) in app bar. How to implement that?
The text was updated successfully, but these errors were encountered: