Skip to content

Commit

Permalink
Merge pull request #1050 from wordpress-mobile/build/enable-non-trans…
Browse files Browse the repository at this point in the history
…itive-resources

[Build] Enable Non-Transitive Resources
  • Loading branch information
ParaskP7 authored Jul 6, 2023
2 parents b1f600a + f2dcd9c commit 6a119a9
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import org.wordpress.aztec.demo.BasePage
import org.wordpress.aztec.demo.R
import org.wordpress.aztec.R as AztecR

class EditLinkPage : BasePage() {

Expand All @@ -24,9 +24,9 @@ class EditLinkPage : BasePage() {
get() = onView(withText("Insert link"))

init {
urlField = onView(withId(R.id.linkURL))
nameField = onView(withId(R.id.linkText))
openInNewWindowCheckbox = onView(withId(R.id.openInNewWindow))
urlField = onView(withId(AztecR.id.linkURL))
nameField = onView(withId(AztecR.id.linkText))
openInNewWindowCheckbox = onView(withId(AztecR.id.openInNewWindow))
okButton = onView(withId(android.R.id.button1))
cancelButton = onView(withId(android.R.id.button2))
removeButton = onView(withId(android.R.id.button3))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.wordpress.aztec.demo.pages

import android.view.KeyEvent
import android.view.View
import androidx.test.espresso.DataInteraction
import androidx.test.espresso.Espresso.onData
import androidx.test.espresso.Espresso.onView
Expand All @@ -12,8 +14,6 @@ import androidx.test.espresso.action.ViewActions.typeTextIntoFocusedView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import android.view.KeyEvent
import android.view.View
import org.hamcrest.Matcher
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.hasToString
Expand All @@ -22,6 +22,8 @@ import org.wordpress.aztec.demo.Actions
import org.wordpress.aztec.demo.BasePage
import org.wordpress.aztec.demo.Matchers
import org.wordpress.aztec.demo.R
import org.wordpress.aztec.R as AztecR
import org.wordpress.aztec.plugins.wpcomments.R as WPCommentsR

class EditorPage : BasePage() {
private var editor: ViewInteraction
Expand Down Expand Up @@ -58,20 +60,20 @@ class EditorPage : BasePage() {
undoButton = onView(withId(R.id.undo))
redoButton = onView(withId(R.id.redo))

openMediaToolbarButton = onView(withId(R.id.format_bar_button_media_collapsed))
closeMediaToolbarButton = onView(withId(R.id.format_bar_button_media_expanded))
headingButton = onView(withId(R.id.format_bar_button_heading))
listButton = onView(withId(R.id.format_bar_button_list))
quoteButton = onView(withId(R.id.format_bar_button_quote))
boldButton = onView(withId(R.id.format_bar_button_bold))
italicsButton = onView(withId(R.id.format_bar_button_italic))
linkButton = onView(withId(R.id.format_bar_button_link))
underlineButton = onView(withId(R.id.format_bar_button_underline))
strikethroughButton = onView(withId(R.id.format_bar_button_strikethrough))
horizontalRuleButton = onView(withId(R.id.format_bar_button_horizontal_rule))
moreRuleButton = onView(withId(R.id.format_bar_button_more))
pageButton = onView(withId(R.id.format_bar_button_page))
htmlButton = onView(withId(R.id.format_bar_button_html))
openMediaToolbarButton = onView(withId(AztecR.id.format_bar_button_media_collapsed))
closeMediaToolbarButton = onView(withId(AztecR.id.format_bar_button_media_expanded))
headingButton = onView(withId(AztecR.id.format_bar_button_heading))
listButton = onView(withId(AztecR.id.format_bar_button_list))
quoteButton = onView(withId(AztecR.id.format_bar_button_quote))
boldButton = onView(withId(AztecR.id.format_bar_button_bold))
italicsButton = onView(withId(AztecR.id.format_bar_button_italic))
linkButton = onView(withId(AztecR.id.format_bar_button_link))
underlineButton = onView(withId(AztecR.id.format_bar_button_underline))
strikethroughButton = onView(withId(AztecR.id.format_bar_button_strikethrough))
horizontalRuleButton = onView(withId(AztecR.id.format_bar_button_horizontal_rule))
moreRuleButton = onView(withId(WPCommentsR.id.format_bar_button_more))
pageButton = onView(withId(WPCommentsR.id.format_bar_button_page))
htmlButton = onView(withId(AztecR.id.format_bar_button_html))

photoButton = onView(allOf(withId(android.R.id.title), withText("Photo from device")))
galleryButton = onView(withId(R.id.media_bar_button_gallery))
Expand Down
13 changes: 7 additions & 6 deletions app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import org.wordpress.aztec.util.AztecLog
import org.xml.sax.Attributes
import java.io.File
import java.util.Random
import org.wordpress.aztec.R as AztecR

open class MainActivity : AppCompatActivity(),
AztecText.OnImeBackListener,
Expand Down Expand Up @@ -489,7 +490,7 @@ open class MainActivity : AppCompatActivity(),
aztec.visualEditor.setCalypsoMode(false)
aztec.sourceEditor?.setCalypsoMode(false)

aztec.visualEditor.setBackgroundSpanColor(ContextCompat.getColor(this, R.color.blue_dark))
aztec.visualEditor.setBackgroundSpanColor(ContextCompat.getColor(this, AztecR.color.blue_dark))

aztec.sourceEditor?.displayStyledAndFormattedHtml(EXAMPLE)

Expand Down Expand Up @@ -704,7 +705,7 @@ open class MainActivity : AppCompatActivity(),
startActivityForResult(intent, REQUEST_MEDIA_PHOTO)
} catch (exception: ActivityNotFoundException) {
AppLog.e(AppLog.T.EDITOR, exception.message)
ToastUtils.showToast(this, getString(R.string.error_chooser_photo), ToastUtils.Duration.LONG)
ToastUtils.showToast(this, getString(AztecR.string.error_chooser_photo), ToastUtils.Duration.LONG)
}
}
}
Expand All @@ -719,7 +720,7 @@ open class MainActivity : AppCompatActivity(),
startActivityForResult(intent, REQUEST_MEDIA_VIDEO)
} catch (exception: ActivityNotFoundException) {
AppLog.e(AppLog.T.EDITOR, exception.message)
ToastUtils.showToast(this, getString(R.string.error_chooser_video), ToastUtils.Duration.LONG)
ToastUtils.showToast(this, getString(AztecR.string.error_chooser_video), ToastUtils.Duration.LONG)
}
}
}
Expand Down Expand Up @@ -819,7 +820,7 @@ open class MainActivity : AppCompatActivity(),
val mediaPending = aztec.visualEditor.getAllElementAttributes(uploadingPredicate).isNotEmpty()

