From 2c540ef7ce473fbd681c42959a51224be4784eb7 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sat, 8 May 2021 18:01:47 -0600 Subject: added about fragment --- .../brysonsteck/wiimmfiwatcher/MainActivity.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java') diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java index 31f74fd..e48486e 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java @@ -1,7 +1,9 @@ package me.brysonsteck.wiimmfiwatcher; +import android.content.ClipData; import android.os.Bundle; +import android.view.View; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.ObservableArrayList; @@ -15,18 +17,6 @@ public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); -// FragmentContainerView fcInput = findViewById(R.id.room_fragment); -// this.database = Room.databaseBuilder(this, AppDatabase.class, "friend-codes-db").build(); -// new Thread(() -> { -// try { -// Thread.sleep(1000); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } -// recentFCList.addAll(database.getFriendCodeDao().getAll()); -// }).start(); - - if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() @@ -37,5 +27,15 @@ public class MainActivity extends AppCompatActivity { } setContentView(R.layout.activity_main); + View aboutButton = findViewById(R.id.about_button); + + aboutButton.setOnClickListener((about) -> { + getSupportFragmentManager().beginTransaction() + .replace(R.id.friend_code_input_fragment, new AboutFragment(), null) + .setReorderingAllowed(true) + .addToBackStack(null) + .commit(); + }); + } } \ No newline at end of file -- cgit v1.2.3