⣿⣿⣿⠟⠛⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⢋⣩⣉⢻⣿⡇

⣿⣿⣿⠀⣿⣶⣕⣈⠹⠿⠿⠿⠿⠟⠛⣛⢋⣰⠣⣿⣿⠀⣿⣿
⣿⣿⣿⡀⣿⣿⣿⣧⢻⣿⣶⣷⣿⣿⣿⣿⣿⣿⠿⠶⡝⠀⣿⣿
⣿⣿⣿⣷⠘⣿⣿⣿⢏⣿⣿⣋⣀⣈⣻⣿⣿⣷⣤⣤⣿⡐⢿⣿
⣿⣿⣿⣿⣆⢩⣝⣫⣾⣿⣿⣿⣿⡟⠿⠿⠦⠀⠸⠿⣻⣿⡄⢻
⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⠇⣼
⣿⣿⣿⣿⣿⣿⡄⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⣰⣿
⣿⣿⣿⣿⣿⣿⠇⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢀⣿⣿
⣿⣿⣿⣿⣿⠏⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢸⣿⣿
⣿⣿⣿⣿⠟⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⣿⣿
⣿⣿⣿⠋⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⣿⡇
⣿⣿⠋⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢸⡇
⣿⠏⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡯⢸⡇
This commit is contained in:
Hells Hound 2023-10-14 10:25:41 +04:00
parent e72741669c
commit 584a867732
18 changed files with 185 additions and 123 deletions

View File

@ -12,9 +12,6 @@
android:supportsRtl="true"
android:theme="@style/Theme.AppMobile"
tools:targetApi="31">
<activity
android:name=".TaskViewActivity"
android:exported="false" />
<activity
android:name=".NewTaskActivity"
android:exported="false" />

View File

@ -8,7 +8,7 @@ import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.example.appmobile.models.User;
import com.example.appmobile.helpers.User;
public class ForgotPasswordActivity extends AppCompatActivity {

View File

@ -6,11 +6,10 @@ import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.example.appmobile.models.Task;
import com.example.appmobile.models.User;
import com.example.appmobile.helpers.Task;
import com.example.appmobile.helpers.User;
public class MainActivity extends AppCompatActivity {
@ -21,32 +20,36 @@ public class MainActivity extends AppCompatActivity {
}
public void onEnter(View v){
String Email = ((EditText) findViewById(R.id.logEmail)).getText().toString(),
Password = ((EditText) findViewById(R.id.logPassword)).getText().toString();
if(Email.equals(User.email) && Password.equals(User.password)){
User.tasks.add(new Task("1", "asdasdas", true));
User.tasks.add(new Task("2", "dwa", false));
User.tasks.add(new Task("3", "vfgdfgdf", false));
User.tasks.add(new Task("4", "wafafwfwafw", true));
User.tasks.add(new Task("5", "ytuukyuk", true));
User.tasks.add(new Task("6", "ytuukfefeeeeyuk", true));
User.open.add(new Task("Лабы", "сделать лабы по всем предметам"));
User.closed.add(new Task("Уборка", "генеральная уборка в квартире"));
User.open.add(new Task("Продукты", "купить молоко и хлеб"));
User.open.add(new Task("Отчеты", "сделать все нужные отчеты по лабам"));
User.closed.add(new Task("Бег", "3 км"));
User.open.add(new Task("Белочки", "пойти покормить белочек"));
Intent intent = new Intent(this, TasksActivity.class);
startActivity(intent);
}
else{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("ERROR!!")
.setMessage("Неверная почта или пароль " + Email + " " + User.email + " " + Password + " " + User.password)
.setCancelable(true)
.setPositiveButton("Ok", (dialog, which) -> {
dialog.cancel();
});
AlertDialog dialog = builder.create();
dialog.show();
}
Intent intent = new Intent(this, TasksActivity.class);
startActivity(intent);
// String Email = ((EditText) findViewById(R.id.logEmail)).getText().toString(),
// Password = ((EditText) findViewById(R.id.logPassword)).getText().toString();
//
// if(Email.equals(User.email) && Password.equals(User.password)){
//
// }
// else{
// AlertDialog.Builder builder = new AlertDialog.Builder(this);
// builder.setTitle("ERROR!!")
// .setMessage("Неверная почта или пароль " + Email + " " + User.email + " " + Password + " " + User.password)
// .setCancelable(true)
// .setPositiveButton("Ok", (dialog, which) -> {
// dialog.cancel();
// });
//
// AlertDialog dialog = builder.create();
// dialog.show();
// }
}
public void toRegistration(View v){

View File

@ -8,8 +8,8 @@ import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.example.appmobile.models.Task;
import com.example.appmobile.models.User;
import com.example.appmobile.helpers.Task;
import com.example.appmobile.helpers.User;
public class NewTaskActivity extends AppCompatActivity {
@ -32,9 +32,9 @@ public class NewTaskActivity extends AppCompatActivity {
Toast.makeText(this, "Title or description is empty", Toast.LENGTH_LONG).show();
return;
}
User.tasks.add(new Task(title, desc,false));
User.open.add(new Task(title, desc));
Intent intent = new Intent(this, MainActivity.class);
Intent intent = new Intent(this, TasksActivity.class);
startActivity(intent);
}
}

View File

@ -1,11 +1,15 @@
package com.example.appmobile;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.Toast;
public class ProfileActivity extends AppCompatActivity {

View File

@ -3,18 +3,12 @@ package com.example.appmobile;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.example.appmobile.models.User;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import com.example.appmobile.helpers.User;
public class RegistrationActivity extends AppCompatActivity {

View File

@ -1,14 +0,0 @@
package com.example.appmobile;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class TaskViewActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_task_view);
}
}

View File

@ -10,20 +10,33 @@ import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import com.example.appmobile.databinding.ActivityMainBinding;
import com.example.appmobile.databinding.ActivityTasksBinding;
import com.example.appmobile.helpers.ListAdapter;
import com.example.appmobile.helpers.User;
public class TasksActivity extends AppCompatActivity {
private Button btn_open, btn_closed;
ActivityTasksBinding binding;
ListAdapter listAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tasks);
binding = ActivityTasksBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
listAdapter = new ListAdapter(this, User.open);
binding.tasksView.setAdapter(listAdapter);
binding.tasksView.setClickable(true);
btn_open = findViewById(R.id.save_new_task);
btn_closed = findViewById(R.id.btn_closed);
FrameLayout navBarFrameLayout = findViewById(R.id.nav_bar_ticks);
FrameLayout navBarFrameLayout = findViewById(R.id.nav_bar_task);
NavigationFragment navBar = new NavigationFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
@ -44,9 +57,10 @@ public class TasksActivity extends AppCompatActivity {
btn_closed.setBackground(getDrawable(R.drawable.not_active_back));
btn_closed.setTextColor(getColorStateList(R.color.main_grey));
listAdapter = new ListAdapter(this, User.open);
binding.tasksView.setAdapter(listAdapter);
binding.tasksView.setClickable(true);
Intent intent = new Intent(this, RegistrationActivity.class);
startActivity(intent);
}
@SuppressLint("UseCompatLoadingForDrawables")
@ -57,7 +71,9 @@ public class TasksActivity extends AppCompatActivity {
btn_open.setBackground(getDrawable(R.drawable.not_active_back));
btn_open.setTextColor(getColorStateList(R.color.main_grey));
Intent intent = new Intent(this, RegistrationActivity.class);
startActivity(intent);
listAdapter = new ListAdapter(this, User.closed);
binding.tasksView.setAdapter(listAdapter);
binding.tasksView.setClickable(true);
}
}

