This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VenueListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
private static final int VENUE_ITEM_VIEW_TYPE = 1; | |
private static final int EMPTY_LIST_VIEW_TYPE = 2; | |
private List<Venue> mListData = new ArrayList<>(); | |
public VenueListAdapter(List<Venue> listData) { | |
if (listData != null){ | |
this.mListData.addAll(listData); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Architectures: | |
MVVM, MVP, MVC | |
OOP: | |
Inheritance | |
Polymorphism | |
Encapsulation | |
Android: | |
Activity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static CurrentLocationProvider.OnLocationSuccessReceiveListener getLocationSuccessListener(Context context){ | |
if (locationSuccessReceiveListener == null) | |
locationSuccessReceiveListener = location -> { | |
if (!shouldStopSending) { | |
if (isNotSoClose(location)){ | |
IntentFilter batteryIntentFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); | |
Intent batteryStatus = context.registerReceiver(null, batteryIntentFilter); | |
int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); |