Add entrypoint for Learn More in PS settings & Setup intro

Screenshots:
go/ss/RXhN57DSuSj7aQf.png
go/ss/5xcbx3mWeo2sZ37.png

Bug: 326059389
Test: atest PrivateSpaceFooterPreferenceControllerTest
Change-Id: I72beb1a04ea11909643dd6b455575478cfb5d87c
This commit is contained in:
josephpv
2024-03-05 19:06:56 +00:00
parent aed31bb8bd
commit 1af33733c6
6 changed files with 172 additions and 2 deletions

View File

@@ -19,10 +19,12 @@ package com.android.settings.privatespace;
import android.app.Activity;
import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.text.util.Linkify;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.navigation.fragment.NavHostFragment;
@@ -34,6 +36,8 @@ import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupdesign.GlifLayout;
import java.util.regex.Pattern;
/** Fragment educating about the usage of Private Space. */
public class PrivateSpaceEducation extends InstrumentedFragment {
private static final String TAG = "PrivateSpaceEducation";
@@ -66,6 +70,13 @@ public class PrivateSpaceEducation extends InstrumentedFragment {
.setTheme(com.google.android.setupdesign.R.style.SudGlifButton_Secondary)
.build());
TextView infoTextView = rootView.findViewById(R.id.learn_more);
Pattern pattern = Pattern.compile(infoTextView.getText().toString());
Linkify.addLinks(
infoTextView,
pattern,
getContext().getString(R.string.private_space_learn_more_url));
return rootView;
}