Merge pull request #1 from brysonsteck/detour

adding pictures instead
This commit is contained in:
Bryson Steck 2021-08-15 21:16:30 -05:00 committed by GitHub
commit f6438b7cd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 142 additions and 15 deletions

View file

@ -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>

View file

@ -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

View file

@ -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(

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -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

View file

@ -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">

View file

@ -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>

View file

@ -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>

View file

@ -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>