Jelajahi Sumber

buttons in map and event list

felocsss 1 tahun lalu
induk
melakukan
9fa6baa8f5

+ 17 - 0
.idea/deploymentTargetDropDown.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="deploymentTargetDropDown">
+    <targetSelectedWithDropDown>
+      <Target>
+        <type value="QUICK_BOOT_TARGET" />
+        <deviceKey>
+          <Key>
+            <type value="VIRTUAL_DEVICE_PATH" />
+            <value value="C:\Users\vlads\.android\avd\Pixel_5_API_33.avd" />
+          </Key>
+        </deviceKey>
+      </Target>
+    </targetSelectedWithDropDown>
+    <timeTargetWasSelectedWithDropDown value="2023-04-30T20:54:44.487883800Z" />
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 1 - 0
app/build.gradle

@@ -34,6 +34,7 @@ android {
 }
 
 dependencies {
+    implementation 'com.google.android.gms:play-services-location:21.0.1'
 
     implementation 'org.osmdroid:osmdroid-android:6.1.14'
     /*implementation 'com.github.MKergall:osmbonuspack:6.9.0'*/

+ 44 - 5
app/src/main/java/com/sharix/sportsmanfriend/view/MainActivity.java

@@ -2,6 +2,8 @@ package com.sharix.sportsmanfriend.view;
 
 import androidx.appcompat.app.AppCompatActivity;
 import android.os.Bundle;
+import android.widget.Toast;
+
 import com.sharix.sportsmanfriend.R;
 import com.sharix.sportsmanfriend.databinding.ActivityMainBinding;
 import com.sharix.sportsmanfriend.view.fragments.CalendarFragment;
@@ -18,6 +20,12 @@ public class MainActivity extends AppCompatActivity {
 
     ActivityMainBinding binding;
 
+    MapFragment mapFragment = new MapFragment();
+    CalendarFragment calendarFragment = new CalendarFragment();
+    CreateMettingFragment createMettingFragment = new CreateMettingFragment();
+    ChatsFragment chatsFragment = new ChatsFragment();
+    ProfileFragment profileFragment = new ProfileFragment();
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -32,23 +40,53 @@ public class MainActivity extends AppCompatActivity {
             switch (item.getItemId()){
 
                 case R.id.home:
-                    replaceFragment(new MapFragment());
+                    /*if(mapFragment == null){
+                        mapFragment = new MapFragment();
+                        Toast toast = Toast.makeText(getApplicationContext(),
+                                "Пора покормить кота!", Toast.LENGTH_SHORT);
+                        toast.show();
+                    }*/
+                    replaceFragment(mapFragment);
                     break;
 
                 case R.id.today:
-                    replaceFragment(new CalendarFragment());
+                    /*if(calendarFragment == null){
+                        Toast toast = Toast.makeText(getApplicationContext(),
+                                "Пора покормить кота!", Toast.LENGTH_SHORT);
+                        toast.show();
+                        calendarFragment = new CalendarFragment();
+                    }*/
+                    replaceFragment(calendarFragment);
                     break;
 
                 case R.id.history:
-                    replaceFragment(new CreateMettingFragment());
+                    /*if(createMettingFragment == null){
+                        Toast toast = Toast.makeText(getApplicationContext(),
+                                "Пора покормить кота!", Toast.LENGTH_SHORT);
+                        toast.show();
+                        createMettingFragment = new CreateMettingFragment();
+                    }*/
+                    replaceFragment(createMettingFragment);
                     break;
 
                 case R.id.chats:
-                    replaceFragment(new ChatsFragment());
+                    /*if(chatsFragment == null){
+                        Toast toast = Toast.makeText(getApplicationContext(),
+                                "Пора покормить кота!", Toast.LENGTH_SHORT);
+                        toast.show();
+                        chatsFragment = new ChatsFragment();
+                    }*/
+                    replaceFragment(chatsFragment);
                     break;
 
                 case R.id.account:
-                    replaceFragment(new ProfileFragment());
+                    /*if(profileFragment == null){
+                        Toast toast = Toast.makeText(getApplicationContext(),
+                                "Пора покормить кота!", Toast.LENGTH_SHORT);
+                        toast.show();
+                        profileFragment = new ProfileFragment();
+                    }*/
+                    replaceFragment(profileFragment);
                     break;
             }
 
@@ -60,6 +98,7 @@ public class MainActivity extends AppCompatActivity {
         FragmentManager fragmentManager = getSupportFragmentManager();
         FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
         fragmentTransaction.replace(R.id.frameWindow,fragment);
+        fragmentTransaction.addToBackStack(null);
         fragmentTransaction.commit();
     }
 }

+ 41 - 45
app/src/main/java/com/sharix/sportsmanfriend/view/fragments/ChatsFragment.java

@@ -1,66 +1,62 @@
 package com.sharix.sportsmanfriend.view.fragments;
 
+import android.graphics.Color;
 import android.os.Bundle;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
 
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.Spinner;
+import android.widget.TextView;
 
 import com.sharix.sportsmanfriend.R;
 
-/**
- * A simple {@link Fragment} subclass.
- * Use the {@link ChatsFragment#newInstance} factory method to
- * create an instance of this fragment.
- */
 public class ChatsFragment extends Fragment {
 
-    // TODO: Rename parameter arguments, choose names that match
-    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
-    private static final String ARG_PARAM1 = "param1";
-    private static final String ARG_PARAM2 = "param2";
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+                             Bundle savedInstanceState) {
+        // Inflate the layout for this fragment
+        View view =  inflater.inflate(R.layout.fragment_chats, container, false);
 
-    // TODO: Rename and change types of parameters
-    private String mParam1;
-    private String mParam2;
+        Spinner spinner = view.findViewById(R.id.sort_spinner);
 
-    public ChatsFragment() {
-        // Required empty public constructor
-    }
+        // Создание массива строк с элементами для Spinner
+        String[] items = new String[]{"Sort by", "Date", "Saved", "Distance"};
 
-    /**
-     * Use this factory method to create a new instance of
-     * this fragment using the provided parameters.
-     *
-     * @param param1 Parameter 1.
-     * @param param2 Parameter 2.
-     * @return A new instance of fragment ChatsFragment.
-     */
-    // TODO: Rename and change types and number of parameters
-    public static ChatsFragment newInstance(String param1, String param2) {
-        ChatsFragment fragment = new ChatsFragment();
-        Bundle args = new Bundle();
-        args.putString(ARG_PARAM1, param1);
-        args.putString(ARG_PARAM2, param2);
-        fragment.setArguments(args);
-        return fragment;
-    }
+        // Создание ArrayAdapter с использованием созданного массива строк и стандартного макета выпадающего списка
+        ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items) {
+            @Override
+            public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
+                View view = super.getDropDownView(position, convertView, parent);
 
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        if (getArguments() != null) {
-            mParam1 = getArguments().getString(ARG_PARAM1);
-            mParam2 = getArguments().getString(ARG_PARAM2);
-        }
-    }
+                if (position == 0) {
+                    // Если это элемент с подсказкой, то делаем его серым и неактивным
+                    ((TextView) view).setTextColor(Color.GRAY);
+                    ((TextView) view).setEnabled(false);
+                } else {
+                    // Иначе делаем активным
+                    ((TextView) view).setTextColor(Color.BLACK);
+                    ((TextView) view).setEnabled(true);
+                }
 
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
-        // Inflate the layout for this fragment
-        return inflater.inflate(R.layout.fragment_chats, container, false);
+                return view;
+            }
+        };
+
+        // Задание стиля выпадающего списка
+        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+
+        // Связывание ArrayAdapter с Spinner
+        spinner.setAdapter(adapter);
+
+        // Установка первоначального текста
+
+        return view;
     }
 }

