diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a6fa9fe..d35538f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -30,6 +30,7 @@ @@ -48,7 +49,7 @@ . */ -package it.danieleverducci.nextcloudmaps.activity.main; +package it.danieleverducci.nextcloudmaps.activity.detail; import android.Manifest; import android.content.Context; @@ -25,7 +25,6 @@ import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.util.Log; -import android.view.LayoutInflater; import android.view.View; import android.widget.Toast; diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/GeofavoriteAdapter.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/GeofavoriteAdapter.java index f0d1990..bda26ac 100644 --- a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/GeofavoriteAdapter.java +++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/main/GeofavoriteAdapter.java @@ -21,16 +21,17 @@ package it.danieleverducci.nextcloudmaps.activity.main; import android.content.Context; +import android.content.Intent; import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Filter; import android.widget.Filterable; +import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; -import androidx.cardview.widget.CardView; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; @@ -41,7 +42,7 @@ import java.util.List; import it.danieleverducci.nextcloudmaps.R; import it.danieleverducci.nextcloudmaps.model.Geofavorite; -public class GeofavoriteAdapter extends RecyclerView.Adapter implements Filterable { +public class GeofavoriteAdapter extends RecyclerView.Adapter implements Filterable { public static final int SORT_BY_TITLE = 0; public static final int SORT_BY_CREATED = 1; @@ -83,13 +84,13 @@ public class GeofavoriteAdapter extends RecyclerView.Adapter { - Geofavorite geofavorite = geofavoriteAdapter.get(position); - Intent i = new Intent(); - i.setAction(Intent.ACTION_VIEW); - i.setData(geofavorite.getGeoUri()); - startActivity(i); - }); + itemClickListener = new ItemClickListener() { + @Override + public void onItemClick(View view, int position) { + Geofavorite geofavorite = geofavoriteAdapter.get(position); + Intent i = new Intent(); + i.setAction(Intent.ACTION_VIEW); + i.setData(geofavorite.getGeoUri()); + startActivity(i); + } + + @Override + public void onItemShareClick(Geofavorite item) { + Intent i = new Intent(); + i.setAction(Intent.ACTION_SEND); + i.setType("text/plain"); + String shareMessage = getString(R.string.share_message) + .replace("{lat}", ""+item.getLat()) + .replace("{lng}", ""+item.getLng()); + i.putExtra(Intent.EXTRA_TEXT, shareMessage ); + startActivity(Intent.createChooser(i, getString(R.string.share_via))); + } + }; geofavoriteAdapter = new GeofavoriteAdapter(getApplicationContext(), itemClickListener); recyclerView.setAdapter(geofavoriteAdapter); diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 6136287..0000000 --- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index ca3826a..0000000 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index 429b8ab..f13af32 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -2,13 +2,14 @@ android:width="108dp" android:height="108dp" android:viewportWidth="108" - android:viewportHeight="108"> - + android:viewportHeight="108" + android:tint="#FFFFFF"> + + android:fillColor="@android:color/white" + android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/> diff --git a/app/src/main/res/drawable/ic_more.xml b/app/src/main/res/drawable/ic_more.xml new file mode 100644 index 0000000..6a7f274 --- /dev/null +++ b/app/src/main/res/drawable/ic_more.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_share.xml b/app/src/main/res/drawable/ic_share.xml new file mode 100644 index 0000000..9300daf --- /dev/null +++ b/app/src/main/res/drawable/ic_share.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/item_geofav.xml b/app/src/main/res/layout/item_geofav.xml index 7021db5..fe17e22 100644 --- a/app/src/main/res/layout/item_geofav.xml +++ b/app/src/main/res/layout/item_geofav.xml @@ -18,7 +18,6 @@ + android:layout_height="wrap_content" + android:layout_marginStart="10dp" + android:layout_weight="1"> + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index 8930d3a..a5a0a58 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..0a72786 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index a2b45ce..4bdcd52 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..3e2b765 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index b81d040..deb7456 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..6613478 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 219f8c0..550868d 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..1bec9e3 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index fd94ece..b53cb13 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..ff74693 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ab5ce27..3bad446 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -17,15 +17,14 @@ --> - - + #ffffff #121212 #00000000 - #0082C9 - @android:color/white - #202124 + + + #aaa \ No newline at end of file diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml index ca85919..2506c08 100644 --- a/app/src/main/res/values/ic_launcher_background.xml +++ b/app/src/main/res/values/ic_launcher_background.xml @@ -1,21 +1,4 @@ - - #0082C9 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1ab01f9..275068f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -29,6 +29,8 @@ Switch account List Search by name + Share via + Check out this place: {lat}°N, {lng}°E Sort by