|
72 | 72 | import org.wordpress.android.ui.EmptyViewMessageType; |
73 | 73 | import org.wordpress.android.ui.FilteredRecyclerView; |
74 | 74 | import org.wordpress.android.ui.RequestCodes; |
75 | | -import org.wordpress.android.ui.ScrollableViewInitializedListener; |
76 | 75 | import org.wordpress.android.ui.ViewPagerFragment; |
77 | 76 | import org.wordpress.android.ui.main.BottomNavController; |
78 | 77 | import org.wordpress.android.ui.main.SitePickerActivity; |
@@ -529,21 +528,11 @@ private void showJetpackBanner() { |
529 | 528 | mJetpackBrandingUtils.setNavigationBarColorForBanner(requireActivity().getWindow()); |
530 | 529 | mJetpackBanner.setVisibility(View.VISIBLE); |
531 | 530 |
|
532 | | - if (mJetpackBrandingUtils.shouldShowJetpackPoweredBottomSheet()) { |
533 | | - mJetpackBanner.setOnClickListener(v -> { |
534 | | - mJetpackBrandingUtils.trackBannerTapped(Screen.READER_SEARCH); |
535 | | - new JetpackPoweredBottomSheetFragment() |
536 | | - .show(getChildFragmentManager(), JetpackPoweredBottomSheetFragment.TAG); |
537 | | - }); |
538 | | - } |
539 | | - |
540 | | - if (!isSearching()) { |
541 | | - // Add bottom margin to search suggestions post list and empty view. |
542 | | - int jetpackBannerHeight = getResources().getDimensionPixelSize(R.dimen.jetpack_banner_height); |
543 | | - ((MarginLayoutParams) mRecyclerView.getSearchSuggestionsRecyclerView().getLayoutParams()).bottomMargin |
544 | | - = jetpackBannerHeight; |
545 | | - ((MarginLayoutParams) mActionableEmptyView.getLayoutParams()).bottomMargin = jetpackBannerHeight; |
546 | | - } |
| 531 | + // Add bottom margin to search suggestions list and empty view. |
| 532 | + int jetpackBannerHeight = getResources().getDimensionPixelSize(R.dimen.jetpack_banner_height); |
| 533 | + ((MarginLayoutParams) mRecyclerView.getSearchSuggestionsRecyclerView().getLayoutParams()).bottomMargin |
| 534 | + = jetpackBannerHeight; |
| 535 | + ((MarginLayoutParams) mActionableEmptyView.getLayoutParams()).bottomMargin = jetpackBannerHeight; |
547 | 536 | } |
548 | 537 |
|
549 | 538 | private void hideJetpackBanner() { |
@@ -791,11 +780,6 @@ public void onResume() { |
791 | 780 | showEmptyView(); |
792 | 781 | } |
793 | 782 |
|
794 | | - if (getActivity() instanceof ScrollableViewInitializedListener) { |
795 | | - ((ScrollableViewInitializedListener) getActivity()) |
796 | | - .onScrollableViewInitialized(mRecyclerView.getInternalRecyclerView().getId()); |
797 | | - } |
798 | | - |
799 | 783 | mViewModel.onFragmentResume(mIsTopLevel, isSearching(), isFilterableScreen(), |
800 | 784 | isFilterableScreen() ? mSubFilterViewModel.getCurrentSubfilterValue() : null); |
801 | 785 | } |
@@ -1162,6 +1146,17 @@ public void onShowCustomEmptyView(EmptyViewMessageType emptyViewMsgType) { |
1162 | 1146 | mProgress.setVisibility(View.GONE); |
1163 | 1147 |
|
1164 | 1148 | mJetpackBanner = rootView.findViewById(R.id.jetpack_banner); |
| 1149 | + if (mJetpackBrandingUtils.shouldShowJetpackBranding()) { |
| 1150 | + mJetpackBrandingUtils.initJetpackBannerAnimation(mJetpackBanner, mRecyclerView.getInternalRecyclerView()); |
| 1151 | + |
| 1152 | + if (mJetpackBrandingUtils.shouldShowJetpackPoweredBottomSheet()) { |
| 1153 | + mJetpackBanner.setOnClickListener(v -> { |
| 1154 | + mJetpackBrandingUtils.trackBannerTapped(Screen.READER_SEARCH); |
| 1155 | + new JetpackPoweredBottomSheetFragment() |
| 1156 | + .show(getChildFragmentManager(), JetpackPoweredBottomSheetFragment.TAG); |
| 1157 | + }); |
| 1158 | + } |
| 1159 | + } |
1165 | 1160 |
|
1166 | 1161 | if (savedInstanceState != null && savedInstanceState.getBoolean(ReaderConstants.KEY_IS_REFRESHING)) { |
1167 | 1162 | mIsUpdating = true; |
|
0 commit comments