From 64a2e223b37eb73d3d285e8b9c6f9af3bdd009df Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 12 Feb 2021 12:06:06 +0100 Subject: [PATCH] Allow to analyze app from reports --- app/src/amal/res/values/colors.xml | 2 +- .../fragments/ReportFragment.java | 12 +++++++++++ app/src/main/res/drawable/progressbar.xml | 7 +++---- .../main/res/layout/app_check_activity.xml | 1 - app/src/main/res/layout/report.xml | 20 +++++++++++++++---- app/src/main/res/values/strings.xml | 1 + 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/app/src/amal/res/values/colors.xml b/app/src/amal/res/values/colors.xml index cd80a80..9f9e2d6 100644 --- a/app/src/amal/res/values/colors.xml +++ b/app/src/amal/res/values/colors.xml @@ -1,7 +1,7 @@ #005e8b - #3d2b43 + #005e8b #007bff #77005e8b #6fc384 diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ReportFragment.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ReportFragment.java index 8fbcb0e..0ab40c2 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ReportFragment.java +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ReportFragment.java @@ -36,6 +36,7 @@ import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; +import org.eu.exodus_privacy.exodusprivacy.BuildConfig; import org.eu.exodus_privacy.exodusprivacy.R; import org.eu.exodus_privacy.exodusprivacy.ReportViewModel; import org.eu.exodus_privacy.exodusprivacy.Utils; @@ -141,6 +142,17 @@ public class ReportFragment extends Fragment implements Updatable { startActivity(intent); }); + reportBinding.analyseApp.setOnClickListener(v -> { + Uri uri; + if (!BuildConfig.amal) { + uri = Uri.parse("https://reports.exodus-privacy.eu.org/analysis/submit/#" + reportDisplay.packageName); + } else { + uri = Uri.parse("https://exodus.phm.education.gouv.fr/analysis/submit/#" + reportDisplay.packageName); + } + Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(browserIntent); + }); + if (reportDisplay.report != null) { reportBinding.reportUrl.setOnClickListener(v -> { Intent intent = new Intent(Intent.ACTION_VIEW); diff --git a/app/src/main/res/drawable/progressbar.xml b/app/src/main/res/drawable/progressbar.xml index 6e6de66..bed28bd 100644 --- a/app/src/main/res/drawable/progressbar.xml +++ b/app/src/main/res/drawable/progressbar.xml @@ -34,10 +34,9 @@ + android:endColor="@color/colorAccent" + android:startColor="@color/colorAccent" + android:angle="270" /> diff --git a/app/src/main/res/layout/app_check_activity.xml b/app/src/main/res/layout/app_check_activity.xml index 05bc6cf..ad4fba5 100644 --- a/app/src/main/res/layout/app_check_activity.xml +++ b/app/src/main/res/layout/app_check_activity.xml @@ -172,7 +172,6 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/report_url" /> - \ No newline at end of file diff --git a/app/src/main/res/layout/report.xml b/app/src/main/res/layout/report.xml index a2a415f..a0b9bb3 100644 --- a/app/src/main/res/layout/report.xml +++ b/app/src/main/res/layout/report.xml @@ -263,7 +263,7 @@ android:text="@{reportInfo.trackerNumberStr}" android:layout_marginStart="20dp" android:layout_marginTop="30dp" - app:layout_constraintTop_toBottomOf="@id/analysed" + app:layout_constraintTop_toBottomOf="@id/analyse_app" app:layout_constraintStart_toStartOf="parent" android:background="@{ContextCompat.getDrawable(context,reportInfo.trackerColor)}" android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}" @@ -282,7 +282,7 @@ android:layout_marginStart="10dp" android:layout_marginEnd="20dp" android:layout_marginTop="30dp" - app:layout_constraintTop_toBottomOf="@id/analysed" + app:layout_constraintTop_toBottomOf="@id/analyse_app" app:layout_constraintStart_toEndOf="@id/trackers_nb_list" app:layout_constraintEnd_toEndOf="parent" android:textStyle="bold" @@ -437,9 +437,21 @@ android:layout_marginEnd="20dp" android:layout_marginTop="5dp" android:textAlignment="center" - android:textAppearance="@style/TextAppearance.AppCompat.Small" - /> + android:textAppearance="@style/TextAppearance.AppCompat.Small" /> +