From 14cde8e6259f2b97ef52187d3b5ba9ba24986b0c Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 16 Dec 2020 10:14:46 +0100 Subject: [PATCH] Fixes --- .../app/fedilab/fedilabtube/MainActivity.java | 7 +- .../helper/HelperAcadInstance.java | 75 +++++-------------- app/src/main/res/layout/drawer_comment.xml | 13 ++-- 3 files changed, 28 insertions(+), 67 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java index a20b074..b1f04aa 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java @@ -345,9 +345,8 @@ public class MainActivity extends AppCompatActivity implements ChromeCastsListen typeOfConnection = TypeOfConnection.UNKNOWN; - BottomNavigationView navView = findViewById(R.id.nav_view); - navView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); + binding.navView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayShowTitleEnabled(false); @@ -420,11 +419,11 @@ public class MainActivity extends AppCompatActivity implements ChromeCastsListen setTitleCustom(R.string.title_discover); if (Helper.isLoggedIn(MainActivity.this)) { - navView.inflateMenu(R.menu.bottom_nav_menu_connected); + binding.navView.inflateMenu(R.menu.bottom_nav_menu_connected); refreshToken(); } else { - navView.inflateMenu(R.menu.bottom_nav_menu); + binding.navView.inflateMenu(R.menu.bottom_nav_menu); } peertubeInformation = new PeertubeInformation(); peertubeInformation.setCategories(new LinkedHashMap<>()); diff --git a/app/src/main/java/app/fedilab/fedilabtube/helper/HelperAcadInstance.java b/app/src/main/java/app/fedilab/fedilabtube/helper/HelperAcadInstance.java index 7f767c0..1213c04 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/helper/HelperAcadInstance.java +++ b/app/src/main/java/app/fedilab/fedilabtube/helper/HelperAcadInstance.java @@ -15,7 +15,7 @@ package app.fedilab.fedilabtube.helper; * see . */ import java.util.Collections; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; public class HelperAcadInstance { @@ -23,62 +23,7 @@ public class HelperAcadInstance { public static Map instances_themes; - static { - Map is = new HashMap<>(); - is.put("Normandie", "tube-normandie.beta.education.fr"); - is.put("Enseignement professionnel", "tube-enseignement-professionnel.apps.education.fr"); - is.put("Action éducative", "tube-action-educative.apps.education.fr"); - is.put("Numérique éducatif", "tube-numerique-educatif.apps.education.fr"); - is.put("Institutionnel", "tube-institutionnelle.apps.education.fr"); - is.put("2d - langues vivantes", "tube-2d-langues-vivantes.apps.education.fr"); - is.put("2d - éducation physique et sportive", "tube-2d-education-physique-et-sportive.apps.education.fr"); - is.put("2d - arts, lettres et sciences humaines", "tube-2d-arts-lettres-sciences-humaines.apps.education.fr"); - is.put("Maternelle", "tube-maternelle.apps.education.fr"); - is.put("Cycle 2", "tube-cycle-2.apps.education.fr"); - is.put("Cycle 3", "tube-cycle-3.apps.education.fr"); - instances_themes = Collections.unmodifiableMap(is); - } - - //List of available academies - - /*public static String[] openid = { - "ac-normandie.fr", - "education.fr", - "education.gouv.fr" - //TODO: remove this one used for tests - // "ac-orleans-tours.fr" - }; - - public static String[] academies = { - "ac-aix-marseille.fr", - "ac-amiens.fr", - "ac-besancon.fr", - "ac-bordeaux.fr", - "clermont-ferrand.fr", - "ac-corse.fr", - "ac-creteil.fr", - "ac-dijon.fr", - "ac-grenoble.fr", - "education.fr", - "ac-lille.fr", - "ac-limoges.fr", - "ac-lyon.fr", - "ac-mayotte.fr", - "ac-montpellier.fr", - "ac-nancy.fr", - "ac-nantes.fr", - "ac-normandie.fr", - "ac-orleans-tours.fr", - "ac-paris.fr", - "ac-poitiers.fr", - "outremer.fr", - "ac-rennes.fr", - "ac-strasbourg.fr", - "ac-toulouse.fr", - "ac-versailles.fr" - };*/ - - + //List of available emails public static String[] valideEmails = { "ac-aix-marseille.fr", "ac-amiens.fr", @@ -117,4 +62,20 @@ public class HelperAcadInstance { "igesr.gouv.fr" }; + static { + Map is = new LinkedHashMap<>(); + is.put("Normandie", "tube-normandie.beta.education.fr"); + is.put("Enseignement professionnel", "tube-enseignement-professionnel.apps.education.fr"); + is.put("Action éducative", "tube-action-educative.apps.education.fr"); + is.put("Numérique éducatif", "tube-numerique-educatif.apps.education.fr"); + is.put("Institutionnel", "tube-institutionnelle.apps.education.fr"); + is.put("2d - langues vivantes", "tube-2d-langues-vivantes.apps.education.fr"); + is.put("2d - éducation physique et sportive", "tube-2d-education-physique-et-sportive.apps.education.fr"); + is.put("2d - arts, lettres et sciences humaines", "tube-2d-arts-lettres-sciences-humaines.apps.education.fr"); + is.put("Maternelle", "tube-maternelle.apps.education.fr"); + is.put("Cycle 2", "tube-cycle-2.apps.education.fr"); + is.put("Cycle 3", "tube-cycle-3.apps.education.fr"); + instances_themes = Collections.unmodifiableMap(is); + } + } diff --git a/app/src/main/res/layout/drawer_comment.xml b/app/src/main/res/layout/drawer_comment.xml index e14a89f..434509b 100644 --- a/app/src/main/res/layout/drawer_comment.xml +++ b/app/src/main/res/layout/drawer_comment.xml @@ -112,21 +112,22 @@ android:id="@+id/number_of_replies" app:layout_constraintTop_toBottomOf="@+id/comment_content" app:layout_constraintStart_toStartOf="@id/comment_account_profile" + android:layout_marginEnd="15dp" + app:layout_constraintEnd_toStartOf="@+id/replyButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="?attr/colorAccent"/> + android:textColor="?attr/colorAccent" /> + android:layout_height="wrap_content" />