View File

@ -1,28 +1,37 @@
package com.example.appmobile;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
public class TicksActivity extends AppCompatActivity {
private TextView tick;
private int temp = -1;
private String[] ticks = new String[]{"hfsehg sehgkjdhgkj sdhg kjdfhgjkdfhg jkdhf gkj dfhgkjdfhgkjhkr hgrug hdfghfkjghkjdfg hkd fjhgskjdfhgkjdshfg k jhdrk jghkdrjghk djfhg dfbgfdbghgdrg",
"dfhsdhf shfeuihfush fhskjfeh ieufh sdhfhsefsghfegh fh sodfheh fkshfuisegts egh;a rhega;gh eraugh ghehgsojdhgejhgkejgh kdghdfkjghdkrgh drdh gshelosehf sie toisyotisdgsdg s",
"elfhs ;;oeihftehtughshs fls heuf dkh gsdgjfgnvdfjk vbv seyfg dhgfhdf sdxdfjbfhbvryglauerheufhsofhekhf shfehfkjshf ksdhfghjkfhgkrtjhgkrdjhg djfghslkhef kdj fhskefush turghsdurg"};
private final String[] ticks = new String[]{"Никогда не сравнивайте себя с другими, каждый имеет свой собственный путь и свои уникальные обстоятельства. Сосредоточьтесь на своем прогрессе и постоянно совершенствовайтесь, верьте в свои силы и двигайтесь к своим целям.",
"Ставьте реалистичные цели и разбивайте их на маленькие шаги, так вам будет легче двигаться вперед и достигать успеха. Не забывайте отдыхать и наслаждаться жизнью, ведь успех не только в достижениях, но и в гармонии с самим собой.",
"Сохраняйте спокойствие и оптимизм в любой ситуации, так как это поможет вам принимать более взвешенные решения и двигаться вперед в жизни."};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ticks);
tick = findViewById(R.id.text_ticks);
temp = 0;
tick.setText(ticks[temp++]);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ticks);
FrameLayout navBarFrameLayout = findViewById(R.id.nav_bar_ticks);
NavigationFragment navBar = new NavigationFragment();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(navBarFrameLayout.getId(), navBar);
ft.commit();
}
public void onRight(View v){

View File

@ -0,0 +1,37 @@
package com.example.appmobile.helpers;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.example.appmobile.R;
import java.util.ArrayList;
public class ListAdapter extends ArrayAdapter<Task>{
public ListAdapter(@NonNull Context context, ArrayList<Task> data) {
super(context, R.layout.task_item, data);
}
@NonNull
@Override
public View getView(int position, @Nullable View view, @NonNull ViewGroup parent) {
Task task = getItem(position);
if(view == null)
view = LayoutInflater.from(getContext()).inflate(R.layout.task_item,parent,false);
TextView title = view.findViewById(R.id.view_title);
TextView description = view.findViewById(R.id.view_desc);
title.setText(task.title);
description.setText(task.description);
return view;
}
}

View File

@ -1,15 +1,12 @@
package com.example.appmobile.models;
package com.example.appmobile.helpers;
public class Task {
public String title;
public String description;
public boolean done;
public Task(String title, String description, boolean done){
public Task(String title, String description){
this.title = title;
this.description = description;
this.done = done;
}
}

View File

@ -1,12 +1,12 @@
package com.example.appmobile.models;
package com.example.appmobile.helpers;
import java.util.ArrayList;
import java.util.List;
public class User {
public static String name = "user";
public static String email = "qw@qw";
public static String password = "qw";
public static ArrayList<Task> tasks = new ArrayList<>();
public static ArrayList<Task> open = new ArrayList<>();
public static ArrayList<Task> closed = new ArrayList<>();
}

View File

@ -81,7 +81,7 @@
android:background="@drawable/rounded_corner"
android:ems="10"
android:gravity="center_horizontal"
android:hint="@string/description"
android:hint="@string/desc_upper"
android:inputType="textMultiLine"
android:padding="10dp"
android:text="@string/empty_str"

View File

@ -45,8 +45,8 @@
<ImageView
android:id="@+id/imageView2"
android:layout_width="175dp"
android:layout_height="119dp"
android:layout_width="203dp"
android:layout_height="159dp"
android:layout_marginTop="24dp"
app:layout_constraintEnd_toEndOf="parent"
@ -54,16 +54,37 @@
app:layout_constraintTop_toBottomOf="@+id/line2"
app:srcCompat="@drawable/user" />
<Button
android:id="@+id/button"
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_marginBottom="44dp"
android:background="@drawable/active_back"
android:text="@string/del_profile"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/nav_bar_user"
<TextView
android:id="@+id/textView2"
android:layout_width="344dp"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
android:background="@drawable/rounded_corner"
android:padding="10dp"
android:textColor="@color/black"
android:textStyle="bold"
android:textAlignment="center"
android:text="@string/name_upper"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintHorizontal_bias="0.492"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
<TextView
android:id="@+id/textView3"
android:layout_width="344dp"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:background="@drawable/rounded_corner"
android:padding="10dp"
android:textSize="18sp"
android:textColor="@color/black"
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/email_upper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.492"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,14 +0,0 @@
<?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"
tools:context=".TaskViewActivity">
<androidx.cardview.widget.CardView
android:layout_width="409dp"
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="111dp" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -31,7 +31,7 @@
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/nav_bar_ticks"
android:id="@+id/nav_bar_task"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
@ -81,9 +81,9 @@
</LinearLayout>
<ImageButton
android:id="@+id/imageButton"
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/add_new_task"
android:layout_width="62dp"
android:layout_height="61dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="28dp"
android:background="@drawable/back_add_btn"
@ -91,20 +91,22 @@
android:onClick="onNew"
android:padding="5dp"
android:scaleType="centerInside"
app:layout_constraintBottom_toTopOf="@+id/nav_bar_ticks"
app:layout_constraintBottom_toTopOf="@+id/nav_bar_task"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/add_b" />
<ListView
android:layout_width="353dp"
android:layout_height="583dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
app:layout_constraintVertical_bias="0.149"
android:id="@+id/tasks_view"
android:layout_width="350dp"
android:layout_height="578dp"
android:layout_marginTop="20dp"
android:divider="@color/mine_transparent"
android:dividerHeight="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.491"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
tools:listitem="@layout/task_item">
</ListView>

View File

@ -7,14 +7,6 @@
android:layout_height="match_parent"
tools:context=".TicksActivity">
<FrameLayout
android:id="@+id/nav_bar_ticks"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"></FrameLayout>
<TextView
android:id="@+id/title_ticks"
@ -58,6 +50,10 @@
android:layout_height="536dp"
android:text="@string/empty_str"
android:textAlignment="center"
android:textSize="25sp"
android:textColor="@color/black"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/back_ticks"
app:layout_constraintEnd_toEndOf="@+id/back_ticks"
app:layout_constraintStart_toStartOf="@+id/back_ticks"
@ -94,4 +90,15 @@
app:layout_constraintTop_toTopOf="@+id/back_ticks"
app:layout_constraintVertical_bias="0.494"
app:srcCompat="@drawable/arrow_left" />
<FrameLayout
android:id="@+id/nav_bar_ticks"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent">
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -49,5 +49,8 @@
<string name="save_changes">SAVE CHANGES</string>
<string name="save">SAVE</string>
<string name="title">TITLE</string>
<string name="description">DESCRIPTION</string>
<string name="desc_upper">DESCRIPTION</string>
<string name="email_upper">EMAIL@EMAIL</string>
<string name="name_upper">NAME</string>
</resources>