if (mediaPending) {
ToastUtils.showToast(this, R.string.media_upload_dialog_message)
ToastUtils.showToast(this, AztecR.string.media_upload_dialog_message)
} else {
aztec.toolbar.toggleEditorMode()
}
Expand Down Expand Up @@ -858,8 +859,8 @@ open class MainActivity : AppCompatActivity(),

private fun showMediaUploadDialog() {
val builder = AlertDialog.Builder(this)
builder.setMessage(getString(org.wordpress.aztec.R.string.media_upload_dialog_message))
builder.setPositiveButton(getString(org.wordpress.aztec.R.string.media_upload_dialog_positive), null)
builder.setMessage(getString(AztecR.string.media_upload_dialog_message))
builder.setPositiveButton(getString(AztecR.string.media_upload_dialog_positive), null)
mediaUploadDialog = builder.create()
mediaUploadDialog!!.show()
}
Expand Down
13 changes: 8 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.enableJetifier=false
android.useAndroidX=true


# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
org.gradle.parallel=true

# AztecAndroid-Android properties.

android.enableJetifier=false
android.useAndroidX=true

android.nonTransitiveRClass=true
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.6.10'
gradle.ext.agpVersion = '7.2.1'
gradle.ext.automatticPublishToS3Version = '0.7.0'

plugins {
id "com.android.library" version gradle.ext.agpVersion
id "com.android.application" version gradle.ext.agpVersion
id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
id "com.automattic.android.publish-to-s3" version "0.7.0"
id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version
}
repositories {
maven {
Expand Down

0 comments on commit 6a119a9

Please sign in to comment.