]> git.ktnx.net Git - mobile-ledger.git/commitdiff
Toast → Snackbar
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 3 May 2020 12:56:38 +0000 (15:56 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 3 May 2020 12:57:45 +0000 (15:57 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListFragment.java

index 21ed55884181b8814a5e8e33fd358f4134e770c5..bc481a6de20a319008b42dba06f39509a73d1956 100644 (file)
@@ -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);
index 6477fe84586f039894a930330793416d18b0e47d..edd3782578faf550a60cbae1fb1d9edf043bee07 100644 (file)
@@ -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(