Sfoglia il codice sorgente

improve auth; added login caching

felocsss 1 anno fa
parent
commit
903b9f4384

+ 64 - 0
app/src/main/java/com/sharix/sportsmanfriend/dialogs/AgeLimitDialog.java

@@ -0,0 +1,64 @@
+package com.sharix.sportsmanfriend.dialogs;
+
+import android.app.Dialog;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.google.android.material.slider.RangeSlider;
+import com.sharix.sportsmanfriend.BaseDialogClass;
+import com.sharix.sportsmanfriend.R;
+
+import java.util.List;
+
+public class AgeLimitDialog extends BaseDialogClass {
+
+    private TextView tv_number_from, tv_number_to;
+    private RangeSlider rangeSlider;
+
+    @NonNull
+    @Override
+    public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
+        LayoutInflater inflater = requireActivity().getLayoutInflater();
+        view = inflater.inflate(R.layout.dialog_age_limit, null);
+
+        tv_number_from = view.findViewById(R.id.tv_number_from);
+        tv_number_to = view.findViewById(R.id.tv_number_to);
+        rangeSlider = view.findViewById(R.id.rangeSlider);
+
+        configureRangeSlider();
+        addClickEventToAllViews();
+
+        return super.onCreateDialog(savedInstanceState);
+    }
+
+    @Override
+    protected Bundle DataToTransfer() {
+        Bundle bundle = new Bundle();
+        bundle.putString("FromBlock", "AgeLimitBlock");
+        List<Float> values = rangeSlider.getValues();
+        bundle.putInt("LimitFrom", values.get(0).intValue());
+        bundle.putInt("LimitTo", values.get(1).intValue());
+        return bundle;
+    }
+
+    private void configureRangeSlider(){
+        rangeSlider.setValues(0f, 100f);
+        tv_number_from.setText(String.valueOf(0));
+        tv_number_to.setText(String.valueOf(100));
+    }
+
+    @Override
+    protected void addClickEventToAllViews() {
+        super.addClickEventToAllViews();
+
+        rangeSlider.addOnChangeListener((slider, value, fromUser) -> {
+            List<Float> values = rangeSlider.getValues();
+            tv_number_from.setText(String.valueOf(values.get(0).intValue()));
+            tv_number_to.setText(String.valueOf(values.get(1).intValue()));
+        });
+    }
+}

+ 45 - 0
app/src/main/java/com/sharix/sportsmanfriend/dialogs/DurationDialog.java

@@ -0,0 +1,45 @@
+package com.sharix.sportsmanfriend.dialogs;
+
+import android.app.Dialog;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.widget.TimePicker;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.sharix.sportsmanfriend.BaseDialogClass;
+import com.sharix.sportsmanfriend.R;
+
+public class DurationDialog extends BaseDialogClass {
+
+    private TimePicker timePicker;
+
+    @NonNull
+    @Override
+    public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
+        LayoutInflater inflater = requireActivity().getLayoutInflater();
+        view = inflater.inflate(R.layout.dialog_duration, null);
+
+        timePicker = view.findViewById(R.id.timePickerStart);
+        timePicker.setIs24HourView(true);
+
+        addClickEventToAllViews();
+
+        return super.onCreateDialog(savedInstanceState);
+    }
+
+    @Override
+    protected Bundle DataToTransfer() {
+        Bundle bundle = new Bundle();
+        bundle.putString("FromBlock", "DurationBlock");
+        bundle.putInt("HourStart", timePicker.getHour());
+        bundle.putInt("MinuteStart", timePicker.getMinute());
+        return bundle;
+    }
+
+    @Override
+    protected void addClickEventToAllViews() {
+        super.addClickEventToAllViews();
+    }
+}

+ 21 - 16
app/src/main/java/com/sharix/sportsmanfriend/view/LauncherActivity.java

@@ -1,34 +1,39 @@
 package com.sharix.sportsmanfriend.view;
 
-import androidx.appcompat.app.AppCompatActivity;
-
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.Handler;
 
