новые штуки
This commit is contained in:
parent
88c61ded49
commit
5f3e35ae00
@ -3,6 +3,7 @@ package com.example.appmobile;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -29,12 +30,27 @@ public class TasksActivity extends AppCompatActivity {
|
|||||||
ft.commit();
|
ft.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("UseCompatLoadingForDrawables")
|
||||||
public void showOpen(View v){
|
public void showOpen(View v){
|
||||||
Intent intent = new Intent(this, RegistrationActivity.class);
|
btn_open.setBackground(getDrawable(R.drawable.active_back));
|
||||||
startActivity(intent);
|
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){
|
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);
|
Intent intent = new Intent(this, RegistrationActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,46 @@ package com.example.appmobile;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
public class TicksActivity extends AppCompatActivity {
|
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
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
tick = findViewById(R.id.text_ticks);
|
||||||
|
temp = 0;
|
||||||
|
tick.setText(ticks[temp++]);
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_ticks);
|
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--]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
6
AppMobile/app/src/main/res/drawable/active_back.xml
Normal file
6
AppMobile/app/src/main/res/drawable/active_back.xml
Normal 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>
|
BIN
AppMobile/app/src/main/res/drawable/arrow_left.png
Normal file
BIN
AppMobile/app/src/main/res/drawable/arrow_left.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
BIN
AppMobile/app/src/main/res/drawable/arrow_right.png
Normal file
BIN
AppMobile/app/src/main/res/drawable/arrow_right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
16
AppMobile/app/src/main/res/drawable/not_active_back.xml
Normal file
16
AppMobile/app/src/main/res/drawable/not_active_back.xml
Normal 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>
|
@ -50,24 +50,25 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/line">
|
app:layout_constraintTop_toBottomOf="@+id/line">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<Button
|
||||||
android:id="@+id/btn_open"
|
android:id="@+id/btn_open"
|
||||||
android:layout_width="159dp"
|
android:layout_width="159dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_marginLeft="30dp"
|
android:layout_marginLeft="30dp"
|
||||||
android:layout_marginRight="15dp"
|
android:layout_marginRight="15dp"
|
||||||
android:backgroundTint="@color/main_pink"
|
android:background="@drawable/active_back"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:text="@string/open"
|
android:text="@string/open"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<Button
|
||||||
android:id="@+id/btn_closed"
|
android:id="@+id/btn_closed"
|
||||||
android:layout_width="159dp"
|
android:layout_width="159dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_marginLeft="15dp"
|
android:layout_marginLeft="15dp"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:backgroundTint="@android:color/transparent"
|
android:background="@drawable/not_active_back"
|
||||||
android:text="@string/closed"
|
android:text="@string/closed"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/main_grey"
|
android:textColor="@color/main_grey"
|
||||||
|
@ -39,14 +39,59 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@+id/title_ticks"
|
app:layout_constraintTop_toBottomOf="@+id/title_ticks"
|
||||||
tools:ignore="MissingConstraints" />
|
tools:ignore="MissingConstraints" />
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/textViewTick"
|
android:id="@+id/back_ticks"
|
||||||
android:layout_width="360dp"
|
android:layout_width="349dp"
|
||||||
android:layout_height="607dp"
|
android:layout_height="590dp"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="20dp"
|
||||||
android:background="@drawable/rounded_corner"
|
app:layout_constraintBottom_toTopOf="@+id/nav_bar_ticks"
|
||||||
android:text="@string/empty_str"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="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>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -1,6 +1,6 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- 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. -->
|
<!-- Customize your dark theme here. -->
|
||||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||||
</style>
|
</style>
|
||||||
|
@ -8,4 +8,5 @@
|
|||||||
<color name="main_green">#bbf39b</color>
|
<color name="main_green">#bbf39b</color>
|
||||||
<color name="main_grey">#949494</color>
|
<color name="main_grey">#949494</color>
|
||||||
|
|
||||||
|
<color name="mine_transparent">#00000000</color>
|
||||||
</resources>
|
</resources>
|
@ -40,5 +40,8 @@
|
|||||||
|
|
||||||
<string name="ticks">TICKS</string>
|
<string name="ticks">TICKS</string>
|
||||||
<string name="empty_str"></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>
|
</resources>
|
@ -1,9 +1,9 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- 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. -->
|
<!-- Customize your light theme here. -->
|
||||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.AppMobile" parent="Base.Theme.AppMobile" />
|
<style name="Theme.AppMobile" parent="Theme.AppCompat.Light.NoActionBar" />
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user