diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java index 0af647c..b4987ec 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/HomeFragment.java @@ -223,8 +223,15 @@ public class HomeFragment extends Fragment { EventBus.getDefault().unregister(this); PanoramioCacheUtils.savePhotosToCache(getActivity(), photos); - EventBus.getDefault().unregister(locationChangedHandler); - EventBus.getDefault().unregister(providerChangedHandler); + // FIXME true reason is that hot swapping doesn't fire the activityCreated event while it was recreated + if (locationChangedHandler != null) { + // FIXME only avoiding crash + EventBus.getDefault().unregister(locationChangedHandler); + } + if (providerChangedHandler != null) { + // FIXME only avoiding crash + EventBus.getDefault().unregister(providerChangedHandler); + } } @Override diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/PanoramioShowerFragment.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/PanoramioShowerFragment.java index b0a8104..bfcd85f 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/PanoramioShowerFragment.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/PanoramioShowerFragment.java @@ -66,6 +66,15 @@ public class PanoramioShowerFragment extends Fragment { photoUrl = (TextView)inflatedView.findViewById(R.id.photo_url); photoUrl.setText(imageInfo.getPhotoUrl()); + photoUrl.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + Intent intent = new Intent(android.content.Intent.ACTION_VIEW, + Uri.parse(imageInfo.getPhotoUrl())); + startActivity(intent); + return true; + } + }); photoLocation = (TextView)inflatedView.findViewById(R.id.photo_location); photoLocation.setText(imageInfo.getLatitude() + "," + imageInfo.getLongitude()); diff --git a/app/src/main/res/color/green.xml b/app/src/main/res/color/green.xml new file mode 100644 index 0000000..133e1aa --- /dev/null +++ b/app/src/main/res/color/green.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_panoramio_shower.xml b/app/src/main/res/layout/fragment_panoramio_shower.xml index 0543990..363c2c5 100644 --- a/app/src/main/res/layout/fragment_panoramio_shower.xml +++ b/app/src/main/res/layout/fragment_panoramio_shower.xml @@ -17,17 +17,17 @@ - - + android:layout_height="match_parent" + android:text="@string/test_string" + android:layout_gravity="left" + android:layout_weight="2"/> + android:layout_height="match_parent" + android:text="@string/test_string" + android:layout_gravity="right" + android:layout_marginLeft="5dp"/> + android:layout_height="wrap_content" + android:layout_gravity="left" + android:layout_weight="2"/> - + android:textColor="@color/blue" + android:layout_gravity="right" + android:layout_marginLeft="5dp"/> @@ -53,7 +54,8 @@ + android:layout_gravity="center_horizontal" + android:textColor="@color/green"/>