|
6 | 6 | import android.view.LayoutInflater; |
7 | 7 | import android.view.View; |
8 | 8 | import android.view.ViewGroup; |
| 9 | +import android.view.ViewGroup.MarginLayoutParams; |
9 | 10 | import android.view.ViewTreeObserver; |
10 | 11 | import android.widget.TextView; |
11 | 12 |
|
|
24 | 25 | import org.wordpress.android.fluxc.store.AccountStore; |
25 | 26 | import org.wordpress.android.ui.ScrollableViewInitializedListener; |
26 | 27 | import org.wordpress.android.ui.mysite.cards.quickstart.QuickStartRepository; |
| 28 | +import org.wordpress.android.ui.mysite.jetpackbadge.JetpackPoweredBottomSheetFragment; |
27 | 29 | import org.wordpress.android.ui.publicize.adapters.PublicizeServiceAdapter; |
28 | 30 | import org.wordpress.android.ui.publicize.adapters.PublicizeServiceAdapter.OnAdapterLoadedListener; |
29 | 31 | import org.wordpress.android.ui.publicize.adapters.PublicizeServiceAdapter.OnServiceClickListener; |
30 | 32 | import org.wordpress.android.ui.quickstart.QuickStartEvent; |
31 | 33 | import org.wordpress.android.ui.utils.UiString.UiStringText; |
| 34 | +import org.wordpress.android.util.JetpackBrandingUtils; |
| 35 | +import org.wordpress.android.util.JetpackBrandingUtils.Screen; |
32 | 36 | import org.wordpress.android.util.NetworkUtils; |
33 | 37 | import org.wordpress.android.util.QuickStartUtils; |
34 | 38 | import org.wordpress.android.util.QuickStartUtilsWrapper; |
@@ -60,6 +64,7 @@ public interface PublicizeButtonPrefsListener { |
60 | 64 | @Inject QuickStartUtilsWrapper mQuickStartUtilsWrapper; |
61 | 65 | @Inject QuickStartRepository mQuickStartRepository; |
62 | 66 | @Inject SnackbarSequencer mSnackbarSequencer; |
| 67 | + @Inject JetpackBrandingUtils mJetpackBrandingUtils; |
63 | 68 |
|
64 | 69 | public static PublicizeListFragment newInstance(@NonNull SiteModel site) { |
65 | 70 | Bundle args = new Bundle(); |
@@ -130,6 +135,19 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa |
130 | 135 | showQuickStartFocusPoint(); |
131 | 136 | } |
132 | 137 |
|
| 138 | + if (mJetpackBrandingUtils.shouldShowJetpackBranding()) { |
| 139 | + View jetpackBadgeFooter = rootView.findViewById(R.id.jetpack_badge_footer); |
| 140 | + jetpackBadgeFooter.setVisibility(View.VISIBLE); |
| 141 | + |
| 142 | + if (mJetpackBrandingUtils.shouldShowJetpackPoweredBottomSheet()) { |
| 143 | + jetpackBadgeFooter.setOnClickListener(v -> { |
| 144 | + mJetpackBrandingUtils.trackBannerTapped(Screen.SHARE); |
| 145 | + new JetpackPoweredBottomSheetFragment() |
| 146 | + .show(requireActivity().getSupportFragmentManager(), JetpackPoweredBottomSheetFragment.TAG); |
| 147 | + }); |
| 148 | + } |
| 149 | + } |
| 150 | + |
133 | 151 | return rootView; |
134 | 152 | } |
135 | 153 |
|
|
0 commit comments