From 616aeb9da6c680fce81aa9bf441892d1725e222b Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 7 Sep 2020 17:45:46 -0700 Subject: [PATCH] reorganize About dialog Changed enough that I needed to replace an already-localized string with one that'll need localization. Sorry. --- xwords4/android/app/build.gradle | 3 +- .../org/eehouse/android/xw4/AboutAlert.java | 16 ++++--- .../android/xw4/XWDevIDPreference.java | 42 ------------------- .../app/src/main/res/layout/about_dlg.xml | 14 ++++--- .../app/src/main/res/values/strings.xml | 28 ++++++++----- .../android/app/src/main/res/xml/xwprefs.xml | 9 ---- xwords4/android/res_src/values-ca/strings.xml | 1 - xwords4/android/res_src/values-de/strings.xml | 1 - xwords4/android/res_src/values-fr/strings.xml | 6 +-- xwords4/android/res_src/values-ja/strings.xml | 1 - .../android/res_src/values-nb-rNO/strings.xml | 1 - xwords4/android/res_src/values-nl/strings.xml | 1 - xwords4/android/res_src/values-pl/strings.xml | 1 - xwords4/android/res_src/values-pt/strings.xml | 3 -- 14 files changed, 39 insertions(+), 88 deletions(-) delete mode 100644 xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWDevIDPreference.java diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index 50f9f0072..76d32a6a4 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -22,6 +22,7 @@ if (! forFDroid) { GITREV += " --dirty" } GITREV = GITREV.execute().text.trim() +def GITREV_SHORT = "git rev-parse --short HEAD".execute().text.trim() // Make CURTAG non-empty IFF we're at a tag (release build) def CURTAG = "git describe --exact-match".execute().text.trim() @@ -55,8 +56,8 @@ android { // We need both of these because xwprefs.xml can't reference // the BuildConfig constant - resValue "string", "git_rev", "$GITREV" variant.buildConfigField "String", "GIT_REV", "\"$GITREV\"" + variant.buildConfigField "String", "GITREV_SHORT", "\"$GITREV_SHORT\"" // def stamp = Long.valueOf('date +\'%s\''.execute().text.trim()); def stamp = Math.round(System.currentTimeMillis() / 1000) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java index f1ee116b3..44587764f 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/AboutAlert.java @@ -50,16 +50,16 @@ public class AboutAlert extends XWDialogFragment { View view = LocUtils.inflate( context, R.layout.about_dlg ); TextView vers = (TextView)view.findViewById( R.id.version_string ); - DateFormat df = DateFormat.getDateTimeInstance( DateFormat.FULL, - DateFormat.FULL ); + DateFormat df = DateFormat.getDateTimeInstance( DateFormat.DEFAULT, + DateFormat.DEFAULT ); String dateString = df.format( new Date( BuildConfig.BUILD_STAMP * 1000 ) ); - String devID = XwJNI.dvc_getMQTTDevID(null); - vers.setText( getString( R.string.about_vers_fmt, + vers.setText( getString( R.string.about_vers_fmt2, BuildConfig.VARIANT_NAME, BuildConfig.VERSION_NAME, - BuildConfig.GIT_REV, - dateString, devID ) ); + BuildConfig.VERSION_CODE, + BuildConfig.GITREV_SHORT, + dateString ) ); TextView xlator = (TextView)view.findViewById( R.id.about_xlator ); String str = getString( R.string.xlator ); @@ -69,6 +69,10 @@ public class AboutAlert extends XWDialogFragment { xlator.setVisibility( View.GONE ); } + str = getString( R.string.about_devid_fmt, XwJNI.dvc_getMQTTDevID(null) ); + ((TextView)view.findViewById( R.id.about_build )) + .setText( str ); + AlertDialog.Builder builder = LocUtils.makeAlertBuilder( context ) .setIcon( R.drawable.icon48x48 ) .setTitle( R.string.app_name ) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWDevIDPreference.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWDevIDPreference.java deleted file mode 100644 index 1cc12d22a..000000000 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWDevIDPreference.java +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- compile-command: "find-and-gradle.sh inXw4dDeb"; -*- */ -/* - * Copyright 2010 - 2015 by Eric House (xwords@eehouse.org). All rights - * reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -package org.eehouse.android.xw4; - -import android.content.Context; -import android.preference.EditTextPreference; -import android.util.AttributeSet; - -public class XWDevIDPreference extends EditTextPreference { - private Context m_context; - - public XWDevIDPreference( Context context, AttributeSet attrs ) - { - super( context, attrs ); - m_context = context; - } - - protected void onAttachedToActivity() - { - super.onAttachedToActivity(); - int devID = DevID.getRelayDevIDInt( m_context ); - setSummary( String.format( "%d", devID ) ); - } -} diff --git a/xwords4/android/app/src/main/res/layout/about_dlg.xml b/xwords4/android/app/src/main/res/layout/about_dlg.xml index 6c53fd279..39ecd1781 100644 --- a/xwords4/android/app/src/main/res/layout/about_dlg.xml +++ b/xwords4/android/app/src/main/res/layout/about_dlg.xml @@ -11,12 +11,12 @@ android:layout_height="fill_parent" > - - + + diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index a1405adbc..606e88f37 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -1468,14 +1468,21 @@ ########################################################### --> - CrossWords for Android, %1$s variant, Version %2$s, - rev %3$s, built on %4$s. DevID: %5$s. + Build information: + \n\tVariant: %1$s + \n\tVersion name: %2$s + \n\tVersion code: %3$d + \n\tSource (git) rev: %4$s + \n\tBuilt: %5$s + + Device ID: %1$s + - Copyright (C) 1998-2020 by Eric - House. This free/open source software is released under the GNU Public - License. + CrossWords for Android \nCopyright + (C) 1998-2020 by Eric House. This free/open source software is + released under the GNU Public License. - For a manual or sourcecode see: + For an (old) manual or sourcecode see: http://xwords.sf.net/android.php. To report bugs, suggest features, offer to help, etc., please email: xwords@eehouse.org. @@ -1485,9 +1492,10 @@ [empty] - Toolbar icons by Sarah Chu. Navbar - icons from the Noun Project: “archive” by Trendy; “rematch” by - Becris; and “swap” by iconomania. + Credits: Toolbar icons by Sarah + Chu. Navbar icons from the Noun Project: “archive” by Trendy; + “rematch” by Becris; and “swap” by iconomania. Localization by + volunteers via weblate.org. Recent changes @@ -2260,8 +2268,6 @@ Network stats Show invites Game network stats - Source version id - Device ID (on relay) Relay game port MQTT port MQTT QOS diff --git a/xwords4/android/app/src/main/res/xml/xwprefs.xml b/xwords4/android/app/src/main/res/xml/xwprefs.xml index 13b3a644e..571a2d19f 100644 --- a/xwords4/android/app/src/main/res/xml/xwprefs.xml +++ b/xwords4/android/app/src/main/res/xml/xwprefs.xml @@ -547,14 +547,5 @@ android:summary="@string/unhide_dupmode_summary" android:defaultValue="false" /> - - - diff --git a/xwords4/android/res_src/values-ca/strings.xml b/xwords4/android/res_src/values-ca/strings.xml index 87de617f4..1e09ccc6b 100644 --- a/xwords4/android/res_src/values-ca/strings.xml +++ b/xwords4/android/res_src/values-ca/strings.xml @@ -354,7 +354,6 @@ que connecti via el repetidor. Introduïu el vostre nom aquí. S\'usarà en crear partides noves. (Podreu canviar-lo després a la secció «Partida nova predeterminada» de la configuració.) - CrossWords per a l\'Android, %1$s variant, versió %2$s, rev %3$s, construït en %4$s. (DevID: %5$s) Icones de la barra d\'eines per Sarah Chu. Icones Navbar del Noun Project: «archive» per Trendy; «rematch» per Becris i «swap» per iconomania. Canvis recents Canvis recents diff --git a/xwords4/android/res_src/values-de/strings.xml b/xwords4/android/res_src/values-de/strings.xml index 673510536..bf803ebf0 100644 --- a/xwords4/android/res_src/values-de/strings.xml +++ b/xwords4/android/res_src/values-de/strings.xml @@ -801,7 +801,6 @@ \n \nHalten Sie Ihren Finger auf einen Namen auf der Punktetafel, um Details über den letzten Zug dieses Spielers anzuzeigen. Eine neue Partie erzeugen, die bereit zum Spielen ist, mit allen Einstellungen aus dieser Partie. Das heißt, diese Partie als Vorlage verwenden. - CrossWords für Android, %1$s Variant, Version %2$s, Rev. %3$s, Build-Datum %4$s. (DevID: %5$s) Weitere paaren Verbinde … Sende Einladung an CrossWords auf %1$s diff --git a/xwords4/android/res_src/values-fr/strings.xml b/xwords4/android/res_src/values-fr/strings.xml index 8f0620606..768731680 100644 --- a/xwords4/android/res_src/values-fr/strings.xml +++ b/xwords4/android/res_src/values-fr/strings.xml @@ -1783,11 +1783,7 @@ modèle. # Dialog giving copyright and other basic info about # the app ########################################################### --> - - - CrossWords pour Android, %1$s variant, version %2$s, -rév. %3$s, compilé le %4$s. (DevID: %5$s) + - - CrossWords para Android, %1$s Variant, Versão %2$s, - rev %3$s, built on %4$s. (DevID: %5$s) Copyright (C) 1998-2020 por Eric House. Esse software livre/aberto é liberado sob a Licença