+ 96 - 61
app/src/main/java/com/sharix/sportsmanfriend/view/fragments/MapFragment.java

@@ -1,94 +1,67 @@
 package com.sharix.sportsmanfriend.view.fragments;
 
 import android.Manifest;
-import android.content.Context;
 import android.content.pm.PackageManager;
-import android.os.Build;
+
 import android.os.Bundle;
 
 import androidx.annotation.NonNull;
-import androidx.constraintlayout.widget.ConstraintLayout;
+import androidx.annotation.Nullable;
+import androidx.core.app.ActivityCompat;
 import androidx.core.content.ContextCompat;
 import androidx.fragment.app.Fragment;
 
-import android.os.StrictMode;
-import android.preference.PreferenceManager;
+
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ImageButton;
+
+
+import com.google.android.gms.location.FusedLocationProviderClient;
+import com.google.android.gms.location.LocationServices;
 
 import com.sharix.sportsmanfriend.R;
 
 import org.osmdroid.api.IMapController;
-import org.osmdroid.config.Configuration;
 import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
 import org.osmdroid.util.GeoPoint;
 import org.osmdroid.views.MapView;
 
 public class MapFragment extends Fragment {
 
-
-    private static final String ARG_PARAM1 = "param1";
-    private static final String ARG_PARAM2 = "param2";
-
-    private String mParam1;
-    private String mParam2;
-
-    public MapFragment() {
-        // Required empty public constructor
-    }
-
-    public static MapFragment newInstance(String param1, String param2) {
-        MapFragment fragment = new MapFragment();
-        Bundle args = new Bundle();
-        args.putString(ARG_PARAM1, param1);
-        args.putString(ARG_PARAM2, param2);
-        fragment.setArguments(args);
-        return fragment;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        if (getArguments() != null) {
-            mParam1 = getArguments().getString(ARG_PARAM1);
-            mParam2 = getArguments().getString(ARG_PARAM2);
-        }
-    }
-
     private final int REQUEST_PERMISSIONS_REQUEST_CODE = 1;
+    private final int PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 2;
     private MapView map = null;
-    View view = null;
+    private IMapController mapController = null;
+    private View view = null;
+    private ImageButton btnZoomIn;
+    private ImageButton btnZoomOut;
+    private ImageButton btnMyLocation;
+    private double latitude, longitude;
+    private FusedLocationProviderClient fusedLocationProviderClient;
 
     @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
-
-        StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
-        StrictMode.setThreadPolicy(policy);
+    public void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
 
-        Context ctx = getActivity().getApplicationContext();
-        Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));
+    }
 
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         view = inflater.inflate(R.layout.fragment_map, container, false);
 
