diff options
Diffstat (limited to 'app/src/main/java/me')
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java | 5 | ||||
-rw-r--r-- | app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java | 10 |
2 files changed, 7 insertions, 8 deletions
diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java index bb7663c..e2c97db 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java @@ -6,14 +6,11 @@ import android.view.View; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; -import androidx.databinding.ObservableArrayList; import androidx.room.Room; import me.brysonsteck.wiimmfiwatcher.database.AppDatabase; -import me.brysonsteck.wiimmfiwatcher.model.FriendCode; public class MainActivity extends AppCompatActivity { - ObservableArrayList<FriendCode> recentFCList = new ObservableArrayList<>(); AppDatabase database; @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @@ -29,8 +26,6 @@ public class MainActivity extends AppCompatActivity { .replace(R.id.friend_code_input_fragment, new WatchCodeFragment(), null) .setReorderingAllowed(true) .commit(); - - } database = Room.databaseBuilder(this, AppDatabase.class, "friend-codes-db").build(); diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java index 93165df..1b285b9 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java @@ -1,15 +1,14 @@ package me.brysonsteck.wiimmfiwatcher; import android.content.Intent; -import android.content.res.Configuration; -import android.graphics.Color; import android.os.Bundle; import android.transition.TransitionInflater; import android.view.KeyEvent; import android.view.View; import android.widget.Button; import android.widget.EditText; -import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -151,6 +150,11 @@ public class WatchCodeFragment extends Fragment { errorText.setText(""); viewModel.saveFriendCode("", friendCode.getText().toString()); intent.putExtra("friendCode", friendCode.getText().toString()); + ProgressBar p = view.findViewById(R.id.progressBar1); + if(p.getVisibility() != View.GONE){ // check if it is visible + p.setVisibility(View.GONE); // if not set it to visible + watchButton.setVisibility(View.VISIBLE); // use 1 or 2 as parameters.. arg0 is the view(your button) from the onclick listener + } startActivity(intent); } } |