From: Damyan Ivanov Date: Sun, 3 May 2020 12:56:38 +0000 (+0300) Subject: Toast → Snackbar X-Git-Tag: v0.12.0~12 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=42fcb92013bb28047b0fb2a81f86eea90416cb09;p=mobile-ledger.git Toast → Snackbar --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 21ed5588..bc481a6d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -36,7 +36,6 @@ import android.view.animation.AnimationUtils; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; -import android.widget.Toast; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.widget.Toolbar; @@ -50,6 +49,7 @@ import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.ViewPager; import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.snackbar.Snackbar; import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.async.DbOpQueue; @@ -597,8 +597,8 @@ public class MainActivity extends ProfileThemedActivity { TransactionListViewModel.scheduleTransactionListReload(); } else - Toast.makeText(this, error, Toast.LENGTH_LONG) - .show(); + Snackbar.make(mViewPager, error, Snackbar.LENGTH_LONG) + .show(); } public void onRetrieveStart() { ProgressBar progressBar = findViewById(R.id.transaction_list_progress_bar); diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java index 6477fe84..edd37825 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java @@ -28,13 +28,14 @@ import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.AutoCompleteTextView; -import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.google.android.material.snackbar.Snackbar; + import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.model.Data; import net.ktnx.mobileledger.ui.MobileLedgerListFragment; @@ -138,8 +139,8 @@ public class TransactionListFragment extends MobileLedgerListFragment { if (err == null) return; - Toast.makeText(mActivity, err, Toast.LENGTH_SHORT) - .show(); + Snackbar.make(this.root, err, Snackbar.LENGTH_LONG) + .show(); TransactionListViewModel.updateError.set(null); }); Data.transactions.addObserver(