-        map = (MapView) view.findViewById(R.id.map);
-        map.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
-        map.setMultiTouchControls(true);
+        btnZoomIn = view.findViewById(R.id.btn_zoomIn);
+        btnZoomOut = view.findViewById(R.id.btn_zoomOut);
+        btnMyLocation = view.findViewById(R.id.btnMyLocation);
 
-        IMapController iMapController = map.getController();
-        iMapController.setZoom(12);
-        GeoPoint startPoint = new GeoPoint(55.934473, 37.497081);
-        iMapController.setCenter(startPoint);
-
-        if (Build.VERSION.SDK_INT >= 23) {
-            if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED ||
-                    ContextCompat.checkSelfPermission(getContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED ||
-                    ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
-                String[] permissoes = {Manifest.permission.INTERNET, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION};
-                requestPermissions(permissoes, REQUEST_PERMISSIONS_REQUEST_CODE);
-            }
-        }
+        map = view.findViewById(R.id.map);
+        mapController = map.getController();
+        fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(getActivity());
+
+        configureMap();
+        askPermissions();
+        addClickEventToAllButtons();
 
         return view;
     }
@@ -98,11 +71,73 @@ public class MapFragment extends Fragment {
         super.onRequestPermissionsResult(requestCode, permissions, grantResults);
         switch (requestCode) {
             case REQUEST_PERMISSIONS_REQUEST_CODE: {
-                if (grantResults.length > 0
-                        && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+                    getActivity().recreate();
+                }
+            }
+            case PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION: {
+                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                     getActivity().recreate();
                 }
             }
         }
     }
