From c33b13966b15eb631640dcbb01245b472305758a Mon Sep 17 00:00:00 2001 From: Billel Bmsd Date: Sat, 21 Mar 2020 15:04:10 +0100 Subject: [PATCH 1/2] add google AdMob --- app/build.gradle | 4 +- app/src/main/AndroidManifest.xml | 9 ++- app/src/main/java/com/covid19/app/Utils.java | 37 --------- .../com/covid19/app/data/DataManager.java | 35 +++++++- .../com/covid19/app/ui/home/MainActivity.java | 73 ++++++++++++++--- .../countries_fragment/CountriesFragment.java | 1 - .../app/ui/home/profile/ProfileFragment.java | 9 +-- app/src/main/res/layout/activity_main.xml | 10 +++ app/src/main/res/layout/country_item.xml | 81 ++++++++++--------- app/src/main/res/layout/fragment_global.xml | 16 ++-- app/src/main/res/values/strings.xml | 1 + 11 files changed, 173 insertions(+), 103 deletions(-) delete mode 100644 app/src/main/java/com/covid19/app/Utils.java diff --git a/app/build.gradle b/app/build.gradle index c3c55a9..6e38749 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 23 targetSdkVersion 29 versionCode 1 - versionName "1.0" + versionName "1.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -31,6 +31,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.google.android.gms:play-services-ads:19.0.1' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.appcompat:appcompat:1.1.0' // cardview diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 28bbbfe..45776f1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,12 @@ android:networkSecurityConfig="@xml/network_security_config" android:theme="@style/AppTheme"> + + @@ -26,7 +31,9 @@ - diff --git a/app/src/main/java/com/covid19/app/Utils.java b/app/src/main/java/com/covid19/app/Utils.java deleted file mode 100644 index 7becffc..0000000 --- a/app/src/main/java/com/covid19/app/Utils.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.covid19.app; - - -import android.content.Context; -import android.location.Address; -import android.location.Geocoder; -import android.location.Location; -import android.location.LocationManager; -import java.io.IOException; -import java.util.List; - - -public class Utils { - - - public static String getCountryName(Context mContext) { - LocationManager lm = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); - Geocoder geocoder = new Geocoder(mContext); - for(String provider: lm.getAllProviders()) { - Location location = lm.getLastKnownLocation(provider); - if(location!=null) { - try { - List
addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); - if(addresses != null && addresses.size() > 0) { - return addresses.get(0).getCountryName(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return "null"; - } - - -} - diff --git a/app/src/main/java/com/covid19/app/data/DataManager.java b/app/src/main/java/com/covid19/app/data/DataManager.java index 129245d..79e3360 100644 --- a/app/src/main/java/com/covid19/app/data/DataManager.java +++ b/app/src/main/java/com/covid19/app/data/DataManager.java @@ -1,20 +1,53 @@ package com.covid19.app.data; +import android.content.SharedPreferences; + +import com.covid19.app.App; import com.covid19.app.data.network.services.DataService; import com.covid19.app.data.network.services.location.LocationService; +import static android.content.Context.MODE_PRIVATE; + public class DataManager { private static DataManager mInstance; + private SharedPreferences sharedPreferences; + public static final String MY_PREFS_NAME = "covid_pref"; + public static final String COUNTRY_KEY = "county"; + public static final String RUN_COUNT_KEY = "run_count"; + public static final int MAX_COUNT = 5; private DataManager(){ - + sharedPreferences = App.getInstance().getSharedPreferences(MY_PREFS_NAME,MODE_PRIVATE); } public static synchronized DataManager getInstance(){ return mInstance == null ? new DataManager() : mInstance; } + public void setDefaultCountry(String country){ + sharedPreferences.edit() + .putString(COUNTRY_KEY, country) + .apply(); + } + + public String getDefaultCountry(){ + return sharedPreferences.getString(COUNTRY_KEY, null); + } + + public void setRunCount(){ + int count = getRunCount(); + if (count == MAX_COUNT || count > MAX_COUNT) count = 0; + else count++; + sharedPreferences.edit() + .putInt(RUN_COUNT_KEY, count) + .apply(); + } + + public int getRunCount(){ + return sharedPreferences.getInt(RUN_COUNT_KEY, 0); + } + public DataService getDataService(){ return DataService.getInstance(); } diff --git a/app/src/main/java/com/covid19/app/ui/home/MainActivity.java b/app/src/main/java/com/covid19/app/ui/home/MainActivity.java index ca7f232..a43c699 100644 --- a/app/src/main/java/com/covid19/app/ui/home/MainActivity.java +++ b/app/src/main/java/com/covid19/app/ui/home/MainActivity.java @@ -8,9 +8,17 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; +import android.view.View; import com.covid19.app.R; import com.covid19.app.data.network.model.Location; +import com.google.android.gms.ads.AdListener; +import com.google.android.gms.ads.AdRequest; +import com.google.android.gms.ads.AdView; +import com.google.android.gms.ads.InterstitialAd; +import com.google.android.gms.ads.MobileAds; +import com.google.android.gms.ads.initialization.InitializationStatus; +import com.google.android.gms.ads.initialization.OnInitializationCompleteListener; import com.google.android.material.tabs.TabLayout; import com.covid19.app.data.DataManager; import com.covid19.app.ui.base.BaseActivity; @@ -26,16 +34,18 @@ public class MainActivity extends BaseActivity { - public static final String MY_PREFS_NAME = "current_country"; + public static final String INTERSTITIAL_AD_KEY = "ca-app-pub-4756765024373725/6038319531"; private final String TAG = "MainActivity"; + @BindView(R.id.mainBanner) + AdView bannerView; @BindView(R.id.mainPager) ViewPager mainPager; @BindView(R.id.mainTabs) TabLayout mainTabLayout; private MainPagerAdapter mainAdapter; private MainViewModel viewModel; - private SharedPreferences.Editor editor; - private String country; + private InterstitialAd mInterstitialAd; + @Override public MainViewModel createViewModel() { @@ -49,10 +59,10 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); - SharedPreferences prefs = getSharedPreferences(MainActivity.MY_PREFS_NAME, MODE_PRIVATE); - country = prefs.getString("country", null); - if (country == null) { - editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit(); + initAdMob(); + DataManager.getInstance().setRunCount(); + Log.d(TAG, "onCreate: count"+DataManager.getInstance().getRunCount()); + if (DataManager.getInstance().getDefaultCountry() == null) { viewModel.loadLocationData(); viewModel.getLocationData().observe(this, new LocationDataObserver()); } else @@ -61,6 +71,48 @@ protected void onCreate(Bundle savedInstanceState) { mainTabLayout.setupWithViewPager(mainPager, true); } + private void initAdMob(){ + MobileAds.initialize(this, new OnInitializationCompleteListener() { + @Override + public void onInitializationComplete(InitializationStatus initializationStatus) { + } + }); + + AdRequest adRequest = new AdRequest.Builder().build(); + bannerView.loadAd(adRequest); + bannerView.setAdListener(new AdListener(){ + @Override + public void onAdLoaded() { + bannerView.setVisibility(View.VISIBLE); + } + + @Override + public void onAdFailedToLoad(int errorCode) { + Log.e(TAG, "onAdFailedToLoad: " + errorCode); + bannerView.setVisibility(View.GONE); + } + }); + if(!bannerView.isLoading()) bannerView.setVisibility(View.GONE); + + if( DataManager.getInstance().getRunCount() == DataManager.MAX_COUNT) { + mInterstitialAd = new InterstitialAd(this); + mInterstitialAd.setAdUnitId(INTERSTITIAL_AD_KEY); + mInterstitialAd.loadAd(new AdRequest.Builder().build()); + + mInterstitialAd.setAdListener(new AdListener() { + @Override + public void onAdLoaded() { + mInterstitialAd.show(); + } + + @Override + public void onAdFailedToLoad(int errorCode) { + Log.e(TAG, "onAdFailedToLoad: " + errorCode); + } + }); + } + } + private void setMainPagerAdapter() { mainAdapter = new MainPagerAdapter(getSupportFragmentManager(), 0); @@ -88,14 +140,9 @@ private class LocationDataObserver implements Observer { public void onChanged(Location location) { if (location == null) return; Log.d(TAG, "onChanged: location " + location.getCountry()); - editor.putString("country", location.getCountry()); - editor.apply(); - country = location.getCountry(); + DataManager.getInstance().setDefaultCountry(location.getCountry()); loadFragment(R.id.profileContainer, new ProfileFragment()); } } - public String getCountry() { - return country; - } } diff --git a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesFragment.java b/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesFragment.java index 5211e65..bd99de7 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesFragment.java +++ b/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesFragment.java @@ -97,7 +97,6 @@ public void onClick(View view) { int itemPosition = mRecyclerView.getChildLayoutPosition(view); CountryDataModel item = recyclerAdapter.getCountryData(itemPosition); showDetailDialog(item.getCountry()); - Toast.makeText(getActivity(), item.getCountry(), Toast.LENGTH_LONG).show(); } } diff --git a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileFragment.java b/app/src/main/java/com/covid19/app/ui/home/profile/ProfileFragment.java index bf341f7..6d3f165 100644 --- a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileFragment.java +++ b/app/src/main/java/com/covid19/app/ui/home/profile/ProfileFragment.java @@ -1,7 +1,6 @@ package com.covid19.app.ui.home.profile; import android.app.AlertDialog; -import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; @@ -20,11 +19,8 @@ import com.covid19.app.data.network.model.CountryDataModel; import butterknife.BindView; import butterknife.ButterKnife; -import com.covid19.app.Utils; -import com.covid19.app.ui.base.BaseFragment; -import com.covid19.app.ui.home.MainActivity; -import static android.content.Context.MODE_PRIVATE; +import com.covid19.app.ui.base.BaseFragment; public class ProfileFragment extends BaseFragment { private static final String TAG = "ProfileFragment"; @@ -80,8 +76,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { private void showProfile() { viewModel.getCountryData().observe(this, new CountryDataObserver()); - String country = ((MainActivity) getActivity()).getCountry(); - viewModel.loadCountryData(country); + viewModel.loadCountryData(DataManager.getInstance().getDefaultCountry()); } private void showAboutDialog(){ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index dc10229..c21ab7a 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -56,10 +56,20 @@ android:layout_gravity="center|bottom" app:layout_behavior="@string/appbar_scrolling_view_behavior"/> + + + diff --git a/app/src/main/res/layout/country_item.xml b/app/src/main/res/layout/country_item.xml index 26fdd36..f2dfe3d 100644 --- a/app/src/main/res/layout/country_item.xml +++ b/app/src/main/res/layout/country_item.xml @@ -1,62 +1,66 @@ + android:layout_height="match_parent" + android:background="@drawable/bg_main"> - + app:layout_constraintTop_toBottomOf="@+id/item_title" /> + + + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.384" /> - - + app:layout_constraintTop_toTopOf="parent" /> - @@ -85,8 +92,8 @@ android:layout_height="wrap_content" android:text="10" android:textColor="@color/colorRecoveredCases" - android:textStyle="bold" android:textSize="26sp" + android:textStyle="bold" app:layout_constraintLeft_toLeftOf="@+id/recover_cases_description" app:layout_constraintRight_toRightOf="@+id/recover_cases_description" app:layout_constraintTop_toBottomOf="@+id/recover_cases_description" /> diff --git a/app/src/main/res/layout/fragment_global.xml b/app/src/main/res/layout/fragment_global.xml index 8803d5e..392bc4f 100644 --- a/app/src/main/res/layout/fragment_global.xml +++ b/app/src/main/res/layout/fragment_global.xml @@ -5,17 +5,19 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.060000002" /> + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@id/cases_img" + app:layout_constraintVertical_bias="0.0"> + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 19588ac..e46d284 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,4 +18,5 @@ Abdelkader SELLAMI (sellislem@gmail.com) Billel BOUMESSAIDIA (billel.bmsd@gmail.com) Source : worldometers.info/coronavirus \n provided by NovelCOVID Api + ca-app-pub-4756765024373725/2482217902 From a32142e18d0adfab384a7173ba505d2ea066220b Mon Sep 17 00:00:00 2001 From: Billel Bmsd Date: Sat, 21 Mar 2020 15:20:07 +0100 Subject: [PATCH 2/2] change package name --- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 8 ++++---- .../app/ui/splash/SplashViewModel.java | 10 ---------- .../com/{covid19 => covidvirus}/app/App.java | 2 +- .../app/data/DataManager.java | 8 ++++---- .../data/network/model/CountryDataModel.java | 2 +- .../data/network/model/GlobalDataModel.java | 2 +- .../app/data/network/model/Location.java | 2 +- .../app/data/network/services/DataApi.java | 6 +++--- .../data/network/services/DataService.java | 2 +- .../services/location/LocationApi.java | 4 ++-- .../services/location/LocationService.java | 4 +--- .../app/ui/base/BaseActivity.java | 2 +- .../app/ui/base/BaseFragment.java | 2 +- .../app/ui/base/BaseViewModel.java | 2 +- .../app/ui/home/MainActivity.java | 17 ++++++++--------- .../app/ui/home/MainPagerAdapter.java | 2 +- .../app/ui/home/MainViewModel.java | 8 ++++---- .../app/ui/home/MainViewModelFactory.java | 4 ++-- .../countries_fragment/CountriesFragment.java | 19 +++++-------------- .../CountriesViewModel.java | 8 ++++---- .../CountriesViewModelFactory.java | 4 ++-- .../countries_fragment/RecyclerAdapter.java | 10 +++------- .../RecyclerItemDecoration.java | 2 +- .../main/global_fragment/GlobalFragment.java | 10 +++++----- .../main/global_fragment/GlobalViewModel.java | 8 ++++---- .../GlobalViewModelFactory.java | 4 ++-- .../app/ui/home/profile/ProfileFragment.java | 10 +++++----- .../app/ui/home/profile/ProfileViewModel.java | 8 ++++---- .../home/profile/ProfileViewModelFactory.java | 4 ++-- .../app/ui/splash/SplashActivity.java | 8 ++++---- .../app/ui/splash/SplashViewModel.java | 10 ++++++++++ .../app/ui/splash/SplashViewModelFactory.java | 2 +- 33 files changed, 90 insertions(+), 106 deletions(-) delete mode 100644 app/src/main/java/com/covid19/app/ui/splash/SplashViewModel.java rename app/src/main/java/com/{covid19 => covidvirus}/app/App.java (90%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/DataManager.java (88%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/network/model/CountryDataModel.java (98%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/network/model/GlobalDataModel.java (96%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/network/model/Location.java (90%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/network/services/DataApi.java (68%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/network/services/DataService.java (93%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/network/services/location/LocationApi.java (55%) rename app/src/main/java/com/{covid19 => covidvirus}/app/data/network/services/location/LocationService.java (87%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/base/BaseActivity.java (91%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/base/BaseFragment.java (94%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/base/BaseViewModel.java (72%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/MainActivity.java (92%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/MainPagerAdapter.java (96%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/MainViewModel.java (85%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/MainViewModelFactory.java (86%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/countries_fragment/CountriesFragment.java (91%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/countries_fragment/CountriesViewModel.java (91%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/countries_fragment/CountriesViewModelFactory.java (84%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/countries_fragment/RecyclerAdapter.java (92%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/countries_fragment/RecyclerItemDecoration.java (92%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/global_fragment/GlobalFragment.java (90%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/global_fragment/GlobalViewModel.java (85%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/main/global_fragment/GlobalViewModelFactory.java (84%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/profile/ProfileFragment.java (95%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/profile/ProfileViewModel.java (86%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/home/profile/ProfileViewModelFactory.java (86%) rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/splash/SplashActivity.java (90%) create mode 100644 app/src/main/java/com/covidvirus/app/ui/splash/SplashViewModel.java rename app/src/main/java/com/{covid19 => covidvirus}/app/ui/splash/SplashViewModelFactory.java (92%) diff --git a/app/build.gradle b/app/build.gradle index 6e38749..7efb961 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ android { buildToolsVersion "29.0.3" defaultConfig { - applicationId "com.covid19.app" + applicationId "com.covidvirus.app" minSdkVersion 23 targetSdkVersion 29 versionCode 1 diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 45776f1..dea95a0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ @@ -10,7 +10,7 @@ android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" - android:name=".App" + android:name="com.covidvirus.app.App" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:networkSecurityConfig="@xml/network_security_config" @@ -22,7 +22,7 @@ @@ -33,7 +33,7 @@ diff --git a/app/src/main/java/com/covid19/app/ui/splash/SplashViewModel.java b/app/src/main/java/com/covid19/app/ui/splash/SplashViewModel.java deleted file mode 100644 index 4395b7e..0000000 --- a/app/src/main/java/com/covid19/app/ui/splash/SplashViewModel.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.covid19.app.ui.splash; - - -import com.covid19.app.ui.base.BaseViewModel; - - -public class SplashViewModel extends BaseViewModel { - -} - diff --git a/app/src/main/java/com/covid19/app/App.java b/app/src/main/java/com/covidvirus/app/App.java similarity index 90% rename from app/src/main/java/com/covid19/app/App.java rename to app/src/main/java/com/covidvirus/app/App.java index f082aa0..85e5f17 100644 --- a/app/src/main/java/com/covid19/app/App.java +++ b/app/src/main/java/com/covidvirus/app/App.java @@ -1,4 +1,4 @@ -package com.covid19.app; +package com.covidvirus.app; import android.app.Application; diff --git a/app/src/main/java/com/covid19/app/data/DataManager.java b/app/src/main/java/com/covidvirus/app/data/DataManager.java similarity index 88% rename from app/src/main/java/com/covid19/app/data/DataManager.java rename to app/src/main/java/com/covidvirus/app/data/DataManager.java index 79e3360..2006aff 100644 --- a/app/src/main/java/com/covid19/app/data/DataManager.java +++ b/app/src/main/java/com/covidvirus/app/data/DataManager.java @@ -1,10 +1,10 @@ -package com.covid19.app.data; +package com.covidvirus.app.data; import android.content.SharedPreferences; -import com.covid19.app.App; -import com.covid19.app.data.network.services.DataService; -import com.covid19.app.data.network.services.location.LocationService; +import com.covidvirus.app.App; +import com.covidvirus.app.data.network.services.DataService; +import com.covidvirus.app.data.network.services.location.LocationService; import static android.content.Context.MODE_PRIVATE; diff --git a/app/src/main/java/com/covid19/app/data/network/model/CountryDataModel.java b/app/src/main/java/com/covidvirus/app/data/network/model/CountryDataModel.java similarity index 98% rename from app/src/main/java/com/covid19/app/data/network/model/CountryDataModel.java rename to app/src/main/java/com/covidvirus/app/data/network/model/CountryDataModel.java index b90c954..3753aef 100644 --- a/app/src/main/java/com/covid19/app/data/network/model/CountryDataModel.java +++ b/app/src/main/java/com/covidvirus/app/data/network/model/CountryDataModel.java @@ -1,4 +1,4 @@ -package com.covid19.app.data.network.model; +package com.covidvirus.app.data.network.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/covid19/app/data/network/model/GlobalDataModel.java b/app/src/main/java/com/covidvirus/app/data/network/model/GlobalDataModel.java similarity index 96% rename from app/src/main/java/com/covid19/app/data/network/model/GlobalDataModel.java rename to app/src/main/java/com/covidvirus/app/data/network/model/GlobalDataModel.java index 3e3dbd0..06b8d90 100644 --- a/app/src/main/java/com/covid19/app/data/network/model/GlobalDataModel.java +++ b/app/src/main/java/com/covidvirus/app/data/network/model/GlobalDataModel.java @@ -1,4 +1,4 @@ -package com.covid19.app.data.network.model; +package com.covidvirus.app.data.network.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/covid19/app/data/network/model/Location.java b/app/src/main/java/com/covidvirus/app/data/network/model/Location.java similarity index 90% rename from app/src/main/java/com/covid19/app/data/network/model/Location.java rename to app/src/main/java/com/covidvirus/app/data/network/model/Location.java index f913246..0776129 100644 --- a/app/src/main/java/com/covid19/app/data/network/model/Location.java +++ b/app/src/main/java/com/covidvirus/app/data/network/model/Location.java @@ -1,4 +1,4 @@ -package com.covid19.app.data.network.model; +package com.covidvirus.app.data.network.model; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; diff --git a/app/src/main/java/com/covid19/app/data/network/services/DataApi.java b/app/src/main/java/com/covidvirus/app/data/network/services/DataApi.java similarity index 68% rename from app/src/main/java/com/covid19/app/data/network/services/DataApi.java rename to app/src/main/java/com/covidvirus/app/data/network/services/DataApi.java index 3253301..f2cbcde 100644 --- a/app/src/main/java/com/covid19/app/data/network/services/DataApi.java +++ b/app/src/main/java/com/covidvirus/app/data/network/services/DataApi.java @@ -1,7 +1,7 @@ -package com.covid19.app.data.network.services; +package com.covidvirus.app.data.network.services; -import com.covid19.app.data.network.model.CountryDataModel; -import com.covid19.app.data.network.model.GlobalDataModel; +import com.covidvirus.app.data.network.model.CountryDataModel; +import com.covidvirus.app.data.network.model.GlobalDataModel; import java.util.List; diff --git a/app/src/main/java/com/covid19/app/data/network/services/DataService.java b/app/src/main/java/com/covidvirus/app/data/network/services/DataService.java similarity index 93% rename from app/src/main/java/com/covid19/app/data/network/services/DataService.java rename to app/src/main/java/com/covidvirus/app/data/network/services/DataService.java index 24c98c2..a0c8dd3 100644 --- a/app/src/main/java/com/covid19/app/data/network/services/DataService.java +++ b/app/src/main/java/com/covidvirus/app/data/network/services/DataService.java @@ -1,4 +1,4 @@ -package com.covid19.app.data.network.services; +package com.covidvirus.app.data.network.services; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; diff --git a/app/src/main/java/com/covid19/app/data/network/services/location/LocationApi.java b/app/src/main/java/com/covidvirus/app/data/network/services/location/LocationApi.java similarity index 55% rename from app/src/main/java/com/covid19/app/data/network/services/location/LocationApi.java rename to app/src/main/java/com/covidvirus/app/data/network/services/location/LocationApi.java index ed94e92..658d939 100644 --- a/app/src/main/java/com/covid19/app/data/network/services/location/LocationApi.java +++ b/app/src/main/java/com/covidvirus/app/data/network/services/location/LocationApi.java @@ -1,6 +1,6 @@ -package com.covid19.app.data.network.services.location; +package com.covidvirus.app.data.network.services.location; -import com.covid19.app.data.network.model.Location; +import com.covidvirus.app.data.network.model.Location; import retrofit2.Call; import retrofit2.http.GET; diff --git a/app/src/main/java/com/covid19/app/data/network/services/location/LocationService.java b/app/src/main/java/com/covidvirus/app/data/network/services/location/LocationService.java similarity index 87% rename from app/src/main/java/com/covid19/app/data/network/services/location/LocationService.java rename to app/src/main/java/com/covidvirus/app/data/network/services/location/LocationService.java index 0e74498..805df56 100644 --- a/app/src/main/java/com/covid19/app/data/network/services/location/LocationService.java +++ b/app/src/main/java/com/covidvirus/app/data/network/services/location/LocationService.java @@ -1,6 +1,4 @@ -package com.covid19.app.data.network.services.location; - -import com.covid19.app.data.network.services.DataApi; +package com.covidvirus.app.data.network.services.location; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; diff --git a/app/src/main/java/com/covid19/app/ui/base/BaseActivity.java b/app/src/main/java/com/covidvirus/app/ui/base/BaseActivity.java similarity index 91% rename from app/src/main/java/com/covid19/app/ui/base/BaseActivity.java rename to app/src/main/java/com/covidvirus/app/ui/base/BaseActivity.java index 0c5b79a..44b96c0 100644 --- a/app/src/main/java/com/covid19/app/ui/base/BaseActivity.java +++ b/app/src/main/java/com/covidvirus/app/ui/base/BaseActivity.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.base; +package com.covidvirus.app.ui.base; import android.os.Bundle; diff --git a/app/src/main/java/com/covid19/app/ui/base/BaseFragment.java b/app/src/main/java/com/covidvirus/app/ui/base/BaseFragment.java similarity index 94% rename from app/src/main/java/com/covid19/app/ui/base/BaseFragment.java rename to app/src/main/java/com/covidvirus/app/ui/base/BaseFragment.java index 33997c9..ccc95b1 100644 --- a/app/src/main/java/com/covid19/app/ui/base/BaseFragment.java +++ b/app/src/main/java/com/covidvirus/app/ui/base/BaseFragment.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.base; +package com.covidvirus.app.ui.base; import android.content.Context; import android.util.Log; diff --git a/app/src/main/java/com/covid19/app/ui/base/BaseViewModel.java b/app/src/main/java/com/covidvirus/app/ui/base/BaseViewModel.java similarity index 72% rename from app/src/main/java/com/covid19/app/ui/base/BaseViewModel.java rename to app/src/main/java/com/covidvirus/app/ui/base/BaseViewModel.java index 9228e37..678b562 100644 --- a/app/src/main/java/com/covid19/app/ui/base/BaseViewModel.java +++ b/app/src/main/java/com/covidvirus/app/ui/base/BaseViewModel.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.base; +package com.covidvirus.app.ui.base; import androidx.lifecycle.ViewModel; diff --git a/app/src/main/java/com/covid19/app/ui/home/MainActivity.java b/app/src/main/java/com/covidvirus/app/ui/home/MainActivity.java similarity index 92% rename from app/src/main/java/com/covid19/app/ui/home/MainActivity.java rename to app/src/main/java/com/covidvirus/app/ui/home/MainActivity.java index a43c699..e0c8727 100644 --- a/app/src/main/java/com/covid19/app/ui/home/MainActivity.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/MainActivity.java @@ -1,17 +1,16 @@ -package com.covid19.app.ui.home; +package com.covidvirus.app.ui.home; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.viewpager.widget.ViewPager; -import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.View; -import com.covid19.app.R; -import com.covid19.app.data.network.model.Location; +import com.covidvirus.app.R; +import com.covidvirus.app.data.network.model.Location; import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdView; @@ -20,11 +19,11 @@ import com.google.android.gms.ads.initialization.InitializationStatus; import com.google.android.gms.ads.initialization.OnInitializationCompleteListener; import com.google.android.material.tabs.TabLayout; -import com.covid19.app.data.DataManager; -import com.covid19.app.ui.base.BaseActivity; -import com.covid19.app.ui.home.main.countries_fragment.CountriesFragment; -import com.covid19.app.ui.home.main.global_fragment.GlobalFragment; -import com.covid19.app.ui.home.profile.ProfileFragment; +import com.covidvirus.app.data.DataManager; +import com.covidvirus.app.ui.base.BaseActivity; +import com.covidvirus.app.ui.home.main.countries_fragment.CountriesFragment; +import com.covidvirus.app.ui.home.main.global_fragment.GlobalFragment; +import com.covidvirus.app.ui.home.profile.ProfileFragment; import java.util.ArrayList; diff --git a/app/src/main/java/com/covid19/app/ui/home/MainPagerAdapter.java b/app/src/main/java/com/covidvirus/app/ui/home/MainPagerAdapter.java similarity index 96% rename from app/src/main/java/com/covid19/app/ui/home/MainPagerAdapter.java rename to app/src/main/java/com/covidvirus/app/ui/home/MainPagerAdapter.java index 9c5a553..ebc66de 100644 --- a/app/src/main/java/com/covid19/app/ui/home/MainPagerAdapter.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/MainPagerAdapter.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.home; +package com.covidvirus.app.ui.home; import androidx.annotation.NonNull; diff --git a/app/src/main/java/com/covid19/app/ui/home/MainViewModel.java b/app/src/main/java/com/covidvirus/app/ui/home/MainViewModel.java similarity index 85% rename from app/src/main/java/com/covid19/app/ui/home/MainViewModel.java rename to app/src/main/java/com/covidvirus/app/ui/home/MainViewModel.java index 670b94a..6e7700f 100644 --- a/app/src/main/java/com/covid19/app/ui/home/MainViewModel.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/MainViewModel.java @@ -1,13 +1,13 @@ -package com.covid19.app.ui.home; +package com.covidvirus.app.ui.home; import android.util.Log; import androidx.annotation.NonNull; import androidx.lifecycle.MutableLiveData; -import com.covid19.app.data.network.model.Location; -import com.covid19.app.data.network.services.location.LocationService; -import com.covid19.app.ui.base.BaseViewModel; +import com.covidvirus.app.data.network.model.Location; +import com.covidvirus.app.data.network.services.location.LocationService; +import com.covidvirus.app.ui.base.BaseViewModel; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; diff --git a/app/src/main/java/com/covid19/app/ui/home/MainViewModelFactory.java b/app/src/main/java/com/covidvirus/app/ui/home/MainViewModelFactory.java similarity index 86% rename from app/src/main/java/com/covid19/app/ui/home/MainViewModelFactory.java rename to app/src/main/java/com/covidvirus/app/ui/home/MainViewModelFactory.java index 27e972b..79e5152 100644 --- a/app/src/main/java/com/covid19/app/ui/home/MainViewModelFactory.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/MainViewModelFactory.java @@ -1,9 +1,9 @@ -package com.covid19.app.ui.home; +package com.covidvirus.app.ui.home; import androidx.annotation.NonNull; import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModelProvider; -import com.covid19.app.data.network.services.location.LocationService; +import com.covidvirus.app.data.network.services.location.LocationService; public class MainViewModelFactory implements ViewModelProvider.Factory { diff --git a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesFragment.java b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesFragment.java similarity index 91% rename from app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesFragment.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesFragment.java index bd99de7..60194cc 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesFragment.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesFragment.java @@ -1,38 +1,29 @@ -package com.covid19.app.ui.home.main.countries_fragment; +package com.covidvirus.app.ui.home.main.countries_fragment; import android.app.AlertDialog; import android.os.Bundle; -import android.util.Log; -import android.view.GestureDetector; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; -import android.widget.Toast; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.covid19.app.R; -import com.covid19.app.data.DataManager; -import com.covid19.app.data.network.model.CountryDataModel; +import com.covidvirus.app.R; +import com.covidvirus.app.data.DataManager; +import com.covidvirus.app.data.network.model.CountryDataModel; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; -import com.covid19.app.ui.base.BaseFragment; -import com.covid19.app.ui.home.MainActivity; -import com.covid19.app.ui.home.profile.ProfileFragment; - -import static android.content.ContentValues.TAG; +import com.covidvirus.app.ui.base.BaseFragment; public class CountriesFragment extends BaseFragment { private static final String TAG = "CountriesFragment"; diff --git a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesViewModel.java b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesViewModel.java similarity index 91% rename from app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesViewModel.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesViewModel.java index dbf1521..c97876c 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesViewModel.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesViewModel.java @@ -1,12 +1,12 @@ -package com.covid19.app.ui.home.main.countries_fragment; +package com.covidvirus.app.ui.home.main.countries_fragment; import android.util.Log; import androidx.annotation.NonNull; import androidx.lifecycle.MutableLiveData; -import com.covid19.app.data.network.model.CountryDataModel; -import com.covid19.app.data.network.services.DataService; +import com.covidvirus.app.data.network.model.CountryDataModel; +import com.covidvirus.app.data.network.services.DataService; import java.util.List; -import com.covid19.app.ui.base.BaseViewModel; +import com.covidvirus.app.ui.base.BaseViewModel; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; diff --git a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesViewModelFactory.java b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesViewModelFactory.java similarity index 84% rename from app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesViewModelFactory.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesViewModelFactory.java index a7b6c8e..cea96d1 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/CountriesViewModelFactory.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/CountriesViewModelFactory.java @@ -1,10 +1,10 @@ -package com.covid19.app.ui.home.main.countries_fragment; +package com.covidvirus.app.ui.home.main.countries_fragment; import androidx.annotation.NonNull; import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModelProvider; -import com.covid19.app.data.network.services.DataService; +import com.covidvirus.app.data.network.services.DataService; public class CountriesViewModelFactory implements ViewModelProvider.Factory { diff --git a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/RecyclerAdapter.java b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/RecyclerAdapter.java similarity index 92% rename from app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/RecyclerAdapter.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/RecyclerAdapter.java index 4846ab4..feab7d1 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/RecyclerAdapter.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/RecyclerAdapter.java @@ -1,21 +1,17 @@ -package com.covid19.app.ui.home.main.countries_fragment; +package com.covidvirus.app.ui.home.main.countries_fragment; -import android.util.Log; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; -import com.covid19.app.data.network.model.CountryDataModel; +import com.covidvirus.app.data.network.model.CountryDataModel; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; -import com.covid19.app.R; - -import static android.content.ContentValues.TAG; +import com.covidvirus.app.R; public class RecyclerAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/RecyclerItemDecoration.java b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/RecyclerItemDecoration.java similarity index 92% rename from app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/RecyclerItemDecoration.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/RecyclerItemDecoration.java index 59a19db..dae8536 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/countries_fragment/RecyclerItemDecoration.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/countries_fragment/RecyclerItemDecoration.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.home.main.countries_fragment; +package com.covidvirus.app.ui.home.main.countries_fragment; import android.graphics.Rect; import android.view.View; diff --git a/app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalFragment.java b/app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalFragment.java similarity index 90% rename from app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalFragment.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalFragment.java index 4078977..1640577 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalFragment.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalFragment.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.home.main.global_fragment; +package com.covidvirus.app.ui.home.main.global_fragment; import android.os.Bundle; import android.view.LayoutInflater; @@ -9,12 +9,12 @@ import androidx.annotation.Nullable; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; -import com.covid19.app.R; -import com.covid19.app.data.DataManager; -import com.covid19.app.data.network.model.GlobalDataModel; +import com.covidvirus.app.R; +import com.covidvirus.app.data.DataManager; +import com.covidvirus.app.data.network.model.GlobalDataModel; import butterknife.BindView; import butterknife.ButterKnife; -import com.covid19.app.ui.base.BaseFragment; +import com.covidvirus.app.ui.base.BaseFragment; public class GlobalFragment extends BaseFragment { diff --git a/app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalViewModel.java b/app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalViewModel.java similarity index 85% rename from app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalViewModel.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalViewModel.java index 6fe2528..584fddd 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalViewModel.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalViewModel.java @@ -1,13 +1,13 @@ -package com.covid19.app.ui.home.main.global_fragment; +package com.covidvirus.app.ui.home.main.global_fragment; import android.util.Log; import androidx.annotation.NonNull; import androidx.lifecycle.MutableLiveData; -import com.covid19.app.data.network.model.GlobalDataModel; -import com.covid19.app.data.network.services.DataService; -import com.covid19.app.ui.base.BaseViewModel; +import com.covidvirus.app.data.network.model.GlobalDataModel; +import com.covidvirus.app.data.network.services.DataService; +import com.covidvirus.app.ui.base.BaseViewModel; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; diff --git a/app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalViewModelFactory.java b/app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalViewModelFactory.java similarity index 84% rename from app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalViewModelFactory.java rename to app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalViewModelFactory.java index 4c7d4e1..9ecf762 100644 --- a/app/src/main/java/com/covid19/app/ui/home/main/global_fragment/GlobalViewModelFactory.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/main/global_fragment/GlobalViewModelFactory.java @@ -1,10 +1,10 @@ -package com.covid19.app.ui.home.main.global_fragment; +package com.covidvirus.app.ui.home.main.global_fragment; import androidx.annotation.NonNull; import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModelProvider; -import com.covid19.app.data.network.services.DataService; +import com.covidvirus.app.data.network.services.DataService; public class GlobalViewModelFactory implements ViewModelProvider.Factory { diff --git a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileFragment.java b/app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileFragment.java similarity index 95% rename from app/src/main/java/com/covid19/app/ui/home/profile/ProfileFragment.java rename to app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileFragment.java index 6d3f165..b6fdb1d 100644 --- a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileFragment.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileFragment.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.home.profile; +package com.covidvirus.app.ui.home.profile; import android.app.AlertDialog; import android.os.Bundle; @@ -14,13 +14,13 @@ import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; -import com.covid19.app.R; -import com.covid19.app.data.DataManager; -import com.covid19.app.data.network.model.CountryDataModel; +import com.covidvirus.app.R; +import com.covidvirus.app.data.DataManager; +import com.covidvirus.app.data.network.model.CountryDataModel; import butterknife.BindView; import butterknife.ButterKnife; -import com.covid19.app.ui.base.BaseFragment; +import com.covidvirus.app.ui.base.BaseFragment; public class ProfileFragment extends BaseFragment { private static final String TAG = "ProfileFragment"; diff --git a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileViewModel.java b/app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileViewModel.java similarity index 86% rename from app/src/main/java/com/covid19/app/ui/home/profile/ProfileViewModel.java rename to app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileViewModel.java index 42e3117..c8a2b61 100644 --- a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileViewModel.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileViewModel.java @@ -1,13 +1,13 @@ -package com.covid19.app.ui.home.profile; +package com.covidvirus.app.ui.home.profile; import android.util.Log; import androidx.annotation.NonNull; import androidx.lifecycle.MutableLiveData; -import com.covid19.app.data.network.model.CountryDataModel; -import com.covid19.app.data.network.services.DataService; -import com.covid19.app.ui.base.BaseViewModel; +import com.covidvirus.app.data.network.model.CountryDataModel; +import com.covidvirus.app.data.network.services.DataService; +import com.covidvirus.app.ui.base.BaseViewModel; import retrofit2.Call; import retrofit2.Callback; diff --git a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileViewModelFactory.java b/app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileViewModelFactory.java similarity index 86% rename from app/src/main/java/com/covid19/app/ui/home/profile/ProfileViewModelFactory.java rename to app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileViewModelFactory.java index 2d1617e..38336c2 100644 --- a/app/src/main/java/com/covid19/app/ui/home/profile/ProfileViewModelFactory.java +++ b/app/src/main/java/com/covidvirus/app/ui/home/profile/ProfileViewModelFactory.java @@ -1,10 +1,10 @@ -package com.covid19.app.ui.home.profile; +package com.covidvirus.app.ui.home.profile; import androidx.annotation.NonNull; import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModelProvider; -import com.covid19.app.data.network.services.DataService; +import com.covidvirus.app.data.network.services.DataService; public class ProfileViewModelFactory implements ViewModelProvider.Factory { diff --git a/app/src/main/java/com/covid19/app/ui/splash/SplashActivity.java b/app/src/main/java/com/covidvirus/app/ui/splash/SplashActivity.java similarity index 90% rename from app/src/main/java/com/covid19/app/ui/splash/SplashActivity.java rename to app/src/main/java/com/covidvirus/app/ui/splash/SplashActivity.java index 3db88f4..5bcaad9 100644 --- a/app/src/main/java/com/covid19/app/ui/splash/SplashActivity.java +++ b/app/src/main/java/com/covidvirus/app/ui/splash/SplashActivity.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.splash; +package com.covidvirus.app.ui.splash; import android.content.Intent; @@ -10,11 +10,11 @@ import android.view.animation.RotateAnimation; import android.widget.ImageView; -import com.covid19.app.R; -import com.covid19.app.ui.base.BaseActivity; +import com.covidvirus.app.R; +import com.covidvirus.app.ui.base.BaseActivity; -import com.covid19.app.ui.home.MainActivity; +import com.covidvirus.app.ui.home.MainActivity; import butterknife.BindView; import butterknife.ButterKnife; diff --git a/app/src/main/java/com/covidvirus/app/ui/splash/SplashViewModel.java b/app/src/main/java/com/covidvirus/app/ui/splash/SplashViewModel.java new file mode 100644 index 0000000..2117b78 --- /dev/null +++ b/app/src/main/java/com/covidvirus/app/ui/splash/SplashViewModel.java @@ -0,0 +1,10 @@ +package com.covidvirus.app.ui.splash; + + +import com.covidvirus.app.ui.base.BaseViewModel; + + +public class SplashViewModel extends BaseViewModel { + +} + diff --git a/app/src/main/java/com/covid19/app/ui/splash/SplashViewModelFactory.java b/app/src/main/java/com/covidvirus/app/ui/splash/SplashViewModelFactory.java similarity index 92% rename from app/src/main/java/com/covid19/app/ui/splash/SplashViewModelFactory.java rename to app/src/main/java/com/covidvirus/app/ui/splash/SplashViewModelFactory.java index 762f752..fb2be68 100644 --- a/app/src/main/java/com/covid19/app/ui/splash/SplashViewModelFactory.java +++ b/app/src/main/java/com/covidvirus/app/ui/splash/SplashViewModelFactory.java @@ -1,4 +1,4 @@ -package com.covid19.app.ui.splash; +package com.covidvirus.app.ui.splash; import androidx.annotation.NonNull; import androidx.lifecycle.ViewModel;