Questions tagged [presenter]

In MVP pattern the presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.

143 questions
2
votes
1 answer

Android MVP How to get data back from model to presenter

After some time developing personal Android Applications I found that usually Activities get really big and have both logic and UI operations quite mixed up. So looking for a way to separate logic from UI I came across MVP pattern and now I'm trying…
Aldridge1991
  • 1,326
  • 6
  • 24
  • 51
2
votes
2 answers

How to implement PhoneStateListener with MVP

I am refactoring one of my old apps in MVP. I have refactored most of the logic and now I am stuck with following one. In one of my Activities, I have implemented PhoneStateLister as following. private class CallStateListener extends…
Dhaval
  • 2,724
  • 2
  • 24
  • 33
2
votes
3 answers

In MVP pattern, should Presenter be activity-wise or functionality-wise of Android app

While building Android App using MVP pattern, I am wondering should I use presenter activity-wise or functionality-wise? Activity-wise means, number of presenters equivalent to number of Activities. Functionality-wise means, for each functionality,…
raghav_si
  • 185
  • 1
  • 15
2
votes
3 answers

Rails 5 Render view/partial with Active Job with presenter

I'm new to Rails and i've been trying out Active Job and Action Cable and also Presenter and I've searched all over the place but not being able to figure it out. so my question is that is there any way to use presenter in a partial and render it…
2
votes
2 answers

Using CSS and JQuery to control an iframe embedded with hard coded autoplay

I have a presentation made on Adobe Presenter which is embedded using an iframe. Autoplay was hard-coded in when the presentation was published. when the page is loaded the presentation starts automatically and the audio plays. Since I can't turn…
mackswel
  • 23
  • 2
2
votes
1 answer

Cannot resolve current top activity while showing viewmodel using mvvmcross

I'm implementing a custom presenter in my Mvvmcross application. What I wanted to accomplish is: regular navigation and fragment navigation. In my main activity, I managed to embed several fragment views based on this example:…
Jelle
  • 365
  • 3
  • 11
2
votes
1 answer

GWT Model View Presenter , Reusing Presenters ? Or Presenter - Presenter Communication

A rookie here. I just started with Ray Ryan's Google IO talk and following some articles on Google Developers site. I have not used any of the GWT add-ons like GWTP or MVP4G or GIN or any other stuff. Just followed the contacts example on the GWT…
Napster
  • 157
  • 3
  • 17
2
votes
1 answer

Rails - Helper Singleton and Rails Route Helpers in a Presenter

I can't seem to figure out why I'm getting a 500 Error when trying to utilize a route helper in my Presenter class Have a Presenter class under /apps/presenters/base_presenter.rb /apps/presenters/object_presenter.rb class BasePresenter def…
bokor
  • 1,829
  • 1
  • 19
  • 25
1
vote
0 answers

how to update ui in presenter android tv

class RecommendPresenter(val viewModel: HomeViewModel) : Presenter() { override fun onCreateViewHolder(parent: ViewGroup?): ViewHolder { val context = parent?.context val view = BaseColumnItemView(context!!) return…
Cupid Chow
  • 11
  • 1
1
vote
1 answer

Best way to define the presenter and outport in clear architecture?

I have been trying to follow clear architecture, to develop applications. most of the stuff suggested by uncle bob's clean architecture theoretically makes sense. As shown in the picture, All the use cases of the system define the output port,…
rahul Kushwaha
  • 2,395
  • 7
  • 32
  • 64
1
vote
0 answers

UnitTest does't work properly for MVP pattern Swift

I'm trying to write some UnitTests for the first time. My pattern is MVP and I'm trying to test my Presenter. I've created mock class: class TeamViewMock: TeamViewPresenterProtocol { }. It contains all the methods from my real Presenter. Inside the…
1
vote
1 answer

Name conflict between controller name and presenter namespace

I am using the presenter pattern and am seemingly running into inconsistent class naming conflicts. I have a pages controller with a homepage method and I'd like to have that method use the Pages::HomepagePresenter class, but end up with the…
Eric M.
  • 5,399
  • 6
  • 41
  • 67
1
vote
1 answer

How to create template protocol for presenter UITableViewCell delegate IN VIPER

I am using VIPER architecture with Swift. I want to use protocol for presenter to get UITableView delegate, because I do not want to repeat the declarations of those methods for all presenters. So I have created protocol protocol…
Mirzohid Akbarov
  • 1,192
  • 1
  • 10
  • 17
1
vote
2 answers

Ruby: define a class that returns something other than itself when an instance is called without any methods

I'm wondering if there's a way to return an object instead of a string when calling an object without any methods. For instance: class Foo def initialize @bar = Bar.new end end Is there any way to define the Foo class so that the following…
Andrew
  • 42,517
  • 51
  • 181
  • 281
1
vote
1 answer

Presenter Pattern

I have often seen pattern 1 used the most for Rails presenters. 1) Why does the presenter need a view context? 2) Between pattern 1 and 2, pattern 2 seems easier, since you don't need to wrap the entire code with a block. Why isn't this used more…
user2012677
  • 5,465
  • 6
  • 51
  • 113
1 2
3
9 10