Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:wordpress-mobile/WordPress-Android…
Browse files Browse the repository at this point in the history
… into ci/enable-dependency-cache-on-ci-final
  • Loading branch information
ParaskP7 committed Jan 17, 2025
2 parents 2363663 + 21f3d59 commit dfbef04
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 25 deletions.
3 changes: 2 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

25.7
-----

* [**] Send feedback from within the experimental editor "more" options menu. [#21586]
* [**] Support accessing the code editor within the experimental editor. [#21582]

25.6
-----
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/jetpack/res/values-night/colors_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<color name="colorSecondary">@color/primary_40</color>
<color name="colorSecondaryVariant">@color/primary_50</color>

<color name="colorPrimaryEditor">@color/blue_30</color>
<color name="colorPrimaryEditor">@color/colorPrimary</color>

<color name="nav_bar">@color/white</color>
<color name="tab_indicator">@color/white</color>
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/jetpack/res/values/colors_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<color name="colorSecondary">@color/primary</color>
<color name="colorSecondaryVariant">@color/primary_40</color>

<color name="colorPrimaryEditor">@color/blue_50</color>
<color name="colorPrimaryEditor">@color/colorPrimary</color>

<color name="primary">@color/jetpack_green_50</color>
<color name="primary_0">@color/jetpack_green_0</color>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,13 @@ public static void viewHelp(@NonNull Context context, @NonNull Origin origin, @N
}

public static void viewFeedbackForm(@NonNull Context context) {
viewFeedbackForm(context, null);
}

public static void viewFeedbackForm(@NonNull Context context, @Nullable String feedbackPrefix) {
AnalyticsTracker.track(Stat.APP_REVIEWS_FEEDBACK_SCREEN_OPENED);
Intent intent = new Intent(context, FeedbackFormActivity.class);
intent.putExtra(FeedbackFormActivity.EXTRA_FEEDBACK_PREFIX, feedbackPrefix);
context.startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.ui.platform.ViewCompositionStrategy
import dagger.hilt.android.AndroidEntryPoint
import androidx.appcompat.app.AppCompatActivity
import org.wordpress.android.ui.RequestCodes
import org.wordpress.android.ui.accounts.HelpActivity

@AndroidEntryPoint
class FeedbackFormActivity : AppCompatActivity() {
Expand All @@ -18,6 +19,9 @@ class FeedbackFormActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val feedbackPrefix = intent.getStringExtra(EXTRA_FEEDBACK_PREFIX)
viewModel.feedbackPrefix = feedbackPrefix

setContentView(
ComposeView(this).apply {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Expand Down Expand Up @@ -45,15 +49,21 @@ class FeedbackFormActivity : AppCompatActivity() {
viewModel.onRemoveMediaClick(it)
},
onSupportClick = {
// This will return to the Help screen, where the user can see the contact support link
finish()
navigateToHelpScreen()
},
)
}
}
)
}

private fun navigateToHelpScreen() {
val intent = Intent(this, HelpActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent)
finish()
}

@Deprecated("Deprecated in Java")
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
Expand All @@ -64,4 +74,8 @@ class FeedbackFormActivity : AppCompatActivity() {
}
}
}

