Android Open Source - YOW2014-Android-MVVM View Model Base






From Project

Back to project page YOW2014-Android-MVVM.

License

The source code is released under:

MIT License

If you think the Android project YOW2014-Android-MVVM listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.adilmughal.demo.yow.mvvm.searchd.viewmodel;
// w  w w.jav  a  2 s  .c  o  m
import org.robobinding.presentationmodel.AbstractPresentationModel;

import android.os.Handler;
import android.os.Looper;

public class ViewModelBase extends AbstractPresentationModel {

  protected void notifyPropertyChanged(final String propertyName) {
    if (Looper.myLooper() == Looper.getMainLooper()) {
      super.firePropertyChange(propertyName);
    } else {
      // Dispatch/post to UI thread
      new Handler(Looper.getMainLooper()).post(new Runnable() {
        @Override
        public void run() {
          firePropertyChange(propertyName);
        }
      });
    }
  }
}




Java Source Code List

com.adilmughal.demo.yow.mvvm.searchd.activity.SearchActivity.java
com.adilmughal.demo.yow.mvvm.searchd.activity.SearchPclActivity.java
com.adilmughal.demo.yow.mvvm.searchd.contract.SearchRepository.java
com.adilmughal.demo.yow.mvvm.searchd.repository.DummySearchRepository.java
com.adilmughal.demo.yow.mvvm.searchd.viewmodel.SearchPclViewModel.java
com.adilmughal.demo.yow.mvvm.searchd.viewmodel.SearchViewModel.java
com.adilmughal.demo.yow.mvvm.searchd.viewmodel.StringItemPresentationModel.java
com.adilmughal.demo.yow.mvvm.searchd.viewmodel.ViewModelBase.java
com.adilmughal.demo.yow.mvvm.searchd.viewmodel.ViewModelPclBase.java
com.adilmughal.demo.yow.searchd.traditional.activity.SearchActivity.java
com.adilmughal.demo.yow.searchd.traditional.contract.SearchRepository.java
com.adilmughal.demo.yow.searchd.traditional.repository.DummySearchRepository.java