WePhoto allows you to automatically depict photos so that photos can be read these images on the screen reader.
Step 1. Add the JitPack repository to your build file (settings.gradle)
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}Step 2. Add the dependency
dependencies {
implementation 'com.github.signfordeaf:wephoto-kt:1.0.0'
}Ensure that the following permission is present in your Android Manifest file, located in app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
Call the getImageDescription function.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WeAccessConfig.initialize("YOUR_API_KEY")
enableEdgeToEdge()
setContentView(R.layout.activity_main)
imageView = findViewById(R.id.imageView)
imageView.getImageDescription("image-url", DescriptionType.LONG)
}
}