/* This file is part of GNU Taler (C) 2019 Taler Systems S.A. GNU Taler is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see */ package net.taler.wallet import android.annotation.SuppressLint import android.os.Bundle import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Button import android.widget.TextView import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders import androidx.navigation.findNavController import com.google.android.material.snackbar.Snackbar import me.zhanghai.android.materialprogressbar.MaterialProgressBar class PromptWithdraw : Fragment() { private lateinit var model: WalletViewModel private fun triggerLoading() { val loading = model.withdrawStatus.value is WithdrawStatus.Loading || model.withdrawStatus.value is WithdrawStatus.Withdrawing val myActivity = activity!! val progressBar = myActivity.findViewById(R.id.progress_bar) if (loading) { progressBar.visibility = View.VISIBLE } else { progressBar.visibility = View.INVISIBLE } } private fun showWithdrawStatus(view: View, status: WithdrawStatus) { val confirmButton = view.findViewById