Merge branch 'master' into feature-wiki-integration

master
Tomasz Półgrabia 2016-09-11 18:04:24 +02:00
commit 1b02bafda7
6 changed files with 55 additions and 2 deletions

View File

@ -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,5 +44,8 @@ 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;
}
compile 'org.apache.commons:commons-lang3:3.4'
}

View File

@ -15,6 +15,10 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="io.fabric.ApiKey"
android:value="f9f8274d1e204bbb3ef13a27a23fc58aa146d4b9"
/>
</application>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

View File

@ -16,10 +16,12 @@ import android.view.GestureDetector;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.widget.Toast;
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.callbacks.StandardLocationListener;
import pl.tpolgrabia.urbanexplorer.callbacks.StandardLocationListenerCallback;
import pl.tpolgrabia.urbanexplorer.dto.panoramio.PanoramioImageInfo;
@ -92,6 +94,8 @@ public class MainActivity extends ActionBarActivity implements GestureDetector.O
gestureDetector = new GestureDetectorCompat(this, this);
locationCallback = new StandardLocationListener();
initLocalication();
Fabric fabric = new Fabric.Builder(this).debuggable(true).kits(new Crashlytics()).build();
Fabric.with(fabric);
}
@Override
@ -152,6 +156,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

View File

@ -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;
}
});
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#0000ff" />
</selector>

View File

@ -50,7 +50,8 @@
<TextView android:id="@+id/photo_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:textColor="@color/blue" />
</LinearLayout>
<LinearLayout android:layout_width="match_parent"