Giter Site home page Giter Site logo

missme's Introduction

MissMe

Android ProgressDialog brought back to life

Android Arsenal Download TravisCI Codacy Badge StackShare

MissMe is an Android library written in Kotlin. Android SDK's ProgressDialog class was deprecated in Android Oreo. MissMe's ProgressDialog functions exactly the same and has the same interface.

Screenshots

Horizontal Determinate Horizontal Indeterminate Spinner

Gradle Setup

Add the following dependency to module/build.gradle:

compile 'com.lmntrx.android.library.livin.missme:missme:0.1.5'

How to use it?

Usage is similar to original ProgressDialog

ProgressDialog progressDialog = new ProgressDialog(YourActivity.this);

// Set message
progressDialog.setMessage("Please wait");

// Set cancelable
progressDialog.setCancelable(false);

// Show dialog
progressDialog.show();

// Hide
progressDialog.dismiss();

NB: You must override activity's onBackPressed()

Java8 Implementation:

@Override
public void onBackPressed() {
    progressDialog.onBackPressed(
            () -> {
                YourActivity.super.onBackPressed();
                return null;
            }
    );
}

Kotlin Implementation:

override fun onBackPressed() {
    progressDialog.onBackPressed { super.onBackPressed() }
}
  • Refer Sample App for the full implementation
  • Full documentation can be found here

Buy Me A Coffee

Copyright

 Copyright (c) 2018.  Livin
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.

missme's People

Contributors

esafirm avatar livin21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

missme's Issues

Error compiling

I added this lib to my project, and now it's giving this error, has anyone ever gone through it?

gradlew assemble

Configure project :app

C:\Users\cabalerdw.gradle\caches\transforms-1\files-1.1\missme-0.1.5.aar\6ce5d64647
097d315db9d1ebfff3a8b6\res\layout\horizontal_progress_dialog.xml:34: AAPT: error
: attribute cardCornerRadius (aka com.myproject.app:cardCornerRadius) n
ot found.

C:\Users\cabalerdw.gradle\caches\transforms-1\files-1.1\missme-0.1.5.aar\6ce5d64647
097d315db9d1ebfff3a8b6\res\layout\horizontal_progress_dialog.xml:34: AAPT: error
: attribute cardElevation (aka com.myproject.app:cardElevation) not fou
nd.

C:\Users\cabalerdw.gradle\caches\transforms-1\files-1.1\missme-0.1.5.aar\6ce5d64647
097d315db9d1ebfff3a8b6\res\layout\spinner_progress_dialog.xml:34: AAPT: error: a
ttribute cardElevation (aka com.myproject.app:cardElevation) not found.

error: failed linking file resources.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

Failed to process resources, see aapt output above for details.

In this order the message text doesn't apear

In this order the message text doesn't apear:

progressDialog = ProgressDialog(App.geralActivity)
        progressDialog?.apply {
            setMessage("Loading")
            setCancelable(false)
            setProgress(0)
            setProgressStyle(ProgressDialog.STYLE_HORIZONTAL)
            setMax(100)
        }

But this way it shows:

progressDialog = ProgressDialog(App.geralActivity)
        progressDialog?.apply {
            setCancelable(false)
            setProgress(0)
            setProgressStyle(ProgressDialog.STYLE_HORIZONTAL)
            setMax(100)
             setMessage("Loading")
        }

Misleading API regarding colors

  • setColor requires a color constant and its argument has no @ColorInt annotation
  • setTextColor requires a color resource int and its argument has no @ColorRes annotation

I suggest you add at least the annotations to guide people.

An alignment of both methods to either use color consts or color resource ints would be greatly appreciated.

Thanks :-)

what am i doing wrong

hi love this - when i use it - it is closing after reaching 100 but also closing whole app - what am i doing wrong please?

public void doProgressDialog() {
ProgressDialog progressDialog = new ProgressDialog(this);
// Set horizontal progress bar style.
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
// Set progress dialog message.
progressDialog.setMessage("This is a horizontal progress dialog.");
// The maxima progress value.
progressDialog.setMax(100);
// Whether progress dialog can be canceled or not.
progressDialog.setCancelable(true);
// Popup the progress dialog.
progressDialog.show();
// Create a new thread object.
Thread thread = new Thread(new Runnable() {

		@Override
		public void run() {
			int i = 0;
			// Update progress bar every 0.3 second.
			while (i < 100) {
				try {
					Thread.sleep(30);
					// Update the progress value.
					progressDialog.incrementProgressBy(1);
					// Update the secondary progress value.
					progressDialog.incrementSecondaryProgressBy(5);
					i++;
				} catch (Exception ex) {
					ex.printStackTrace();
				}
			}
			// Close and delete the dialog when the progress bar is finished
			progressDialog.dismiss();
		}
	});

	// Start the thread.
	thread.start();

}

Wrap Content with

Hi,

Any way to make the loading windosw wrapa_content in widht?¿

Thx

Suport builder pattern

val progressDialog = ProgressDialog(this.activity)
            .setMessage("Updating")
            .setCancelable(false)
            .show()

setProgressDrawable doesn't seem to work

When I use setDrawable, it doesn't seem to add the drawable to the dialog,

 private var  progressDialog = ProgressDialog(this)
 progressDialog?.setCancelable(false)
 progressDialog?.setMessage("Logging in....")
 progressDialog?.setProgressDrawable(getDrawable(R.drawable.ic_truck_black_18dp))
 progressDialog?.show()

Not sure if I am doing something wrong....

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.