aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/me/brysonsteck/wiimmfiwatcher
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/me/brysonsteck/wiimmfiwatcher')
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java33
-rw-r--r--app/src/main/java/me/brysonsteck/wiimmfiwatcher/fragments/WatchCodeFragment.java7
2 files changed, 38 insertions, 2 deletions
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(