This commit is contained in:
Alexey Kulish 2015-10-07 19:34:02 +03:00
parent 0c98eda604
commit 17ba2e1e93
2 changed files with 5 additions and 5 deletions

View file

@ -65,11 +65,11 @@ public class RegionDialogFragment extends DialogFragment{
toolbar.setTitle(region.getName()); toolbar.setTitle(region.getName());
} }
} }
((DownloadActivity) getActivity()).initFreeVersionBanner(view); getDownloadActivity().initFreeVersionBanner(view);
listener = new DialogDismissListener() { listener = new DialogDismissListener() {
@Override @Override
public void onDialogDismissed() { public void onDialogDismissed() {
((DownloadActivity) getActivity()).initFreeVersionBanner(view); getDownloadActivity().initFreeVersionBanner(view);
} }
}; };
return view; return view;
@ -92,7 +92,7 @@ public class RegionDialogFragment extends DialogFragment{
public void onRegionSelected(String regionId) { public void onRegionSelected(String regionId) {
final RegionDialogFragment regionDialogFragment = createInstance(regionId); final RegionDialogFragment regionDialogFragment = createInstance(regionId);
regionDialogFragment.setOnDismissListener(listener); regionDialogFragment.setOnDismissListener(listener);
((DownloadActivity) getActivity()).showDialog(getActivity(), regionDialogFragment); getDownloadActivity().showDialog(getActivity(), regionDialogFragment);
} }
public static RegionDialogFragment createInstance(String regionId) { public static RegionDialogFragment createInstance(String regionId) {

View file

@ -127,8 +127,8 @@ public class WorldItemsFragment extends OsmandExpandableListFragment {
if (groupPosition == worldRegionsIndex) { if (groupPosition == worldRegionsIndex) {
WorldRegion region = (WorldRegion)listAdapter.getChild(groupPosition, childPosition); WorldRegion region = (WorldRegion)listAdapter.getChild(groupPosition, childPosition);
final RegionDialogFragment regionDialogFragment = RegionDialogFragment.createInstance(region.getRegionId()); final RegionDialogFragment regionDialogFragment = RegionDialogFragment.createInstance(region.getRegionId());
regionDialogFragment.setOnDismissListener((DownloadActivity) getActivity()); regionDialogFragment.setOnDismissListener(getDownloadActivity());
((DownloadActivity)getActivity()).showDialog(getActivity(), regionDialogFragment); getDownloadActivity().showDialog(getActivity(), regionDialogFragment);
return true; return true;
} else if (groupPosition == voicePromptsIndex) { } else if (groupPosition == voicePromptsIndex) {
if (childPosition == voicePromptsItemsRecordedSubIndex) { if (childPosition == voicePromptsItemsRecordedSubIndex) {