mirror of
https://github.com/ethauvin/android-about-box.git
synced 2025-04-25 10:47:10 -07:00
Fixed PMD
This commit is contained in:
parent
6a2a19f5b4
commit
6ff27e1170
3 changed files with 11 additions and 15 deletions
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
|
@ -37,5 +37,5 @@
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||||
</project>
|
</project>
|
|
@ -1,20 +1,9 @@
|
||||||
package com.eggheadgames.aboutbox;
|
package com.eggheadgames.aboutbox;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
public class AboutConfig {
|
public class AboutConfig {
|
||||||
|
|
||||||
public enum BuildType {AMAZON, GOOGLE}
|
public enum BuildType {AMAZON, GOOGLE}
|
||||||
|
|
||||||
private static AboutConfig aboutConfig;
|
|
||||||
|
|
||||||
public static AboutConfig getInstance() {
|
|
||||||
if (aboutConfig == null) {
|
|
||||||
aboutConfig = new AboutConfig();
|
|
||||||
}
|
|
||||||
return aboutConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
// general info
|
// general info
|
||||||
public String appName;
|
public String appName;
|
||||||
public int appIcon;
|
public int appIcon;
|
||||||
|
@ -29,8 +18,7 @@ public class AboutConfig {
|
||||||
public String privacyHtmlPath;
|
public String privacyHtmlPath;
|
||||||
public String acknowledgmentHtmlPath;
|
public String acknowledgmentHtmlPath;
|
||||||
public BuildType buildType;
|
public BuildType buildType;
|
||||||
|
public String packageName;
|
||||||
public Context context;
|
|
||||||
|
|
||||||
// custom analytics and dialog
|
// custom analytics and dialog
|
||||||
public IAnalytic analytics;
|
public IAnalytic analytics;
|
||||||
|
@ -46,4 +34,12 @@ public class AboutConfig {
|
||||||
public String shareMessage;
|
public String shareMessage;
|
||||||
public String sharingTitle;
|
public String sharingTitle;
|
||||||
|
|
||||||
|
public static class SingletonHolder {
|
||||||
|
public static final AboutConfig HOLDER_INSTANCE = new AboutConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AboutConfig getInstance() {
|
||||||
|
return SingletonHolder.HOLDER_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class AboutActivity extends MaterialAboutActivity {
|
||||||
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
|
.setOnClickListener(new MaterialAboutActionItem.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick() {
|
||||||
openApp(config.context.getPackageName(), config.buildType == AboutConfig.BuildType.GOOGLE);
|
openApp(config.packageName, config.buildType == AboutConfig.BuildType.GOOGLE);
|
||||||
if (config.analytics != null) {
|
if (config.analytics != null) {
|
||||||
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.review_log_event));
|
config.analytics.logUiEvent(config.logUiEventName, getString(R.string.review_log_event));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue