From 31430df5989d2b3014633912be5d27485d3e3a25 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 12 Feb 2024 17:20:05 +0100 Subject: main activity tablet/horizontal layout done --- app/build.gradle.kts | 10 +++- app/src/main/AndroidManifest.xml | 3 - .../lonkaars/bingo3/DisplayMessageActivity.java | 22 -------- .../java/com/lonkaars/bingo3/MainActivity.java | 14 ++--- 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 + .../main/res/layout/activity_display_message.xml | 12 ---- app/src/main/res/layout/activity_main.xml | 64 +++++++++++++++++----- .../main/res/layout/header_navigation_drawer.xml | 26 +++++++++ app/src/main/res/menu/navigation_drawer.xml | 40 ++++++++++++++ app/src/main/res/values-night/themes.xml | 7 --- app/src/main/res/values/strings.xml | 11 ++++ app/src/main/res/values/themes.xml | 9 +++ 21 files changed, 158 insertions(+), 70 deletions(-) delete mode 100644 app/src/main/java/com/lonkaars/bingo3/DisplayMessageActivity.java create mode 100644 app/src/main/res/drawable/menu.xml create mode 100644 app/src/main/res/drawable/roman_numeral_1.xml create mode 100644 app/src/main/res/drawable/roman_numeral_2.xml create mode 100644 app/src/main/res/drawable/roman_numeral_3.xml create mode 100644 app/src/main/res/drawable/roman_numeral_4.xml create mode 100644 app/src/main/res/drawable/roman_numeral_5.xml create mode 100644 app/src/main/res/drawable/roman_numeral_6.xml create mode 100644 app/src/main/res/drawable/roman_numeral_7.xml create mode 100644 app/src/main/res/drawable/roman_numeral_8.xml create mode 100644 app/src/main/res/drawable/roman_numeral_9.xml delete mode 100644 app/src/main/res/layout/activity_display_message.xml create mode 100644 app/src/main/res/layout/header_navigation_drawer.xml create mode 100644 app/src/main/res/menu/navigation_drawer.xml delete mode 100644 app/src/main/res/values-night/themes.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 17e3326..788eafb 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -26,13 +26,21 @@ android { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } + buildFeatures { + viewBinding = true + } } dependencies { implementation("androidx.appcompat:appcompat:1.6.1") - implementation("com.google.android.material:material:1.9.0") + implementation("com.google.android.material:material:1.11.0") implementation("androidx.constraintlayout:constraintlayout:2.1.4") + implementation("androidx.drawerlayout:drawerlayout:1.2.0") + implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0") + 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") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8f8a7c3..08e7139 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,9 +12,6 @@ android:supportsRtl="true" android:theme="@style/Theme.Bingo3" tools:targetApi="31"> - diff --git a/app/src/main/java/com/lonkaars/bingo3/DisplayMessageActivity.java b/app/src/main/java/com/lonkaars/bingo3/DisplayMessageActivity.java deleted file mode 100644 index d2c12f1..0000000 --- a/app/src/main/java/com/lonkaars/bingo3/DisplayMessageActivity.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.lonkaars.bingo3; - -import androidx.appcompat.app.AppCompatActivity; - -import android.content.Intent; -import android.os.Bundle; -import android.widget.TextView; - -public class DisplayMessageActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_display_message); - - Intent intent = getIntent(); - String message = intent.getStringExtra(Intent.EXTRA_TEXT); - - TextView textView = findViewById(R.id.textView); - textView.setText(message); - } -} diff --git a/app/src/main/java/com/lonkaars/bingo3/MainActivity.java b/app/src/main/java/com/lonkaars/bingo3/MainActivity.java index 5e75ecd..495811d 100644 --- a/app/src/main/java/com/lonkaars/bingo3/MainActivity.java +++ b/app/src/main/java/com/lonkaars/bingo3/MainActivity.java @@ -5,22 +5,16 @@ 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); } - - public void send(View view) { - EditText editText = findViewById(R.id.edit_message); - String message = editText.getText().toString(); - - Intent intent = new Intent(this, DisplayMessageActivity.class); - intent.putExtra(Intent.EXTRA_TEXT, message); - startActivity(intent); - } } diff --git a/app/src/main/res/drawable/menu.xml b/app/src/main/res/drawable/menu.xml new file mode 100644 index 0000000..2623a2b --- /dev/null +++ b/app/src/main/res/drawable/menu.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..4476568 --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_1.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..15bb3dc --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_2.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..f8a7934 --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_3.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..c620710 --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_4.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..93f876c --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_5.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..22ce4de --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_6.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..68768cf --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_7.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..e0c4104 --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_8.xml @@ -0,0 +1 @@ + \ 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 new file mode 100644 index 0000000..2cc5736 --- /dev/null +++ b/app/src/main/res/drawable/roman_numeral_9.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_display_message.xml b/app/src/main/res/layout/activity_display_message.xml deleted file mode 100644 index c44487f..0000000 --- a/app/src/main/res/layout/activity_display_message.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index fe42b62..d740acb 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,20 +1,54 @@ - - + android:layout_height="match_parent"> -