+import androidx.appcompat.app.AppCompatActivity;
+
 import com.sharix.sportsmanfriend.R;
 
 public class LauncherActivity extends AppCompatActivity {
 
-    /*SharedPreferences preferences;
-    SharedPreferences.Editor editor;*/
+    private SharedPreferences sharedPreferences;
+    boolean userIsLoggedIn;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_launcher);
 
-        /*preferences = getSharedPreferences("MODE", Context.MODE_PRIVATE);
-
-        AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
-        editor = preferences.edit();
-        editor.putBoolean("night", true);
-        editor.apply();*/
-
-        new Handler().postDelayed(() -> {
-            Intent mainIntent = new Intent(LauncherActivity.this, SingInSingUpActivity.class);
-            startActivity(mainIntent);
-            finish();
-        }, 1000);
+        sharedPreferences = getSharedPreferences("Data", MODE_PRIVATE);
+        userIsLoggedIn = sharedPreferences.getBoolean("userIsLoggedIn", false);
+
+        if(userIsLoggedIn){
+            new Handler().postDelayed(() -> {
+                Intent intent = new Intent(LauncherActivity.this, MainActivity.class);
+                startActivity(intent);
+                finish();
+            }, 1000);
+        } else {
+            new Handler().postDelayed(() -> {
+                Intent intent = new Intent(LauncherActivity.this, SingInSingUpActivity.class);
+                startActivity(intent);
+                finish();
+            }, 1000);
+        }
     }
 }

+ 30 - 19
app/src/main/java/com/sharix/sportsmanfriend/view/SingInSingUpActivity.java

@@ -1,43 +1,54 @@
 package com.sharix.sportsmanfriend.view;
 
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.widget.Button;
-import android.widget.TextView;
+import android.widget.EditText;
+import android.widget.Toast;
 
 import androidx.appcompat.app.AppCompatActivity;
 
 import com.sharix.sportsmanfriend.R;
 import com.sharix.sportsmanfriend.requests.HTTPRequest;
 
-public class SingInSingUpActivity extends AppCompatActivity {
+import java.util.Objects;
 
-    Button btnNext;
-    private TextView test;
+public class SingInSingUpActivity extends AppCompatActivity {
 
-    private final boolean devBtn = true;
+    private Button btnSingIn;
+    private EditText EDPhone, EDPassword;
+    private SharedPreferences sharedPreferences;
+    private SharedPreferences.Editor editor;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_singinsingup);
 
-        btnNext = findViewById(R.id.btnNext);
-        test = findViewById(R.id.textView3);
-
-        btnNext.setOnClickListener(view -> {
-            Intent intent;
-            if (devBtn){
-                intent = new Intent(SingInSingUpActivity.this, LoginActivity.class);
+        btnSingIn = findViewById(R.id.btnSingIn);
+        EDPhone = findViewById(R.id.phoneED);
+        EDPassword = findViewById(R.id.passwordED);
+
+        sharedPreferences = getSharedPreferences("Data", MODE_PRIVATE);
+
+        EDPhone.setText("99999999999");
+        EDPassword.setText("password");
+
+        btnSingIn.setOnClickListener(view -> {
+            HTTPRequest httpRequest = new HTTPRequest(SingInSingUpActivity.this);
+            String response = httpRequest.login(EDPhone.getText().toString(), EDPassword.getText().toString());
+            if (Objects.equals(response, "Ошибка")){
+                Toast.makeText(getApplicationContext(), "Не правильный логин или пароль", Toast.LENGTH_LONG).show();
+            } else {
+                editor = sharedPreferences.edit();
+                editor.putBoolean("userIsLoggedIn", true);
+                editor.apply();
+                Intent intent = new Intent(SingInSingUpActivity.this, MainActivity.class);
+                startActivity(intent);
+                finish();
             }
-            else {
-                intent = new Intent(SingInSingUpActivity.this, RegisterActivity.class);
-            }
-            startActivity(intent);
         });
-
-        HTTPRequest httpRequest = new HTTPRequest(SingInSingUpActivity.this);
-        test.setText(httpRequest.login("99999999999", "password"));
     }
 
 }

+ 20 - 11
app/src/main/java/com/sharix/sportsmanfriend/view/fragments/CreateEventFragment.java

@@ -27,6 +27,7 @@ import com.sharix.sportsmanfriend.BaseDialogClass;
 import com.sharix.sportsmanfriend.BaseFragmentClass;
 import com.sharix.sportsmanfriend.PhotoHelperClass;
 import com.sharix.sportsmanfriend.R;
+import com.sharix.sportsmanfriend.dialogs.AgeLimitDialog;
 import com.sharix.sportsmanfriend.dialogs.ChoiceOfGenderDialog;
 import com.sharix.sportsmanfriend.dialogs.ChoiceOfSportDialog;
 import com.sharix.sportsmanfriend.dialogs.DateOfEventDialog;
@@ -43,11 +44,11 @@ import java.util.Objects;
 public class CreateEventFragment extends BaseFragmentClass implements BaseDialogClass.DialogListener {
     // Элементы на которые будет вызываться диалоговое окно
     private ConstraintLayout locationBlock, sportBlock, memberLimitBlock, dayBlock, timeBlock, endRegistrationBlock,
-            levelBlock, genderBlock;
+            levelBlock, genderBlock, ageLimitBlock;
     private ImageButton btnGetImageFromGallery, btnGetImageFromCamera;
     // поля для отображения выбранных значений в диалогах
     private TextView locationBlockText, sportBlockText, memberLimitsBlockText, dayBlockText, timeBlockText,
-            endRegistrationBlockText, levelBlockText, genderBlockText;
+            endRegistrationBlockText, levelBlockText, genderBlockText, ageLimitBlockText;
     private ShapeableImageView LocationBlockImage;
     // данные для бд
     private String description;
@@ -82,6 +83,8 @@ public class CreateEventFragment extends BaseFragmentClass implements BaseDialog
         levelBlockText = v.findViewById(R.id.levelBlockText);
         genderBlock = v.findViewById(R.id.genderBlock);
         genderBlockText = v.findViewById(R.id.genderBlockText);
+        ageLimitBlock = v.findViewById(R.id.ageLimitBlock);
+        ageLimitBlockText = v.findViewById(R.id.ageLimitBlockText);
         btnGetImageFromGallery = v.findViewById(R.id.btn_get_image_from_galary);
         btnGetImageFromCamera = v.findViewById(R.id.btn_get_image_from_camera);
         photoContainer = v.findViewById(R.id.photo_container);
@@ -144,6 +147,12 @@ public class CreateEventFragment extends BaseFragmentClass implements BaseDialog
             choiceOfGenderDialog.show(requireActivity().getSupportFragmentManager(), "choiceOfGenderDialog");
         });
 
+        ageLimitBlock.setOnClickListener(v -> {
+            AgeLimitDialog ageLimitDialog = new AgeLimitDialog();
+            ageLimitDialog.setTargetFragment(CreateEventFragment.this, 0);
+            ageLimitDialog.show(requireActivity().getSupportFragmentManager(), "ageLimitDialog");
+        });
+
         btnGetImageFromGallery.setOnClickListener(v -> {
             Intent intent = new Intent();
             intent.setType("image/*");
@@ -158,15 +167,12 @@ public class CreateEventFragment extends BaseFragmentClass implements BaseDialog
             startActivityForResult(cameraIntent, CAMERA_REQUEST);
         });
 
-        saveButton.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                FragmentManager fragmentManager = requireActivity().getSupportFragmentManager();
-                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
-                CreateEventFragment myFragment = new CreateEventFragment();
-                fragmentTransaction.replace(R.id.frameWindow, myFragment);
-                fragmentTransaction.commit();
-            }
+        saveButton.setOnClickListener(v -> {
+            FragmentManager fragmentManager = requireActivity().getSupportFragmentManager();
+            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+            CreateEventFragment myFragment = new CreateEventFragment();
+            fragmentTransaction.replace(R.id.frameWindow, myFragment);
+            fragmentTransaction.commit();
         });
     }
 
