Code Monkey home page Code Monkey logo

planmer's Introduction

XLibs

the library for android developers

it makes code so easy!!

this Library include the following function :

BaseLib(baseActivity,activityManager)

@Route(path = TestLibs.TestLibs_net_NetTestActivity)
public class NetTestActivity extends BaseActivity<NetTestView> {

    @Override
    public void afterInitView(NetTestView v) {
        v.post.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        if (v == view.post) {
            getP(NetTestP.class).getTestJson(new NetCallBack<TestM>() {
                @Override
                public void onGetData(TestM testM) {
                    view.response.setText(testM.getJson());
                }
                @Override
                public void onFinish() {
                    Log.e(getTag(), "onFinish");
                }

                @Override
                public void onFailure() {
                    Log.e(getTag(), "onFailure");
                }
            });
        }
    }

}

MVP frame

model

public class TestM extends BaseM {
    private String json;
  
    public String getJson() {
        return json;
    }

    public void setJson(String json) {
        this.json = json;
    }
}

view

public class NetTestView extends BaseV {
    public Button post;
    public TextView response;

    public NetTestView(AppCompatActivity activity) {
        super(activity);
    }

    @Override
    public int setViewLayout() {
        return R.layout.net_test_activity;
    }

    @Override
    public void initView() {
        post=findViewById(R.id.post);
        response=findViewById(R.id.response);
    }

}

presenter

public class NetTestP extends BaseP<NetTestS> {

    public Observable<TestM> getTestJson(NetCallBack<TestM> callBack) {
        return request(getService().getTestJson(), callBack);
    }
}

Modularization(base on ARouter)

LibJumpHelper.startActivity(TestLibs.TestLibs_MainActivity);

Dialog

http frame(base on Retrofit2+RxJava2)

XRetrofit.getServerCall(getSClass())
XRetrofit.toRequest(observable, netCallBack, disposables)

XWebView(base on x5)

code(base on blankJ AndroidUtilCode)

planmer's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.