Skip to main content
PESDK/Android/Guides/User Interface/Customize Layout
Language:

Custom Activity

PhotoEditor SDK supports extending from PhotoEditorActivity and creating your custom activity to use with our editor.

Extending from PhotoEditorActivity#

Here, we create our custom activity extending from PhotoEditorActivity. We copy the layout from our demo repository and add a custom view to it.

Make sure to add your custom activity to the AndroidManifest.xml.

Set custom activity#

Here, we pass our custom activity class to the PhotoEditorBuilder. This indicates to the SDK to use the custom activity for showing the photo editor.

File:
class CustomPhotoEditorActivity : PhotoEditorActivity() {
private lateinit var imglyCustomView: ImglyCustomView
// Override the layoutResource to specify your own layout
override var layoutResource = R.layout.activity_custom_editor
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
imglyCustomView = findView(R.id.imgly_custom_view)
imglyCustomView.setOnClickListener {
Toast.makeText(this, "Banner Clicked", Toast.LENGTH_SHORT).show()
}
}
}