@@ -252,6 +258,9 @@ public class CreateEventFragment extends BaseFragmentClass implements BaseDialog
             case "GenderBlock":
                 genderBlockText.setText(bundle.getString("Name"));
                 break;
+            case "AgeLimitBlock":
+                ageLimitBlockText.setText(String.format("%s - %s", bundle.getFloat("LimitFrom"), bundle.getFloat("LimitTo")));
+                break;
         }
     }
 }

+ 80 - 5
app/src/main/java/com/sharix/sportsmanfriend/view/fragments/EventFiltersFragment.java

@@ -1,39 +1,114 @@
 package com.sharix.sportsmanfriend.view.fragments;
 
+import android.annotation.SuppressLint;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageButton;
+import android.widget.TextView;
 
+import androidx.constraintlayout.widget.ConstraintLayout;
 import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
 
+import com.sharix.sportsmanfriend.BaseDialogClass;
 import com.sharix.sportsmanfriend.OnBackPressedListener;
 import com.sharix.sportsmanfriend.R;
+import com.sharix.sportsmanfriend.dialogs.AgeLimitDialog;
+import com.sharix.sportsmanfriend.dialogs.ChoiceOfGenderDialog;
+import com.sharix.sportsmanfriend.dialogs.DurationDialog;
+import com.sharix.sportsmanfriend.dialogs.RecommendedLevelDialog;
 
-public class EventFiltersFragment extends Fragment implements OnBackPressedListener {
+public class EventFiltersFragment extends Fragment implements OnBackPressedListener, BaseDialogClass.DialogListener {
 
-    private View view;
+    private View v;
+    private ConstraintLayout durationBlock, ageBlock, genderBlock, levelBlock;
+    private TextView durationBlockText, ageBlockText, genderBlockText, levelBlockText, btnClear;
     private ImageButton btnBack;
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
-        view = inflater.inflate(R.layout.fragment_event_filters, container, false);
+        v = inflater.inflate(R.layout.fragment_event_filters, container, false);
 
-        btnBack = view.findViewById(R.id.btnBack);
+        btnBack = v.findViewById(R.id.btnBack);
+
+        durationBlock = v.findViewById(R.id.durationBlock);
+        durationBlockText = v.findViewById(R.id.durationBlockText);
+        ageBlock = v.findViewById(R.id.ageBlock);
+        ageBlockText = v.findViewById(R.id.ageBlockText);
+        genderBlock = v.findViewById(R.id.genderBlock);
+        genderBlockText = v.findViewById(R.id.genderBlockText);
+        levelBlock = v.findViewById(R.id.levelBlock);
+        levelBlockText = v.findViewById(R.id.levelBlockText);
+        btnClear = v.findViewById(R.id.btnClear);
 
         addClickEventToAllViews();
 
-        return view;
+        return v;
     }
 
     private void addClickEventToAllViews() {
         btnBack.setOnClickListener(v -> onBackPressed());
+
+        durationBlock.setOnClickListener(v -> {
+            DurationDialog durationDialog = new DurationDialog();
+            durationDialog.setTargetFragment(EventFiltersFragment.this, 0);
+            durationDialog.show(requireActivity().getSupportFragmentManager(), "durationDialog");
+        });
+
+        ageBlock.setOnClickListener(v -> {
+            AgeLimitDialog ageLimitDialog = new AgeLimitDialog();
+            ageLimitDialog.setTargetFragment(EventFiltersFragment.this, 0);
+            ageLimitDialog.show(requireActivity().getSupportFragmentManager(), "ageLimitDialog");
+        });
+
+        genderBlock.setOnClickListener(v -> {
+            ChoiceOfGenderDialog choiceOfGenderDialog = new ChoiceOfGenderDialog();
+            choiceOfGenderDialog.setTargetFragment(EventFiltersFragment.this, 0);
+            choiceOfGenderDialog.show(requireActivity().getSupportFragmentManager(), "choiceOfGenderDialog");
+
+        });
+
+        levelBlock.setOnClickListener(v -> {
+            RecommendedLevelDialog recommendedLevelDialog = new RecommendedLevelDialog();
+            recommendedLevelDialog.setTargetFragment(EventFiltersFragment.this, 0);
+            recommendedLevelDialog.show(requireActivity().getSupportFragmentManager(), "recommendedLevelDialog");
+
+        });
+
+        btnClear.setOnClickListener(v -> {
+            FragmentManager fragmentManager = requireActivity().getSupportFragmentManager();
+            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
+            EventFiltersFragment myFragment = new EventFiltersFragment();
+            fragmentTransaction.replace(R.id.frameWindow, myFragment);
+            fragmentTransaction.commit();
+        });
     }
 
     @Override
     public void onBackPressed() {
         requireActivity().getSupportFragmentManager().popBackStack();
     }
+
+    @SuppressLint({"DefaultLocale", "SetTextI18n"})
+    @Override
+    public void applyInfo(Bundle bundle) {
+        switch (bundle.getString("FromBlock")){
+            case "DurationBlock":
+                durationBlockText.setText(String.format("До %d часов %d минут", bundle.getInt("HourStart"), bundle.getInt("MinuteStart")));
+                break;
+            case "LevelBlock":
+                levelBlockText.setText(String.format("%s - %s", bundle.getFloat("LimitFrom"), bundle.getFloat("LimitTo")));
+                break;
+            case "GenderBlock":
+                genderBlockText.setText(bundle.getString("Name"));
+                break;
+            case "AgeLimitBlock":
+                ageBlockText.setText(String.format("%s - %s", bundle.getFloat("LimitFrom"), bundle.getFloat("LimitTo")));
+                break;
+        }
+    }
 }

