Skip to content

RecyclerView QueryAdapter + Example #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from

Conversation

lukas1994
Copy link
Contributor

added ParseQueryRecyclerViewAdapter (similar to ParseQueryAdapter)
simple example

@lukas1994
Copy link
Contributor Author

I saw that we also don't have an example for the ListView query adapter. Should we add one or are we deprecating ParseQueryAdapter?

@@ -3,6 +3,8 @@ apply plugin: 'android-library'
dependencies {
compile 'com.parse.bolts:bolts-android:1.2.1'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to make these provided so that they're not required if they're not using these helpers, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use provided but it doesn't build.

@grantland
Copy link
Contributor

Do we really want to keep the same API design as ParseQueryAdapter? I thought it had some issues with the current API design.

Some things that might make this design a bit better like converting void loadObjects() to Task<Void> loadObjectsInBackground()

@lukas1994
Copy link
Contributor Author

I was thinking about keeping the API as similar as possible to the old adapter so that's easy for people to update their apps. Currently, we can't use Tasks (see parse-community/Parse-SDK-Android#6).

- added test file
- added copyright / doc
- moved binding to ViewHolder
- use 2 spaces for indentation
@grantland
Copy link
Contributor

We can't use ParseQuery Tasks APIs, but we can still return Tasks by utilizing TaskCompletionSources.

Lukas Koebis added 4 commits September 10, 2015 20:41
- use exception instead of package-private method
- copyed private static method
@@ -5,6 +5,9 @@ dependencies {
compile 'com.android.support:support-v4:22.0.0'
compile 'com.parse:parse-android:1.10.1'

compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:recyclerview-v7:22.0.0'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm... I don't like the fact that we're requiring these when developers might not be utilizing ParseQueryAdapter... Why not leave as provided and have the same use compile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use provided but it didn't compile.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what target didn't compile? and i had a typo: why not leave this as provided and the sample/example compile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I use provided then connectedDebugAndroidTest fails with java.lang.NoClassDefFoundError: com.parse.widget.ParseQueryAdapter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add compile dependencies to androidTest by using androidTestCompile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using androidTestCompile and adding androidTestCompile and provided, both doesn't work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hrm grab me sometime tomorrow and we can check out what's going on, but it should work with provided and androidTestCompile

@@ -0,0 +1,612 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename as ParseQueryAdapterTest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ParseQueryAdapterTest is used for the ListView adapter :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could probably benefit from changing packages as well to match

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then we can't use any of the package-private classes like ParseQueryController, ParseCurrentUserController, ParseQuery.State, ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right... nvm then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants