From 1ed362fdcac42fd2c18d1b580c8e20196564ba47 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 30 May 2021 16:53:09 -0600 Subject: fixed about fragment license text error, added margins to watchcodesfragment --- app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java | 3 +++ .../main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/me') diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java index e2c97db..7247e58 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java @@ -3,6 +3,8 @@ package me.brysonsteck.wiimmfiwatcher; import android.os.Build; import android.os.Bundle; import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; @@ -18,6 +20,7 @@ public class MainActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); View aboutButton = findViewById(R.id.about_button); if (savedInstanceState == null) { diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java index 1b285b9..a14e6f7 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java @@ -12,6 +12,9 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.view.OnApplyWindowInsetsListener; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; import androidx.databinding.ObservableList; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; @@ -77,7 +80,7 @@ public class WatchCodeFragment extends Fragment { @Override public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) { getActivity().runOnUiThread(() -> { - adapter.notifyItemRangeInserted(positionStart, itemCount); + adapter.notifyItemRangeInserted(positionStart, itemCount); // this is the only method that seems to be called }); } @@ -101,8 +104,8 @@ public class WatchCodeFragment extends Fragment { linearLayoutManager.setStackFromEnd(true); recyclerView.setLayoutManager(linearLayoutManager); recyclerView.setAdapter(adapter); - EditText friendCode = view.findViewById(R.id.friend_code_edit_text); + EditText friendCode = view.findViewById(R.id.friend_code_edit_text); MaterialTextView errorText = view.findViewById(R.id.error_text); Button watchButton = view.findViewById(R.id.watch_button); watchButton.setOnClickListener(buttonClick -> { -- cgit v1.2.3