+ 15 - 1
app/src/main/java/com/sharix/sportsmanfriend/view/fragments/MoreFragment.java

@@ -1,5 +1,7 @@
 package com.sharix.sportsmanfriend.view.fragments;
 
+import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -11,11 +13,14 @@ import androidx.fragment.app.FragmentManager;
 import androidx.fragment.app.FragmentTransaction;
 
 import com.sharix.sportsmanfriend.R;
+import com.sharix.sportsmanfriend.view.MainActivity;
 
 public class MoreFragment extends Fragment {
 
     private View view;
-    private ConstraintLayout settingsBlock, profileBlock;
+    private ConstraintLayout settingsBlock, profileBlock, logOutBlock;
+    private SharedPreferences sharedPreferences;
+    private SharedPreferences.Editor editor;
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
@@ -25,6 +30,7 @@ public class MoreFragment extends Fragment {
 
         settingsBlock = view.findViewById(R.id.settingsBlock);
         profileBlock = view.findViewById(R.id.profileBlock);
+        logOutBlock = view.findViewById(R.id.logOutBlock);
 
         addClickEventToAllViews();
 
@@ -50,5 +56,13 @@ public class MoreFragment extends Fragment {
             fragmentTransaction.addToBackStack(null);
             fragmentTransaction.commit();
         });
+
+        logOutBlock.setOnClickListener(v -> {
+            editor = sharedPreferences.edit();
+            editor.clear().commit();
+            Intent intent = new Intent(requireActivity(), MainActivity.class);
+            startActivity(intent);
+            requireActivity().finish();
+        });
     }
 }

+ 2 - 2
app/src/main/java/com/sharix/sportsmanfriend/view/fragments/SupportFragment.kt

