Auster


Source link: https://github.com/Prokky/Auster

Auster

Simple lightweight MVP library for Android

##Usage To include this library to your project add dependency in build.gradle file:

dependencies {

  compile 'com.prokkypew:auster:0.9.2' 
}

MvpActivity, MvpFragment, MvpView

First create your mvp view interface which extends MvpView and put view callbacks there.

public interface MyMvpView extends MvpView {

  void onLoad(String text);
 
}

Then create your presenter which extends MvpPresenter and put api/data calls there to bind them to your view.

public class MyMvpPresenter extends MvpPresenter<MyMvpView> {

  public MyMvpPresenter() {

}

public void loadIp() {

checkViewAttached();

getMvpView().setProgress(true);

// make your ip call, and then use your mvp callback to pass received data to your view.

IpApi.getApi().getIp().enqueue(new Callback<IpObject>() {

 @Override

 public void onResponse(Call<IpObject> call, Response<IpObject> response) {

  checkViewAttached();

  getMvpView().setProgress(false);

  getMvpView().onLoad(response.body().getText());

 
}

  @Override

 public void onFailure(Call<IpObject> call, Throwable t) {

  checkViewAttached();

  getMvpView().setProgress(false);

  getMvpView().onError(0, t.getLocalizedMessage());

 
}

}
);

  
}
 
}

Finally, create your activity which extends MvpActivity, or fragment which extends MvpFragment and implements your MvpView function.

public class MainActivity extends MvpActivity<MainMvpPresenter> implements MainMvpView {

  @Override
  protected MyMvpPresenter getPresenter() {

return new MyMvpPresenter();

  
}
 
}

And make your presenter call where needed:

presenter.loadIp();

There is no need to use MvpFragment or MvpActivity, you can just extend MvpView for any view you like.

License

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.

Resources

java-object-diff is a simple, yet powerful library to find differences between Java objects. It takes two objects and generates a tree structure that represents any differences between the objects and their children. This tree can then be traversed to extract more information or apply changes to the underlying data structures.

Did you used sqlite to save your data on Android? If you did, you may be puzzled for the complexity of mechanism. Now the Andoird ORM (Aorm) coming which armed to make it simple for the developers.

Sample project showing usage of AutoValue library.

This project holds adapters for combining Realm Java with Android UI components and framework classes.

Another sliding menu base on DrawerLayout.

AutoTypeTextView is simple library which add encryption, decryption and texting animations.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes