From 3e5d90158996b919b6661c3cb9c9fc18ac951bfc Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Mon, 24 May 2021 11:20:01 -0600 Subject: added spanish and portugese, experimenting with progress bars --- .../main/java/me/brysonsteck/wiimmfiwatcher/MainActivity.java | 5 ----- .../java/me/brysonsteck/wiimmfiwatcher/WatchCodeFragment.java | 10 +++++++--- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'app/src/main/java/me/brysonsteck') 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 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); } } -- cgit v1.2.3