diff options
51 files changed, 142 insertions, 15 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bae710f..550b3db 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,7 +18,8 @@ <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity android:name=".wiimmfi.WiimmfiActivity"/> + <activity android:name=".wiimmfi.WiimmfiActivity" + android:theme="@style/Theme.WiimmfiWatcher.Watching"/> </application> </manifest>
\ No newline at end of file diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java index e98856b..1657e38 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java @@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.room.Room; import com.google.android.material.dialog.MaterialAlertDialogBuilder; +import com.google.android.material.tabs.TabLayout; import me.brysonsteck.wiimmfiwatcher.database.AppDatabase; import me.brysonsteck.wiimmfiwatcher.fragments.AboutFragment; @@ -31,7 +32,7 @@ public class MainActivity extends AppCompatActivity { if (savedInstanceState == null) { aboutButton.setVisibility(View.VISIBLE); getSupportFragmentManager().beginTransaction() - .replace(R.id.friend_code_input_fragment, new WatchCodeFragment(), null) + .replace(R.id.friend_code_input_fragment, new WatchCodeFragment(true), null) .setReorderingAllowed(true) .commit(); } @@ -52,6 +53,36 @@ public class MainActivity extends AppCompatActivity { .commit(); }); +// TabLayout tabLayout = findViewById(R.id.tablayout_main); +// tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { +// @Override +// public void onTabSelected(TabLayout.Tab tab) { +// if (tab.getText().equals("Friend Code")) { +// getSupportFragmentManager().beginTransaction() +// .replace(R.id.friend_code_input_fragment, new WatchCodeFragment(true), null) +// .setReorderingAllowed(true) +// .commit(); +// +// } +// else if (tab.getText().equals("Mii Name")) { +// getSupportFragmentManager().beginTransaction() +// .replace(R.id.friend_code_input_fragment, new WatchCodeFragment(false), null) +// .setReorderingAllowed(true) +// .commit(); +// } +// } + +// @Override +// public void onTabUnselected(TabLayout.Tab tab) { +// +// } +// +// @Override +// public void onTabReselected(TabLayout.Tab tab) { +// +// } +// }); +// } @Override diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/fragments/WatchCodeFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/fragments/WatchCodeFragment.java index 2687518..2a63379 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/fragments/WatchCodeFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/fragments/WatchCodeFragment.java @@ -27,9 +27,11 @@ import me.brysonsteck.wiimmfiwatcher.wiimmfi.WiimmfiActivity; public class WatchCodeFragment extends Fragment { ProgressDialog progressBar; + boolean friendCodeMode = true; - public WatchCodeFragment() { + public WatchCodeFragment(boolean friendCodeMode) { super(R.layout.watch_code_fragment); + this.friendCodeMode = friendCodeMode; } public boolean isValidFriendCode(String friendCode) { @@ -107,6 +109,9 @@ public class WatchCodeFragment extends Fragment { recyclerView.setAdapter(adapter); EditText friendCode = view.findViewById(R.id.friend_code_edit_text); + if (!friendCodeMode) { + friendCode.setHint(R.string.enter_mii); + } Button watchButton = view.findViewById(R.id.watch_button); watchButton.setOnClickListener(buttonClick -> { startWiimmfiActivity( diff --git a/app/src/main/res/drawable/battle_bp.jpg b/app/src/main/res/drawable/battle_bp.jpg Binary files differnew file mode 100644 index 0000000..1c3e4fb --- /dev/null +++ b/app/src/main/res/drawable/battle_bp.jpg diff --git a/app/src/main/res/drawable/battle_ccw.jpg b/app/src/main/res/drawable/battle_ccw.jpg Binary files differnew file mode 100644 index 0000000..50c5c69 --- /dev/null +++ b/app/src/main/res/drawable/battle_ccw.jpg diff --git a/app/src/main/res/drawable/battle_dp.jpg b/app/src/main/res/drawable/battle_dp.jpg Binary files differnew file mode 100644 index 0000000..2746023 --- /dev/null +++ b/app/src/main/res/drawable/battle_dp.jpg diff --git a/app/src/main/res/drawable/battle_fs.jpg b/app/src/main/res/drawable/battle_fs.jpg Binary files differnew file mode 100644 index 0000000..644aa3e --- /dev/null +++ b/app/src/main/res/drawable/battle_fs.jpg diff --git a/app/src/main/res/drawable/battle_rbc3.jpg b/app/src/main/res/drawable/battle_rbc3.jpg Binary files differnew file mode 100644 index 0000000..4f4ef46 --- /dev/null +++ b/app/src/main/res/drawable/battle_rbc3.jpg diff --git a/app/src/main/res/drawable/battle_rbc4.jpg b/app/src/main/res/drawable/battle_rbc4.jpg Binary files differnew file mode 100644 index 0000000..807c6db --- /dev/null +++ b/app/src/main/res/drawable/battle_rbc4.jpg diff --git a/app/src/main/res/drawable/battle_rcl.jpg b/app/src/main/res/drawable/battle_rcl.jpg Binary files differnew file mode 100644 index 0000000..f93d475 --- /dev/null +++ b/app/src/main/res/drawable/battle_rcl.jpg diff --git a/app/src/main/res/drawable/battle_rs.jpg b/app/src/main/res/drawable/battle_rs.jpg Binary files differnew file mode 100644 index 0000000..9afd76b --- /dev/null +++ b/app/src/main/res/drawable/battle_rs.jpg diff --git a/app/src/main/res/drawable/battle_rth.jpg b/app/src/main/res/drawable/battle_rth.jpg Binary files differnew file mode 100644 index 0000000..5b18c53 --- /dev/null +++ b/app/src/main/res/drawable/battle_rth.jpg diff --git a/app/src/main/res/drawable/battle_td.jpg b/app/src/main/res/drawable/battle_td.jpg Binary files differnew file mode 100644 index 0000000..7acfe49 --- /dev/null +++ b/app/src/main/res/drawable/battle_td.jpg diff --git a/app/src/main/res/drawable/course_bc.jpg b/app/src/main/res/drawable/course_bc.jpg Binary files differnew file mode 100644 index 0000000..138b970 --- /dev/null +++ b/app/src/main/res/drawable/course_bc.jpg diff --git a/app/src/main/res/drawable/course_cm.jpg b/app/src/main/res/drawable/course_cm.jpg Binary files differnew file mode 100644 index 0000000..f0e155b --- /dev/null +++ b/app/src/main/res/drawable/course_cm.jpg diff --git a/app/src/main/res/drawable/course_ctgp.jpg b/app/src/main/res/drawable/course_ctgp.jpg Binary files differnew file mode 100644 index 0000000..75ba3c8 --- /dev/null +++ b/app/src/main/res/drawable/course_ctgp.jpg diff --git a/app/src/main/res/drawable/course_dc.jpg b/app/src/main/res/drawable/course_dc.jpg Binary files differnew file mode 100644 index 0000000..42d18e1 --- /dev/null +++ b/app/src/main/res/drawable/course_dc.jpg diff --git a/app/src/main/res/drawable/course_ddr.jpg b/app/src/main/res/drawable/course_ddr.jpg Binary files differnew file mode 100644 index 0000000..1953ba5 --- /dev/null +++ b/app/src/main/res/drawable/course_ddr.jpg diff --git a/app/src/main/res/drawable/course_dks.jpg b/app/src/main/res/drawable/course_dks.jpg Binary files differnew file mode 100644 index 0000000..80fb78c --- /dev/null +++ b/app/src/main/res/drawable/course_dks.jpg diff --git a/app/src/main/res/drawable/course_gv.jpg b/app/src/main/res/drawable/course_gv.jpg Binary files differnew file mode 100644 index 0000000..88f4f35 --- /dev/null +++ b/app/src/main/res/drawable/course_gv.jpg diff --git a/app/src/main/res/drawable/course_kc.jpg b/app/src/main/res/drawable/course_kc.jpg Binary files differnew file mode 100644 index 0000000..3081fe4 --- /dev/null +++ b/app/src/main/res/drawable/course_kc.jpg diff --git a/app/src/main/res/drawable/course_lc.jpg b/app/src/main/res/drawable/course_lc.jpg Binary files differnew file mode 100644 index 0000000..531374f --- /dev/null +++ b/app/src/main/res/drawable/course_lc.jpg diff --git a/app/src/main/res/drawable/course_mc.jpg b/app/src/main/res/drawable/course_mc.jpg Binary files differnew file mode 100644 index 0000000..4063a33 --- /dev/null +++ b/app/src/main/res/drawable/course_mc.jpg diff --git a/app/src/main/res/drawable/course_mg.jpg b/app/src/main/res/drawable/course_mg.jpg Binary files differnew file mode 100644 index 0000000..17d00c2 --- /dev/null +++ b/app/src/main/res/drawable/course_mg.jpg diff --git a/app/src/main/res/drawable/course_mh.jpg b/app/src/main/res/drawable/course_mh.jpg Binary files differnew file mode 100644 index 0000000..93cb7a3 --- /dev/null +++ b/app/src/main/res/drawable/course_mh.jpg diff --git a/app/src/main/res/drawable/course_mmm.jpg b/app/src/main/res/drawable/course_mmm.jpg Binary files differnew file mode 100644 index 0000000..1c30488 --- /dev/null +++ b/app/src/main/res/drawable/course_mmm.jpg diff --git a/app/src/main/res/drawable/course_mt.jpg b/app/src/main/res/drawable/course_mt.jpg Binary files differnew file mode 100644 index 0000000..edf7e62 --- /dev/null +++ b/app/src/main/res/drawable/course_mt.jpg diff --git a/app/src/main/res/drawable/course_rbc.jpg b/app/src/main/res/drawable/course_rbc.jpg Binary files differnew file mode 100644 index 0000000..abc04a7 --- /dev/null +++ b/app/src/main/res/drawable/course_rbc.jpg diff --git a/app/src/main/res/drawable/course_rbc3.jpg b/app/src/main/res/drawable/course_rbc3.jpg Binary files differnew file mode 100644 index 0000000..f252593 --- /dev/null +++ b/app/src/main/res/drawable/course_rbc3.jpg diff --git a/app/src/main/res/drawable/course_rdh.jpg b/app/src/main/res/drawable/course_rdh.jpg Binary files differnew file mode 100644 index 0000000..8339c8a --- /dev/null +++ b/app/src/main/res/drawable/course_rdh.jpg diff --git a/app/src/main/res/drawable/course_rdkjp.jpg b/app/src/main/res/drawable/course_rdkjp.jpg Binary files differnew file mode 100644 index 0000000..a397916 --- /dev/null +++ b/app/src/main/res/drawable/course_rdkjp.jpg diff --git a/app/src/main/res/drawable/course_rdkm.jpg b/app/src/main/res/drawable/course_rdkm.jpg Binary files differnew file mode 100644 index 0000000..491089f --- /dev/null +++ b/app/src/main/res/drawable/course_rdkm.jpg diff --git a/app/src/main/res/drawable/course_rds.jpg b/app/src/main/res/drawable/course_rds.jpg Binary files differnew file mode 100644 index 0000000..4c3a617 --- /dev/null +++ b/app/src/main/res/drawable/course_rds.jpg diff --git a/app/src/main/res/drawable/course_rgv2.jpg b/app/src/main/res/drawable/course_rgv2.jpg Binary files differnew file mode 100644 index 0000000..2a6ffd4 --- /dev/null +++ b/app/src/main/res/drawable/course_rgv2.jpg diff --git a/app/src/main/res/drawable/course_rmc.jpg b/app/src/main/res/drawable/course_rmc.jpg Binary files differnew file mode 100644 index 0000000..49a765f --- /dev/null +++ b/app/src/main/res/drawable/course_rmc.jpg diff --git a/app/src/main/res/drawable/course_rmc3.jpg b/app/src/main/res/drawable/course_rmc3.jpg Binary files differnew file mode 100644 index 0000000..184a29d --- /dev/null +++ b/app/src/main/res/drawable/course_rmc3.jpg diff --git a/app/src/main/res/drawable/course_rmr.jpg b/app/src/main/res/drawable/course_rmr.jpg Binary files differnew file mode 100644 index 0000000..963be2c --- /dev/null +++ b/app/src/main/res/drawable/course_rmr.jpg diff --git a/app/src/main/res/drawable/course_rpb.jpg b/app/src/main/res/drawable/course_rpb.jpg Binary files differnew file mode 100644 index 0000000..ccfc66d --- /dev/null +++ b/app/src/main/res/drawable/course_rpb.jpg diff --git a/app/src/main/res/drawable/course_rpg.jpg b/app/src/main/res/drawable/course_rpg.jpg Binary files differnew file mode 100644 index 0000000..917e0a2 --- /dev/null +++ b/app/src/main/res/drawable/course_rpg.jpg diff --git a/app/src/main/res/drawable/course_rr.jpg b/app/src/main/res/drawable/course_rr.jpg Binary files differnew file mode 100644 index 0000000..320c626 --- /dev/null +++ b/app/src/main/res/drawable/course_rr.jpg diff --git a/app/src/main/res/drawable/course_rsgb.jpg b/app/src/main/res/drawable/course_rsgb.jpg Binary files differnew file mode 100644 index 0000000..b592868 --- /dev/null +++ b/app/src/main/res/drawable/course_rsgb.jpg diff --git a/app/src/main/res/drawable/course_rsl.jpg b/app/src/main/res/drawable/course_rsl.jpg Binary files differnew file mode 100644 index 0000000..7423f41 --- /dev/null +++ b/app/src/main/res/drawable/course_rsl.jpg diff --git a/app/src/main/res/drawable/course_rws.jpg b/app/src/main/res/drawable/course_rws.jpg Binary files differnew file mode 100644 index 0000000..c9de409 --- /dev/null +++ b/app/src/main/res/drawable/course_rws.jpg diff --git a/app/src/main/res/drawable/course_ryf.jpg b/app/src/main/res/drawable/course_ryf.jpg Binary files differnew file mode 100644 index 0000000..e963059 --- /dev/null +++ b/app/src/main/res/drawable/course_ryf.jpg diff --git a/app/src/main/res/drawable/course_tf.jpg b/app/src/main/res/drawable/course_tf.jpg Binary files differnew file mode 100644 index 0000000..3379695 --- /dev/null +++ b/app/src/main/res/drawable/course_tf.jpg diff --git a/app/src/main/res/drawable/course_wgm.jpg b/app/src/main/res/drawable/course_wgm.jpg Binary files differnew file mode 100644 index 0000000..09dbf26 --- /dev/null +++ b/app/src/main/res/drawable/course_wgm.jpg diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index bf5adcd..863ff0c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -31,6 +31,28 @@ app:title="Wiimmfi Watcher" app:titleTextColor="@color/white" /> + <com.google.android.material.tabs.TabLayout + android:id="@+id/tablayout_main" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/blue_700" + app:tabIndicatorColor="@color/white" + app:tabMode="fixed" + app:tabTextColor="@color/white"> + + <com.google.android.material.tabs.TabItem + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Friend Code" /> + + <com.google.android.material.tabs.TabItem + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Mii Name" /> + + </com.google.android.material.tabs.TabLayout> + + </com.google.android.material.appbar.AppBarLayout> <androidx.fragment.app.FragmentContainerView diff --git a/app/src/main/res/layout/activity_wiimmfi.xml b/app/src/main/res/layout/activity_wiimmfi.xml index f62fe15..41cf4fe 100644 --- a/app/src/main/res/layout/activity_wiimmfi.xml +++ b/app/src/main/res/layout/activity_wiimmfi.xml @@ -15,20 +15,39 @@ <com.google.android.material.appbar.AppBarLayout style="@style/Widget.MaterialComponents.AppBarLayout.Primary" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="200dp" android:fitsSystemWindows="true"> - <com.google.android.material.appbar.MaterialToolbar - android:id="@+id/toolbar" - style="@style/Widget.MaterialComponents.Toolbar.Primary" + <com.google.android.material.appbar.CollapsingToolbarLayout android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="@android:color/transparent" - android:elevation="0dp" - app:navigationIcon="@drawable/ic_baseline_menu_24" - app:navigationIconTint="#FFFFFF" - app:title="Watching 0000-0000-0000" - app:titleTextColor="#FFFFFF" /> + android:layout_height="match_parent" + android:fitsSystemWindows="true" + app:expandedTitleTextAppearance="@style/TextAppearance.App.CollapsingToolbar.Expanded" + app:collapsedTitleTextAppearance="@style/TextAppearance.App.CollapsingToolbar.Collapsed"> + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:fitsSystemWindows="true" + android:scaleType="centerCrop" + android:src="@drawable/course_ctgp" /> + + <com.google.android.material.appbar.MaterialToolbar + android:id="@+id/toolbar" + style="@style/Widget.MaterialComponents.Toolbar.Primary" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@android:color/transparent" + android:elevation="0dp" + app:navigationIcon="@drawable/ic_baseline_menu_24" + app:title="Watching 0000-0000-0000" + app:titleTextColor="#FFFFFF" /> + + </com.google.android.material.appbar.CollapsingToolbarLayout> + + + + </com.google.android.material.appbar.AppBarLayout> @@ -51,7 +70,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" - android:theme="@style/Theme.WiimmfiWatcher" + android:theme="@style/Theme.WiimmfiWatcher.Watching" app:headerLayout="@layout/header_navigation_drawer" app:menu="@menu/drawer_navigation_menu"> diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index d028cf7..1e230ce 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -13,4 +13,28 @@ <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> <!-- Customize your theme here. --> </style> + + <style name="Theme.WiimmfiWatcher.Watching" parent="Theme.MaterialComponents.DayNight.NoActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">#212121</item> + <item name="colorPrimaryVariant">#000000</item> + <item name="colorOnPrimary">@color/white</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/blue_200</item> + <item name="colorSecondaryVariant">@color/blue_200</item> + <item name="colorOnSecondary">@color/white</item> + <item name="android:windowTranslucentStatus">true</item> + <!-- Status bar color. --> + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> + <!-- Customize your theme here. --> + </style> + + <style name="TextAppearance.App.CollapsingToolbar.Expanded" parent="TextAppearance.MaterialComponents.Headline5"> + <item name="android:textColor">@color/white</item> + </style> + + <style name="TextAppearance.App.CollapsingToolbar.Collapsed" parent="TextAppearance.MaterialComponents.Headline6"> + <item name="android:textColor">@color/white</item> + </style> + </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 05fc69e..d62aed7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -12,6 +12,7 @@ <string name="watch">Watch</string> <string name="watching">Watching %1$s</string> <string name="enter_fc">Enter a friend code to watch</string> + <string name="enter_mii">Enter the name of a Mii to watch</string> <string name="recent_fc">Recently watched friend codes:</string> <string name="version_header">Version</string> <string name="version">You are running Wiimmfi Watcher version %1$s. You can view the release notes for this version <![CDATA[<a href="https://github.com/brysonsteck/wiimmfi-watcher/releases/">here.</a>]]></string> diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 73a1e00..68da004 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -10,8 +10,32 @@ <item name="colorSecondary">@color/blue_200</item> <item name="colorSecondaryVariant">@color/blue_200</item> <item name="colorOnSecondary">@color/white</item> + <item name="android:windowTranslucentStatus">false</item> <!-- Status bar color. --> <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> <!-- Customize your theme here. --> </style> + + <style name="Theme.WiimmfiWatcher.Watching" parent="Theme.MaterialComponents.DayNight.NoActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">#1E88E5</item> + <item name="colorPrimaryVariant">#0D47A1</item> + <item name="colorOnPrimary">@color/white</item> + <item name="backgroundColor">#ffffff</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/blue_200</item> + <item name="colorSecondaryVariant">@color/blue_200</item> + <item name="colorOnSecondary">@color/white</item> + <item name="android:windowTranslucentStatus">true</item> + <!-- Customize your theme here. --> + </style> + + <style name="TextAppearance.App.CollapsingToolbar.Expanded" parent="TextAppearance.MaterialComponents.Headline5"> + <item name="android:textColor">@color/white</item> + </style> + + <style name="TextAppearance.App.CollapsingToolbar.Collapsed" parent="TextAppearance.MaterialComponents.Headline6"> + <item name="android:textColor">@color/white</item> + </style> + </resources>
\ No newline at end of file |