Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
/**
* @author fomenkoo
*/
public class PathTrackingActivity extends MifosBaseActivity implements PathTrackingMvpView, SwipeRefreshLayout.OnRefreshListener {
public class PathTrackingActivity extends MifosBaseActivity
implements PathTrackingMvpView, SwipeRefreshLayout.OnRefreshListener {

@BindView(R.id.rv_path_tacker)
RecyclerView rvPathTracker;
Expand Down Expand Up @@ -98,17 +99,20 @@ public void showUserInterface() {
rvPathTracker.setHasFixedSize(false);
rvPathTracker.scrollToPosition(0);
pathTrackingAdapter = new PathTrackingAdapter(userLocation -> {
List<UserLatLng> userLatLngs =
pathTrackingAdapter.getLatLngList(userLocation.getLatlng());
String uri = "http://maps.google.com/maps?f=d&hl=en&saddr="
+ userLatLngs.get(0).getLat() + "," + userLatLngs.get(0).getLng() + "&daddr="
+ userLatLngs.get(userLatLngs.size() - 1).getLat() + "," + ""
+ userLatLngs.get(userLatLngs.size() - 1).getLng();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(Intent.createChooser(intent, getString(R.string.start_tracking)));
return null;
});
List<UserLatLng> userLatLngs =
pathTrackingAdapter.getLatLngList(userLocation.getLatlng());
String uri = "http://maps.google.com/maps?f=d&hl=en&saddr="
+ userLatLngs.get(0).getLat() + ","
+ userLatLngs.get(0).getLng() + "&daddr="
+ userLatLngs.get(userLatLngs.size() - 1).getLat() + "," + ""
+ userLatLngs.get(userLatLngs.size() - 1).getLng();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
startActivity(Intent.createChooser(intent, getString(R.string.start_tracking)));
return null;
}
);
rvPathTracker.setAdapter(pathTrackingAdapter);
swipeRefreshLayout.setColorSchemeColors(this
.getResources().getIntArray(R.array.swipeRefreshColors));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
rv_offline_dashboard.addItemDecoration(new ItemOffsetDecoration(getActivity(),
R.dimen.item_offset));
mOfflineDashboardAdapter = new OfflineDashboardAdapter(position -> {
startPayloadActivity(mPayloadClasses.get(position));
return null;
});
startPayloadActivity(mPayloadClasses.get(position));
return null;
}
);
rv_offline_dashboard.setAdapter(mOfflineDashboardAdapter);

return rootView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ public void showReportCategories(List<ClientReportTypeItem> reportTypes) {
rvReports.setLayoutManager(layoutManager);
rvReports.addItemDecoration(dividerItemDecoration);
reportAdapter = new ClientReportAdapter(position -> {
openDetailFragment(position);
return null;
});
openDetailFragment(position);
return null;
}
);
rvReports.setAdapter(reportAdapter);

reportAdapter.setReportItems(reportTypes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
import uk.co.deanwild.materialshowcaseview.MaterialShowcaseSequence;
import uk.co.deanwild.materialshowcaseview.ShowcaseConfig;

public class SearchFragment extends MifosBaseFragment implements SearchMvpView, AdapterView.OnItemSelectedListener {
public class SearchFragment extends MifosBaseFragment
implements SearchMvpView, AdapterView.OnItemSelectedListener {

private static final String LOG_TAG = SearchFragment.class.getSimpleName();

Expand Down Expand Up @@ -136,37 +137,38 @@ public void showUserInterface() {
rv_search.setLayoutManager(layoutManager);
rv_search.setHasFixedSize(true);
searchAdapter = new SearchAdapter(searchedEntity -> {
Intent activity = null;
switch (searchedEntity.getEntityType()) {
case Constants.SEARCH_ENTITY_LOAN:
activity = new Intent(getActivity(), ClientActivity.class);
activity.putExtra(Constants.LOAN_ACCOUNT_NUMBER,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_CLIENT:
activity = new Intent(getActivity(), ClientActivity.class);
activity.putExtra(Constants.CLIENT_ID,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_GROUP:
activity = new Intent(getActivity(), GroupsActivity.class);
activity.putExtra(Constants.GROUP_ID,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_SAVING:
activity = new Intent(getActivity(), ClientActivity.class);
activity.putExtra(Constants.SAVINGS_ACCOUNT_NUMBER,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_CENTER:
activity = new Intent(getActivity(), CentersActivity.class);
activity.putExtra(Constants.CENTER_ID,
searchedEntity.getEntityId());
break;
Intent activity = null;
switch (searchedEntity.getEntityType()) {
case Constants.SEARCH_ENTITY_LOAN:
activity = new Intent(getActivity(), ClientActivity.class);
activity.putExtra(Constants.LOAN_ACCOUNT_NUMBER,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_CLIENT:
activity = new Intent(getActivity(), ClientActivity.class);
activity.putExtra(Constants.CLIENT_ID,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_GROUP:
activity = new Intent(getActivity(), GroupsActivity.class);
activity.putExtra(Constants.GROUP_ID,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_SAVING:
activity = new Intent(getActivity(), ClientActivity.class);
activity.putExtra(Constants.SAVINGS_ACCOUNT_NUMBER,
searchedEntity.getEntityId());
break;
case Constants.SEARCH_ENTITY_CENTER:
activity = new Intent(getActivity(), CentersActivity.class);
activity.putExtra(Constants.CENTER_ID,
searchedEntity.getEntityId());
break;
}
startActivity(activity);
return null;
}
startActivity(activity);
return null;
});
);
rv_search.setAdapter(searchAdapter);

cb_exactMatch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
Expand Down