Skip to content

Commit

Permalink
resolved commets
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil7174 committed Nov 10, 2024
1 parent e71b990 commit d3bcbe3
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@ public void run() {

private void setNtpRecyclerView(LinearLayoutManager linearLayoutManager) {
mIsTopSitesEnabled = NtpUtil.shouldDisplayTopSites();
// mIsBraveStatsEnabled = NtpUtil.shouldDisplayBraveStats();
mIsBraveStatsEnabled = false;
mIsBraveStatsEnabled = NtpUtil.shouldDisplayBraveStats();

if (mNtpAdapter == null) {
if (mActivity != null && !mActivity.isDestroyed() && !mActivity.isFinishing()) {
Expand Down Expand Up @@ -884,8 +883,7 @@ private void initPreferenceObserver() {
mNtpAdapter.setTopSitesEnabled(mIsTopSitesEnabled);
} else if (TextUtils.equals(
key, BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS)) {
// mIsBraveStatsEnabled = NtpUtil.shouldDisplayBraveStats();
mIsBraveStatsEnabled = false;
mIsBraveStatsEnabled = NtpUtil.shouldDisplayBraveStats();
mNtpAdapter.setBraveStatsEnabled(mIsBraveStatsEnabled);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ protected void onFinishInflate() {
// any shortcut causes the UrlBar to be focused. See ViewRootImpl.leaveTouchMode().
mScrollView.setDescendantFocusability(FOCUS_BEFORE_DESCENDANTS);

// mVpnCta = findViewById(R.id.tv_try_vpn);
// if (BraveVpnUtils.isVpnFeatureSupported(getContext())
// && !BraveVpnNativeWorker.getInstance().isPurchasedUser()) {
// mVpnCta.setOnClickListener(
// v -> {
// if (!InternetConnection.isNetworkAvailable(getContext())) {
// Toast.makeText(getContext(), R.string.no_internet, Toast.LENGTH_SHORT)
// .show();
// } else {
// BraveVpnUtils.openBraveVpnPlansActivity(getContext());
// }
// });
// } else {
// mVpnCta.setVisibility(View.GONE);
// }
mVpnCta = findViewById(R.id.tv_try_vpn);
if (BraveVpnUtils.isVpnFeatureSupported(getContext())
&& !BraveVpnNativeWorker.getInstance().isPurchasedUser() || false) {
mVpnCta.setOnClickListener(
v -> {
if (!InternetConnection.isNetworkAvailable(getContext())) {
Toast.makeText(getContext(), R.string.no_internet, Toast.LENGTH_SHORT)
.show();
} else {
BraveVpnUtils.openBraveVpnPlansActivity(getContext());
}
});
} else {
mVpnCta.setVisibility(View.GONE);
}
}

/**
Expand Down
5 changes: 2 additions & 3 deletions android/java/org/chromium/chrome/browser/ntp/NtpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ public static void setDisplayTopSites(boolean shouldDisplayTopSites) {
}

public static boolean shouldDisplayBraveStats() {
// return ChromeSharedPreferences.getInstance()
// .readBoolean(BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS, true);
return false;
return ChromeSharedPreferences.getInstance()
.readBoolean(BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS, false);
}

public static void setDisplayBraveStats(boolean shouldDisplayBraveStats) {
Expand Down
25 changes: 15 additions & 10 deletions android/java/res/layout/new_tab_page_incognito.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
app:layout_constraintGuide_end="32dp" />

<!-- Keep the ID below as it's been tested in Chromium code by IncognitoNewTabPageStation. -->
<!-- <ImageView
<ImageView
android:visibility="gone"
android:id="@+id/new_tab_incognito_icon"
android:layout_width="@dimen/new_tab_page_incognito_logo_size"
android:layout_height="@dimen/new_tab_page_incognito_logo_size"
Expand All @@ -54,7 +55,7 @@
app:layout_constraintBottom_toBottomOf="@+id/title"
app:layout_constraintStart_toStartOf="@id/guideline_begin"
app:layout_constraintEnd_toStartOf="@+id/title"
/> -->
/>

<TextView
android:id="@+id/title"
Expand Down Expand Up @@ -159,7 +160,8 @@
app:layout_constraintEnd_toEndOf="@id/tv_second_title"
/>

<!-- <ImageView
<ImageView
android:visibility="invisible"
android:id="@+id/iv_third_icon"
app:layout_constraintHorizontal_chainStyle="packed"
android:layout_width="@dimen/new_tab_page_incognito_icon_size"
Expand All @@ -170,9 +172,10 @@
app:layout_constraintTop_toTopOf="@+id/tv_third_title"
app:layout_constraintStart_toStartOf="@+id/guideline_begin"
app:layout_constraintEnd_toStartOf="@+id/tv_third_title"
/> -->
/>

<!-- <TextView
<TextView
android:visibility="invisible"
android:id="@+id/tv_third_title"
style="@style/DefaultSemibold"
app:layout_constraintWidth_max="460dp"
Expand All @@ -185,9 +188,10 @@
app:layout_constraintBottom_toTopOf="@+id/tv_third_description"
app:layout_constraintStart_toEndOf="@id/iv_third_icon"
app:layout_constraintEnd_toEndOf="@id/guideline_end"
/> -->
/>

<!-- <TextView
<TextView
android:visibility="invisible"
android:id="@+id/tv_third_description"
style="@style/DefaultRegular"
android:layout_width="0dp"
Expand All @@ -199,9 +203,10 @@
app:layout_constraintBottom_toTopOf="@+id/tv_try_vpn"
app:layout_constraintStart_toStartOf="@id/tv_third_title"
app:layout_constraintEnd_toEndOf="@id/tv_third_title"
/> -->
/>

<!-- <TextView
<TextView
android:visibility="invisible"
android:id="@+id/tv_try_vpn"
style="@style/DefaultSemibold"
android:layout_width="0dp"
Expand All @@ -212,7 +217,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_third_title"
app:layout_constraintEnd_toEndOf="@id/tv_third_title"
/> -->
/>

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down

0 comments on commit d3bcbe3

Please sign in to comment.