Skip to content

Commit efd0723

Browse files
author
James Stapleton
committed
Merge branch 'release/2.0.5'
Some phones won't update the profile name when you manually select a profile, until they type something. This fixes that.
2 parents 85aa810 + a24a4d3 commit efd0723

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

passwordmaker/build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repositories {
1818
/*
1919
* Gets the version name from the latest Git tag
2020
*
21-
* Tag each release like: git tag -a 1.0
21+
* Tag each release like: git tag -a v1.0
2222
* then Rebuild for a nice version number
2323
*
2424
*/
@@ -41,11 +41,19 @@ def generateVersionCode = { ->
4141
it.padLeft(2, "0")
4242
}.join("")
4343
if ( versions.size() >= 2 && versions[1].isNumber() ) {
44+
// This is off of a release tag: '2.0.5' but has a couple of commits since: 2.0.5-4-g6af5805 we want the code to have '04' in this case.
4445
code += versions[1].padLeft(2, "0")
4546
} else if ( versions.size() >= 3 && versions[2].isNumber() ) {
47+
// This has a '-qualifier-##' e.g. '2.0.5-SNAPSHOT-1-g6af5805' we want the code to have '01' appended in this case.
4648
code += versions[2].padLeft(2, "0")
47-
} else {
49+
} else if ( versions[-1] == "SNAPSHOT") {
50+
// The first snapshot
4851
code += "00"
52+
} else {
53+
// This is if we are on the release tag itself, lets force this to be the end of the revisions
54+
// example: '2.0.5' as the tag, we want to add 99 to the end, so that any revisions handed out during testing will be
55+
// less than this revision.
56+
code += "99"
4957
}
5058
return code.toInteger()
5159
}

passwordmaker/src/main/java/org/passwordmaker/android/MainActivity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ protected void onResume() {
108108
showUsernameBasedOnPreference();
109109
showPassStrengthBasedOnPreference();
110110
favoritesAdapter.notifyDataSetChanged();
111+
updateSelectedProfileText();
111112
}
112113

113114
@Override
@@ -272,6 +273,8 @@ protected void updateSelectedProfileText() {
272273
if ( btnClearSelectedProfile.getVisibility() != View.VISIBLE )
273274
btnClearSelectedProfile.setVisibility(View.VISIBLE);
274275
}
276+
if ( ! text.getText().toString().equals(value) )
277+
Log.i(LOG_TAG, "Updated selected profile to be: \"" + value + "\"");
275278
text.setText(value);
276279
}
277280

0 commit comments

Comments
 (0)