Skip to content

Commit a583de2

Browse files
fix: use ContextCompat in MainActivity
1 parent ca1e1e0 commit a583de2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import androidx.appcompat.app.AlertDialog
3030
import androidx.appcompat.app.AppCompatActivity
3131
import androidx.appcompat.content.res.AppCompatResources
3232
import androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
33+
import androidx.core.content.ContextCompat
3334
import androidx.core.content.FileProvider
3435
import org.wordpress.android.util.AppLog
3536
import org.wordpress.android.util.ImageUtils
@@ -469,7 +470,7 @@ open class MainActivity : AppCompatActivity(),
469470
aztec.visualEditor.setCalypsoMode(false)
470471
aztec.sourceEditor?.setCalypsoMode(false)
471472

472-
aztec.visualEditor.setBackgroundSpanColor(resources.getColor(R.color.blue_dark))
473+
aztec.visualEditor.setBackgroundSpanColor(ContextCompat.getColor(this, R.color.blue_dark))
473474

474475
aztec.sourceEditor?.displayStyledAndFormattedHtml(EXAMPLE)
475476

0 commit comments

Comments
 (0)