From ce90b90a5e53ec530887be5b54086f460952c574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Sun, 28 Aug 2016 18:07:37 +0200 Subject: [PATCH 1/5] Fix of compilation error. --- app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index 6e81369..8769c5b 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -66,7 +66,7 @@ public class MainActivity extends ActionBarActivity implements GestureDetector.O .add(R.id.fragments, new HomeFragment()) .commit(); - LinearLayout locations = (LinearLayout) findViewById(R.id.locations); + // locations.setOnTouchListener(new OnSwipeTouchListener); gestureDetector = new GestureDetectorCompat(this, this); } From f2535dd10ebdbed7486dd4e696616ab484dc3d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Mon, 29 Aug 2016 13:45:39 +0200 Subject: [PATCH 2/5] Fixed issue with errors during switching to panoramio show dlg, and added possibility to route to the image. --- .../pl/tpolgrabia/urbanexplorer/MainActivity.java | 8 ++++++++ .../fragments/PanoramioShowerFragment.java | 14 +++++++++++++- app/src/main/res/color/blue.xml | 4 ++++ .../main/res/layout/fragment_panoramio_shower.xml | 3 ++- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/color/blue.xml diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index 8769c5b..e01ac58 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -129,6 +129,14 @@ public class MainActivity extends ActionBarActivity implements GestureDetector.O @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + if (e1 == null) { + return false; + } + + if (e2 == null) { + return false; + } + float diffx = e2.getX() - e1.getX(); float diffy = e2.getY() - e1.getY(); Log.d(CLASS_TAG, "Flinging... diffx: " + diffx + " diffy" + diffy 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 ca5887a..425614c 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/PanoramioShowerFragment.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/PanoramioShowerFragment.java @@ -1,6 +1,8 @@ package pl.tpolgrabia.urbanexplorer.fragments; +import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; @@ -43,7 +45,7 @@ public class PanoramioShowerFragment extends Fragment { return inflatedView; } - PanoramioImageInfo imageInfo = (PanoramioImageInfo) arguments.getSerializable(PANORAMIO_PHOTO_ARG_KEY); + final PanoramioImageInfo imageInfo = (PanoramioImageInfo) arguments.getSerializable(PANORAMIO_PHOTO_ARG_KEY); if (imageInfo != null) { ImageLoader.getInstance().displayImage( @@ -65,6 +67,16 @@ public class PanoramioShowerFragment extends Fragment { photoLocation = (TextView)inflatedView.findViewById(R.id.photo_location); photoLocation.setText(imageInfo.getLatitude() + "," + imageInfo.getLongitude()); + photoLocation.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + Intent intent = new Intent(android.content.Intent.ACTION_VIEW, + Uri.parse("http://maps.google.com/maps?daddr=" + imageInfo.getLatitude() + "," + + imageInfo.getLongitude())); + startActivity(intent); + return true; + } + }); } diff --git a/app/src/main/res/color/blue.xml b/app/src/main/res/color/blue.xml new file mode 100644 index 0000000..afa20de --- /dev/null +++ b/app/src/main/res/color/blue.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 e8ebb72..b531e56 100644 --- a/app/src/main/res/layout/fragment_panoramio_shower.xml +++ b/app/src/main/res/layout/fragment_panoramio_shower.xml @@ -50,7 +50,8 @@ + android:layout_height="wrap_content" + android:textColor="@color/blue" /> Date: Tue, 30 Aug 2016 11:36:01 +0200 Subject: [PATCH 3/5] Integration of crashylytics --- app/build.gradle | 20 +++++++++++++++++++ app/src/main/AndroidManifest.xml | 4 ++++ .../urbanexplorer/MainActivity.java | 3 +++ 3 files changed, 27 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index b000daf..cff33c2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,21 @@ +buildscript { + repositories { + maven { url 'https://maven.fabric.io/public' } + } + + dependencies { + // The Fabric Gradle plugin uses an open ended version to react + // quickly to Android tooling updates + classpath 'io.fabric.tools:gradle:1.+' + } +} + apply plugin: 'com.android.application' +apply plugin: 'io.fabric' + +repositories { + maven { url 'https://maven.fabric.io/public' } +} android { compileSdkVersion 21 @@ -27,4 +44,7 @@ dependencies { compile 'com.android.support:recyclerview-v7:21.0.3' compile 'com.googlecode.android-query:android-query:0.25.9' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' + compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') { + transitive = true; + } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c10098e..768c216 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,6 +15,10 @@ + diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index e01ac58..db40f12 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -11,10 +11,12 @@ import android.view.GestureDetector; import android.view.MenuItem; import android.view.MotionEvent; import android.widget.LinearLayout; +import com.crashlytics.android.Crashlytics; import com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; +import io.fabric.sdk.android.Fabric; import pl.tpolgrabia.urbanexplorer.dto.PanoramioImageInfo; import pl.tpolgrabia.urbanexplorer.fragments.HomeFragment; import pl.tpolgrabia.urbanexplorer.fragments.PanoramioShowerFragment; @@ -44,6 +46,7 @@ public class MainActivity extends ActionBarActivity implements GestureDetector.O @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + Fabric.with(this, new Crashlytics()); setContentView(R.layout.activity_main); // Toolbar toolbar = (Toolbar) findViewById(R.id.navbar); // setSupportActionBar(toolbar); From 34e5da12333b6179c72d1a6f21340f57411dd87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Wed, 31 Aug 2016 22:19:56 +0200 Subject: [PATCH 4/5] Crashlytics integration. --- app/build.gradle | 20 +++++++++++++++++++ app/src/main/AndroidManifest.xml | 4 ++++ .../urbanexplorer/MainActivity.java | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index b000daf..cff33c2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,21 @@ +buildscript { + repositories { + maven { url 'https://maven.fabric.io/public' } + } + + dependencies { + // The Fabric Gradle plugin uses an open ended version to react + // quickly to Android tooling updates + classpath 'io.fabric.tools:gradle:1.+' + } +} + apply plugin: 'com.android.application' +apply plugin: 'io.fabric' + +repositories { + maven { url 'https://maven.fabric.io/public' } +} android { compileSdkVersion 21 @@ -27,4 +44,7 @@ dependencies { compile 'com.android.support:recyclerview-v7:21.0.3' compile 'com.googlecode.android-query:android-query:0.25.9' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' + compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') { + transitive = true; + } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c10098e..768c216 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,6 +15,10 @@ + diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java index 8769c5b..27d340f 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/MainActivity.java @@ -11,10 +11,12 @@ import android.view.GestureDetector; import android.view.MenuItem; import android.view.MotionEvent; import android.widget.LinearLayout; +import com.crashlytics.android.Crashlytics; import com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; +import io.fabric.sdk.android.Fabric; import pl.tpolgrabia.urbanexplorer.dto.PanoramioImageInfo; import pl.tpolgrabia.urbanexplorer.fragments.HomeFragment; import pl.tpolgrabia.urbanexplorer.fragments.PanoramioShowerFragment; @@ -69,6 +71,8 @@ public class MainActivity extends ActionBarActivity implements GestureDetector.O // locations.setOnTouchListener(new OnSwipeTouchListener); gestureDetector = new GestureDetectorCompat(this, this); + Fabric fabric = new Fabric.Builder(this).debuggable(true).kits(new Crashlytics()).build(); + Fabric.with(fabric); } @Override From 5456292ef206b9a102e4dacd00da4d83fd921d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20P=C3=B3=C5=82grabia?= Date: Fri, 2 Sep 2016 14:56:09 +0200 Subject: [PATCH 5/5] Crash button. --- .../fragments/WikiLocationsFragment.java | 9 ++++++++- app/src/main/res/layout/fragment_wiki_locations.xml | 12 +++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/WikiLocationsFragment.java b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/WikiLocationsFragment.java index 4066970..a79f3cd 100644 --- a/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/WikiLocationsFragment.java +++ b/app/src/main/java/pl/tpolgrabia/urbanexplorer/fragments/WikiLocationsFragment.java @@ -24,7 +24,14 @@ public class WikiLocationsFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_wiki_locations, container, false); + View inflatedView = inflater.inflate(R.layout.fragment_wiki_locations, container, false); + inflatedView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + throw new RuntimeException("FAKE BUG 2"); + } + }); + return inflatedView; } } diff --git a/app/src/main/res/layout/fragment_wiki_locations.xml b/app/src/main/res/layout/fragment_wiki_locations.xml index d6d8986..2876d88 100644 --- a/app/src/main/res/layout/fragment_wiki_locations.xml +++ b/app/src/main/res/layout/fragment_wiki_locations.xml @@ -1,13 +1,19 @@ - - +