+
+    private void configureMap() {
+        map = (MapView) view.findViewById(R.id.map);
+        map.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
+        map.setMultiTouchControls(true);
+        map.setMaxZoomLevel(18.0);
+
+        mapController.setZoom(15);
+        GeoPoint startPoint = new GeoPoint(55.934473, 37.497081);
+        mapController.setCenter(startPoint);
+
+        map.setBuiltInZoomControls(false);
+    }
+
+    private void askPermissions() {
+        if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED ||
+                ContextCompat.checkSelfPermission(getContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED ||
+                ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+            String[] permission = {Manifest.permission.INTERNET, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION};
+            requestPermissions(permission, REQUEST_PERMISSIONS_REQUEST_CODE);
+        }
+    }
+
+    private void addClickEventToAllButtons() {
+
+        btnZoomIn.setOnClickListener(v -> {
+            if (map.canZoomIn()) {
+                mapController.zoomIn();
+            }
+        });
+
+        btnZoomOut.setOnClickListener(v -> {
+            if (map.canZoomOut()) {
+                mapController.zoomOut();
+            }
+        });
+
+        btnMyLocation.setOnClickListener(v -> {
+            if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
+                    && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+
+                String[] permission = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
+                requestPermissions(permission, PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);
+            }
+
+            fusedLocationProviderClient.getLastLocation()
+                    .addOnSuccessListener(getActivity(), location -> {
+                        if (location != null) {
+                            latitude = location.getLatitude();
+                            longitude = location.getLongitude();
+                            mapController.setCenter(new GeoPoint(latitude, longitude));
+                            mapController.setZoom(18);
+                        }
+                    });
+
+        });
+    }
+
 }

+ 5 - 0
app/src/main/res/drawable/ic_event_list.xml

@@ -0,0 +1,5 @@
+<vector android:autoMirrored="true" android:height="25dp"
+    android:tint="#000000" android:viewportHeight="24"
+    android:viewportWidth="24" android:width="25dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M4,10.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM4,4.5c-0.83,0 -1.5,0.67 -1.5,1.5S3.17,7.5 4,7.5 5.5,6.83 5.5,6 4.83,4.5 4,4.5zM4,16.5c-0.83,0 -1.5,0.68 -1.5,1.5s0.68,1.5 1.5,1.5 1.5,-0.68 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM7,19h14v-2L7,17v2zM7,13h14v-2L7,11v2zM7,5v2h14L21,5L7,5z"/>
+</vector>

+ 5 - 0
app/src/main/res/drawable/ic_map_filters.xml

@@ -0,0 +1,5 @@
+<vector android:height="40dp" android:tint="#000000"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M4.25,5.61C6.27,8.2 10,13 10,13v6c0,0.55 0.45,1 1,1h2c0.55,0 1,-0.45 1,-1v-6c0,0 3.72,-4.8 5.74,-7.39C20.25,4.95 19.78,4 18.95,4H5.04C4.21,4 3.74,4.95 4.25,5.61z"/>
+</vector>

+ 5 - 0
app/src/main/res/drawable/ic_my_location.xml

@@ -0,0 +1,5 @@
+<vector android:height="35dp" android:tint="#000000"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="35dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM20.94,11c-0.46,-4.17 -3.77,-7.48 -7.94,-7.94L13,1h-2v2.06C6.83,3.52 3.52,6.83 3.06,11L1,11v2h2.06c0.46,4.17 3.77,7.48 7.94,7.94L11,23h2v-2.06c4.17,-0.46 7.48,-3.77 7.94,-7.94L23,13v-2h-2.06zM12,19c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
+</vector>

+ 5 - 0
app/src/main/res/drawable/ic_search.xml

