From bce1be54a1661c8512fa5fe24ba0ec35c4a9ff96 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 13 Feb 2024 16:09:14 +0100 Subject: minimal effort app --- app/build.gradle.kts | 27 ++ app/src/main/AndroidManifest.xml | 43 +-- .../java/com/lonkaars/bingo3/MainActivity.java | 25 +- .../com/lonkaars/bingo3/OrientationActivity.java | 13 + .../java/com/lonkaars/bingo3/WeatherActivity.java | 21 ++ app/src/main/res/drawable/arrow_left.xml | 1 + .../main/res/drawable/ic_launcher_background.xml | 334 ++++++++++----------- .../main/res/drawable/ic_launcher_foreground.xml | 56 ++-- app/src/main/res/drawable/menu.xml | 1 - app/src/main/res/drawable/roman_numeral_1.xml | 1 - app/src/main/res/drawable/roman_numeral_2.xml | 1 - app/src/main/res/drawable/roman_numeral_3.xml | 1 - app/src/main/res/drawable/roman_numeral_4.xml | 1 - app/src/main/res/drawable/roman_numeral_5.xml | 1 - app/src/main/res/drawable/roman_numeral_6.xml | 1 - app/src/main/res/drawable/roman_numeral_7.xml | 1 - app/src/main/res/drawable/roman_numeral_8.xml | 1 - app/src/main/res/drawable/roman_numeral_9.xml | 1 - app/src/main/res/layout-land/orientation_demo.xml | 23 ++ app/src/main/res/layout/activity_main.xml | 92 ++++-- .../main/res/layout/header_navigation_drawer.xml | 26 -- app/src/main/res/layout/orientation_demo.xml | 24 ++ app/src/main/res/layout/weather.xml | 63 ++++ app/src/main/res/menu/navigation_drawer.xml | 40 --- app/src/main/res/mipmap-anydpi/ic_launcher.xml | 6 +- .../main/res/mipmap-anydpi/ic_launcher_round.xml | 6 +- app/src/main/res/values/colors.xml | 4 +- app/src/main/res/values/strings.xml | 14 +- app/src/main/res/values/themes.xml | 24 +- app/src/main/res/xml/backup_rules.xml | 6 +- app/src/main/res/xml/data_extraction_rules.xml | 24 +- build.gradle.kts | 1 + 32 files changed, 511 insertions(+), 372 deletions(-) create mode 100644 app/src/main/java/com/lonkaars/bingo3/OrientationActivity.java create mode 100644 app/src/main/java/com/lonkaars/bingo3/WeatherActivity.java create mode 100644 app/src/main/res/drawable/arrow_left.xml delete mode 100644 app/src/main/res/drawable/menu.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_1.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_2.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_3.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_4.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_5.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_6.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_7.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_8.xml delete mode 100644 app/src/main/res/drawable/roman_numeral_9.xml create mode 100644 app/src/main/res/layout-land/orientation_demo.xml delete mode 100644 app/src/main/res/layout/header_navigation_drawer.xml create mode 100644 app/src/main/res/layout/orientation_demo.xml create mode 100644 app/src/main/res/layout/weather.xml delete mode 100644 app/src/main/res/menu/navigation_drawer.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 788eafb..b330a7d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,6 @@ plugins { id("com.android.application") + id("org.jetbrains.kotlin.android") } android { @@ -14,6 +15,9 @@ android { versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } } buildTypes { @@ -28,6 +32,18 @@ android { } buildFeatures { viewBinding = true + compose = true + } + kotlinOptions { + jvmTarget = "1.8" + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.1" + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } } } @@ -41,7 +57,18 @@ dependencies { implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0") implementation("androidx.navigation:navigation-fragment:2.7.7") implementation("androidx.navigation:navigation-ui:2.7.7") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0") + implementation("androidx.activity:activity-compose:1.8.2") + implementation(platform("androidx.compose:compose-bom:2023.08.00")) + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.ui:ui-graphics") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.compose.material3:material3") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00")) + androidTestImplementation("androidx.compose.ui:ui-test-junit4") + debugImplementation("androidx.compose.ui:ui-tooling") + debugImplementation("androidx.compose.ui:ui-test-manifest") } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 08e7139..0cc7f54 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,26 +1,27 @@ + xmlns:tools="http://schemas.android.com/tools"> - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/lonkaars/bingo3/MainActivity.java b/app/src/main/java/com/lonkaars/bingo3/MainActivity.java index 495811d..6440c3c 100644 --- a/app/src/main/java/com/lonkaars/bingo3/MainActivity.java +++ b/app/src/main/java/com/lonkaars/bingo3/MainActivity.java @@ -5,16 +5,21 @@ import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.EditText; -import android.widget.ListView; -import android.widget.Toast; public class MainActivity extends AppCompatActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - } + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } + + public void navigate_orientation(View view) { + Intent intent = new Intent(this, OrientationActivity.class); + startActivity(intent); + } + + public void navigate_weather(View view) { + Intent intent = new Intent(this, WeatherActivity.class); + startActivity(intent); + } } diff --git a/app/src/main/java/com/lonkaars/bingo3/OrientationActivity.java b/app/src/main/java/com/lonkaars/bingo3/OrientationActivity.java new file mode 100644 index 0000000..960af18 --- /dev/null +++ b/app/src/main/java/com/lonkaars/bingo3/OrientationActivity.java @@ -0,0 +1,13 @@ +package com.lonkaars.bingo3; + +import android.os.Bundle; + +import androidx.appcompat.app.AppCompatActivity; + +public class OrientationActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.orientation_demo); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/lonkaars/bingo3/WeatherActivity.java b/app/src/main/java/com/lonkaars/bingo3/WeatherActivity.java new file mode 100644 index 0000000..46c965c --- /dev/null +++ b/app/src/main/java/com/lonkaars/bingo3/WeatherActivity.java @@ -0,0 +1,21 @@ +package com.lonkaars.bingo3; + +import android.os.Bundle; +import android.view.View; + +import androidx.appcompat.app.AppCompatActivity; + +import com.google.android.material.appbar.MaterialToolbar; + +public class WeatherActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.weather); + + MaterialToolbar toolbar = findViewById(R.id.topAppBar); + toolbar.setNavigationOnClickListener(v -> { + finish(); + }); + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/arrow_left.xml b/app/src/main/res/drawable/arrow_left.xml new file mode 100644 index 0000000..5f4caff --- /dev/null +++ b/app/src/main/res/drawable/arrow_left.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index 07d5da9..4e12b43 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,170 +1,170 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index 2b068d1..c6aee64 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -1,30 +1,30 @@ - - - - - - - - - + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/menu.xml b/app/src/main/res/drawable/menu.xml deleted file mode 100644 index 2623a2b..0000000 --- a/app/src/main/res/drawable/menu.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_1.xml b/app/src/main/res/drawable/roman_numeral_1.xml deleted file mode 100644 index 4476568..0000000 --- a/app/src/main/res/drawable/roman_numeral_1.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_2.xml b/app/src/main/res/drawable/roman_numeral_2.xml deleted file mode 100644 index 15bb3dc..0000000 --- a/app/src/main/res/drawable/roman_numeral_2.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_3.xml b/app/src/main/res/drawable/roman_numeral_3.xml deleted file mode 100644 index f8a7934..0000000 --- a/app/src/main/res/drawable/roman_numeral_3.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_4.xml b/app/src/main/res/drawable/roman_numeral_4.xml deleted file mode 100644 index c620710..0000000 --- a/app/src/main/res/drawable/roman_numeral_4.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_5.xml b/app/src/main/res/drawable/roman_numeral_5.xml deleted file mode 100644 index 93f876c..0000000 --- a/app/src/main/res/drawable/roman_numeral_5.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_6.xml b/app/src/main/res/drawable/roman_numeral_6.xml deleted file mode 100644 index 22ce4de..0000000 --- a/app/src/main/res/drawable/roman_numeral_6.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_7.xml b/app/src/main/res/drawable/roman_numeral_7.xml deleted file mode 100644 index 68768cf..0000000 --- a/app/src/main/res/drawable/roman_numeral_7.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_8.xml b/app/src/main/res/drawable/roman_numeral_8.xml deleted file mode 100644 index e0c4104..0000000 --- a/app/src/main/res/drawable/roman_numeral_8.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/drawable/roman_numeral_9.xml b/app/src/main/res/drawable/roman_numeral_9.xml deleted file mode 100644 index 2cc5736..0000000 --- a/app/src/main/res/drawable/roman_numeral_9.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/src/main/res/layout-land/orientation_demo.xml b/app/src/main/res/layout-land/orientation_demo.xml new file mode 100644 index 0000000..65dec93 --- /dev/null +++ b/app/src/main/res/layout-land/orientation_demo.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index d740acb..30b029b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -2,23 +2,10 @@ - - - - + app:title="bingo 3" /> - + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/appBarLayout2"> + + + +