From 1657e678ac20fdb472e7051543e04d9080665941 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 2 Jan 2020 09:04:00 +0100 Subject: [PATCH] automatically set year in about message --- src/main/java/de/pixart/messenger/ui/AboutActivity.java | 8 ++++++++ src/main/res/layout/activity_about.xml | 1 - src/main/res/values/about.xml | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/pixart/messenger/ui/AboutActivity.java b/src/main/java/de/pixart/messenger/ui/AboutActivity.java index 88f863476..709ba8ee5 100644 --- a/src/main/java/de/pixart/messenger/ui/AboutActivity.java +++ b/src/main/java/de/pixart/messenger/ui/AboutActivity.java @@ -4,6 +4,9 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.widget.Button; +import android.widget.TextView; + +import java.util.Calendar; import de.pixart.messenger.R; import de.pixart.messenger.utils.ThemeHelper; @@ -12,6 +15,7 @@ public class AboutActivity extends XmppActivity { private Button privacyButton; private Button termsOfUseButton; + private TextView aboutmessage; @Override protected void refreshUiReal() { @@ -31,6 +35,10 @@ public class AboutActivity extends XmppActivity { setSupportActionBar(findViewById(R.id.toolbar)); configureActionBar(getSupportActionBar()); + aboutmessage = findViewById(R.id.aboutmessage); + String year = String.valueOf(Calendar.getInstance().get(Calendar.YEAR)); + aboutmessage.setText(getString(R.string.pref_about_message, year)); + privacyButton = findViewById(R.id.show_privacy_policy); privacyButton.setOnClickListener(view -> { final Uri uri = Uri.parse("https://jabber.pix-art.de/privacy/"); diff --git a/src/main/res/layout/activity_about.xml b/src/main/res/layout/activity_about.xml index cf812170b..427042215 100644 --- a/src/main/res/layout/activity_about.xml +++ b/src/main/res/layout/activity_about.xml @@ -71,7 +71,6 @@ android:fontFamily="monospace" android:linksClickable="true" android:paddingBottom="@dimen/activity_vertical_margin" - android:text="@string/pref_about_message" android:textAppearance="@style/TextAppearance.Conversations.Body1" android:textSize="?attr/TextSizeBody" android:typeface="monospace" /> diff --git a/src/main/res/values/about.xml b/src/main/res/values/about.xml index b203db24a..ee702a7de 100644 --- a/src/main/res/values/about.xml +++ b/src/main/res/values/about.xml @@ -1,7 +1,7 @@ Pix-Art Messenger - \n\nCopyright © 2014-2019 Christian Schneppe + \n\nCopyright © 2014-%s Christian Schneppe \n\nhttp://jabber.pix-art.de \n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ GNU General Public License for more details. \n\nYou should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses - \n\nDownload the full original source code at https://github.com/siacs/Conversations (Copyright © 2014-2019 Daniel Gultsch) + \n\nDownload the full original source code at https://github.com/siacs/Conversations (Copyright © Daniel Gultsch) \n\nDownload the modified source code at https://github.com/kriztan/Pix-Art-Messenger \n\nPix-Art Messenger recommends blabber.im as provider. More information can be found at https://blabber.im \n\nYou can support me by making a donation in form of a gift in sense of § 516 ff BGB i.e. a gratuitous donation.