@@ -0,0 +1,5 @@
+<vector android:height="40dp" android:tint="#000000"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
+</vector>

+ 5 - 0
app/src/main/res/drawable/ic_spinner_down.xml

@@ -0,0 +1,5 @@
+<vector android:height="25dp" android:tint="#000000"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="25dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M7,10l5,5 5,-5z"/>
+</vector>

+ 6 - 0
app/src/main/res/drawable/ic_zoom_in.xml

@@ -0,0 +1,6 @@
+<vector android:height="40dp" android:tint="#000000"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
+    <path android:fillColor="@android:color/white" android:pathData="M12,10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>
+</vector>

+ 5 - 0
app/src/main/res/drawable/ic_zoom_out.xml

@@ -0,0 +1,5 @@
+<vector android:height="40dp" android:tint="#000000"
+    android:viewportHeight="24" android:viewportWidth="24"
+    android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14zM7,9h5v1L7,10z"/>
+</vector>

+ 19 - 0
app/src/main/res/drawable/spinner_style.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <layer-list>
+            <item>
+                <shape android:shape="rectangle">
+                    <solid android:color="@color/white"/>
+                    <corners android:radius="15dp"/>
+                    <padding android:right="15dp"/>
+                    <padding android:top="2.5dp"/>
+                    <padding android:left="15dp"/>
+                    <padding android:bottom="2.5dp"/>
+                </shape>
+            </item>
+            <item android:drawable="@drawable/ic_spinner_down"
+                android:gravity="center|end"/>
+        </layer-list>
+    </item>
+</selector>

+ 1 - 1
app/src/main/res/drawable/white_border.xml

@@ -7,7 +7,7 @@
     </solid>
 
     <corners
-        android:radius="40dp" >
+        android:radius="15dp" >
     </corners>
 
 </shape>

+ 1 - 0
app/src/main/res/layout/activity_launcher.xml

@@ -21,6 +21,7 @@
             android:layout_width="150dp"
             android:layout_height="150dp"
             android:background="@drawable/white_border"
+            android:backgroundTint="@color/white"
             android:contentDescription="@string/cdLogo"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"

+ 3 - 1
app/src/main/res/layout/activity_main.xml

@@ -13,8 +13,10 @@
         android:layout_height="0dp"
         app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
         app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.0"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent">
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.0">
 
     </FrameLayout>
 

+ 1 - 1
app/src/main/res/layout/activity_singinsingup.xml

@@ -23,7 +23,7 @@
             android:id="@+id/textView3"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="Sing in / Sinh up"
+            android:text="Sing in / Sign up"
             android:textColor="@color/TextColor"
             android:textSize="32sp"
             android:textStyle="bold" />

+ 44 - 7
app/src/main/res/layout/fragment_chats.xml

@@ -1,16 +1,53 @@
 <?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     tools:context=".view.fragments.ChatsFragment"
     android:background="@color/AppBackground">
 
-    <!-- TODO: Update blank fragment layout -->
-    <TextView
+    <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:text="@string/hello_blank_fragment"
-        android:textColor="@color/TextColor"/>
+        android:layout_height="55dp"
+        android:background="@color/ElementsColor"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
 
-</FrameLayout>
+        <ImageView
+            android:id="@+id/sort_icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentTop="true"
+            android:layout_alignParentBottom="true"
+            android:layout_marginStart="10dp"
+            android:layout_marginBottom="5dp"
+            android:src="@drawable/ic_map_filters"
+            app:tint="@color/TextColor" />
+
+        <Spinner
+            android:id="@+id/sort_spinner"
+            android:layout_width="wrap_content"
+            android:layout_height="40dp"
+            android:layout_centerVertical="true"
+            android:layout_marginStart="10dp"
+            android:layout_toEndOf="@+id/sort_icon"
+            android:background="@drawable/spinner_style"
+            android:spinnerMode="dropdown" />
+
+        <ImageButton
+            android:id="@+id/search_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentTop="true"
+            android:layout_alignParentEnd="true"
+            android:layout_alignParentBottom="true"
+            android:layout_marginEnd="10dp"
+            android:background="#00000000"
+            android:src="@drawable/ic_search"
+            app:tint="@color/TextColor" />
+
+    </RelativeLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 94 - 51
app/src/main/res/layout/fragment_map.xml

