- ๐ Hi, Iโm @tashilapathum
- ๐ Iโm interested in Android Development
- ๐ฑ Check out the apps I've developed: https://bit.ly/appsbytashila
- ๐ซ How to reach me: [email protected]
A simple and lightweight Material 3 progress dialog library for Android to replace now-deprecated android.app.ProgressDialog
License: Apache License 2.0
Would be great if you could configure a delay for showing the dialog.
Maybe taking inspiration from https://github.com/tasomaniac/DelayedProgress
This is useful when you have a task that could take very little time, for not spawning a dialog in that case.
Unlike Java, Kotlin make classes final
by default, thus they cannot be extended.
Thus it is not possible to subclass class PleaseWaitDialog
to override onDismiss(),
onCancel()` and possibly other functions:
Example in Java, this does not compile (probably with Kotlin too) because PleaseWaitDialog is final
PleaseWaitDialog dialog = new PleaseWaitDialog(this) {
public void onCancel(DialogInterface d) {
// do something
}
};
I'm not super familiar with Kotlin, but the solution I think is to declare PleaseWaitDialog open:
open class PleaseWaitDialog {
...
Hello,
I am trying to update Pleasewait Message and Title in OnProgressUpdate method but its not updating properly. It's displaying only first message. It was working fine in ProgressDialog.
code example
@Override
protected void onPreExecute() {
super.onPreExecute();
pd = new PleaseWaitDialog(g);
pd.setTitle("Please wait");
pd.setMessage("Loading...");
pd.setCancelable(false);
pd.show();
//pd.setTitle(mContext.getString(R.string.syncing_data));
//pd.setMessage("Processing");
pd.setTitle(mContext.getString(R.string.syncing_data));
pd.setMessage("Processing");
//pd = ProgressDialog.show(mContext, mContext.getString(R.string.syncing_data), "Processing", true, false);
// Create and show Progress dialog
//pd.getWindow().setBackgroundDrawable(new ColorDrawable(mContext.getResources().getColor(R.color.background_color, mContext.getResources().newTheme())));
}
/**
* This callback method is invoked when publishProgress()
* method is called
*/
@Override
protected void onProgressUpdate(String... values) {
super.onProgressUpdate(values);
pd.setMessage(values[0]);
}
Encountered duplicate path "main/com/tashila/pleasewait/PleaseWaitDialog.kt" during copy operation configured with DuplicatesStrategy.WARN
Downgraded the Gradle plugin version until a solution is found.
java.lang.IllegalStateException: Fragment already added: PleaseWaitDialog{8b088c0} (9459f249-959e-44a7-b253-41de74725d63)
at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:92)
at androidx.fragment.app.FragmentManager.addFragment(FragmentManager.java:1472)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:387)
at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:1956)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1864)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1814)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1751)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:538)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8152)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
In this case:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.