From 915c208d3eb672d31dc02e2c2cb4138ae0eade3a Mon Sep 17 00:00:00 2001 From: Akash Yadav Date: Thu, 20 Jan 2022 11:45:16 +0530 Subject: [PATCH] Updated about activity to include translations and their authors --- .idea/misc.xml | 2 +- .../com/itsaky/androidide/AboutActivity.java | 54 +++++++++++++++---- app/src/main/res/layout/activity_about.xml | 49 +++++++++-------- .../main/res/layout/layout_about_items.xml | 5 +- app/src/main/res/values-in/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 6 files changed, 79 insertions(+), 35 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 2e93772c6..adbae967d 100755 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + diff --git a/app/src/main/java/com/itsaky/androidide/AboutActivity.java b/app/src/main/java/com/itsaky/androidide/AboutActivity.java index d2d26a8d7..832a4b9e9 100755 --- a/app/src/main/java/com/itsaky/androidide/AboutActivity.java +++ b/app/src/main/java/com/itsaky/androidide/AboutActivity.java @@ -1,8 +1,6 @@ -/************************************************************************************ +/* * This file is part of AndroidIDE. * - * - * * AndroidIDE 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 3 of the License, or @@ -16,9 +14,7 @@ * You should have received a copy of the GNU General Public License * along with AndroidIDE. If not, see . * -**************************************************************************************/ - - + */ package com.itsaky.androidide; import android.os.Bundle; @@ -26,6 +22,8 @@ import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; import androidx.appcompat.widget.TooltipCompat; +import androidx.core.util.Pair; + import com.itsaky.androidide.app.StudioActivity; import com.itsaky.androidide.app.StudioApp; import com.itsaky.androidide.databinding.ActivityAboutBinding; @@ -52,6 +50,7 @@ public class AboutActivity extends StudioActivity { binding.items.footerText.setText(getFooter()); + setupTranslations (); setupLicenses(); LayoutAboutItemsBinding items = binding.items; @@ -73,6 +72,46 @@ public class AboutActivity extends StudioActivity { }); } + private void setupTranslations () { + final var translations = createTranslationsList (); + final var sb = new StringBuilder (); + + for (var translation : translations) { + final var author = translation.first; + final var language = translation.second; + + sb.append (author); + sb.append (" - "); + sb.append (language); + sb.append ("\n"); + } + + binding.items.translations.setText (sb); + } + + /** + * Create the list of translations. + * The list items are pairs. + * The first item of the pair is the name of the language. + * The second item is the name of the person who made the translations. + * + * If you're adding translations, make sure you add an item to this list. + * You can choose to display the language in a localized version. For example : + * Language: हिन्दी - < name of author > + * + * Prefer using unicode escapes for language names. For example, हिन्दी can be written as : + * Language: \u0939\u093f\u0928\u094d\u0926\u0940 - < name of author > + * + * @return The translations list. + */ + private List> createTranslationsList () { + final var list = new ArrayList> (); + + list.add (Pair.create ("Bahasa Indonesia", "Fitrah Nuno Syahbani")); + + return list; + } + private void setupLicenses() { final var licenses = new ArrayList(); licenses.add(new License("AndroidX Libraries", "Apache License 2.0", "https://github.com/androidx/androidx")); @@ -88,7 +127,6 @@ public class AboutActivity extends StudioActivity { licenses.add(new License("AndroidTreeView", "Apache License 2.0", "https://github.com/bmelnychuk/AndroidTreeView")); licenses.add(new License("CodeEditor v0.5.2", "Apache License 2.0", "https://github.com/Rosemoe/CodeEditor")); licenses.add(new License("Guava-Android", "Apache License 2.0", "https://github.com/google/guava")); - licenses.add(new License("LSP4J", "Eclipse Public License 2.0", "https://github.com/eclipse/lsp4j")); licenses.add(new License("Jsoup", "MIT License", "https://github.com/jhy/jsoup")); licenses.add(new License("Termux [Terminal Emulator]", "GPL 3", "https://github.com/termux/termux-app")); licenses.add(new License("JavaPoet", "Apache License 2.0", "https://github.com/square/JavaPoet")); @@ -111,8 +149,6 @@ public class AboutActivity extends StudioActivity { sb.append(getString(R.string.license_jdk)); sb.append(String.format("
%1$s", JDK_SOURCE)); sb.append("

"); - sb.append(getString(R.string.license_epl)); - sb.append(String.format("
%1$s", StudioApp.EMAIL)); binding.items.licenses.setText(Html.fromHtml(sb.toString())); binding.items.licenses.setMovementMethod(LinkMovementMethod.getInstance()); } diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 321635b45..3db8d2d3d 100755 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,5 +1,5 @@ - + android:background="@color/primaryDarkColor" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:id="@+id/icon" /> + android:textSize="30sp" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/icon_container" /> + android:textColor="@color/secondaryTextColor" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/title" /> - + - + diff --git a/app/src/main/res/layout/layout_about_items.xml b/app/src/main/res/layout/layout_about_items.xml index 78e153654..789355e8c 100755 --- a/app/src/main/res/layout/layout_about_items.xml +++ b/app/src/main/res/layout/layout_about_items.xml @@ -84,7 +84,7 @@ + AndroidIDE - AndroidIDE uses LSP4J in its object code form (i.e. without any modifications) which is licensed under EPL 2.0. If you want us to disclose the source code to you, contact us at: AndroidIDE uses a modified build of the JDK which is licensed under the GNU General Public License v2.0. The source code and the license of the JDK is available at : Pengembang \u2022 Akash Yadav\n\u2022 Marvin Stelter @@ -348,5 +347,6 @@ Salin dan laporkan Membaca arsip bootstrap… Instalasi Bootstrap gagal dengan exception berikut. + Terjemahan diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 958a0283c..6c933636c 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,7 +2,6 @@ AndroidIDE - AndroidIDE uses LSP4J in its object code form (i.e. without any modifications) which is licensed under EPL 2.0. If you want us to disclose the source code to you, contact us at: AndroidIDE uses a modified build of the JDK which is licensed under the GNU General Public License v2.0. The source code and the license of the JDK is available at : Developers \u2022 Akash Yadav\n\u2022 Marvin Stelter @@ -348,5 +347,6 @@ Copy and report Reading bootstrap archive… Bootstrap installation failed with the following exception. + Translations