@@ -1,70 +1,113 @@
 <?xml version="1.0" encoding="utf-8"?>
-<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:background="@color/AppBackground">
 
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginBottom="70dp"
-        android:id="@+id/test">
-
-        <org.osmdroid.views.MapView
+    <org.osmdroid.views.MapView
             android:id="@+id/map"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
+            android:layout_height="match_parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
 
-    </androidx.constraintlayout.widget.ConstraintLayout>
+    <ImageButton
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:background="@drawable/black_border"
+        android:padding="5dp"
+        android:src="@drawable/ic_map_filters"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:tint="@color/TextColor"
+        android:layout_marginStart="15dp"
+        android:layout_marginTop="15dp"/>
 
-    <FrameLayout
-        android:id="@+id/containerBottomSheet"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        app:behavior_hideable="false"
-        app:behavior_peekHeight="70dp"
-        app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
-        android:background="#1A1A1A">
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="15dp"
+        android:orientation="vertical"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.5">
 
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
+        <ImageButton
+            android:id="@+id/btnMyLocation"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/black_border"
+            android:padding="7.5dp"
+            android:src="@drawable/ic_my_location"
+            app:tint="@color/TextColor" />
+
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="15dp"
+        android:orientation="vertical"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_bias="0.7">
+
+        <ImageButton
+            android:id="@+id/btn_zoomIn"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/black_border"
+            android:padding="5dp"
+            android:src="@drawable/ic_zoom_in"
+            app:tint="@color/TextColor" />
 
-            <ImageView
-                android:id="@+id/imageView2"
-                android:layout_width="80dp"
-                android:layout_height="7dp"
-                android:layout_marginTop="5dp"
-                android:background="@drawable/black_border"
-                android:backgroundTint="#343434"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toTopOf="parent" />
+        <ImageButton
+            android:id="@+id/btn_zoomOut"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:background="@drawable/black_border"
+            android:padding="5dp"
+            android:src="@drawable/ic_zoom_out"
+            app:tint="@color/TextColor" />
 
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="40dp"
-                android:orientation="horizontal"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintHorizontal_bias="0.0"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toBottomOf="@+id/imageView2"
-                android:layout_marginTop="10dp">
+    </LinearLayout>
 
-                <TextView
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:text="Тут что-то будет"
-                    android:textColor="@color/white"
-                    android:textAlignment="center"
-                    android:textSize="28dp"/>
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        android:background="@drawable/black_border"
+        android:paddingTop="10dp"
+        android:paddingBottom="10dp"
+        android:paddingStart="20dp"
+        android:paddingEnd="20dp"
+        android:layout_marginBottom="40dp"
+        android:layout_marginStart="15dp">
 
-            </LinearLayout>
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/ic_event_list"
+            app:tint="@color/TextColor" />
 
-        </androidx.constraintlayout.widget.ConstraintLayout>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="View event list"
+            android:textColor="@color/TextColor"
+            android:textSize="16sp"
+            android:layout_marginStart="15dp"/>
 
-    </FrameLayout>
+    </LinearLayout>
 
-</androidx.coordinatorlayout.widget.CoordinatorLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -27,4 +27,6 @@
     <string name="textSingUp">Sing Up</string>
     <!-- TODO: Remove or change this placeholder text -->
     <string name="hello_blank_fragment">Hello blank fragment</string>
+    <string name="spinner_prompt">Sort by</string>
+
 </resources>

+ 1 - 0
app/src/main/res/values/themes.xml

@@ -31,4 +31,5 @@
         <item name="colorControlHighlight">@color/white</item>
         <item name="android:textColor">@drawable/calendar_selected_date</item>
     </style>
+
 </resources>