новые штуки

This commit is contained in:
Your Name 2023-10-11 16:37:09 +04:00
parent 88c61ded49
commit 5f3e35ae00
12 changed files with 138 additions and 17 deletions

View File

@ -3,6 +3,7 @@ package com.example.appmobile;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
@ -29,12 +30,27 @@ public class TasksActivity extends AppCompatActivity {
ft.commit();
}
@SuppressLint("UseCompatLoadingForDrawables")
public void showOpen(View v){
Intent intent = new Intent(this, RegistrationActivity.class);
startActivity(intent);
btn_open.setBackground(getDrawable(R.drawable.active_back));
btn_open.setTextColor(getColorStateList(R.color.white));
btn_closed.setBackground(getDrawable(R.drawable.not_active_back));
btn_closed.setTextColor(getColorStateList(R.color.main_grey));
Intent intent = new Intent(this, RegistrationActivity.class);
startActivity(intent);
}
@SuppressLint("UseCompatLoadingForDrawables")
public void showClosed(View v){
btn_closed.setBackground(getDrawable(R.drawable.active_back));
btn_closed.setTextColor(getColorStateList(R.color.white));
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);
}

View File

@ -2,13 +2,46 @@ package com.example.appmobile;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
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"};
@Override
protected void onCreate(Bundle savedInstanceState) {
tick = findViewById(R.id.text_ticks);
temp = 0;
tick.setText(ticks[temp++]);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ticks);
}
public void onRight(View v){
if(temp < ticks.length)
tick.setText(ticks[temp++]);
else{
temp = 0;
tick.setText(ticks[temp++]);
}
}
public void onLeft(View v){
if(temp >= 0)
tick.setText(ticks[temp--]);
else{
temp = ticks.length - 1;
tick.setText(ticks[temp--]);
}
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/main_pink" />
<corners android:radius="70dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="4dp"
android:color="@color/main_grey" />
<solid android:color="@color/mine_transparent" />
<padding
android:left="1dp"
android:right="1dp"
android:bottom="1dp"
android:top="1dp" />
<corners android:radius="70dp" />
</shape>

View File

@ -50,24 +50,25 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/line">
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/btn_open"
android:layout_width="159dp"
android:layout_height="48dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="15dp"
android:backgroundTint="@color/main_pink"
android:background="@drawable/active_back"
android:textColor="@color/white"
android:text="@string/open"
android:textAlignment="center"
android:textSize="20sp" />
<com.google.android.material.button.MaterialButton
<Button
android:id="@+id/btn_closed"
android:layout_width="159dp"
android:layout_height="48dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="30dp"
android:backgroundTint="@android:color/transparent"
android:background="@drawable/not_active_back"
android:text="@string/closed"
android:textAlignment="center"
android:textColor="@color/main_grey"

View File

@ -39,14 +39,59 @@
app:layout_constraintTop_toBottomOf="@+id/title_ticks"
tools:ignore="MissingConstraints" />
<TextView
android:id="@+id/textViewTick"
android:layout_width="360dp"
android:layout_height="607dp"
android:layout_marginTop="32dp"
android:background="@drawable/rounded_corner"
android:text="@string/empty_str"
<ImageView
android:id="@+id/back_ticks"
android:layout_width="349dp"
android:layout_height="590dp"
android:layout_marginTop="20dp"
app:layout_constraintBottom_toTopOf="@+id/nav_bar_ticks"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/line_ticks" />
app:layout_constraintTop_toBottomOf="@+id/line_ticks"
app:layout_constraintVertical_bias="0.094"
app:srcCompat="@drawable/rounded_corner"
android:contentDescription="@string/ticks_back" />
<TextView
android:id="@+id/text_ticks"
android:layout_width="240dp"
android:layout_height="536dp"
android:text="@string/empty_str"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="@+id/back_ticks"
app:layout_constraintEnd_toEndOf="@+id/back_ticks"
app:layout_constraintStart_toStartOf="@+id/back_ticks"
app:layout_constraintTop_toTopOf="@+id/back_ticks" />
<ImageButton
android:id="@+id/right_btn"
android:layout_width="52dp"
android:layout_height="52dp"
android:background="@android:color/transparent"
android:contentDescription="@string/arrow_right"
android:onClick="onRight"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@+id/back_ticks"
app:layout_constraintEnd_toEndOf="@+id/back_ticks"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="@+id/back_ticks"
app:layout_constraintTop_toTopOf="@+id/back_ticks"
app:layout_constraintVertical_bias="0.496"
app:srcCompat="@drawable/arrow_right" />
<ImageButton
android:id="@+id/left_btn"
android:layout_width="52dp"
android:layout_height="52dp"
android:background="@android:color/transparent"
android:contentDescription="@string/arrow_left"
android:onClick="onLeft"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@+id/back_ticks"
app:layout_constraintEnd_toEndOf="@+id/back_ticks"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/back_ticks"
app:layout_constraintTop_toTopOf="@+id/back_ticks"
app:layout_constraintVertical_bias="0.494"
app:srcCompat="@drawable/arrow_left" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.AppMobile" parent="Theme.Material3.DayNight.NoActionBar">
<style name="Base.Theme.AppMobile" parent="Theme.Material3.Light.NoActionBar">
<!-- Customize your dark theme here. -->
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
</style>

View File

@ -8,4 +8,5 @@
<color name="main_green">#bbf39b</color>
<color name="main_grey">#949494</color>
<color name="mine_transparent">#00000000</color>
</resources>

View File

@ -40,5 +40,8 @@
<string name="ticks">TICKS</string>
<string name="empty_str"></string>
<string name="ticks_back">ticks_back</string>
<string name="arrow_right">arrow_right</string>
<string name="arrow_left">arrow_left</string>
</resources>

View File

@ -1,9 +1,9 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.AppMobile" parent="Theme.Material3.DayNight.NoActionBar">
<style name="Base.Theme.AppMobile" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>
<style name="Theme.AppMobile" parent="Base.Theme.AppMobile" />
<style name="Theme.AppMobile" parent="Theme.AppCompat.Light.NoActionBar" />
</resources>