From 793241fe47c09c63e2a2e5a4429deed8e7401754 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Mon, 10 May 2021 12:54:31 -0600 Subject: added todo list file, app icon and implemented about fragment --- app/src/main/AndroidManifest.xml | 4 +- app/src/main/ic_watcher_icons-playstore.png | Bin 0 -> 252507 bytes .../brysonsteck/wiimmfiwatcher/AboutFragment.java | 43 ++++++++---- .../brysonsteck/wiimmfiwatcher/MainActivity.java | 32 +++++---- .../wiimmfiwatcher/WatchCodeFragment.java | 5 +- .../res/drawable/ic_watcher_icons_background.xml | 74 +++++++++++++++++++++ app/src/main/res/layout/activity_main.xml | 28 ++++---- .../main/res/layout/friend_code_input_fragment.xml | 9 +-- app/src/main/res/menu/top_app_bar.xml | 1 + .../res/mipmap-anydpi-v26/ic_watcher_icons.xml | 5 ++ .../mipmap-anydpi-v26/ic_watcher_icons_round.xml | 5 ++ app/src/main/res/mipmap-hdpi/ic_watcher_icons.png | Bin 0 -> 9397 bytes .../mipmap-hdpi/ic_watcher_icons_foreground.png | Bin 0 -> 25746 bytes .../res/mipmap-hdpi/ic_watcher_icons_round.png | Bin 0 -> 11576 bytes app/src/main/res/mipmap-mdpi/ic_watcher_icons.png | Bin 0 -> 4810 bytes .../mipmap-mdpi/ic_watcher_icons_foreground.png | Bin 0 -> 12898 bytes .../res/mipmap-mdpi/ic_watcher_icons_round.png | Bin 0 -> 5739 bytes app/src/main/res/mipmap-xhdpi/ic_watcher_icons.png | Bin 0 -> 15572 bytes .../mipmap-xhdpi/ic_watcher_icons_foreground.png | Bin 0 -> 40827 bytes .../res/mipmap-xhdpi/ic_watcher_icons_round.png | Bin 0 -> 19167 bytes .../main/res/mipmap-xxhdpi/ic_watcher_icons.png | Bin 0 -> 29933 bytes .../mipmap-xxhdpi/ic_watcher_icons_foreground.png | Bin 0 -> 76061 bytes .../res/mipmap-xxhdpi/ic_watcher_icons_round.png | Bin 0 -> 37321 bytes .../main/res/mipmap-xxxhdpi/ic_watcher_icons.png | Bin 0 -> 47579 bytes .../mipmap-xxxhdpi/ic_watcher_icons_foreground.png | Bin 0 -> 114545 bytes .../res/mipmap-xxxhdpi/ic_watcher_icons_round.png | Bin 0 -> 59568 bytes app/src/main/res/values-night/themes.xml | 4 +- app/src/main/res/values/colors.xml | 3 +- app/src/main/res/values/strings.xml | 2 +- app/src/main/res/values/themes.xml | 4 +- 30 files changed, 165 insertions(+), 54 deletions(-) create mode 100644 app/src/main/ic_watcher_icons-playstore.png create mode 100644 app/src/main/res/drawable/ic_watcher_icons_background.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_watcher_icons.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_watcher_icons_foreground.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_watcher_icons_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_watcher_icons.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_watcher_icons_foreground.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_watcher_icons_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_watcher_icons.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_watcher_icons_foreground.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_watcher_icons_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_watcher_icons.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_foreground.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_foreground.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_round.png (limited to 'app') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index aaf7fd9..bae710f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,9 +6,9 @@ diff --git a/app/src/main/ic_watcher_icons-playstore.png b/app/src/main/ic_watcher_icons-playstore.png new file mode 100644 index 0000000..b06bb01 Binary files /dev/null and b/app/src/main/ic_watcher_icons-playstore.png differ diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java index 4cd51fd..c74c8c5 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java @@ -11,14 +11,25 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; +import com.google.android.material.appbar.MaterialToolbar; + public class AboutFragment extends Fragment { - public AboutFragment() { super(R.layout.about_fragment); } + View aboutButton; + MaterialToolbar toolbar; + + public AboutFragment() { + super(R.layout.about_fragment); + } @SuppressLint("SetTextI18n") @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + aboutButton = getActivity().findViewById(R.id.about_button); + toolbar = getActivity().findViewById(R.id.toolbar); + toolbar.setTitle("About Wiimmfi Watcher"); + TextView aboutWatcher = view.findViewById(R.id.about_watcher_text); TextView aboutMe = view.findViewById(R.id.about_me_text); TextView github = view.findViewById(R.id.github_text); @@ -31,18 +42,15 @@ public class AboutFragment extends Fragment { "Free and open source, you can watch your Wiimmfi Mario Kart Wii matches on your phone in a quick and easy way. " + ""); - aboutMe.setText("Hi there! My name is Bryson Steck. I am a student studying Computer Science at Utah State University. This is my first official application that I'm maintaining. " + + aboutMe.setText("Hi there! My name is Bryson Steck. I am a student studying Computer Science. This is my first official application that I'm maintaining. " + "This whole \"application on the Google Play Store\" thing is new to me, so please be patient as I am learning how to maintain something like this. " + - "I hope you enjoy my first application!"); + "I hope you enjoy!"); github.setClickable(true); github.setMovementMethod(LinkMovementMethod.getInstance()); - String githubLink = "here."; -// github.setText("All of the code in this project is open source on my GitHub repository " + Html.fromHtml(githubLink) + " You are free to use this code and expand upon it under the GNU General Public License."); github.setText(R.string.github); -// donations.setMovementMethod(LinkMovementMethod.getInstance()); -// String donationsLink = "here."; + donations.setText("Since this application is free and the code is open source, I do not receive income from maintaining this app. Because of that, I'd appreciate any donation in the following methods:\n\n" + "PayPal: @bryzinga\n" + "Venmo: @brysonsteck\n" + @@ -53,12 +61,23 @@ public class AboutFragment extends Fragment { contact.setText("If you would like to get ahold of me for any reason unrelated to bug reports or this app in general, you can contact me through email at steck.bryson@gmail.com " + "or on Discord at bryzinga#9971."); -// String todoList = "todo list."; -// String issueGithub = "here."; -// bugs.setText("Speaking of bugs, did you find a bug? First, make sure that the issue you found is not listed on my " + Html.fromHtml(todoList) + -// "It's possible I'm already aware of it or working on it. If your issue is not addressed on the todo list, then you can create an issue on my GitHub repository " + Html.fromHtml(issueGithub) + -// "If you aren't sure how to use GitHub, you can also fill out this Google Forum."); + bugs.setClickable(true); + bugs.setMovementMethod(LinkMovementMethod.getInstance()); + bugs.setText(R.string.bugs); } + @Override + public void onStop() { + super.onStop(); + aboutButton.setVisibility(View.VISIBLE); + toolbar.setTitle("Wiimmfi Watcher"); + } + @Override + public void onResume() { + super.onResume(); + aboutButton.setVisibility(View.INVISIBLE); + toolbar.setTitle("About Wiimmfi Watcher"); + } + } diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java index c3933ee..d935d48 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java @@ -24,8 +24,12 @@ public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + View aboutButton = findViewById(R.id.about_button); if (savedInstanceState == null) { + aboutButton.setVisibility(View.VISIBLE); getSupportFragmentManager().beginTransaction() .replace(R.id.friend_code_input_fragment, new WatchCodeFragment(), null) .setReorderingAllowed(true) @@ -33,25 +37,25 @@ public class MainActivity extends AppCompatActivity { } - setContentView(R.layout.activity_main); database = Room.databaseBuilder(this, AppDatabase.class, "friend-codes-db").build(); - View aboutButton = findViewById(R.id.about_button); - ExtendedFloatingActionButton clearButton = findViewById(R.id.clear_button); - FriendCodeViewModel viewModel = new ViewModelProvider(MainActivity.this).get(FriendCodeViewModel.class); - clearButton.setOnClickListener(new View.OnClickListener() { - - @Override - public void onClick(View view) { - new Thread(() -> { - database.clearAllTables(); - database.query(new SimpleSQLiteQuery("DELETE FROM friendcode")); - }); - } - }); +// aboutButton.setVisibility(View.INVISIBLE); +// ExtendedFloatingActionButton clearButton = findViewById(R.id.clear_button); + FriendCodeViewModel viewModel = new ViewModelProvider(MainActivity.this).get(FriendCodeViewModel.class); +// clearButton.setOnClickListener(new View.OnClickListener() { +// +// +// @Override +// public void onClick(View view) { +// getApplicationContext().deleteDatabase("friend-codes-db"); +// database = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "friend-codes-db").build(); +// } +// }); aboutButton.setOnClickListener((about) -> { +// aboutButton.setClickable(false); + aboutButton.setVisibility(View.INVISIBLE); getSupportFragmentManager().beginTransaction() .replace(R.id.friend_code_input_fragment, new AboutFragment(), null) .setReorderingAllowed(true) diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java index 414519c..465cccf 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java @@ -84,7 +84,10 @@ public class WatchCodeFragment extends Fragment { } }); RecyclerView recyclerView = view.findViewById(R.id.recent_friend_codes_recycler_view); - recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()); + linearLayoutManager.setReverseLayout(true); + linearLayoutManager.setStackFromEnd(true); + recyclerView.setLayoutManager(linearLayoutManager); recyclerView.setAdapter(adapter); Button watchButton = view.findViewById(R.id.watch_button); EditText friendCode = view.findViewById(R.id.friend_code_edit_text); diff --git a/app/src/main/res/drawable/ic_watcher_icons_background.xml b/app/src/main/res/drawable/ic_watcher_icons_background.xml new file mode 100644 index 0000000..ca3826a --- /dev/null +++ b/app/src/main/res/drawable/ic_watcher_icons_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1e15f02..1116b4b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -44,20 +44,20 @@ android:hapticFeedbackEnabled="false" app:layout_constraintTop_toBottomOf="@+id/friend_code_input_fragment" /> - + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/friend_code_input_fragment.xml b/app/src/main/res/layout/friend_code_input_fragment.xml index 4421a65..0dcf568 100644 --- a/app/src/main/res/layout/friend_code_input_fragment.xml +++ b/app/src/main/res/layout/friend_code_input_fragment.xml @@ -56,9 +56,10 @@ + android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/textView3" /> \ No newline at end of file diff --git a/app/src/main/res/menu/top_app_bar.xml b/app/src/main/res/menu/top_app_bar.xml index 845eaf4..0b2e0aa 100644 --- a/app/src/main/res/menu/top_app_bar.xml +++ b/app/src/main/res/menu/top_app_bar.xml @@ -5,6 +5,7 @@ android:id="@+id/about_button" android:icon="@drawable/ic_baseline_info_24" android:title="About" + android:visible="true" app:showAsAction="ifRoom" /> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons.xml b/app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons.xml new file mode 100644 index 0000000..e813a3f --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons_round.xml new file mode 100644 index 0000000..e813a3f --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_watcher_icons_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_watcher_icons.png b/app/src/main/res/mipmap-hdpi/ic_watcher_icons.png new file mode 100644 index 0000000..155a208 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_watcher_icons.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_watcher_icons_foreground.png b/app/src/main/res/mipmap-hdpi/ic_watcher_icons_foreground.png new file mode 100644 index 0000000..fe9360c Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_watcher_icons_foreground.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_watcher_icons_round.png b/app/src/main/res/mipmap-hdpi/ic_watcher_icons_round.png new file mode 100644 index 0000000..5530efc Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_watcher_icons_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_watcher_icons.png b/app/src/main/res/mipmap-mdpi/ic_watcher_icons.png new file mode 100644 index 0000000..f7fd03e Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_watcher_icons.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_watcher_icons_foreground.png b/app/src/main/res/mipmap-mdpi/ic_watcher_icons_foreground.png new file mode 100644 index 0000000..605df09 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_watcher_icons_foreground.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_watcher_icons_round.png b/app/src/main/res/mipmap-mdpi/ic_watcher_icons_round.png new file mode 100644 index 0000000..4161cb8 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_watcher_icons_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_watcher_icons.png b/app/src/main/res/mipmap-xhdpi/ic_watcher_icons.png new file mode 100644 index 0000000..9d7811c Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_watcher_icons.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_watcher_icons_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_watcher_icons_foreground.png new file mode 100644 index 0000000..6c156f7 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_watcher_icons_foreground.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_watcher_icons_round.png b/app/src/main/res/mipmap-xhdpi/ic_watcher_icons_round.png new file mode 100644 index 0000000..6693089 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_watcher_icons_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons.png b/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons.png new file mode 100644 index 0000000..1bafe3a Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_foreground.png new file mode 100644 index 0000000..074ca58 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_foreground.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_round.png b/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_round.png new file mode 100644 index 0000000..da6a227 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_watcher_icons_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons.png b/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons.png new file mode 100644 index 0000000..2e04328 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_foreground.png new file mode 100644 index 0000000..329a488 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_foreground.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_round.png new file mode 100644 index 0000000..4752fc7 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_watcher_icons_round.png differ diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 359a761..efb6bec 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -6,8 +6,8 @@ @color/purple_700 @color/black - @color/teal_200 - @color/teal_200 + @color/blue_200 + @color/blue_200 @color/black ?attr/colorPrimaryVariant diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index e3b20f7..f508026 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,8 +3,7 @@ #FFBB86FC #FF6200EE #FF3700B3 - #FF03DAC5 - #FF018786 + #42A5F5 #FF000000 #FFFFFFFF #1E88E5 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 88268f7..2a6f8a6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ Wiimmfi All of the code in this project is open source on my GitHub repository here. You are free to use this code and expand upon it under the GNU General Public License. - Speaking of bugs, did you find a bug? First, make sure that the issue you found is not listed on my todo list. It\'s possible I\'m already aware of it or working on it. If your issue is not addressed on the todo list, then you can create an issue on my GitHub repository here. If you aren\'t sure how to use GitHub, you can also fill out this Google Forum. + Speaking of bugs, did you find a bug? First, make sure that the issue you found is not listed on my todo list. It\'s possible I\'m already aware of it or working on it. If your issue is not addressed on the todo list, then you can create an issue on my GitHub repository here. If you don\'t know how to use GitHub, you can fill out this Google Form instead. \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 48628ef..b166e7b 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -6,8 +6,8 @@ #0D47A1 @color/white - @color/teal_200 - @color/teal_700 + @color/blue_200 + @color/blue_200 @color/black ?attr/colorPrimaryVariant -- cgit v1.2.3