mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Added privacy policy to menu and report form.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package org.briarproject.briar.android.reporting;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -10,6 +13,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
|
||||
@@ -17,6 +21,9 @@ import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||
import org.briarproject.briar.android.fragment.BaseFragment;
|
||||
import org.briarproject.briar.android.settings.AboutFragment;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -27,14 +34,19 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.widget.Toast.LENGTH_LONG;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static java.util.logging.Logger.getLogger;
|
||||
import static org.briarproject.bramble.util.LogUtils.logException;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@ParametersNotNullByDefault
|
||||
public class ReportFormFragment extends BaseFragment {
|
||||
|
||||
public final static String TAG = ReportFormFragment.class.getName();
|
||||
private static final Logger LOG = getLogger(TAG);
|
||||
|
||||
@Inject
|
||||
ViewModelProvider.Factory viewModelFactory;
|
||||
@@ -43,6 +55,7 @@ public class ReportFormFragment extends BaseFragment {
|
||||
|
||||
private EditText userCommentView;
|
||||
private EditText userEmailView;
|
||||
private TextView privacyPolicy;
|
||||
private CheckBox includeDebugReport;
|
||||
private Button chevron;
|
||||
private RecyclerView list;
|
||||
@@ -73,6 +86,7 @@ public class ReportFormFragment extends BaseFragment {
|
||||
|
||||
userCommentView = v.findViewById(R.id.user_comment);
|
||||
userEmailView = v.findViewById(R.id.user_email);
|
||||
privacyPolicy = v.findViewById(R.id.PrivacyPolicy);
|
||||
includeDebugReport = v.findViewById(R.id.include_debug_report);
|
||||
chevron = v.findViewById(R.id.chevron);
|
||||
list = v.findViewById(R.id.list);
|
||||
@@ -90,6 +104,19 @@ public class ReportFormFragment extends BaseFragment {
|
||||
userCommentView.setHint(R.string.describe_crash);
|
||||
}
|
||||
|
||||
privacyPolicy.setOnClickListener(View -> {
|
||||
String url = "https://briarproject.org/privacy-policy/";
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(url));
|
||||
try {
|
||||
startActivity(i);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
logException(LOG, WARNING, e);
|
||||
Toast.makeText(requireContext(),
|
||||
R.string.error_start_activity, LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
|
||||
chevron.setOnClickListener(view -> {
|
||||
boolean show = chevron.getText().equals(getString(R.string.show));
|
||||
viewModel.showReportData(show);
|
||||
|
||||
@@ -38,6 +38,7 @@ public class AboutFragment extends Fragment {
|
||||
private TextView briarWebsite;
|
||||
private TextView briarSourceCode;
|
||||
private TextView briarChangelog;
|
||||
private TextView briarPrivacyPolicy;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@@ -61,6 +62,8 @@ public class AboutFragment extends Fragment {
|
||||
briarWebsite = requireActivity().findViewById(R.id.BriarWebsite);
|
||||
briarSourceCode = requireActivity().findViewById(R.id.BriarSourceCode);
|
||||
briarChangelog = requireActivity().findViewById(R.id.BriarChangelog);
|
||||
briarPrivacyPolicy =
|
||||
requireActivity().findViewById(R.id.BriarPrivacyPolicy);
|
||||
briarWebsite.setOnClickListener(View -> {
|
||||
String url = "https://briarproject.org/";
|
||||
goToUrl(url);
|
||||
@@ -74,6 +77,11 @@ public class AboutFragment extends Fragment {
|
||||
"https://code.briarproject.org/briar/briar/-/wikis/changelog";
|
||||
goToUrl(url);
|
||||
});
|
||||
briarPrivacyPolicy.setOnClickListener(View -> {
|
||||
String url =
|
||||
"https://briarproject.org/privacy-policy/";
|
||||
goToUrl(url);
|
||||
});
|
||||
}
|
||||
|
||||
private void goToUrl(String url) {
|
||||
|
||||
@@ -60,6 +60,15 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/BriarSourceCode" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/BriarPrivacyPolicy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/briar_privacy_policy"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/BriarChangelog" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/TranslatorThanks"
|
||||
android:layout_width="match_parent"
|
||||
@@ -68,6 +77,6 @@
|
||||
android:text="@string/translator_thanks"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/BriarChangelog" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/BriarPrivacyPolicy" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -56,6 +56,18 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/PrivacyPolicy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/margin_large"
|
||||
android:layout_marginRight="@dimen/margin_large"
|
||||
android:layout_marginTop="@dimen/margin_large"
|
||||
android:text="@string/privacy_policy"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/user_email_layout" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/include_debug_report"
|
||||
android:layout_width="0dp"
|
||||
@@ -74,9 +86,10 @@
|
||||
style="@style/BriarButtonFlat.Positive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_medium"
|
||||
android:text="@string/show"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/user_email_layout" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/PrivacyPolicy" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
|
||||
@@ -699,6 +699,7 @@
|
||||
<string name="briar_website">\u2022 <a href="">Website</a></string>
|
||||
<string name="briar_source_code">\u2022 <a href="">Source code</a></string>
|
||||
<string name="briar_changelog">\u2022 <a href="">Changelog</a></string>
|
||||
<string name="briar_privacy_policy">\u2022 <a href="">Privacy Policy</a></string>
|
||||
<!-- Here translators can add their names or Transifex usernames(eg "Thanks to all the contributors at the Localization Lab, especially Tom, Matthew and Jerry") -->
|
||||
<string name="translator_thanks">Thanks to all the contributors at the Localization Lab</string>
|
||||
|
||||
@@ -736,6 +737,7 @@
|
||||
<string name="describe_crash">Describe what happened (optional)</string>
|
||||
<string name="enter_feedback">Enter your feedback</string>
|
||||
<string name="optional_contact_email">Your email address (optional)</string>
|
||||
<string name="privacy_policy">By sending us data you agree to our <a href="">privacy policy</a></string>
|
||||
<string name="include_debug_report_crash">Include anonymous data about the crash</string>
|
||||
<string name="include_debug_report_feedback">Include anonymous data about this device</string>
|
||||
<string name="dev_report_user_info">User information</string>
|
||||
|
||||
Reference in New Issue
Block a user