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

[Home Page Picker] Enable the feature #13409

Merged
merged 19 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
16.3
-----
* [***] Site Creation: Adds an option to pick a home page design when creating a WordPress.com site.
* [*] Posts Settings: removed deprecated location setting [https://github.com/wordpress-mobile/WordPress-Android/pull/13404]
* [***] Stories: New feature for WordPress.com and Jetpack sites: Use photos and videos to create engaging and tappable fullscreen slideshows. [https://github.com/wordpress-mobile/WordPress-Android/pull/13459]

Expand Down
5 changes: 1 addition & 4 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ android {
buildConfigField "boolean", "FEATURE_ANNOUNCEMENT_AVAILABLE", "false"
buildConfigField "boolean", "GUTENBERG_MENTIONS", "true"
buildConfigField "boolean", "MODAL_LAYOUT_PICKER", "true"
buildConfigField "boolean", "HOME_PAGE_PICKER", "false"
buildConfigField "boolean", "HOME_PAGE_PICKER", "true"
buildConfigField "boolean", "UNIFIED_LOGIN_AVAILABLE", "true"
buildConfigField "boolean", "WP_STORIES_AVAILABLE", "true"
buildConfigField "boolean", "ANY_FILE_UPLOAD", "true"
Expand Down Expand Up @@ -105,7 +105,6 @@ android {
buildConfigField "boolean", "TENOR_AVAILABLE", "false"
buildConfigField "long", "REMOTE_CONFIG_FETCH_INTERVAL", "3600"
buildConfigField "boolean", "GUTENBERG_MENTIONS", "true"
buildConfigField "boolean", "HOME_PAGE_PICKER", "false"
buildConfigField "boolean", "WP_STORIES_AVAILABLE", "true"
buildConfigField "boolean", "ANY_FILE_UPLOAD", "false"
buildConfigField "boolean", "ENABLE_FEATURE_CONFIGURATION", "false"
Expand All @@ -121,7 +120,6 @@ android {
wasabi { // "hot" version, can be installed along release, alpha or beta versions
applicationId "org.wordpress.android.beta"
dimension "buildType"
buildConfigField "boolean", "HOME_PAGE_PICKER", "true"
// Enable this for testing consolidated media picker
// buildConfigField "boolean", "CONSOLIDATED_MEDIA_PICKER", "true"
buildConfigField "boolean", "FOLLOW_UNFOLLOW_COMMENTS", "true"
Expand All @@ -130,7 +128,6 @@ android {
jalapeno { // Pre-Alpha version, used for PR builds, can be installed along release, alpha, beta, dev versions
applicationId "org.wordpress.android.prealpha"
dimension "buildType"
buildConfigField "boolean", "HOME_PAGE_PICKER", "false"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class SiteCreationTracker @Inject constructor(val tracker: AnalyticsTrackerWrapp

fun trackSiteDesignPreviewLoaded(template: String) {
tracker.track(
AnalyticsTracker.Stat.ENHANCED_SITE_CREATION_SUCCESS_PREVIEW_LOADED,
AnalyticsTracker.Stat.ENHANCED_SITE_CREATION_SITE_DESIGN_PREVIEW_LOADED,
mapOf("template" to template)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class SiteCreationPreviewFragment : SiteCreationBaseFormFragment(),
viewModel.preloadPreview.observe(this, Observer { url ->
url?.let {
sitePreviewWebView.webViewClient = URLFilteredWebViewClient(url, this@SiteCreationPreviewFragment)
sitePreviewWebView.settings.userAgentString = WordPress.getUserAgent()
sitePreviewWebView.loadUrl(url)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class DesignPreviewFragment : FullscreenBottomSheetDialogFragment() {
when (state) {
is Loading -> {
progressBar.setVisible(true)
webView.setVisible(true)
webView.setVisible(false)
errorView.setVisible(false)
webView.loadUrl(url)
}
Expand All @@ -89,6 +89,7 @@ class DesignPreviewFragment : FullscreenBottomSheetDialogFragment() {

chooseButton.setOnClickListener { viewModel.onPreviewChooseTapped() }

webView.settings.userAgentString = WordPress.getUserAgent()
webView.webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
style="@style/SiteCreationHeaderLinearLayoutStyle"
android:paddingStart="@dimen/site_creation_segments_content_padding_horizontal"
android:paddingTop="@dimen/site_creation_segments_content_padding_vertical"
android:paddingEnd="@dimen/site_creation_segments_content_padding_horizontal"
android:paddingBottom="@dimen/site_creation_segments_content_padding_vertical">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="@dimen/picker_bottom_button_vertical_margin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="@dimen/picker_bottom_button_vertical_margin"
Expand Down
9 changes: 5 additions & 4 deletions WordPress/src/main/res/layout/home_page_picker_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:fitsSystemWindows="false"
android:focusableInTouchMode="true">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:fitsSystemWindows="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
Expand All @@ -32,13 +32,14 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:elevation="0dp"
app:layout_collapseMode="pin">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height"
android:layout_marginTop="@dimen/margin_extra_small"
android:orientation="vertical">

<include
Expand Down Expand Up @@ -70,7 +71,7 @@
android:paddingStart="@dimen/hpp_card_padding"
android:paddingEnd="0dp"
android:paddingBottom="@dimen/toolbar_content_offset"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:clipToPadding="false"
android:descendantFocusability="beforeDescendants"
android:scrollbars="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
app:shimmer_base_alpha="@dimen/skeleton_shimmer_base_alpha"
app:shimmer_highlight_alpha="@dimen/skeleton_shimmer_highlight_alpha">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_marginTop="@dimen/margin_small_medium">

<ImageButton
android:id="@+id/backButton"
Expand Down Expand Up @@ -69,7 +70,7 @@
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|top" />
android:layout_gravity="center" />
</FrameLayout>

<LinearLayout
Expand All @@ -84,7 +85,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:gravity="center"
android:paddingBottom="@dimen/picker_bottom_button_vertical_margin"
android:paddingTop="@dimen/picker_bottom_button_vertical_margin">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="@dimen/picker_bottom_button_vertical_margin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="@dimen/picker_bottom_button_vertical_margin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:id="@+id/categoriesSkeleton"
android:layout_width="match_parent"
android:layout_height="@dimen/mlp_categories_bar_height"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:paddingEnd="@dimen/mlp_layout_card_margin_end"
android:paddingStart="@dimen/mlp_layout_card_margin_start">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:id="@+id/errorLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/mlp_layouts_row_height"
android:background="?attr/categoriesBackground">
android:background="?attr/layoutPickerBackground">

<org.wordpress.android.ui.ActionableEmptyView
android:id="@+id/actionableEmptyView"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:fitsSystemWindows="false">

<com.google.android.material.appbar.CollapsingToolbarLayout
Expand All @@ -32,7 +32,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:elevation="0dp"
app:layout_collapseMode="pin">

Expand Down Expand Up @@ -69,7 +69,7 @@
android:id="@+id/categoriesRecyclerView"
android:layout_width="match_parent"
android:layout_height="@dimen/mlp_categories_bar_height"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:clipToPadding="false"
android:descendantFocusability="beforeDescendants"
android:orientation="horizontal"
Expand All @@ -89,7 +89,7 @@
android:id="@+id/layoutsRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:layout_marginBottom="@dimen/toolbar_content_offset"
android:clipToPadding="false"
android:descendantFocusability="beforeDescendants"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/mlp_layouts_row_height"
android:layout_marginTop="@dimen/margin_extra_large"
android:background="?attr/categoriesBackground">
android:background="?attr/layoutPickerBackground">

<com.facebook.shimmer.ShimmerFrameLayout
android:layout_width="match_parent"
Expand Down
3 changes: 2 additions & 1 deletion WordPress/src/main/res/layout/site_creation_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="true"
android:orientation="vertical">
android:orientation="vertical"
android:background="?attr/layoutPickerBackground">

<FrameLayout
android:id="@+id/fragment_container"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
android:id="@+id/create_site_button_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?attr/categoriesBackground"
android:background="?attr/layoutPickerBackground"
android:gravity="center"
android:paddingBottom="@dimen/picker_bottom_button_vertical_margin"
android:paddingTop="@dimen/picker_bottom_button_vertical_margin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:id="@+id/appbar_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/layoutPickerBackground"
app:liftOnScrollTargetViewId="@+id/site_creation_nested_scroll_view">

<com.google.android.material.appbar.MaterialToolbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
style="@style/SiteCreationHeaderLinearLayoutStyle"
android:paddingStart="@dimen/site_creation_segments_content_padding_horizontal"
android:paddingTop="@dimen/site_creation_segments_content_padding_vertical"
android:paddingEnd="@dimen/site_creation_segments_content_padding_horizontal"
android:paddingBottom="@dimen/site_creation_segments_content_padding_vertical">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="?attr/colorSurface"
android:background="?attr/layoutPickerBackground"
tools:visibility="invisible">

<ProgressBar
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values-en-rAU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ Language: en_AU
<string name="new_site_creation_create_site_button">Create Site</string>
<string name="new_site_creation_search_domain_input_hint">Search Domains</string>
<string name="new_site_creation_domain_header_subtitle">This is where people will find you on the internet.</string>
<string name="new_site_creation_domain_header_title">Choose a domain name for your site</string>
<string name="new_site_creation_domain_header_title">Choose a domain</string>
<string name="new_site_creation_empty_domain_list_message">No available addresses matching your search</string>
<string name="site_creation_error_generic_subtitle">Error communicating with the server, please try again</string>
<string name="site_creation_error_generic_title">There was a problem</string>
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values-en-rCA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ Language: en_CA
<string name="new_site_creation_create_site_button">Create Site</string>
<string name="new_site_creation_search_domain_input_hint">Search Domains</string>
<string name="new_site_creation_domain_header_subtitle">This is where people will find you on the internet.</string>
<string name="new_site_creation_domain_header_title">Choose a domain name for your site</string>
<string name="new_site_creation_domain_header_title">Choose a domain</string>
<string name="new_site_creation_empty_domain_list_message">No available addresses matching your search</string>
<string name="site_creation_error_generic_subtitle">Error communicating with the server, please try again</string>
<string name="site_creation_error_generic_title">There was a problem</string>
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values-en-rGB/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ Language: en_GB
<string name="new_site_creation_create_site_button">Create Site</string>
<string name="new_site_creation_search_domain_input_hint">Search Domains</string>
<string name="new_site_creation_domain_header_subtitle">This is where people will find you on the internet.</string>
<string name="new_site_creation_domain_header_title">Choose a domain name for your site</string>
<string name="new_site_creation_domain_header_title">Choose a domain</string>
<string name="new_site_creation_empty_domain_list_message">No available addresses matching your search</string>
<string name="site_creation_error_generic_subtitle">Error communicating with the server, please try again</string>
<string name="site_creation_error_generic_title">There was a problem</string>
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<item name="categoriesButtonBackground">@color/mlp_categories_button_background_dark</item>
<item name="categoriesButtonBackgroundSelected">@color/mlp_categories_button_background_selected_dark</item>
<item name="mlpDividerColor">@color/mlp_divider_dark</item>
<item name="categoriesBackground">@color/mlp_categories_background_dark</item>
<item name="layoutPickerBackground">@color/mlp_categories_background_dark</item>

<!-- Material Date Range Picker -->
<item name="materialCalendarStyle">@style/WordPress.MaterialCalendarStyle</item>
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<attr name="colorGutenbergBackground" format="reference|color" />

<!-- Modal layout picker colors-->
<attr name="categoriesBackground" format="reference|color" />
<attr name="layoutPickerBackground" format="reference|color" />
<attr name="categoriesButtonBackground" format="reference|color" />
<attr name="categoriesButtonBackgroundSelected" format="reference|color" />
<attr name="mlpDividerColor" format="reference|color" />
Expand Down
1 change: 1 addition & 0 deletions WordPress/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
@dimen/emphasis_extra_low
</item>

<dimen name="text_sz_extra_extra_small">7sp</dimen>
<dimen name="text_sz_extra_small">10sp</dimen>
<dimen name="text_sz_small">12sp</dimen>
<dimen name="text_sz_medium">14sp</dimen>
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@

<!-- Home Page Picker -->
<string name="hpp_title">Choose a design</string>
<string name="hpp_subtitle">Pick your favorite homepage layout. You can customize or change it later.</string>
<string name="hpp_subtitle">Pick your favorite homepage layout. You can edit and customize it later.</string>
<string name="hpp_choose_button">Choose</string>
<string name="hpp_skip_button">Skip</string>
<string name="hpp_error_title">Layouts not available while offline</string>
Expand Down
6 changes: 4 additions & 2 deletions WordPress/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<item name="categoriesButtonBackground">@color/mlp_categories_button_background</item>
<item name="categoriesButtonBackgroundSelected">@color/grey_900</item>
<item name="mlpDividerColor">@color/grey_300</item>
<item name="categoriesBackground">@color/white</item>
<item name="layoutPickerBackground">@color/white</item>

<!-- Material Date Range Picker -->
<item name="materialCalendarStyle">@style/WordPress.MaterialCalendarStyle</item>
Expand Down Expand Up @@ -1419,7 +1419,9 @@
<style name="ModalLayoutPickerCategoryEmoji" parent="ModalLayoutPickerText">
<item name="android:layout_width">@dimen/mlp_categories_emoji_size</item>
<item name="android:layout_height">@dimen/mlp_categories_emoji_size</item>
<item name="android:textSize">@dimen/text_sz_medium</item>
<item name="autoSizeMaxTextSize">@dimen/text_sz_medium</item>
<item name="autoSizeMinTextSize">@dimen/text_sz_extra_extra_small</item>
<item name="autoSizeTextType">uniform</item>
<item name="android:layout_marginStart">@dimen/mlp_category_horizontal_margin</item>
<item name="android:layout_marginEnd">@dimen/mlp_category_horizontal_central_margin</item>
<item name="android:textAppearance">?attr/textAppearanceBody2</item>
Expand Down
2 changes: 1 addition & 1 deletion libs/gutenberg-mobile
Submodule gutenberg-mobile updated 2 files
+1 −1 gutenberg
+1 −1 jetpack