companion object {
const val EXTRA_FEEDBACK_PREFIX = "extra_feedback_prefix"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class FeedbackFormViewModel @Inject constructor(
private val _progressDialogState = MutableStateFlow<ProgressDialogState?>(null)
val progressDialogState = _progressDialogState.asStateFlow()

var feedbackPrefix: String? = null

fun updateMessageText(message: String) {
if (message != _messageText.value) {
_messageText.value = message
Expand Down Expand Up @@ -138,12 +140,13 @@ class FeedbackFormViewModel @Inject constructor(
attachmentTokens: List<String> = emptyList()
) {
showProgressDialog(R.string.sending)
val descriptionPrefix = feedbackPrefix?.let { "[$it] " } ?: ""
zendeskHelper.createRequest(
context = context,
origin = HelpActivity.Origin.FEEDBACK_FORM,
selectedSite = selectedSiteRepository.getSelectedSite(),
extraTags = listOf("in_app_feedback"),
requestDescription = _messageText.value,
requestDescription = descriptionPrefix + _messageText.value,
attachmentTokens = attachmentTokens,
callback = object : ZendeskHelper.CreateRequestCallback() {
override fun onSuccess() {
Expand Down Expand Up @@ -303,4 +306,3 @@ class FeedbackFormViewModel @Inject constructor(
private const val MAX_ATTACHMENTS = 5
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,8 @@ class EditPostActivity : AppCompatActivity(), EditorFragmentActivity, EditorImag
val historyMenuItem = menu.findItem(R.id.menu_history)
val settingsMenuItem = menu.findItem(R.id.menu_post_settings)
val helpMenuItem = menu.findItem(R.id.menu_editor_help)
val sendFeedbackItem = menu.findItem(R.id.menu_editor_send_feedback)

if (undoItem != null) {
undoItem.setEnabled(menuHasUndo)
undoItem.setVisible(!htmlModeMenuStateOn)
Expand All @@ -1426,10 +1428,7 @@ class EditPostActivity : AppCompatActivity(), EditorFragmentActivity, EditorImag
}
previewMenuItem?.setVisible(showMenuItems)
if (viewHtmlModeMenuItem != null) {
viewHtmlModeMenuItem.setVisible(
(((editorFragment is AztecEditorFragment)
|| (editorFragment is GutenbergEditorFragment))) && showMenuItems
)
viewHtmlModeMenuItem.isVisible = showMenuItems
viewHtmlModeMenuItem.setTitle(
if (htmlModeMenuStateOn) R.string.menu_visual_mode else R.string.menu_html_mode)
}
Expand Down Expand Up @@ -1496,6 +1495,11 @@ class EditPostActivity : AppCompatActivity(), EditorFragmentActivity, EditorImag
helpMenuItem.setVisible(false)
}
}

if (sendFeedbackItem != null) {
sendFeedbackItem.isVisible = editorFragment is GutenbergKitEditorFragment
}

return super.onPrepareOptionsMenu(menu)
}

Expand Down Expand Up @@ -1645,6 +1649,8 @@ class EditPostActivity : AppCompatActivity(), EditorFragmentActivity, EditorImag
analyticsTrackerWrapper.track(Stat.EDITOR_HELP_SHOWN, siteModel)
(editorFragment as GutenbergEditorFragment).showEditorHelp()
}
} else if (itemId == R.id.menu_editor_send_feedback) {
ActivityLauncher.viewFeedbackForm(this@EditPostActivity, "Editor")
} else if (itemId == R.id.menu_undo_action) {
if (editorFragment is GutenbergEditorFragment) {
(editorFragment as GutenbergEditorFragment).onUndoPressed()
Expand Down
4 changes: 2 additions & 2 deletions WordPress/src/main/res/layout/add_category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
android:id="@+id/parent_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="-4dp"
android:layout_marginEnd="-4dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.DayNight"
tools:listitem="@layout/wp_simple_list_item_1" />

Expand All @@ -54,8 +56,6 @@
style="@style/WordPress.PrepubPrimaryButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginTop="@dimen/margin_medium"
android:layout_marginBottom="@dimen/margin_medium"
android:enabled="false"
Expand Down
12 changes: 5 additions & 7 deletions WordPress/src/main/res/layout/prepublishing_tags_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include
android:id="@+id/prepublishing_toolbar"
layout="@layout/prepublishing_toolbar" />

<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_large"
android:layout_marginTop="@dimen/margin_medium_large"
android:layout_margin="@dimen/margin_large"
android:text="@string/prepublishing_tags_description"
android:textAlignment="viewStart"
android:textAppearance="?attr/textAppearanceBody1"
android:textColor="?wpColorOnSurfaceMedium" />

<include
android:id="@+id/prepublishing_toolbar"
layout="@layout/prepublishing_toolbar" />

<include
android:id="@+id/fragment_post_settings_tags"
layout="@layout/fragment_post_settings_tags" />
Expand Down
3 changes: 3 additions & 0 deletions WordPress/src/main/res/layout/publicize_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/margin_extra_large"
android:layout_marginStart="@dimen/margin_extra_large"
android:gravity="center_vertical"
android:minHeight="@dimen/min_touch_target_sz"
android:text="@string/manage"
android:textAppearance="?attr/textAppearanceSubtitle1" />
</LinearLayout>
Expand Down
5 changes: 5 additions & 0 deletions WordPress/src/main/res/menu/edit_post.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,10 @@
android:title="@string/help_and_support" >
</item>

<item
android:id="@+id/menu_editor_send_feedback"
android:title="@string/send_feedback" >
</item>

</group>
</menu>
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values-night/colors_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<color name="colorSecondary">@color/primary_30</color>
<color name="colorSecondaryVariant">@color/primary_50</color>

<color name="colorPrimaryEditor">@color/primary_30</color>
<color name="colorPrimaryEditor">@color/colorPrimary</color>

<color name="nav_bar">@color/colorPrimary</color>
<color name="tab_indicator">@color/colorPrimary</color>
Expand Down
2 changes: 1 addition & 1 deletion WordPress/src/main/res/values/colors_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<color name="colorSecondary">@color/primary</color>
<color name="colorSecondaryVariant">@color/primary_70</color>

<color name="colorPrimaryEditor">@color/blue_50</color>
<color name="colorPrimaryEditor">@color/colorPrimary</color>

<color name="primary">@color/blue_50</color>
<color name="primary_0">@color/blue_0</color>
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 @@ -3730,7 +3730,7 @@
<string name="prepublishing_nudges_back_button">Back</string>
<string name="prepublishing_nudges_toolbar_title_tags">Add Tags</string>
<string name="prepublishing_nudges_toolbar_title_publish">Publish Date</string>
<string name="prepublishing_tags_description">Tags help tell readers what a post is about.</string>
<string name="prepublishing_tags_description">Tags help tell readers what a post is about</string>
<string name="prepublishing_nudges_home_tags_not_set">Not set</string>
<string name="prepublishing_nudges_story_title_hint">Give your story a title</string>
<string name="prepublishing_nudges_home_categories_not_set">Not set</string>
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ androidx-appcompat = '1.7.0'
androidx-arch-core = '2.2.0'
androidx-camera = '1.4.1'
androidx-cardview = '1.0.0'
androidx-compose-bom = '2024.12.01'
androidx-compose-bom = '2025.01.00'
androidx-compose-material3 = '1.3.1'
androidx-constraintlayout-compose = '1.1.0'
androidx-constraintlayout-main = '2.2.0'
Expand Down Expand Up @@ -71,7 +71,7 @@ google-play-services-auth = '20.4.1'
google-services = '4.4.2'
gravatar = '2.2.0'
greenrobot-eventbus = '3.3.1'
gutenberg-kit = '55-a490cd3d2d70ad4bba501655f83fdc42b404d502'
gutenberg-kit = 'trunk-cc52214a50893b41898607ac0bff7f2787b085bb'
gutenberg-mobile = 'v1.121.0'
indexos-media-for-mobile = '43a9026f0973a2f0a74fa813132f6a16f7499c3a'
jackson-databind = '2.12.7.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ private void toggleHtmlMode() {
mHtmlModeEnabled = !mHtmlModeEnabled;
mEditorFragmentListener.onTrackableEvent(TrackableEvent.HTML_BUTTON_TAPPED);
mEditorFragmentListener.onHtmlModeToggledInToolbar();
mGutenbergView.setTextEditorEnabled(mHtmlModeEnabled);
}

@Override
Expand Down

0 comments on commit dfbef04

Please sign in to comment.