Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ntp tutorial jp android (Uplift to 1.27.x) #9466

Merged
merged 1 commit into from
Jul 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@

import java.util.Arrays;
import java.util.List;
import java.util.Locale;

public class HighlightDialogFragment extends DialogFragment {
final public static String TAG_FRAGMENT = "HIGHLIGHT_FRAG";
private final static String NTP_TUTORIAL_PAGE = "https://brave.com/ja/android-ntp-tutorial";

public interface HighlightDialogListener {
void onNextPage();
Expand Down Expand Up @@ -101,6 +103,7 @@ public void onPageScrollStateChanged(int state) {
btnClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkAndOpenNtpPage();
dismiss();
}
});
Expand Down Expand Up @@ -185,6 +188,7 @@ public void onNextPage() {
|| isFromStats) {
dismiss();
BraveStatsUtil.showBraveStats();
checkAndOpenNtpPage();
} else {
viewpager.setCurrentItem(currentPage + 1);
}
Expand All @@ -198,4 +202,11 @@ public void onLearnMore() {
((BraveActivity)getActivity()).showOnboardingV2(false);
}
};

private void checkAndOpenNtpPage() {
String countryCode = Locale.getDefault().getCountry();
if (((BraveActivity) getActivity()) != null && countryCode.equals("JP")) {
((BraveActivity) getActivity()).openNewOrSelectExistingTab(NTP_TUTORIAL_PAGE);
}
}
}