init
This commit is contained in:
parent
c1b74999a8
commit
0a1ed80a15
@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings" defaultProject="true" />
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -7,13 +7,11 @@ import android.widget.TextView;
|
||||
|
||||
public class Click implements View.OnClickListener {
|
||||
TextView mainText;
|
||||
EditText ETPrimerTxt;
|
||||
String letter;
|
||||
long score = 0;
|
||||
|
||||
public Click(TextView mainTxt, EditText ETPrimer){
|
||||
public Click(TextView mainTxt){
|
||||
this.mainText=mainTxt;
|
||||
this.ETPrimerTxt=ETPrimer;
|
||||
}
|
||||
String primer="";
|
||||
@Override
|
||||
@ -67,48 +65,6 @@ public class Click implements View.OnClickListener {
|
||||
score=0;
|
||||
String s = "Кнопка нажата " + score + " раз";
|
||||
mainText.setText(s);
|
||||
} else if (id==R.id.btn0) {
|
||||
primer += "dfgdfg";
|
||||
ETPrimerTxt.setText(primer);
|
||||
}
|
||||
else if (id==R.id.btn1) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn2) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn3) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn4) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn5) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn6) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn7) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn8) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btn9) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btnPlus) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btnMinus) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btnDiv) {
|
||||
|
||||
}
|
||||
else if (id==R.id.btnMulti) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,8 +16,7 @@ import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
TextView mainText;
|
||||
EditText ETPrimer;
|
||||
Button minus_btn, drop_btn, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn0, btnMulti, btnDiv, btnMinus, btnPlus, btnTransfer;
|
||||
Button drop_btn, minus_btn;
|
||||
ImageView mainBtn;
|
||||
|
||||
@Override
|
||||
@ -33,45 +32,12 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
mainText = findViewById(R.id.mainText);
|
||||
mainBtn = findViewById(R.id.main_btn);
|
||||
minus_btn = findViewById(R.id.minus_btn);
|
||||
drop_btn = findViewById(R.id.drop_btn);
|
||||
ETPrimer=findViewById(R.id.ETPrimer);
|
||||
btn1=findViewById(R.id.btn1);
|
||||
btn2=findViewById(R.id.btn2);
|
||||
btn3=findViewById(R.id.btn3);
|
||||
btn4=findViewById(R.id.btn4);
|
||||
btn5=findViewById(R.id.btn5);
|
||||
btn6=findViewById(R.id.btn6);
|
||||
btn7=findViewById(R.id.btn7);
|
||||
btn8=findViewById(R.id.btn8);
|
||||
btn9=findViewById(R.id.btn9);
|
||||
btn0=findViewById(R.id.btn0);
|
||||
btnMulti=findViewById(R.id.btnMulti);
|
||||
btnDiv=findViewById(R.id.btnDiv);
|
||||
btnMinus=findViewById(R.id.btnMinus);
|
||||
btnPlus=findViewById(R.id.btnPlus);
|
||||
btnTransfer=findViewById(R.id.btnTransfer);
|
||||
minus_btn = findViewById(R.id.minus_btn);
|
||||
|
||||
Click clickListener = new Click(mainText,ETPrimer);
|
||||
Click clickListener = new Click(mainText);
|
||||
mainBtn.setOnClickListener(clickListener);
|
||||
minus_btn.setOnClickListener(clickListener);
|
||||
drop_btn.setOnClickListener(clickListener);
|
||||
|
||||
btn1.setOnClickListener(clickListener);
|
||||
btn2.setOnClickListener(clickListener);
|
||||
btn3.setOnClickListener(clickListener);
|
||||
btn4.setOnClickListener(clickListener);
|
||||
btn5.setOnClickListener(clickListener);
|
||||
btn6.setOnClickListener(clickListener);
|
||||
btn7.setOnClickListener(clickListener);
|
||||
btn8.setOnClickListener(clickListener);
|
||||
btn9.setOnClickListener(clickListener);
|
||||
btn0.setOnClickListener(clickListener);
|
||||
btnPlus.setOnClickListener(clickListener);
|
||||
btnMinus.setOnClickListener(clickListener);
|
||||
btnDiv.setOnClickListener(clickListener);
|
||||
btnMulti.setOnClickListener(clickListener);
|
||||
btnTransfer.setOnClickListener(clickListener);
|
||||
|
||||
minus_btn.setOnClickListener(clickListener);
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 179 KiB |
50
app/src/main/res/drawable/skeleton.xml
Normal file
50
app/src/main/res/drawable/skeleton.xml
Normal file
File diff suppressed because one or more lines are too long
@ -47,207 +47,14 @@
|
||||
android:layout_width="259dp"
|
||||
android:layout_height="193dp"
|
||||
|
||||
android:scaleType="fitCenter"
|
||||
android:scaleType="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.503"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.11"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:srcCompat="@drawable/piratik" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnPlus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.981"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.636" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.377"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.838" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="4"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.065"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.739" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnDiv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.987"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.929" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="7"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.068"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.838" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTransfer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="="
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.068"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.929" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.674"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.838" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="5"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.371"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.739" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.674"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.636" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="6"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.674"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.739" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.371"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.636" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.377"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.929" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnMulti"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.981"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.838" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.065"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.636" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnMinus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.981"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.739" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ETPrimer"
|
||||
android:layout_width="208dp"
|
||||
android:layout_height="55dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.536"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.542" />
|
||||
tools:ignore="ContentDescription,MissingConstraints"
|
||||
tools:srcCompat="@drawable/skeleton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue
Block a user