2014-07-03 07:48:39 +02:00
|
|
|
/*
|
|
|
|
* Twidere - Twitter client for Android
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012-2014 Mariotaku Lee <mariotaku.lee@gmail.com>
|
|
|
|
*
|
|
|
|
* This program 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 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-07-02 05:54:53 +02:00
|
|
|
package org.mariotaku.twidere.fragment
|
2014-07-03 07:48:39 +02:00
|
|
|
|
2016-07-02 05:54:53 +02:00
|
|
|
import android.app.Dialog
|
|
|
|
import android.app.ProgressDialog
|
|
|
|
import android.os.Bundle
|
2020-01-26 08:35:15 +01:00
|
|
|
import androidx.fragment.app.FragmentManager
|
2016-12-06 02:26:53 +01:00
|
|
|
import org.mariotaku.ktextension.Bundle
|
|
|
|
import org.mariotaku.ktextension.set
|
2016-07-02 05:54:53 +02:00
|
|
|
import org.mariotaku.twidere.R
|
2016-12-06 02:26:53 +01:00
|
|
|
import org.mariotaku.twidere.constant.IntentConstants.EXTRA_MESSAGE
|
2015-04-14 17:38:50 +02:00
|
|
|
|
2016-07-02 05:54:53 +02:00
|
|
|
class ProgressDialogFragment : BaseDialogFragment() {
|
2015-04-14 17:38:50 +02:00
|
|
|
|
2016-07-02 05:54:53 +02:00
|
|
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
|
|
|
val dialog = ProgressDialog(activity)
|
2017-01-26 14:28:43 +01:00
|
|
|
dialog.setMessage(arguments?.getString(EXTRA_MESSAGE) ?: getString(R.string.message_please_wait))
|
2016-07-02 05:54:53 +02:00
|
|
|
return dialog
|
|
|
|
}
|
2015-04-04 16:31:37 +02:00
|
|
|
|
2016-07-02 05:54:53 +02:00
|
|
|
companion object {
|
|
|
|
|
2016-12-06 02:26:53 +01:00
|
|
|
fun show(fm: FragmentManager, tag: String, message: String? = null): ProgressDialogFragment {
|
2016-07-02 05:54:53 +02:00
|
|
|
val f = ProgressDialogFragment()
|
2016-12-06 02:26:53 +01:00
|
|
|
f.arguments = Bundle {
|
|
|
|
this[EXTRA_MESSAGE] = message
|
|
|
|
}
|
2016-08-30 14:23:59 +02:00
|
|
|
f.show(fm, tag)
|
2016-07-02 05:54:53 +02:00
|
|
|
return f
|
|
|
|
}
|
2017-03-27 05:08:09 +02:00
|
|
|
|
2016-07-02 05:54:53 +02:00
|
|
|
}
|
2014-07-03 07:48:39 +02:00
|
|
|
|
|
|
|
}
|