@@ -35,8 +35,8 @@ class SupportFragment : Fragment() {
 //        val room1 = pref?.getString("room1", "!")
 //        val room2 = pref?.getString("room2", "!")
 //        val room3 = pref?.getString("room3", "!")
-        val jid = "test@msg.sharix-app.org"
-        val pass = "test1234@"
+        val jid = "sports_backend"
+        val pass = "a010f8eb59100e94fb14b3b9f9a3b726"
         val room1 = "testbot@chat.msg.sharix-app.org"
         val room2 = "general@chat.msg.sharix-app.org"
         val room3 = "order001@chat.msg.sharix-app.org"

+ 5 - 0
app/src/main/res/drawable/ic_logout.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="M17,7l-1.41,1.41L18.17,11H8v2h10.17l-2.58,2.58L17,17l5,-5zM4,5h8V3H4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h8v-2H4V5z"/>
+</vector>

+ 19 - 5
app/src/main/res/layout/activity_singinsingup.xml

@@ -23,32 +23,46 @@
             android:id="@+id/textView3"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="Sing in / Sign up"
+            android:text="Sing in"
             style="@style/TextMain"
             android:textSize="32sp"
             android:textStyle="bold" />
 
         <EditText
+            android:id="@+id/phoneED"
             android:layout_width="match_parent"
             android:layout_height="55dp"
             android:layout_marginTop="20dp"
             android:autofillHints="emailAddress"
-            android:hint="@string/etLogin"
+            android:hint="Phone"
             android:textSize="16sp"
-            android:inputType="textEmailAddress"
+            android:inputType="phone"
+            android:paddingStart="25dp"
+            android:paddingEnd="25dp"
+            style="@style/Input"/>
+
+        <EditText
+            android:id="@+id/passwordED"
+            android:layout_width="match_parent"
+            android:layout_height="55dp"
+            android:layout_marginTop="20dp"
+            android:autofillHints="emailAddress"
+            android:hint="Password"
+            android:textSize="16sp"
+            android:inputType="textPassword"
             android:paddingStart="25dp"
             android:paddingEnd="25dp"
             style="@style/Input"/>
 
         <Button
-            android:id="@+id/btnNext"
+            android:id="@+id/btnSingIn"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
             android:layout_marginTop="30dp"
             android:background="@drawable/btn_with_big_corner"
             android:backgroundTint="@color/MainColor"
-            android:text="@string/textNext"
+            android:text="Sing in"
             android:textAllCaps="false"
             android:textColor="#FFFFFF"
             android:textSize="16sp" />

+ 97 - 0
app/src/main/res/layout/dialog_age_limit.xml

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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"
+    style="@style/DialogBack"
+    android:padding="10dp">
+
+    <LinearLayout
+        android:id="@+id/linearLayout5"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="From"
+            style="@style/TextMain" />
+
+        <TextView
+            android:id="@+id/tv_number_from"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="5dp"
+            android:text="Number"
+            style="@style/TextMain" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="5dp"
+            android:text="to"
+            style="@style/TextMain" />
+
+        <TextView
+            android:id="@+id/tv_number_to"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="5dp"
+            android:text="Number"
+            style="@style/TextMain" />
+
+    </LinearLayout>
+
+    <com.google.android.material.slider.RangeSlider
+        app:labelBehavior="gone"
+        android:id="@+id/rangeSlider"
+        style="@style/Slider"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:stepSize="1"
+        android:valueFrom="0"
+        android:valueTo="100"
+        android:layout_marginTop="10dp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/linearLayout5" />
+
+    <LinearLayout
+        android:id="@+id/linearLayout3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:layout_marginTop="10dp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/rangeSlider">
+
+        <Button
+            android:id="@+id/btn_cancel"
+            android:layout_width="wrap_content"
+            android:layout_height="35dp"
+            android:background="@drawable/btn_with_big_corner"
+            android:backgroundTint="@color/MainColor"
+            android:text="Cancel"
+            android:textColor="@color/white" />
+
+        <Button
+            android:id="@+id/btn_apply"
+            android:layout_width="wrap_content"
+            android:layout_height="35dp"
+            android:layout_marginStart="50dp"
+            android:background="@drawable/btn_with_big_corner"
+            android:backgroundTint="@color/MainColor"
+            android:text="Apply"
+            android:textColor="@color/white" />
+
+    </LinearLayout>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 51 - 0
app/src/main/res/layout/dialog_duration.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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"
+    style="@style/DialogBack"
+    android:padding="10dp">
+
+    <TimePicker
+        android:id="@+id/timePickerStart"
+        style="@style/TimePicker"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:timePickerMode="spinner"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+
+    <LinearLayout
+        android:id="@+id/linearLayout3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/timePickerStart">
+
+        <Button
+            android:id="@+id/btn_cancel"
+            android:layout_width="wrap_content"
+            android:layout_height="35dp"
+            android:background="@drawable/btn_with_big_corner"
+            android:backgroundTint="@color/MainColor"
+            android:text="Cancel"
+            android:textColor="@color/white" />
+
+        <Button
+            android:id="@+id/btn_apply"
+            android:layout_width="wrap_content"
+            android:layout_height="35dp"
+            android:layout_marginStart="50dp"
+            android:background="@drawable/btn_with_big_corner"
+            android:backgroundTint="@color/MainColor"
+            android:text="Apply"
+            android:textColor="@color/white" />
+
+    </LinearLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 34 - 0
app/src/main/res/layout/fragment_create_event.xml

@@ -330,6 +330,40 @@
 
                 </androidx.constraintlayout.widget.ConstraintLayout>
 
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:id="@+id/ageLimitBlock"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_marginTop="5dp"
+                    style="@style/Block"
+                    android:paddingStart="15dp"
+                    android:paddingTop="20dp"
+                    android:paddingEnd="15dp"
+                    android:paddingBottom="20dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="Age limit"
+                        style="@style/TextMain"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toTopOf="parent" />
+
+                    <TextView
+                        android:id="@+id/ageLimitBlockText"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text=""
+                        style="@style/BlueTextMainWithImg"
+                        android:drawablePadding="10dp"
+                        app:drawableRightCompat="@drawable/ic_forward"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintTop_toTopOf="parent"/>
+
+                </androidx.constraintlayout.widget.ConstraintLayout>
+
                 <androidx.constraintlayout.widget.ConstraintLayout
                     android:id="@+id/levelBlock"
                     android:layout_width="match_parent"

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

@@ -42,6 +42,7 @@
             app:layout_constraintTop_toTopOf="parent" />
 
         <TextView
+            android:id="@+id/btnClear"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_vertical"

+ 46 - 3
app/src/main/res/layout/fragment_more.xml

@@ -427,21 +427,64 @@
             android:layout_marginEnd="10dp">
 
             <ImageView
-                android:id="@+id/imageView11"
+                android:id="@+id/imageView3"
+                style="@style/Img"
                 android:layout_width="30dp"
                 android:layout_height="30dp"
                 android:layout_gravity="center_vertical"
                 android:src="@drawable/ic_settings"
-                style="@style/Img"
                 app:layout_constraintBottom_toBottomOf="parent"
                 app:layout_constraintStart_toStartOf="parent"
                 app:layout_constraintTop_toTopOf="parent" />
 
             <TextView
+                style="@style/TextMain"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="Settings"
                 android:textAlignment="center"
+                android:layout_marginStart="10dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toEndOf="@+id/imageView3"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <ImageView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/ic_forward"
+                style="@style/Img"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/logOutBlock"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:padding="10dp"
+            android:layout_marginTop="15dp"
+            android:layout_marginStart="10dp"
+            android:layout_marginEnd="10dp">
+
+            <ImageView
+                android:id="@+id/imageView11"
+                android:layout_width="30dp"
+                android:layout_height="30dp"
+                android:layout_gravity="center_vertical"
+                android:src="@drawable/ic_account"
+                style="@style/Img"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="Log Out"
+                android:textAlignment="center"
                 style="@style/TextMain"
                 android:layout_marginStart="10dp"
                 app:layout_constraintBottom_toBottomOf="parent"
@@ -451,7 +494,7 @@
             <ImageView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:src="@drawable/ic_forward"
+                android:src="@drawable/ic_logout"
                 style="@style/Img"
                 app:layout_constraintBottom_toBottomOf="parent"
                 app:layout_constraintEnd_toEndOf="parent"