Ezerous
6 years ago
No known key found for this signature in database
GPG Key ID: 262B2954BBA319E3
3 changed files with
12 additions and
7 deletions
-
app/src/main/assets/changelog.json
-
app/src/main/java/gr/thmmy/mthmmy/activities/main/MainActivity.java
-
app/src/main/java/gr/thmmy/mthmmy/utils/Changelog.java
|
|
@ -1,9 +1,9 @@ |
|
|
|
{ |
|
|
|
"changelogs": [ |
|
|
|
{ |
|
|
|
"version_code": 13, |
|
|
|
"version": "5.0.0", |
|
|
|
"release_date": "Someday in september.... hopefully", |
|
|
|
"version_code": 14, |
|
|
|
"version": "1.5.0", |
|
|
|
"release_date": "Someday in October.... hopefully", |
|
|
|
"video": "Maybe someday", |
|
|
|
"prelude": "May be useful sometimes.. like a text above the actual change list", |
|
|
|
"change_list": [ |
|
|
@ -49,12 +49,12 @@ |
|
|
|
},{ |
|
|
|
"change": "bug", |
|
|
|
"title": "Many bugs.", |
|
|
|
"description": "We fixed a ton of other bugs, so the app is now like 36.2% more bug free." |
|
|
|
"description": "We fixed a ton of other bugs, so the app is now like 36.21% more bug free." |
|
|
|
}, |
|
|
|
{ |
|
|
|
"change": "improvement", |
|
|
|
"title": "Much cutter icons in boards.", |
|
|
|
"description": "Sticky icon changed to much the overall greatness of the forum, also a dot was added. Don't you just love dots?" |
|
|
|
"title": "Much cuter icons in boards.", |
|
|
|
"description": "Sticky icon changed to match the overall greatness of the forum, also a dot was added. Don't you just love dots?" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"change": "improvement", |
|
|
|
|
|
@ -101,6 +101,7 @@ public class MainActivity extends BaseActivity implements RecentFragment.RecentF |
|
|
|
|
|
|
|
if (Changelog.getLaunchType(this) == Changelog.LAUNCH_TYPE.FIRST_LAUNCH_AFTER_UPDATE) { |
|
|
|
AlertDialog dialog = Changelog.getChangelogDialog(this); |
|
|
|
if(dialog!=null) |
|
|
|
dialog.show(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -69,6 +69,7 @@ public class Changelog { |
|
|
|
JSONObject jsonObject = new JSONObject(loadJSONFromAssets(context)); |
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray("changelogs"); |
|
|
|
|
|
|
|
boolean currentVersionFound = false; |
|
|
|
for (int i = 0; i < jsonArray.length(); i++) { |
|
|
|
JSONObject jsonObjectInner = jsonArray.getJSONObject(i); |
|
|
|
int versionCode = jsonObjectInner.getInt("version_code"); |
|
|
@ -125,9 +126,12 @@ public class Changelog { |
|
|
|
changeText.setText(spannable); |
|
|
|
changeListView.addView(changeText); |
|
|
|
} |
|
|
|
currentVersionFound = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if(!currentVersionFound) |
|
|
|
return null; |
|
|
|
} catch (JSONException exception) { |
|
|
|
Timber.e(exception, "Couldn't read changelog json from assets"); |
|
|
|
} |
|
|
|