Code Monkey home page Code Monkey logo

Comments (5)

StefMa avatar StefMa commented on May 24, 2024

Yep, you are doing it wrong ☺️
I have never used Mosby but when I take a look into the Hello Word example you can adopt it to 100% to Ti!
You can also have a look into our Hello World example to get a feeling how to use Ti.

from thirtyinch.

Nxt3 avatar Nxt3 commented on May 24, 2024

That's just it, in the Mosby example, the Activity is calling the implemented methods from the View via presenter.callMethod(). Whereas in the Ti example, the View methods are implemented in the Activity.

from thirtyinch.

passsy avatar passsy commented on May 24, 2024

The sample of Ti isn't showing the full power (we are working on it). There are two kind of methods. Methods doing something with the view such as styling a Toolbar or setting text to a TextView should be part of the Activity. Those methods will be called (only) by the Presenter. The Presenter has logic when those methods should be called. Sadly, in the current sample, the logic in the Presenter is super small and basically non existent.
Another hint: If you required the Context or any kind of android View, put it into the Activity. When dealing with IO (databases and networking stuff) put it into the presenter.

from thirtyinch.

Nxt3 avatar Nxt3 commented on May 24, 2024

Is there a better example somewhere? If I can't see a better example I'm going to have to use something else (which I don't want to do). :|

from thirtyinch.

passsy avatar passsy commented on May 24, 2024

There are a few samples here on github. One of the best I found after a quick search is this here: https://github.com/Mavamaarten/MVPDemo_thirtyinch/tree/7d36935fcaf1436d3a975a86e65251671af2a721/app/src/main/java/com/icapps/mvp

from thirtyinch.

Related Issues (20)

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.