Closed DatL4g closed 5 years ago
I don't know why they're one-sided!?
@DATL4G I think the documentation is a little bit old. There are ways to use in Java. Let me check a little bit.
I think it would work, gimme some time to check:
Initialization :
UnsplashPhotoPicker.INSTANCE.init(this,
"api key",,
"secrect key",
20);
Fetching Data
public class UnsplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_unsplash);
startActivityForResult(
UnsplashPickerActivity.Companion.getStartingIntent(this, false),
100
);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode == 100 && resultCode == Activity.RESULT_OK && data != null) {
ArrayList<UnsplashPhoto> photos = data.getParcelableArrayListExtra(UnsplashPickerActivity.EXTRA_PHOTOS);
}
super.onActivityResult(requestCode, resultCode, data);
}
}
@DATL4G it's working!
@unsplash this issue can be closed
Problem
It's annoying that the methods aren't usable in Java, only in Kotlin!
Solution
I'm only using Java because I don't like Kotlin cuz of it's stupid syntax, so I this library needs to be updated to make it useable in Java too.