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/AboutFragment.java | 18 ++++++++++ .../brysonsteck/wiimmfiwatcher/MainActivity.java | 24 ++++++------- .../wiimmfiwatcher/WatchCodeAdapter.java | 19 ++++++----- app/src/main/res/layout/about_fragment.xml | 38 +++++++++++++++++++++ app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/menu/top_app_bar.xml | 2 +- .../mipmap-anydpi-v26/wiimmterface_launcher.xml | 5 --- .../wiimmterface_launcher_round.xml | 5 --- .../main/res/mipmap-hdpi/wiimmterface_launcher.png | Bin 9446 -> 0 bytes .../wiimmterface_launcher_background.png | Bin 47728 -> 0 bytes .../wiimmterface_launcher_foreground.png | Bin 38928 -> 0 bytes .../mipmap-hdpi/wiimmterface_launcher_round.png | Bin 10825 -> 0 bytes .../main/res/mipmap-mdpi/wiimmterface_launcher.png | Bin 4894 -> 0 bytes .../wiimmterface_launcher_background.png | Bin 24252 -> 0 bytes .../wiimmterface_launcher_foreground.png | Bin 19831 -> 0 bytes .../mipmap-mdpi/wiimmterface_launcher_round.png | Bin 5454 -> 0 bytes .../res/mipmap-xhdpi/wiimmterface_launcher.png | Bin 15552 -> 0 bytes .../wiimmterface_launcher_background.png | Bin 76009 -> 0 bytes .../wiimmterface_launcher_foreground.png | Bin 62079 -> 0 bytes .../mipmap-xhdpi/wiimmterface_launcher_round.png | Bin 17643 -> 0 bytes .../res/mipmap-xxhdpi/wiimmterface_launcher.png | Bin 30067 -> 0 bytes .../wiimmterface_launcher_background.png | Bin 147804 -> 0 bytes .../wiimmterface_launcher_foreground.png | Bin 119513 -> 0 bytes .../mipmap-xxhdpi/wiimmterface_launcher_round.png | Bin 34164 -> 0 bytes .../res/mipmap-xxxhdpi/wiimmterface_launcher.png | Bin 48049 -> 0 bytes .../wiimmterface_launcher_background.png | Bin 236282 -> 0 bytes .../wiimmterface_launcher_foreground.png | Bin 189748 -> 0 bytes .../mipmap-xxxhdpi/wiimmterface_launcher_round.png | Bin 55023 -> 0 bytes 28 files changed, 80 insertions(+), 33 deletions(-) create mode 100644 app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java create mode 100644 app/src/main/res/layout/about_fragment.xml delete mode 100644 app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher.xml delete mode 100644 app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher_round.xml delete mode 100644 app/src/main/res/mipmap-hdpi/wiimmterface_launcher.png delete mode 100644 app/src/main/res/mipmap-hdpi/wiimmterface_launcher_background.png delete mode 100644 app/src/main/res/mipmap-hdpi/wiimmterface_launcher_foreground.png delete mode 100644 app/src/main/res/mipmap-hdpi/wiimmterface_launcher_round.png delete mode 100644 app/src/main/res/mipmap-mdpi/wiimmterface_launcher.png delete mode 100644 app/src/main/res/mipmap-mdpi/wiimmterface_launcher_background.png delete mode 100644 app/src/main/res/mipmap-mdpi/wiimmterface_launcher_foreground.png delete mode 100644 app/src/main/res/mipmap-mdpi/wiimmterface_launcher_round.png delete mode 100644 app/src/main/res/mipmap-xhdpi/wiimmterface_launcher.png delete mode 100644 app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_background.png delete mode 100644 app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_foreground.png delete mode 100644 app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_round.png delete mode 100644 app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher.png delete mode 100644 app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_background.png delete mode 100644 app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_foreground.png delete mode 100644 app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_round.png delete mode 100644 app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher.png delete mode 100644 app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_background.png delete mode 100644 app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_foreground.png delete mode 100644 app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_round.png (limited to 'app/src') diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java new file mode 100644 index 0000000..7851977 --- /dev/null +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java @@ -0,0 +1,18 @@ +package me.brysonsteck.wiimmfiwatcher; + +import android.os.Bundle; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +public class AboutFragment extends Fragment { + public AboutFragment() { super(R.layout.about_fragment); } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + } + +} 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 diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java index beb684f..715dce8 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeAdapter.java @@ -12,20 +12,20 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.button.MaterialButton; +import java.util.ArrayList; + import me.brysonsteck.wiimmfiwatcher.model.FriendCode; import me.brysonsteck.wiimmfiwatcher.wiimmfi.WiimmfiActivity; public class WatchCodeAdapter extends RecyclerView.Adapter{ ObservableArrayList entries; - OnFriendCodeClicked listener; Context context; - public interface OnFriendCodeClicked { - public void onClick(FriendCode entry); - } + ArrayList recentCodes; public WatchCodeAdapter(Context context, ObservableArrayList entries) { this.context = context; this.entries = entries; + this.recentCodes = new ArrayList<>(); } @NonNull @@ -37,16 +37,17 @@ public class WatchCodeAdapter extends RecyclerView.Adapter { - Intent intent = new Intent(view.getContext(), WiimmfiActivity.class); - intent.putExtra("friendCode", currentFC.friendCode); - context.startActivity(intent); + Intent intent = new Intent(view.getContext(), WiimmfiActivity.class); + intent.putExtra("friendCode", currentFC); + context.startActivity(intent); }); } + @Override public int getItemCount() { return entries.size(); diff --git a/app/src/main/res/layout/about_fragment.xml b/app/src/main/res/layout/about_fragment.xml new file mode 100644 index 0000000..0aeaf42 --- /dev/null +++ b/app/src/main/res/layout/about_fragment.xml @@ -0,0 +1,38 @@ + + + + + + + + + \ 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 05b6e5b..109efae 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -27,7 +27,7 @@ android:background="@android:color/transparent" android:elevation="0dp" app:menu="@menu/top_app_bar" - app:title="Wiimmfi Friend Codes" /> + app:title="Wiimmfi Watcher" /> diff --git a/app/src/main/res/menu/top_app_bar.xml b/app/src/main/res/menu/top_app_bar.xml index 333c537..845eaf4 100644 --- a/app/src/main/res/menu/top_app_bar.xml +++ b/app/src/main/res/menu/top_app_bar.xml @@ -2,7 +2,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> diff --git a/app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher.xml deleted file mode 100644 index a4bb6d8..0000000 --- a/app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher_round.xml deleted file mode 100644 index a4bb6d8..0000000 --- a/app/src/main/res/mipmap-anydpi-v26/wiimmterface_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher.png b/app/src/main/res/mipmap-hdpi/wiimmterface_launcher.png deleted file mode 100644 index ce2639b..0000000 Binary files a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_background.png b/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_background.png deleted file mode 100644 index a35463a..0000000 Binary files a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_foreground.png deleted file mode 100644 index d6474db..0000000 Binary files a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_round.png b/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_round.png deleted file mode 100644 index f9ec766..0000000 Binary files a/app/src/main/res/mipmap-hdpi/wiimmterface_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher.png b/app/src/main/res/mipmap-mdpi/wiimmterface_launcher.png deleted file mode 100644 index 784627c..0000000 Binary files a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_background.png b/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_background.png deleted file mode 100644 index 9566638..0000000 Binary files a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_foreground.png deleted file mode 100644 index d35200b..0000000 Binary files a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_round.png b/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_round.png deleted file mode 100644 index a339830..0000000 Binary files a/app/src/main/res/mipmap-mdpi/wiimmterface_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher.png b/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher.png deleted file mode 100644 index 04763a2..0000000 Binary files a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_background.png b/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_background.png deleted file mode 100644 index 4ceed80..0000000 Binary files a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_foreground.png deleted file mode 100644 index fd6b165..0000000 Binary files a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_round.png b/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_round.png deleted file mode 100644 index 4511570..0000000 Binary files a/app/src/main/res/mipmap-xhdpi/wiimmterface_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher.png b/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher.png deleted file mode 100644 index 5dabe1d..0000000 Binary files a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_background.png b/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_background.png deleted file mode 100644 index 64ca114..0000000 Binary files a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_foreground.png deleted file mode 100644 index 2da86e4..0000000 Binary files a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_round.png deleted file mode 100644 index b7b5e4c..0000000 Binary files a/app/src/main/res/mipmap-xxhdpi/wiimmterface_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher.png b/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher.png deleted file mode 100644 index a413f9f..0000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_background.png b/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_background.png deleted file mode 100644 index 8b8fd76..0000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_background.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_foreground.png deleted file mode 100644 index 4e6dd6c..0000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_round.png deleted file mode 100644 index 4bb5f6d..0000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/wiimmterface_launcher_round.png and /dev/null differ -- cgit v1.2.3