aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/me
diff options
context:
space:
mode:
authorBryson Steck <steck.bryson@gmail.com>2021-08-11 22:05:39 -0600
committerBryson Steck <steck.bryson@gmail.com>2021-08-11 22:05:39 -0600
commitfb51cefd42871cc470253edbe9616706bfbd2361 (patch)
tree060d8848a9a630ffe2a1b41442c6f746822f9e12 /app/src/main/java/me
parent5977cfeb9bfe5efcc3457d3fdf2d10f24e5ac395 (diff)
downloadwiimmfi-watcher-fb51cefd42871cc470253edbe9616706bfbd2361.tar
wiimmfi-watcher-fb51cefd42871cc470253edbe9616706bfbd2361.tar.gz
wiimmfi-watcher-fb51cefd42871cc470253edbe9616706bfbd2361.tar.bz2
figured out preferences, going to bed now
Diffstat (limited to 'app/src/main/java/me')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java32
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/ParseSettings.java4
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/SettingsFragment.java4
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/ParseSettings.java4
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsActivity.java18
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsMainFragment.java6
6 files changed, 45 insertions, 23 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
index 878de62..714aee7 100644
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java
@@ -14,8 +14,8 @@ import androidx.room.Room;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import me.brysonsteck.wiimmfiwatcher.database.AppDatabase;
-import me.brysonsteck.wiimmfiwatcher.fragments.AboutFragment;
import me.brysonsteck.wiimmfiwatcher.fragments.WatchCodeFragment;
+import me.brysonsteck.wiimmfiwatcher.settings.SettingsActivity;
public class MainActivity extends AppCompatActivity {
AppDatabase database;
@@ -28,9 +28,9 @@ public class MainActivity extends AppCompatActivity {
setContentView(R.layout.activity_main);
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
- View aboutButton = findViewById(R.id.about_button);
+ View settingsButton = findViewById(R.id.settings_button);
if (savedInstanceState == null) {
- aboutButton.setVisibility(View.VISIBLE);
+ settingsButton.setVisibility(View.VISIBLE);
getSupportFragmentManager().beginTransaction()
.replace(R.id.friend_code_input_fragment, new WatchCodeFragment(), null)
.setReorderingAllowed(true)
@@ -39,18 +39,20 @@ public class MainActivity extends AppCompatActivity {
database = Room.databaseBuilder(this, AppDatabase.class, "friend-codes-db").build();
- aboutButton.setOnClickListener((about) -> {
- aboutButton.setVisibility(View.INVISIBLE);
- getSupportFragmentManager().beginTransaction()
- .setCustomAnimations(
- R.anim.slide_in,
- R.anim.fade_out,
- R.anim.fade_in,
- R.anim.slide_out)
- .replace(R.id.friend_code_input_fragment, new AboutFragment(), null)
- .setReorderingAllowed(true)
- .addToBackStack(null)
- .commit();
+ settingsButton.setOnClickListener((about) -> {
+// settingsButton.setVisibility(View.INVISIBLE);
+// getSupportFragmentManager().beginTransaction()
+// .setCustomAnimations(
+// R.anim.slide_in,
+// R.anim.fade_out,
+// R.anim.fade_in,
+// R.anim.slide_out)
+// .replace(R.id.friend_code_input_fragment, new AboutFragment(), null)
+// .setReorderingAllowed(true)
+// .addToBackStack(null)
+// .commit();
+ Intent intent = new Intent(this, SettingsActivity.class);
+ startActivity(intent);
});
}
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/ParseSettings.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/ParseSettings.java
deleted file mode 100644
index 78ecced..0000000
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/ParseSettings.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package me.brysonsteck.wiimmfiwatcher.preferences;
-
-public class ParseSettings {
-}
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/SettingsFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/SettingsFragment.java
deleted file mode 100644
index e24236b..0000000
--- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/preferences/SettingsFragment.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package me.brysonsteck.wiimmfiwatcher.preferences;
-
-public class SettingsFragment {
-}
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/ParseSettings.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/ParseSettings.java
new file mode 100644
index 0000000..9268bd2
--- /dev/null
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/ParseSettings.java
@@ -0,0 +1,4 @@
+package me.brysonsteck.wiimmfiwatcher.settings;
+
+public class ParseSettings {
+}
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsActivity.java
new file mode 100644
index 0000000..076d6c0
--- /dev/null
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsActivity.java
@@ -0,0 +1,18 @@
+package me.brysonsteck.wiimmfiwatcher.settings;
+
+import android.os.Bundle;
+import android.preference.PreferenceFragment;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.preference.PreferenceFragmentCompat;
+
+import me.brysonsteck.wiimmfiwatcher.R;
+
+public class SettingsActivity extends PreferenceFragmentCompat {
+ @Override
+ public void onCreatePreferences(Bundle savedInstanceState, String rootkey) {
+ super.onCreate(savedInstanceState);
+ setPreferencesFromResource(R.xml.preferences, rootkey);
+ }
+}
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsMainFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsMainFragment.java
new file mode 100644
index 0000000..6f9414f
--- /dev/null
+++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/settings/SettingsMainFragment.java
@@ -0,0 +1,6 @@
+package me.brysonsteck.wiimmfiwatcher.settings;
+
+import androidx.fragment.app.Fragment;
+
+public class SettingsMainFragment extends Fragment {
+}