Приложение
1
.idea/gradle.xml
generated
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
1
.idea/misc.xml
generated
@ -1,4 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
|
BIN
app/src/main/ic_star-playstore.png
Normal file
After Width: | Height: | Size: 39 KiB |
@ -1,6 +1,7 @@
|
|||||||
package com.kolobochki.memory;
|
package com.kolobochki.memory;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ import com.kolobochki.memory.databinding.ActivityMainBinding;
|
|||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private ActivityMainBinding binding;
|
private ActivityMainBinding binding;
|
||||||
|
private NavController navController;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -23,15 +25,25 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||||
setContentView(binding.getRoot());
|
setContentView(binding.getRoot());
|
||||||
|
|
||||||
BottomNavigationView navView = findViewById(R.id.nav_view);
|
navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main);
|
||||||
// Passing each menu ID as a set of Ids because each
|
|
||||||
// menu should be considered as top level destinations.
|
|
||||||
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
|
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
|
||||||
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
|
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_task1)
|
||||||
.build();
|
.build();
|
||||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main);
|
|
||||||
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
|
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
|
||||||
NavigationUI.setupWithNavController(binding.navView, navController);
|
NavigationUI.setupWithNavController(binding.navView, navController);
|
||||||
|
|
||||||
|
navController.addOnDestinationChangedListener((controller, destination, arguments) -> {
|
||||||
|
if (destination.getId() == R.id.navigation_task1) {
|
||||||
|
binding.navView.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
binding.navView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onSupportNavigateUp() {
|
||||||
|
return navController.navigateUp() || super.onSupportNavigateUp();
|
||||||
|
}
|
||||||
}
|
}
|
296
app/src/main/java/com/kolobochki/memory/fragment_task1.java
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
package com.kolobochki.memory;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.GridLayout;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.activity.OnBackPressedCallback;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.navigation.NavController;
|
||||||
|
import androidx.navigation.Navigation;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.kolobochki.memory.R;
|
||||||
|
|
||||||
|
public class fragment_task1 extends Fragment {
|
||||||
|
|
||||||
|
private static final String ARG_PARAM1 = "param1";
|
||||||
|
private static final String ARG_PARAM2 = "param2";
|
||||||
|
private String mParam1;
|
||||||
|
private String mParam2;
|
||||||
|
private OnBackPressedCallback backPressedCallback;
|
||||||
|
private String previousTitle;
|
||||||
|
|
||||||
|
// ----------------------------------------------
|
||||||
|
|
||||||
|
private static final int PAIRS_COUNT = 6; // Кол-во пар
|
||||||
|
private static final int GRID_COLUMNS = 4; // Кол-во колонок
|
||||||
|
private static final int PREVIEW_TIME = 5000; // Задержка в начале в мс
|
||||||
|
private static final int SUCCESS_DELAY = 4000; // Задержка в конце в мс
|
||||||
|
private static final int INITIAL_LIVES = 3; // Кол-во жизек
|
||||||
|
|
||||||
|
// ----------------------------------------------
|
||||||
|
|
||||||
|
private int score = 0;
|
||||||
|
private int lives = INITIAL_LIVES;
|
||||||
|
private int flippedCount = 0;
|
||||||
|
private ImageView firstFlipped = null;
|
||||||
|
private boolean isPreview = true;
|
||||||
|
private boolean isGameComplete = false;
|
||||||
|
|
||||||
|
// ----------------------------------------------
|
||||||
|
|
||||||
|
private GridLayout gridLayout;
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
private List<Integer> tileImages = new ArrayList<>();
|
||||||
|
private List<ImageView> tiles = new ArrayList<>();
|
||||||
|
private LinearLayout livesLayout;
|
||||||
|
|
||||||
|
// -----------------------------------------------
|
||||||
|
|
||||||
|
public fragment_task1() { }
|
||||||
|
|
||||||
|
public static fragment_task1 newInstance(String param1, String param2) {
|
||||||
|
fragment_task1 fragment = new fragment_task1();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
OnBackPressedCallback backPressedCallback = new OnBackPressedCallback(true) {
|
||||||
|
@Override
|
||||||
|
public void handleOnBackPressed() {
|
||||||
|
if (!isGameComplete) {
|
||||||
|
showExitConfirmationDialog();
|
||||||
|
} else {
|
||||||
|
setEnabled(false);
|
||||||
|
navigateHome();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
requireActivity().getOnBackPressedDispatcher().addCallback(this, backPressedCallback);
|
||||||
|
|
||||||
|
if (getActivity() instanceof AppCompatActivity) {
|
||||||
|
ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setTitle("Упражнение 1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_task1, container, false);
|
||||||
|
|
||||||
|
gridLayout = view.findViewById(R.id.gridLayout);
|
||||||
|
progressBar = view.findViewById(R.id.progressBar);
|
||||||
|
livesLayout = view.findViewById(R.id.livesLayout);
|
||||||
|
|
||||||
|
setupGame();
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupGame() {
|
||||||
|
gridLayout.removeAllViews();
|
||||||
|
tiles.clear();
|
||||||
|
tileImages.clear();
|
||||||
|
livesLayout.removeAllViews();
|
||||||
|
|
||||||
|
score = 0;
|
||||||
|
lives = INITIAL_LIVES;
|
||||||
|
firstFlipped = null;
|
||||||
|
isPreview = true;
|
||||||
|
isGameComplete = false;
|
||||||
|
|
||||||
|
progressBar.setProgress(0);
|
||||||
|
updateHearts();
|
||||||
|
|
||||||
|
List<Integer> imageResources = new ArrayList<>();
|
||||||
|
imageResources.add(R.drawable.tile1);
|
||||||
|
imageResources.add(R.drawable.tile2);
|
||||||
|
imageResources.add(R.drawable.tile3);
|
||||||
|
imageResources.add(R.drawable.tile4);
|
||||||
|
imageResources.add(R.drawable.tile5);
|
||||||
|
imageResources.add(R.drawable.tile6);
|
||||||
|
|
||||||
|
Collections.shuffle(imageResources);
|
||||||
|
for (int i = 0; i < PAIRS_COUNT; i++) {
|
||||||
|
tileImages.add(imageResources.get(i));
|
||||||
|
tileImages.add(imageResources.get(i));
|
||||||
|
}
|
||||||
|
Collections.shuffle(tileImages);
|
||||||
|
|
||||||
|
gridLayout.setColumnCount(GRID_COLUMNS);
|
||||||
|
for (int i = 0; i < tileImages.size(); i++) {
|
||||||
|
ImageView tile = new ImageView(getContext());
|
||||||
|
GridLayout.LayoutParams params = new GridLayout.LayoutParams();
|
||||||
|
params.width = 191;
|
||||||
|
params.height = 209;
|
||||||
|
params.setMargins(8, 8, 8, 8);
|
||||||
|
tile.setLayoutParams(params);
|
||||||
|
|
||||||
|
tile.setImageResource(tileImages.get(i));
|
||||||
|
tile.setTag(i);
|
||||||
|
tile.setOnClickListener(this::onTileClicked);
|
||||||
|
|
||||||
|
tiles.add(tile);
|
||||||
|
gridLayout.addView(tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
isPreview = false;
|
||||||
|
flipAllTiles();
|
||||||
|
}, PREVIEW_TIME);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void flipAllTiles() {
|
||||||
|
for (ImageView tile : tiles) {
|
||||||
|
tile.setImageResource(R.drawable.tile_back);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onTileClicked(View view) {
|
||||||
|
if (isPreview || isGameComplete) return;
|
||||||
|
|
||||||
|
ImageView clickedTile = (ImageView) view;
|
||||||
|
int position = (int) clickedTile.getTag();
|
||||||
|
|
||||||
|
if (clickedTile.getDrawable().getConstantState() ==
|
||||||
|
getResources().getDrawable(tileImages.get(position)).getConstantState()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clickedTile.setImageResource(tileImages.get(position));
|
||||||
|
|
||||||
|
if (firstFlipped == null) {
|
||||||
|
firstFlipped = clickedTile;
|
||||||
|
} else {
|
||||||
|
if (tileImages.get((int)firstFlipped.getTag()).equals(tileImages.get(position))) {
|
||||||
|
score++;
|
||||||
|
progressBar.setProgress(score * 100 / PAIRS_COUNT);
|
||||||
|
firstFlipped = null;
|
||||||
|
|
||||||
|
if (score == PAIRS_COUNT) {
|
||||||
|
gameComplete();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
lives--;
|
||||||
|
updateHearts();
|
||||||
|
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
firstFlipped.setImageResource(R.drawable.tile_back);
|
||||||
|
clickedTile.setImageResource(R.drawable.tile_back);
|
||||||
|
firstFlipped = null;
|
||||||
|
|
||||||
|
if (lives <= 0) {
|
||||||
|
gameOver();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateHearts() {
|
||||||
|
livesLayout.removeAllViews();
|
||||||
|
for (int i = 0; i < lives; i++) {
|
||||||
|
ImageView heart = new ImageView(getContext());
|
||||||
|
heart.setImageResource(R.drawable.ic_heart);
|
||||||
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
|
);
|
||||||
|
params.setMargins(4, 0, 4, 0);
|
||||||
|
heart.setLayoutParams(params);
|
||||||
|
livesLayout.addView(heart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void gameComplete() {
|
||||||
|
isGameComplete = true;
|
||||||
|
new Handler().postDelayed(this::navigateHome, 1500);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void gameOver() {
|
||||||
|
isGameComplete = true;
|
||||||
|
new AlertDialog.Builder(requireContext())
|
||||||
|
.setTitle("Игра окончена")
|
||||||
|
.setMessage("Вы проиграли. Попробуйте еще раз!")
|
||||||
|
.setPositiveButton("OK", (dialog, which) -> navigateHome())
|
||||||
|
.setCancelable(false)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void navigateHome() {
|
||||||
|
NavController navController = Navigation.findNavController(requireView());
|
||||||
|
navController.popBackStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
if (backPressedCallback != null) {
|
||||||
|
backPressedCallback.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showExitConfirmationDialog() {
|
||||||
|
new AlertDialog.Builder(requireContext())
|
||||||
|
.setTitle("Закончить упражнение?")
|
||||||
|
.setMessage("Вы точно хотите закончить упражнение?")
|
||||||
|
.setPositiveButton("Да", (dialog, which) -> {
|
||||||
|
NavController navController = Navigation.findNavController(requireView());
|
||||||
|
navController.popBackStack();
|
||||||
|
})
|
||||||
|
.setNegativeButton("Нет", null)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if (getActivity() != null && ((AppCompatActivity)getActivity()).getSupportActionBar() != null) {
|
||||||
|
((AppCompatActivity)getActivity()).getSupportActionBar().hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
if (getActivity() != null && ((AppCompatActivity)getActivity()).getSupportActionBar() != null) {
|
||||||
|
((AppCompatActivity)getActivity()).getSupportActionBar().show();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getActivity() instanceof AppCompatActivity) {
|
||||||
|
ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
|
||||||
|
if (actionBar != null && previousTitle != null) {
|
||||||
|
actionBar.setTitle(previousTitle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -24,8 +24,8 @@ public class DashboardFragment extends Fragment {
|
|||||||
binding = FragmentDashboardBinding.inflate(inflater, container, false);
|
binding = FragmentDashboardBinding.inflate(inflater, container, false);
|
||||||
View root = binding.getRoot();
|
View root = binding.getRoot();
|
||||||
|
|
||||||
final TextView textView = binding.textDashboard;
|
//final TextView textView = binding.textDashboard;
|
||||||
dashboardViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
//dashboardViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,12 +4,12 @@ import android.os.Bundle;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.navigation.Navigation;
|
||||||
|
|
||||||
|
import com.kolobochki.memory.R;
|
||||||
import com.kolobochki.memory.databinding.FragmentHomeBinding;
|
import com.kolobochki.memory.databinding.FragmentHomeBinding;
|
||||||
|
|
||||||
public class HomeFragment extends Fragment {
|
public class HomeFragment extends Fragment {
|
||||||
@ -24,8 +24,13 @@ public class HomeFragment extends Fragment {
|
|||||||
binding = FragmentHomeBinding.inflate(inflater, container, false);
|
binding = FragmentHomeBinding.inflate(inflater, container, false);
|
||||||
View root = binding.getRoot();
|
View root = binding.getRoot();
|
||||||
|
|
||||||
final TextView textView = binding.textHome;
|
//final TextView textView = binding.textHome;
|
||||||
homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
//homeViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
||||||
|
|
||||||
|
binding.button.setOnClickListener(view -> {
|
||||||
|
Navigation.findNavController(view).navigate(R.id.action_navigation_home_to_navigation_task1);
|
||||||
|
});
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
app/src/main/res/drawable/ic_heart.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
74
app/src/main/res/drawable/ic_star_background.xml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector
|
||||||
|
android:height="108dp"
|
||||||
|
android:width="108dp"
|
||||||
|
android:viewportHeight="108"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#3DDC84"
|
||||||
|
android:pathData="M0,0h108v108h-108z"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
</vector>
|
31
app/src/main/res/drawable/ic_star_foreground.xml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
<gradient
|
||||||
|
android:startY="49.59793"
|
||||||
|
android:startX="42.9492"
|
||||||
|
android:endY="92.4963"
|
||||||
|
android:endX="85.84757"
|
||||||
|
android:type="linear">
|
||||||
|
<item
|
||||||
|
android:color="#44000000"
|
||||||
|
android:offset="0.0" />
|
||||||
|
<item
|
||||||
|
android:color="#00000000"
|
||||||
|
android:offset="1.0" />
|
||||||
|
</gradient>
|
||||||
|
</aapt:attr>
|
||||||
|
</path>
|
||||||
|
<path
|
||||||
|
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||||
|
android:fillColor="#FFFFFF"
|
||||||
|
android:fillType="nonZero"
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:strokeColor="#00000000"/>
|
||||||
|
</vector>
|
BIN
app/src/main/res/drawable/mem_home_bg.png
Normal file
After Width: | Height: | Size: 3.2 MiB |
BIN
app/src/main/res/drawable/mem_star.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/tile1.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
app/src/main/res/drawable/tile2.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/drawable/tile3.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
app/src/main/res/drawable/tile4.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/drawable/tile5.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
app/src/main/res/drawable/tile6.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
app/src/main/res/drawable/tile_back.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
@ -6,17 +6,77 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ui.dashboard.DashboardFragment">
|
tools:context=".ui.dashboard.DashboardFragment">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/text_dashboard"
|
android:id="@+id/imageView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="67dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="71dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="18dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="40dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:src="@drawable/mem_star"
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView"
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:text="1"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="19sp"
|
||||||
|
android:translationX="-70dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/imageView" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="17dp"
|
||||||
|
android:layout_marginTop="64dp"
|
||||||
|
android:text="Имя игрока"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/imageView"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip"
|
||||||
|
android:layout_width="378dp"
|
||||||
|
android:layout_height="51dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="124dp"
|
||||||
|
android:text="Инструкции"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip2"
|
||||||
|
android:layout_width="378dp"
|
||||||
|
android:layout_height="51dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="176dp"
|
||||||
|
android:text="Мой прогресс"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip3"
|
||||||
|
android:layout_width="378dp"
|
||||||
|
android:layout_height="51dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="228dp"
|
||||||
|
android:text="Переход на другую платформу"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip
|
||||||
|
android:id="@+id/chip4"
|
||||||
|
android:layout_width="378dp"
|
||||||
|
android:layout_height="51dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="276dp"
|
||||||
|
android:text="Сбросить мои данные"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imageView" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -4,4 +4,37 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ui.home.HomeFragment"/>
|
tools:context=".ui.home.HomeFragment">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView3"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginStart="18dp"
|
||||||
|
android:layout_marginTop="48dp"
|
||||||
|
android:src="@drawable/mem_star"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button"
|
||||||
|
android:layout_width="321dp"
|
||||||
|
android:layout_height="63dp"
|
||||||
|
android:layout_marginStart="46dp"
|
||||||
|
android:layout_marginTop="268dp"
|
||||||
|
android:text="Начать упражнение"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="19dp"
|
||||||
|
android:layout_marginTop="72dp"
|
||||||
|
android:text="1"
|
||||||
|
android:translationX="-47dp"
|
||||||
|
android:translationY="-7dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/imageView3"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
41
app/src/main/res/layout/fragment_task1.xml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:id="@+id/livesLayout"/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:max="100"
|
||||||
|
android:progress="0"/>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="16dp">
|
||||||
|
|
||||||
|
<GridLayout
|
||||||
|
android:id="@+id/gridLayout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:alignmentMode="alignMargins"
|
||||||
|
android:columnCount="4"
|
||||||
|
android:rowCount="3"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
5
app/src/main/res/mipmap-anydpi-v26/ic_star.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_star_background"/>
|
||||||
|
<foreground android:drawable="@drawable/ic_star_foreground"/>
|
||||||
|
</adaptive-icon>
|
5
app/src/main/res/mipmap-anydpi-v26/ic_star_round.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_star_background"/>
|
||||||
|
<foreground android:drawable="@drawable/ic_star_foreground"/>
|
||||||
|
</adaptive-icon>
|
BIN
app/src/main/res/mipmap-hdpi/ic_star.webp
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_star_round.webp
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_star.webp
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_star_round.webp
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_star.webp
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_star_round.webp
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_star.webp
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_star_round.webp
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_star.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_star_round.webp
Normal file
After Width: | Height: | Size: 12 KiB |
@ -9,17 +9,32 @@
|
|||||||
android:id="@+id/navigation_home"
|
android:id="@+id/navigation_home"
|
||||||
android:name="com.kolobochki.memory.ui.home.HomeFragment"
|
android:name="com.kolobochki.memory.ui.home.HomeFragment"
|
||||||
android:label="@string/title_home"
|
android:label="@string/title_home"
|
||||||
tools:layout="@layout/fragment_home" />
|
tools:layout="@layout/fragment_home" >
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_navigation_home_to_navigation_dashboard"
|
||||||
|
app:destination="@id/navigation_dashboard" />
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_navigation_home_to_navigation_task1"
|
||||||
|
app:destination="@id/navigation_task1" />
|
||||||
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/navigation_dashboard"
|
android:id="@+id/navigation_dashboard"
|
||||||
android:name="com.kolobochki.memory.ui.dashboard.DashboardFragment"
|
android:name="com.kolobochki.memory.ui.dashboard.DashboardFragment"
|
||||||
android:label="@string/title_dashboard"
|
android:label="@string/title_dashboard"
|
||||||
tools:layout="@layout/fragment_dashboard" />
|
tools:layout="@layout/fragment_dashboard" >
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_navigation_dashboard_to_navigation_home"
|
||||||
|
app:destination="@id/navigation_home" />
|
||||||
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/navigation_notifications"
|
android:id="@+id/navigation_task1"
|
||||||
android:name="com.kolobochki.memory.ui.notifications.NotificationsFragment"
|
android:name="com.kolobochki.memory.fragment_task1"
|
||||||
android:label="@string/title_notifications"
|
android:label="navigation_task1"
|
||||||
tools:layout="@layout/fragment_notifications" />
|
tools:layout="@layout/fragment_task1">
|
||||||
|
<action
|
||||||
|
android:id="@+id/action_navigation_notifications_to_navigation_home"
|
||||||
|
app:destination="@id/navigation_home" />
|
||||||
|
</fragment>
|
||||||
</navigation>
|
</navigation>
|
@ -3,4 +3,6 @@
|
|||||||
<string name="title_home">Карта</string>
|
<string name="title_home">Карта</string>
|
||||||
<string name="title_dashboard">Профиль</string>
|
<string name="title_dashboard">Профиль</string>
|
||||||
<string name="title_notifications">Notifications</string>
|
<string name="title_notifications">Notifications</string>
|
||||||
|
<!-- TODO: Remove or change this placeholder text -->
|
||||||
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
</resources>
|
</resources>
|
BIN
app/src/mem_star.png
Normal file
After Width: | Height: | Size: 18 KiB |