AQuery is like JQuery but it for android. AQuery allows the developer to write less and do more like Query View, Query Network and more.

Getting Started

To use this library Add in you top build.gradle :

allprojects {
    repositories {
      maven { url 'https://jitpack.io' }
    }
  }

Setup java 8 compiler for enable lambada expression in you app build.gradle :

compileOptions {
  sourceCompatibility 1.8
  targetCompatibility 1.8
}

Add in you app build.gradle :

implementation 'com.github.ar-android:AQuery:v1.0.0'

Use Case

As we have metion before AQuery is just like JQuery but for quering in android. Bellow example of use case.

Before using AQuery :

Button login = findViewById(R.id.login);
login.setOnClickListener(new View.OnClickListenner(){
    @Override
    public void onClick(View v) {
      // Do stuff
    }
})

After using AQuery :

aq.id(R.id.login).click(v -> {
  // Do stuff
});

Also you can do ajax request like this :

aq = new AQuery(this);

aq.ajax("https://api.github.com/users/ar-android")
        .get()
        .showLoading()
        .toObject(GithubUsers.class, (user, error) -> {
            // Do stuff
        });

And you can ajax request post too :

Map<String, String> params = new HashMap<>();
params.put("email", aq.id(R.id.email).text());
params.put("password", aq.id(R.id.password).text());

aq.ajax("https://ocit-tutorial.herokuapp.com/index.php")
        .post(params)
        .showLoading()
        .response((response, error) -> {
            if (response != null){
                aq.openFromRight(MainActivity.class);
            }
        });

And you can too bind image to image view :

// If you want rounded image
aq.id(R.id.image).image(user.getAvatar_url()).rounded();

// If you want set from drawable
aq.id(R.id.image).image(R.drawable.profile);

And AQuery have a lot of API check it on Documentation

Built With

Authors

See also the list of contributors who participated in this project.

License

Copyright 2017 Ahmad Rosid

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.