map ico info in progress

This commit is contained in:
Domagalski 2018-12-06 00:57:53 +01:00
parent 45dac22ec4
commit b4dd785504
27 changed files with 72 additions and 12 deletions

View File

@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="NullableNotNullManager"> <component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" /> <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />

View File

@ -4,6 +4,7 @@ import android.Manifest;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Dialog;
import android.location.Location; import android.location.Location;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -224,7 +225,7 @@ public class MapActivity extends BaseActivity
private void showError(Throwable e) { private void showError(Throwable e) {
String message; String message;
Log.e("ERR",e.toString()); Log.e("ERR", e.toString());
if (e instanceof HttpException) { if (e instanceof HttpException) {
ResponseBody responseBody = ((HttpException) e).response().errorBody(); ResponseBody responseBody = ((HttpException) e).response().errorBody();
@ -370,7 +371,7 @@ public class MapActivity extends BaseActivity
private void SaveCurrentManualLocation(PredefinedCoordViewModel resp) { private void SaveCurrentManualLocation(PredefinedCoordViewModel resp) {
Toast.makeText(getApplicationContext(), R.string.location_saved, Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(), R.string.location_saved, Toast.LENGTH_SHORT).show();
PrefUtils.putCurrentManualLocation(getApplicationContext(),resp.getPredefinedCoordinateId()); PrefUtils.putCurrentManualLocation(getApplicationContext(), resp.getPredefinedCoordinateId());
} }
private void fetchTopCoords() { private void fetchTopCoords() {
@ -719,6 +720,30 @@ public class MapActivity extends BaseActivity
} }
public void adjustMapToSearch(Integer zoom) { public void adjustMapToSearch(Integer zoom) {
MapUtils.setZoom(mapboxMap,zoom); MapUtils.setZoom(mapboxMap, zoom);
}
public void infoDialog(View v) {
// 1. Instantiate an <code><a href="/reference/android/app/AlertDialog.Builder.html">AlertDialog.Builder</a></code> with its constructor
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// 2. Chain together various setter methods to set the dialog characteristics
builder.setTitle("Info")
.setMessage("Na mapie wyświetlane są markery reprezentujące profesorów udostępniających w tej chwili swoją lokalizację. \n" +
"\n" +
"Po kliknięciu w marker możemy sprawdzić kto udostępnia lokalizację, oraz status opisowy (jeśli profesor go ustawił).\n" +
"\n" +
"W aplikacji dostępne są 3 rodzaje lokalizacji, które reprezentowane są przez markery różnego koloru.\n" +
"\n3 typy lokalizacji:\n" +
"<marker> - dokładna (udostępniana z GPS telefonu)\n" +
"<marker> - przybliżona\n" +
"Fioletowy- manualna (wybrana ręcznie)\n");
builder.setIcon(R.drawable.ic_info_black_24dp);
// 3. Get the <code><a href="/reference/android/app/AlertDialog.html">AlertDialog</a></code> from <code><a href="/reference/android/app/AlertDialog.Builder.html#create()">create()</a></code>
AlertDialog dialog = builder.create();
dialog.show();
Toast.makeText(getApplicationContext(), v.getId() + "", Toast.LENGTH_SHORT).show();
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:width="24dp"
android:height="24dp" android:height="24dp"
android:viewportHeight="24.0" android:viewportHeight="24.0"
android:viewportWidth="24.0"> android:viewportWidth="24.0">
<path <path
android:fillColor="#FF000000" android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,15h-2v-6h2v6zm0,-8h-2V7h2v2z" /> android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,15h-2v-6h2v6zm0,-8h-2V7h2v2z" />
</vector> </vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</vector>

View File

@ -21,13 +21,24 @@
</com.mapbox.mapboxsdk.maps.MapView> </com.mapbox.mapboxsdk.maps.MapView>
<ImageButton
android:id="@+id/mapInfoImageButton"
android:onClick="infoDialog"
style="@android:style/Widget.Material.Light.ImageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
mapbox:srcCompat="@drawable/outline_info_24" />
<LinearLayout <LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="bottom" android:gravity="bottom"
android:orientation="vertical" android:orientation="vertical"
tools:layout_editor_absoluteX="0dp" tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="1dp"> tools:layout_editor_absoluteY="0dp">
<!-- Implementation of find my location button --> <!-- Implementation of find my location button -->

View File

@ -0,0 +1,8 @@
<resources>
<declare-styleable name="infoButton">
<attr name="exampleString" format="string" />
<attr name="exampleDimension" format="dimension" />
<attr name="exampleColor" format="color" />
<attr name="exampleDrawable" format="color|reference" />
</declare-styleable>
</resources>

View File

@ -242,4 +242,5 @@
<string name="lack_note">No note.</string> <string name="lack_note">No note.</string>
<string name="search">Search</string> <string name="search">Search</string>
<string name="mockup_location_string" translatable="false">mock location string</string> <string name="mockup_location_string" translatable="false">mock location string</string>
<string name="map_info_text">Na mapie wyświetlane są markery reprezentujące profesorów udostępniających w tej chwili swoją lokalizację.</string>
</resources> </resources>