Skip to content

Commit

Permalink
Fix few crashes from 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeSteam committed Apr 10, 2024
1 parent 7b9b0ff commit b492ec5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Blacksmith/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "uk.co.jakelee.blacksmith"
minSdkVersion 19
targetSdkVersion apiVersion
versionCode 86
versionName "3.0.0"
versionCode 87
versionName "3.0.1"
multiDexEnabled true
}
buildTypes {
Expand Down
4 changes: 2 additions & 2 deletions Blacksmith/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 85,
"versionName": "3.0.0",
"versionCode": 87,
"versionName": "3.0.1",
"outputFile": "Blacksmith-release.apk"
}
],
Expand Down
1 change: 1 addition & 0 deletions Blacksmith/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,19 @@ public static void addFinishedNotification(Context context, boolean useSoundsSet
}

private static void addNotification(Context context, long notificationTime, int notificationType) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
try {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

Intent notificationIntent = new Intent("android.media.action.DISPLAY_NOTIFICATION");
notificationIntent.addCategory("android.intent.category.DEFAULT");
notificationIntent.putExtra(NOTIFICATION_TYPE, notificationType);
Intent notificationIntent = new Intent("android.media.action.DISPLAY_NOTIFICATION");
notificationIntent.addCategory("android.intent.category.DEFAULT");
notificationIntent.putExtra(NOTIFICATION_TYPE, notificationType);

PendingIntent broadcast = PendingIntent.getBroadcast(context, 9000 + notificationType, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
PendingIntent broadcast = PendingIntent.getBroadcast(context, 9000 + notificationType, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

alarmManager.set(AlarmManager.RTC_WAKEUP, notificationTime, broadcast);
alarmManager.set(AlarmManager.RTC_WAKEUP, notificationTime, broadcast);
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
}

public static void clearNotifications(final Context context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ private void displayStatistics() {
int collectionsCrafted = Player_Info.getCollectionsCrafted();
((TextViewPixel) findViewById(R.id.collectionsCrafted)).setText(String.format("%,d", collectionsCrafted));

int questsCompleted = Select.from(Player_Info.class).where(Condition.prop("name").eq("QuestsCompleted")).first().getIntValue();
((TextViewPixel) findViewById(R.id.questsCompleted)).setText(String.format("%,d", questsCompleted));

int prestigeLevel = Player_Info.getPrestige();
int prestigeGoldPercent = prestigeLevel * 50;
int bonusGoldPercent = prestigeGoldPercent + Select.from(Upgrade.class).where(Condition.prop("name").eq("Coins Bonus")).first().getCurrent();
Expand Down

0 comments on commit b492ec5

Please sign in to comment.