diff --git a/.idea/compiler.xml b/.idea/compiler.xml index fb7f4a8..b589d56 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 35ffc65..0897082 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,17 +4,15 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index 4730a08..f5fc841 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,27 +1,36 @@ - - + diff --git a/app/build.gradle b/app/build.gradle index c396031..c3e5e23 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'com.android.application' android { compileSdkVersion 30 - buildToolsVersion "30.0.2" defaultConfig { applicationId "com.rhinemann.project" @@ -25,6 +24,7 @@ android { buildFeatures { viewBinding true } + namespace 'com.rhinemann.project' } dependencies { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c21aa3c..a4fa439 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + + + @@ -23,13 +28,13 @@ android:exported="false" /> + android:exported="false" /> + android:exported="false" /> + android:exported="false" /> @@ -41,7 +46,7 @@ + android:exported="false" /> \ No newline at end of file diff --git a/app/src/main/java/com/rhinemann/project/About.java b/app/src/main/java/com/rhinemann/project/About.java index 1f44bae..b499c43 100644 --- a/app/src/main/java/com/rhinemann/project/About.java +++ b/app/src/main/java/com/rhinemann/project/About.java @@ -2,13 +2,23 @@ package com.rhinemann.project; import androidx.appcompat.app.AppCompatActivity; +import android.content.Intent; import android.os.Bundle; +import android.widget.Button; public class About extends AppCompatActivity { + Button Home; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); + + Home = findViewById(R.id.home); + + Home.setOnClickListener(view -> { + Intent intent = new Intent(About.this, HomeScreen.class); + startActivity(intent); + }); } } \ No newline at end of file diff --git a/app/src/main/java/com/rhinemann/project/Calculator.java b/app/src/main/java/com/rhinemann/project/Calculator.java index 57ac47b..3ae40cf 100644 --- a/app/src/main/java/com/rhinemann/project/Calculator.java +++ b/app/src/main/java/com/rhinemann/project/Calculator.java @@ -3,15 +3,15 @@ package com.rhinemann.project; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; -import android.view.View; import android.widget.Button; import android.widget.CheckBox; -import android.widget.CompoundButton; import android.widget.RadioGroup; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; +import java.util.Locale; + public class Calculator extends AppCompatActivity { RadioGroup UALan; @@ -43,8 +43,6 @@ public class Calculator extends AppCompatActivity { TextView HoursTaken; - Float Hours_Count; - Float UALan_Hours = 2f; Float UALit_Hours = 2f; Float FLit_Hours = 1f; @@ -75,448 +73,250 @@ public class Calculator extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_calculator); - UALan= findViewById(R.id.UALan); - UALit= findViewById(R.id.UALit); - FLit= findViewById(R.id.FLit); - FLan= findViewById(R.id.FLan); - UAHist= findViewById(R.id.UAHist); - FHist= findViewById(R.id.FHist); - AnFLan= findViewById(R.id.AnFLan); - Math= findViewById(R.id.Math); - Alg= findViewById(R.id.Alg); - Geom= findViewById(R.id.Geom); - PhysAstr= findViewById(R.id.PhysAstr); - BioEco= findViewById(R.id.BioEco); - Chem= findViewById(R.id.Chem); - Geo= findViewById(R.id.Geo); - PE= findViewById(R.id.PE); - Milit= findViewById(R.id.Milit); - SocEd= findViewById(R.id.SocEd); - Law= findViewById(R.id.Law); - Econ= findViewById(R.id.Econ); - IT= findViewById(R.id.IT); - Tech= findViewById(R.id.Tech); - Art= findViewById(R.id.Art); + UALan = findViewById(R.id.UALan); + UALit = findViewById(R.id.UALit); + FLit = findViewById(R.id.FLit); + FLan = findViewById(R.id.FLan); + UAHist = findViewById(R.id.UAHist); + FHist = findViewById(R.id.FHist); + AnFLan = findViewById(R.id.AnFLan); + Math = findViewById(R.id.Math); + Alg = findViewById(R.id.Alg); + Geom = findViewById(R.id.Geom); + PhysAstr = findViewById(R.id.PhysAstr); + BioEco = findViewById(R.id.BioEco); + Chem = findViewById(R.id.Chem); + Geo = findViewById(R.id.Geo); + PE = findViewById(R.id.PE); + Milit = findViewById(R.id.Milit); + SocEd = findViewById(R.id.SocEd); + Law = findViewById(R.id.Law); + Econ = findViewById(R.id.Econ); + IT = findViewById(R.id.IT); + Tech = findViewById(R.id.Tech); + Art = findViewById(R.id.Art); HoursTaken = findViewById(R.id.Hours); Home = findViewById(R.id.home); - Home.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(Calculator.this, HomeScreen.class); - startActivity(intent); - } + Home.setOnClickListener(v -> { + Intent intent = new Intent(Calculator.this, HomeScreen.class); + startActivity(intent); }); checkBox_IT = findViewById(R.id.checkBox_IT); checkBox_Tech = findViewById(R.id.checkBox_Tech); checkBox_Art = findViewById(R.id.checkBox_Art); - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - IT.clearCheck(); Tech.clearCheck(); Art.clearCheck(); - UALan.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId) { - case R.id.UALanSt: - UALan_Hours = 2f; - break; - case R.id.UALanPro: - UALan_Hours = 4f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + UALan.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.UALanSt) UALan_Hours = 2f; + else if (checkedId == R.id.UALanPro) UALan_Hours = 4f; + + Final(); }); - UALit.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.UALitSt: - UALit_Hours=2f; - break; - case R.id.UALitPro: - UALit_Hours=4f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + UALit.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.UALitSt) UALit_Hours = 2f; + else if (checkedId == R.id.UALitPro) UALit_Hours = 4f; + + Final(); }); - FLit.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.FLitSt: - FLit_Hours=1f; - break; - case R.id.FLitPro: - FLit_Hours=3f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + FLit.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.FLitSt) FLit_Hours = 1f; + else if (checkedId == R.id.FLitPro) FLit_Hours = 3f; + + Final(); }); - FLan.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.FLanSt: - FLan_Hours=2f; - break; - case R.id.FLanPro: - FLan_Hours= 5f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + FLan.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.FLanSt) FLan_Hours = 2f; + else if (checkedId == R.id.FLanPro) FLan_Hours = 5f; + + Final(); }); - UAHist.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.UAHistSt: - UAHist_Hours=1.5f; - break; - case R.id.UAHistPro: - UAHist_Hours= 3f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + UAHist.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.UAHistSt) UAHist_Hours = 1.5f; + else if (checkedId == R.id.UAHistPro) UAHist_Hours = 3f; + + Final(); }); - FHist.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.FHistSt: - FHist_Hours=1f; - break; - case R.id.FHistPro: - FHist_Hours=3f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + FHist.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.FHistSt) FHist_Hours = 1f; + else if (checkedId == R.id.FHistPro) FHist_Hours = 3f; + + Final(); }); - AnFLan.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.AnFLanSt: - AnFLan_Hours=0f; - break; - case R.id.AnFLanPro: - AnFLan_Hours=3f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + AnFLan.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.AnFLanSt) AnFLan_Hours = 0f; + else if (checkedId == R.id.AnFLanPro) AnFLan_Hours = 3f; + + Final(); }); - Math.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.MathSt: - Math_Hours=3f; - break; - case R.id.MathPro: - Math_Hours=0f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Math.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.MathSt) Math_Hours = 3f; + else if (checkedId == R.id.MathPro) Math_Hours = 0f; + + Final(); }); - Alg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.AlgSt: - Alg_Hours=0f; - break; - case R.id.AlgPro: - Alg_Hours=6f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Alg.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.AlgSt) Alg_Hours = 0f; + else if (checkedId == R.id.AlgPro) Alg_Hours = 6f; + + Final(); }); - Geom.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.GeomSt: - Geom_Hours=0f; - break; - case R.id.GeomPro: - Geom_Hours=3f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Geom.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.GeomSt) Geom_Hours = 0f; + else if (checkedId == R.id.GeomPro) Geom_Hours = 3f; + + Final(); }); - PhysAstr.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.PhysAstrSt: - PhysAstr_Hours=3f; - break; - case R.id.PhysAstrPro: - PhysAstr_Hours=6f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + PhysAstr.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.PhysAstrSt) PhysAstr_Hours = 3f; + else if (checkedId == R.id.PhysAstrPro) PhysAstr_Hours = 6f; + + Final(); }); - BioEco.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.BioEcoSt: - BioEco_Hours=2f; - break; - case R.id.BioEcoPro: - BioEco_Hours=5f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + BioEco.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.BioEcoSt) BioEco_Hours = 2f; + else if (checkedId == R.id.BioEcoPro) BioEco_Hours = 5f; + + Final(); }); - Chem.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.ChemSt: - Chem_Hours=1.5f; - break; - case R.id.ChemPro: - Chem_Hours=4f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Chem.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.ChemSt) Chem_Hours = 1.5f; + else if (checkedId == R.id.ChemPro) Chem_Hours = 4f; + + Final(); }); - Geo.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.GeoSt: - Geo_Hours=1.5f; - break; - case R.id.GeoPro: - Geo_Hours=5f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Geo.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.GeoSt) Geo_Hours = 1.5f; + else if (checkedId == R.id.GeoPro) Geo_Hours = 5f; + + Final(); }); - PE.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.PESt: - PE_Hours=2f; - break; - case R.id.PEPro: - PE_Hours=6f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); + PE.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.PESt) { + PE_Hours = 2f; + } else if (checkedId == R.id.PEPro) { + PE_Hours = 6f; } + + Final(); }); - Milit.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.MilitSt: - Milit_Hours=1.5f; - break; - case R.id.MilitPro: - Milit_Hours=5f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Milit.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.MilitSt) Milit_Hours = 1.5f; + else if (checkedId == R.id.MilitPro) Milit_Hours = 5f; + + Final(); }); - SocEd.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.SocEdSt: - SocEd_Hours=2f; - break; - case R.id.SocEdPro: - SocEd_Hours=0f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + SocEd.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.SocEdSt) SocEd_Hours = 2f; + else if (checkedId == R.id.SocEdPro) SocEd_Hours = 0f; + + Final(); }); - Law.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.LawSt: - Law_Hours=0f; - break; - case R.id.LawPro: - Law_Hours=3f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Law.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.LawSt) Law_Hours = 0f; + else if (checkedId == R.id.LawPro) Law_Hours = 3f; + + Final(); }); - Econ.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - switch (checkedId){ - case R.id.EconSt: - Econ_Hours=0f; - break; - case R.id.EconPro: - Econ_Hours=3f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + Econ.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkedId == R.id.EconSt) Econ_Hours = 0f; + else if (checkedId == R.id.EconPro) Econ_Hours = 3f; + + Final(); }); - checkBox_IT.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (checkBox_IT.isChecked()) { - IT_Hours = 3f; - IT.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - if (checkBox_IT.isChecked()) { - switch (checkedId) { - case R.id.ITSt: - IT_Hours = 3f; - break; - case R.id.ITPro: - IT_Hours = 5f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } else{ - IT_Hours = 0f; - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } - } - }); - } else { - IT.clearCheck(); - IT_Hours = 0f; - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + checkBox_IT.setOnCheckedChangeListener((buttonView, isChecked) -> { + if (checkBox_IT.isChecked()) { + IT_Hours = 3f; + + IT.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkBox_IT.isChecked()) { + if (checkedId == R.id.ITSt) IT_Hours = 3f; + else if (checkedId == R.id.ITPro) IT_Hours = 5f; + } else IT_Hours = 0f; + }); + } else { + IT.clearCheck(); + IT_Hours = 0f; } + + Final(); }); - checkBox_Tech.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (checkBox_Tech.isChecked()) { - Tech_Hours = 3f; - Tech.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - if (checkBox_Tech.isChecked()) { - switch (checkedId) { - case R.id.TechSt: - Tech_Hours = 3f; - break; - case R.id.TechPro: - Tech_Hours = 5f; - break; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } else { - Tech_Hours = 0f; - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } - } - }); - }else { - Tech.clearCheck(); - Tech_Hours = 0f; - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + checkBox_Tech.setOnCheckedChangeListener((buttonView, isChecked) -> { + if (checkBox_Tech.isChecked()) { + Tech_Hours = 3f; + + Tech.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkBox_Tech.isChecked()) { + if (checkedId == R.id.TechSt) Tech_Hours = 3f; + else if (checkedId == R.id.TechPro) Tech_Hours = 5f; + } else Tech_Hours = 0f; + }); + } else { + Tech.clearCheck(); + Tech_Hours = 0f; } + + Final(); }); - checkBox_Art.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (checkBox_Art.isChecked()) { - Art_Hours = 3f; - Art.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(RadioGroup radioGroup, int checkedId) { - if (checkBox_Art.isChecked()){ - switch (checkedId) { - case R.id.ArtSt: - Art_Hours = 3f; - break; - case R.id.ArtPro: - Art_Hours = 5f; - } - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } else { - Art_Hours= 0f; - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } - } - }); - }else { - Art.clearCheck(); - Art_Hours = 0f; - Hours_Count = Final(UALan_Hours, UALit_Hours, FLit_Hours, FLan_Hours, UAHist_Hours, FHist_Hours, AnFLan_Hours, Math_Hours, Alg_Hours, Geom_Hours, PhysAstr_Hours, BioEco_Hours, Chem_Hours, Geo_Hours, Milit_Hours, SocEd_Hours, Law_Hours, Econ_Hours, IT_Hours, Tech_Hours, Art_Hours, PE_Hours); - } + checkBox_Art.setOnCheckedChangeListener((buttonView, isChecked) -> { + if (checkBox_Art.isChecked()) { + Art_Hours = 3f; + + Art.setOnCheckedChangeListener((radioGroup, checkedId) -> { + if (checkBox_Art.isChecked()) { + if (checkedId == R.id.ArtSt) Art_Hours = 3f; + else if (checkedId == R.id.ArtPro) Art_Hours = 5f; + } else Art_Hours = 0f; + }); + } else { + Art.clearCheck(); + Art_Hours = 0f; } + + Final(); }); + Final(); + } - public float Final(float Lesson_1, float Lesson_2, float Lesson_3, float Lesson_4, float Lesson_5, float Lesson_6, float Lesson_7, float Lesson_8, float Lesson_9, float Lesson_10, float Lesson_11, float Lesson_12, float Lesson_13, float Lesson_14, float Lesson_15, float Lesson_16, float Lesson_17, float Lesson_18, float Lesson_19, float Lesson_20, float Lesson_21, float PE){ - float Hours = Lesson_1 + Lesson_2 + Lesson_3 + Lesson_4 + Lesson_5 + Lesson_6 + Lesson_7 + Lesson_8 + Lesson_9 + Lesson_10 + Lesson_11 + Lesson_12 + Lesson_13 + Lesson_14 + Lesson_15 + Lesson_16 + Lesson_17 + Lesson_18 + Lesson_19 + Lesson_20 + Lesson_21; + public void Final() { + float Hours = UALan_Hours + UALit_Hours + FLit_Hours + FLan_Hours + UAHist_Hours + FHist_Hours + AnFLan_Hours + Math_Hours + Alg_Hours + Geom_Hours + PhysAstr_Hours + BioEco_Hours + Chem_Hours + Geo_Hours + Milit_Hours + SocEd_Hours + Law_Hours + Econ_Hours + IT_Hours + Tech_Hours + Art_Hours + PE_Hours; - if (Hours >= 33f){ - HoursTaken.setTextColor(Color.rgb(255,0,0)); - } - else { + if (Hours >= 33f) { + HoursTaken.setTextColor(Color.rgb(255, 0, 0)); + } else { HoursTaken.setTextColor(Color.rgb(0, 0, 0)); } - Hours += PE; - - HoursTaken.setText("Годин вибрано: " + Float.toString(Hours)); - - return Hours; + HoursTaken.setText(String.format(new Locale("UA"), "Годин вибрано: %.1f", Hours)); } } \ No newline at end of file diff --git a/app/src/main/java/com/rhinemann/project/Graph.java b/app/src/main/java/com/rhinemann/project/Graph.java index 4fb1c30..5ba16a0 100644 --- a/app/src/main/java/com/rhinemann/project/Graph.java +++ b/app/src/main/java/com/rhinemann/project/Graph.java @@ -2,7 +2,6 @@ package com.rhinemann.project; import android.content.Intent; import android.os.Bundle; -import android.view.View; import android.widget.Button; import androidx.appcompat.app.AppCompatActivity; @@ -22,15 +21,16 @@ public class Graph extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_graph); - GraphView Graph = (GraphView) findViewById(R.id.Graph); + GraphView Graph = findViewById(R.id.Graph); final String[] XAxis = {"Фізика", "Математика", "Електро- та \nрадіотехніка", "Техніка", "Хімія", "Біологія", "Медицина", "Географія", "Історія", "Філологія", "Мистецтво", "Педагогіка", "Психологія, \nфілософія", "Бізнес", "Сфера \nобслуговувуння", "Військова \nсправа", "Спорт"}; int[] Data = getIntent().getIntArrayExtra("profileAnswers"); - BarGraphSeries series = new BarGraphSeries(); + BarGraphSeries series = new BarGraphSeries<>(); for (int i=0; i<17; i++){ + assert Data != null; series.appendData(new DataPoint(i*2, Data[i]),true,18); } @@ -67,25 +67,21 @@ public class Graph extends AppCompatActivity { Graph.getGridLabelRenderer().setPadding(10); Graph.getGridLabelRenderer().setLabelFormatter(new DefaultLabelFormatter(){ - @Override public String formatLabel(double value, boolean isValueX) { if (isValueX){ return (XAxis[(int) (value/2)]); } else { - return super.formatLabel(value, isValueX); + return super.formatLabel(value, false); } } }); Home = findViewById(R.id.home); - Home.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(Graph.this, HomeScreen.class); - startActivity(intent); - } + Home.setOnClickListener(v -> { + Intent intent = new Intent(Graph.this, HomeScreen.class); + startActivity(intent); }); } } \ No newline at end of file diff --git a/app/src/main/java/com/rhinemann/project/HomeScreen.java b/app/src/main/java/com/rhinemann/project/HomeScreen.java index 393e055..c387dfe 100644 --- a/app/src/main/java/com/rhinemann/project/HomeScreen.java +++ b/app/src/main/java/com/rhinemann/project/HomeScreen.java @@ -3,7 +3,6 @@ package com.rhinemann.project; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; -import android.view.View; import android.widget.Button; public class HomeScreen extends AppCompatActivity { @@ -19,28 +18,19 @@ public class HomeScreen extends AppCompatActivity { button_About = findViewById(R.id.Button_About); button_Calculator = findViewById(R.id.Button_Calculator); - button_Tests.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(HomeScreen.this, Tests.class); - startActivity(intent); - } + button_Tests.setOnClickListener(v -> { + Intent intent = new Intent(HomeScreen.this, Tests.class); + startActivity(intent); }); - button_About.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(HomeScreen.this, About.class); - startActivity(intent); - } + button_About.setOnClickListener(v -> { + Intent intent = new Intent(HomeScreen.this, About.class); + startActivity(intent); }); - button_Calculator.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(HomeScreen.this, Calculator.class); - startActivity(intent); - } + button_Calculator.setOnClickListener(v -> { + Intent intent = new Intent(HomeScreen.this, Calculator.class); + startActivity(intent); }); } diff --git a/app/src/main/java/com/rhinemann/project/Instruction.java b/app/src/main/java/com/rhinemann/project/Instruction.java index a531315..dbd3651 100644 --- a/app/src/main/java/com/rhinemann/project/Instruction.java +++ b/app/src/main/java/com/rhinemann/project/Instruction.java @@ -4,7 +4,6 @@ import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; -import android.view.View; import android.widget.Button; public class Instruction extends AppCompatActivity { @@ -20,20 +19,14 @@ public class Instruction extends AppCompatActivity { Home = findViewById(R.id.home_inst); Prof = findViewById(R.id.button_prof); - Home.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(Instruction.this, HomeScreen.class); - startActivity(intent); - } + Home.setOnClickListener(v -> { + Intent intent = new Intent(Instruction.this, HomeScreen.class); + startActivity(intent); }); - Prof.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(Instruction.this, Profile.class); - startActivity(intent); - } + Prof.setOnClickListener(v -> { + Intent intent = new Intent(Instruction.this, Profile.class); + startActivity(intent); }); } } \ No newline at end of file diff --git a/app/src/main/java/com/rhinemann/project/Profile.java b/app/src/main/java/com/rhinemann/project/Profile.java index ac6ab70..1584b68 100644 --- a/app/src/main/java/com/rhinemann/project/Profile.java +++ b/app/src/main/java/com/rhinemann/project/Profile.java @@ -4,7 +4,6 @@ import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; -import android.view.View; import android.widget.Button; import android.widget.TextView; @@ -21,7 +20,7 @@ public class Profile extends AppCompatActivity { setContentView(R.layout.activity_profile); profileQuestions = getResources().getStringArray(R.array.Profile_Questions); - profileQuestion = findViewById(R.id.Profile_Question); + profileQuestion = findViewById(R.id.Profile_Question); questionId = 0; discipline = 0; profileAnswers = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -33,62 +32,34 @@ public class Profile extends AppCompatActivity { //Кнопка плюс Button plusButton = findViewById(R.id.Button_Plus); - plusButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Test(1); - } - }); + plusButton.setOnClickListener(v -> Test(1)); //Кнопка мінус Button minusButton = findViewById(R.id.Button_Minus); - minusButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Test(-1); - } - }); + minusButton.setOnClickListener(v -> Test(-1)); //Кнопка нуль Button zeroButton = findViewById(R.id.Button_Zero); - zeroButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Test(0); - } - }); + zeroButton.setOnClickListener(v -> Test(0)); //Кнопка два плюси Button doublePlusButton = findViewById(R.id.Button_Double_Plus); - doublePlusButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Test(2); - } - }); + doublePlusButton.setOnClickListener(v -> Test(2)); //Кнопка два мінуси Button doubleMinusButton = findViewById(R.id.Button_Double_Minus); - doubleMinusButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Test(-2); - } - }); + doubleMinusButton.setOnClickListener(v -> Test(-2)); //Кнорка Меню Button Home = findViewById(R.id.home); - Home.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(Profile.this, HomeScreen.class); - startActivity(intent); - } + Home.setOnClickListener(v -> { + Intent intent = new Intent(Profile.this, HomeScreen.class); + startActivity(intent); }); } diff --git a/app/src/main/java/com/rhinemann/project/Temper.java b/app/src/main/java/com/rhinemann/project/Temper.java index 20675a5..b18e84a 100644 --- a/app/src/main/java/com/rhinemann/project/Temper.java +++ b/app/src/main/java/com/rhinemann/project/Temper.java @@ -4,7 +4,6 @@ import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; -import android.view.View; import android.widget.Button; import android.widget.TextView; @@ -30,20 +29,17 @@ public class Temper extends AppCompatActivity { Button yesButton = findViewById(R.id.Button_Yes); - yesButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Test(1); - } - }); + yesButton.setOnClickListener(v -> Test(1)); Button noButton = findViewById(R.id.Button_No); - noButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Test(0); - } + noButton.setOnClickListener(v -> Test(0)); + + Button Home = findViewById(R.id.home); + + Home.setOnClickListener(v -> { + Intent intent = new Intent(Temper.this, HomeScreen.class); + startActivity(intent); }); } @@ -51,9 +47,9 @@ public class Temper extends AppCompatActivity { public void Test(int amount) { if (questionId <= 19) { temper = 0; - } else if (questionId > 19 & questionId <= 39) { + } else if (questionId <= 39) { temper = 1; - } else if (questionId > 39 & questionId <= 59){ + } else if (questionId <= 59){ temper = 2; } else { temper = 3; diff --git a/app/src/main/java/com/rhinemann/project/TemperResult.java b/app/src/main/java/com/rhinemann/project/TemperResult.java index 3aca8ef..1202184 100644 --- a/app/src/main/java/com/rhinemann/project/TemperResult.java +++ b/app/src/main/java/com/rhinemann/project/TemperResult.java @@ -1,10 +1,10 @@ package com.rhinemann.project; +import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; -import android.view.View; import android.widget.Button; import com.github.mikephil.charting.charts.RadarChart; @@ -59,17 +59,15 @@ public class TemperResult extends AppCompatActivity { radarChart.getYAxis().setAxisMinimum(-20f); homeButton = findViewById(R.id.home); - homeButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(TemperResult.this, HomeScreen.class); - startActivity(intent); - } + homeButton.setOnClickListener(v -> { + Intent intent = new Intent(TemperResult.this, HomeScreen.class); + startActivity(intent); }); } + @NonNull private ArrayListdataValues(){ - ArrayList Tempers = new ArrayList(); + ArrayList Tempers = new ArrayList<>(); Tempers.add(new RadarEntry(Data[0])); Tempers.add(new RadarEntry(Data[1])); Tempers.add(new RadarEntry(Data[2])); diff --git a/app/src/main/java/com/rhinemann/project/Tests.java b/app/src/main/java/com/rhinemann/project/Tests.java index 32df1b9..c0b0ea3 100644 --- a/app/src/main/java/com/rhinemann/project/Tests.java +++ b/app/src/main/java/com/rhinemann/project/Tests.java @@ -4,34 +4,41 @@ import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; -import android.view.View; import android.widget.Button; public class Tests extends AppCompatActivity { + Button temperButton, profileButton, mayerButton, Home; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tests); - Button temperButton = findViewById(R.id.Button_Temper); - Button profileButton = findViewById(R.id.Button_Profile); - Button mayerButton = findViewById(R.id.Button_Mayer); + temperButton = findViewById(R.id.Button_Temper); + profileButton = findViewById(R.id.Button_Profile); + mayerButton = findViewById(R.id.Button_Mayer); + Home = findViewById(R.id.home); - profileButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent intent = new Intent(Tests.this, Profile.class); + + profileButton.setOnClickListener(v -> { + Intent intent = new Intent(Tests.this, Instruction.class); startActivity(intent); - } }); - temperButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { + temperButton.setOnClickListener(v -> { Intent intent = new Intent(Tests.this, Temper.class); startActivity(intent); - } + }); + + mayerButton.setOnClickListener(v -> { + Intent intent = new Intent(Tests.this, MBTI.class); + startActivity(intent); + }); + + Home.setOnClickListener(v -> { + Intent intent = new Intent(Tests.this, HomeScreen.class); + startActivity(intent); }); } diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 9939715..6b8b23a 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,8 +1,21 @@ + tools:context=".About" + android:background="@drawable/background_light"> + +