mirror of
https://github.com/SoPat712/TrackCovid19.git
synced 2025-08-25 11:55:27 -04:00
Watermarked in a few places.
Also removed some useless files.
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
package com.josh.trackcovid19v2;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
|
@@ -1,29 +0,0 @@
|
||||
package com.josh.trackcovid19v2.ui.yourcountries;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.josh.trackcovid19v2.data.CountriesRepository;
|
||||
import com.josh.trackcovid19v2.data.database.entity.Countries;
|
||||
import com.josh.trackcovid19v2.model.ServiceRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class YourcountriesViewModel extends ViewModel {
|
||||
|
||||
private final CountriesRepository mRepository;
|
||||
private final LiveData<List<Countries>> mCountriesData;
|
||||
|
||||
public YourcountriesViewModel(CountriesRepository mRepository) {
|
||||
this.mRepository = mRepository;
|
||||
this.mCountriesData = mRepository.getCountriesList();
|
||||
}
|
||||
|
||||
public LiveData<List<Countries>> getCountriesList() {
|
||||
return mCountriesData;
|
||||
}
|
||||
|
||||
public void postRequest(ServiceRequest serviceRequest) {
|
||||
mRepository.postServiceRequest(serviceRequest);
|
||||
}
|
||||
}
|
@@ -28,9 +28,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.josh.trackcovid19v2.R;
|
||||
import com.josh.trackcovid19v2.model.ServiceRequest;
|
||||
import com.josh.trackcovid19v2.ui.viewmodel.YourcountriesViewModel;
|
||||
import com.josh.trackcovid19v2.ui.viewmodel.YourrealcountryViewModel;
|
||||
import com.josh.trackcovid19v2.ui.viewmodel.yourCountriesViewModelFactory;
|
||||
import com.josh.trackcovid19v2.ui.viewmodel.yourrealcountryViewModelFactory;
|
||||
import com.josh.trackcovid19v2.utility.InjectorUtils;
|
||||
import com.squareup.picasso.Picasso;
|
||||
@@ -64,7 +62,8 @@ public class YourrealcountryFragment extends Fragment {
|
||||
|
||||
postRequest();
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Stop animation (This will be after 3 seconds)
|
||||
mSwipeRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
@@ -132,6 +131,7 @@ public class YourrealcountryFragment extends Fragment {
|
||||
spin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
//Created by Josh Patra or souravp12 on Github.. This comment has been added to prevent people from stealing my work and publishing asdf it as their own.
|
||||
rememberLocation[0] = position;
|
||||
j[0] = 0;
|
||||
Picasso.get().load(countries.get(position).flag).into(imageView);
|
||||
@@ -163,7 +163,7 @@ public class YourrealcountryFragment extends Fragment {
|
||||
String testsWithCommas = numberFormat.format(countries.get(position).tests);
|
||||
String testsMilWithcommas = numberFormat.format(countries.get(position).testsPerMillion);
|
||||
Date date = new Date(countries.get(position).updated);
|
||||
textView13.setText(Html.fromHtml("Updated on "+ date));
|
||||
textView13.setText(Html.fromHtml("Updated on " + date));
|
||||
textView.setText(Html.fromHtml("<center><b>" + totalCasesWithCommas + "</b></center>"));
|
||||
textView3.setText(Html.fromHtml("<b>" + deathWithCommas + "</b>"));
|
||||
textView2.setText(Html.fromHtml("<b>" + recoveredWithCommas + "</b>"));
|
||||
@@ -227,16 +227,14 @@ public class YourrealcountryFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
Log.d("lol", "didn't work something broken inside one." + ", name: "+"not found at all");
|
||||
} else {
|
||||
Log.d("lol", "didn't work something broken inside one." + ", name: " + "not found at all");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
Log.d("lol", "didn't work something broken outside one." + ", name: "+"not found at all");
|
||||
} else {
|
||||
Log.d("lol", "didn't work something broken outside one." + ", name: " + "not found at all");
|
||||
}
|
||||
});
|
||||
postRequest();
|
||||
|
@@ -1,29 +0,0 @@
|
||||
package com.josh.trackcovid19v2.ui.yourrealcountry;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.josh.trackcovid19v2.data.CountriesRepository;
|
||||
import com.josh.trackcovid19v2.data.database.entity.Countries;
|
||||
import com.josh.trackcovid19v2.model.ServiceRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class YourrealcountryViewModel extends ViewModel {
|
||||
|
||||
private final CountriesRepository mRepository;
|
||||
private final LiveData<List<Countries>> mCountriesData;
|
||||
|
||||
public YourrealcountryViewModel(CountriesRepository mRepository) {
|
||||
this.mRepository = mRepository;
|
||||
this.mCountriesData = mRepository.getCountriesList();
|
||||
}
|
||||
|
||||
public LiveData<List<Countries>> getCountriesList() {
|
||||
return mCountriesData;
|
||||
}
|
||||
|
||||
public void postRequest(ServiceRequest serviceRequest) {
|
||||
mRepository.postServiceRequest(serviceRequest);
|
||||
}
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
package com.josh.trackcovid19v2.ui.yourstate;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.josh.trackcovid19v2.data.StateRepository;
|
||||
import com.josh.trackcovid19v2.data.database.entity.States;
|
||||
import com.josh.trackcovid19v2.model.ServiceRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class YourstateViewModel extends ViewModel {
|
||||
|
||||
private final StateRepository mRepository;
|
||||
private final LiveData<List<States>> mStatesData;
|
||||
|
||||
public YourstateViewModel(StateRepository mRepository) {
|
||||
this.mRepository = mRepository;
|
||||
this.mStatesData = mRepository.getStatesList();
|
||||
}
|
||||
|
||||
public LiveData<List<States>> getStatesList() {
|
||||
return mStatesData;
|
||||
}
|
||||
|
||||
public void postRequest(ServiceRequest serviceRequest) {
|
||||
mRepository.postServiceRequest(serviceRequest);
|
||||
}
|
||||
}
|
@@ -34,8 +34,6 @@ import java.util.Locale;
|
||||
|
||||
public class YourworldFragment extends Fragment {
|
||||
|
||||
private static YourworldFragment BdTimeUtils;
|
||||
private YourworldViewModel yourworldViewModel;
|
||||
private com.josh.trackcovid19v2.ui.viewmodel.YourworldViewModel vYourworldViewModel;
|
||||
private static DecimalFormat df = new DecimalFormat("0.00");
|
||||
|
||||
|
@@ -1,24 +0,0 @@
|
||||
package com.josh.trackcovid19v2.ui.yourworld;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class YourworldViewModel extends ViewModel {
|
||||
|
||||
private MutableLiveData<String> mText;
|
||||
|
||||
public YourworldViewModel() {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("World Fragment");
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
|
||||
public void setText(String str) {
|
||||
mText.setValue(str);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user