commit 3ae099643500469bb948870ba9ebcbc89e03fe84 Author: Hashik Donthineni HashikDonthineni@gmail.com Date: Sun Jul 26 16:47:24 2020 +0530
Changed MainActivityMVP to MainActivityMVP contract --- app/src/main/java/org/torproject/snowflake/MainActivity.java | 4 ++-- .../org/torproject/snowflake/models/MainActivityModel.java | 10 +++++----- .../mvp/{MainActivityMVP.java => MainActivityMVPContract.java} | 2 +- .../torproject/snowflake/presenters/MainActivityPresenter.java | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/app/src/main/java/org/torproject/snowflake/MainActivity.java b/app/src/main/java/org/torproject/snowflake/MainActivity.java index d888ffd..4a2eb33 100644 --- a/app/src/main/java/org/torproject/snowflake/MainActivity.java +++ b/app/src/main/java/org/torproject/snowflake/MainActivity.java @@ -18,13 +18,13 @@ import org.torproject.snowflake.constants.FragmentConstants; import org.torproject.snowflake.fragments.AppSettingsFragment; import org.torproject.snowflake.fragments.MainFragment; import org.torproject.snowflake.interfaces.MainFragmentCallback; -import org.torproject.snowflake.mvp.MainActivityMVP; +import org.torproject.snowflake.mvp.MainActivityMVPContract; import org.torproject.snowflake.presenters.MainActivityPresenter;
/** * MainActivity is the main UI of the application. */ -public class MainActivity extends AppCompatActivity implements MainFragmentCallback, MainActivityMVP.View { +public class MainActivity extends AppCompatActivity implements MainFragmentCallback, MainActivityMVPContract.View { private static final String TAG = "MainActivity"; int currentFragment; MainActivityPresenter presenter; diff --git a/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java b/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java index b04de57..01cdb14 100644 --- a/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java +++ b/app/src/main/java/org/torproject/snowflake/models/MainActivityModel.java @@ -5,7 +5,7 @@ import android.util.Log;
import org.torproject.snowflake.GlobalApplication; import org.torproject.snowflake.constants.AppPreferenceConstants; -import org.torproject.snowflake.mvp.MainActivityMVP; +import org.torproject.snowflake.mvp.MainActivityMVPContract;
import java.text.ParseException; import java.text.SimpleDateFormat; @@ -19,22 +19,22 @@ import io.reactivex.rxjava3.schedulers.Schedulers; /** * Model for MainActivity to handle network calls, Shared preferences. */ -public class MainActivityModel implements MainActivityMVP.Model { +public class MainActivityModel implements MainActivityMVPContract.Model { private static final String TAG = "MainActivityModel"; private static MainActivityModel instance = null; private SharedPreferences sharedPreferences; - private MainActivityMVP.Presenter presenter; + private MainActivityMVPContract.Presenter presenter; private int servedCount; private SharedPreferences.OnSharedPreferenceChangeListener listener;
- private MainActivityModel(MainActivityMVP.Presenter presenter) { + private MainActivityModel(MainActivityMVPContract.Presenter presenter) { sharedPreferences = GlobalApplication.getAppPreferences(); this.presenter = presenter; servedCount = 0; }
- public static MainActivityModel getInstance(MainActivityMVP.Presenter presenter) { + public static MainActivityModel getInstance(MainActivityMVPContract.Presenter presenter) { if (instance == null) { synchronized (MainActivityModel.class) { instance = new MainActivityModel(presenter); diff --git a/app/src/main/java/org/torproject/snowflake/mvp/MainActivityMVP.java b/app/src/main/java/org/torproject/snowflake/mvp/MainActivityMVPContract.java similarity index 93% rename from app/src/main/java/org/torproject/snowflake/mvp/MainActivityMVP.java rename to app/src/main/java/org/torproject/snowflake/mvp/MainActivityMVPContract.java index 0ea2068..4c76496 100644 --- a/app/src/main/java/org/torproject/snowflake/mvp/MainActivityMVP.java +++ b/app/src/main/java/org/torproject/snowflake/mvp/MainActivityMVPContract.java @@ -3,7 +3,7 @@ package org.torproject.snowflake.mvp; /** * MVP contract Interface */ -public interface MainActivityMVP { +public interface MainActivityMVPContract { interface View { void updateCountInFragment(int i); } diff --git a/app/src/main/java/org/torproject/snowflake/presenters/MainActivityPresenter.java b/app/src/main/java/org/torproject/snowflake/presenters/MainActivityPresenter.java index dee48f8..471fc74 100644 --- a/app/src/main/java/org/torproject/snowflake/presenters/MainActivityPresenter.java +++ b/app/src/main/java/org/torproject/snowflake/presenters/MainActivityPresenter.java @@ -3,17 +3,17 @@ package org.torproject.snowflake.presenters; import android.util.Log;
import org.torproject.snowflake.models.MainActivityModel; -import org.torproject.snowflake.mvp.MainActivityMVP; +import org.torproject.snowflake.mvp.MainActivityMVPContract;
/** * Presenter for MainActivity. */ -public class MainActivityPresenter implements MainActivityMVP.Presenter { +public class MainActivityPresenter implements MainActivityMVPContract.Presenter { private static final String TAG = "MainActivityPresenter"; - MainActivityMVP.View view; - MainActivityMVP.Model model; + MainActivityMVPContract.View view; + MainActivityMVPContract.Model model;
- public MainActivityPresenter(MainActivityMVP.View view) { + public MainActivityPresenter(MainActivityMVPContract.View view) { //Attaching this.view = view; model = MainActivityModel.getInstance(this);