mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Add commit id into About screen
This commit is contained in:
parent
7cf562c8e6
commit
53e7a4740e
@ -15,6 +15,19 @@ tasks.withType(Test) {
|
|||||||
systemProperty "GB_LOGFILES_DIR", Files.createTempDirectory("gblog").toString()
|
systemProperty "GB_LOGFILES_DIR", Files.createTempDirectory("gblog").toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getGitHashShort = { ->
|
||||||
|
try {
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
return stdout.toString().trim()
|
||||||
|
} catch (ignored){
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileOptions {
|
compileOptions {
|
||||||
// for KitKat
|
// for KitKat
|
||||||
@ -35,6 +48,7 @@ android {
|
|||||||
versionCode 208
|
versionCode 208
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
buildConfigField "String", "GIT_HASH_SHORT", "\"${getGitHashShort()}\""
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -31,8 +31,11 @@ public class AboutActivity extends AbstractGBActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
TextView about_version = findViewById(R.id.about_version);
|
TextView about_version = findViewById(R.id.about_version);
|
||||||
|
TextView about_hash = findViewById(R.id.about_hash);
|
||||||
String versionName = BuildConfig.VERSION_NAME;
|
String versionName = BuildConfig.VERSION_NAME;
|
||||||
|
String versionHASH = BuildConfig.GIT_HASH_SHORT;
|
||||||
about_version.setText(String.format(getString(R.string.about_version), versionName));
|
about_version.setText(String.format(getString(R.string.about_version), versionName));
|
||||||
|
about_hash.setText(String.format(getString(R.string.about_hash), versionHASH));
|
||||||
|
|
||||||
TextView link1 = findViewById(R.id.links1);
|
TextView link1 = findViewById(R.id.links1);
|
||||||
link1.setMovementMethod(LinkMovementMethod.getInstance());
|
link1.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
@ -53,6 +53,12 @@
|
|||||||
android:id="@+id/about_version"
|
android:id="@+id/about_version"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/about_hash"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -1079,6 +1079,7 @@
|
|||||||
<string name="fdroid_url" translatable="false">F-Droid: <a href="https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/">https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/</a></string>
|
<string name="fdroid_url" translatable="false">F-Droid: <a href="https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/">https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/</a></string>
|
||||||
<string name="about_title">About</string>
|
<string name="about_title">About</string>
|
||||||
<string name="about_version">Version %s</string>
|
<string name="about_version">Version %s</string>
|
||||||
|
<string name="about_hash">Commit %s</string>
|
||||||
<string name="about_activity_title">About Gadgetbridge</string>
|
<string name="about_activity_title">About Gadgetbridge</string>
|
||||||
<string name="gpx_receiver_activity_title">GPX Receiver Gadgetbridge</string>
|
<string name="gpx_receiver_activity_title">GPX Receiver Gadgetbridge</string>
|
||||||
<string name="gpx_receiver_files_received">GPX file(s) received:</string>
|
<string name="gpx_receiver_files_received">GPX file(s) received:</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user