Merge pull request #817 from Bars107/sherpafy

Sherpafy
This commit is contained in:
vshcherb 2014-08-05 19:45:45 +02:00
commit 501f848e40
2 changed files with 19 additions and 3 deletions

View file

@ -124,11 +124,18 @@ public class SherpafySelectToursFragment extends SherlockListFragment {
LayoutInflater inflater = getActivity().getLayoutInflater();
row = inflater.inflate(R.layout.sherpafy_list_tour_item, parent, false);
}
final TourInformation ti = getItem(position);
TextView description = (TextView) row.findViewById(R.id.TourDescription);
TextView name = (TextView) row.findViewById(R.id.TourName);
TextView moreInformation = (TextView) row.findViewById(R.id.MoreInformation);
SpannableString content = new SpannableString(getString(R.string.sherpafy_more_information));
row.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
((TourViewActivity) getActivity()).selectMenu( ti);
}
});
content.setSpan(new ClickableSpan() {
@Override
public void onClick(View widget) {

View file

@ -108,8 +108,7 @@ public class TourViewActivity extends SherlockFragmentActivity {
}
});
displaySize = new Point();
getWindowManager().getDefaultDisplay().getSize(displaySize);
displaySize = new Point(getWindowManager().getDefaultDisplay().getWidth(), getWindowManager().getDefaultDisplay().getHeight());
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_navigation_drawer_light,
R.string.default_buttons_other_actions, R.string.close);
if (getMyApplication().isApplicationInitializing()) {
@ -119,7 +118,17 @@ public class TourViewActivity extends SherlockFragmentActivity {
showSelectedItem();
}
}
@Override
public void onBackPressed() {
if (state == STATE_SELECT_TOUR){
super.onBackPressed();
} else if (state == STATE_TOUR_VIEW){
selectMenu(R.string.sherpafy_tours);
} else if (state == STATE_STAGE_OVERVIEW){
selectMenu(customization.getSelectedTour());
}
}
private ArrayAdapter<Object> setupAdapter() {
return new ArrayAdapter<Object>(this, R.layout.sherpafy_drawer_list_item){