Coder Social home page Coder Social logo

dmytrodanylyk / android-process-button Goto Github PK

View Code? Open in Web Editor NEW
3.0K 120.0 549.0 3.41 MB

Android Buttons With Built-in Progress Meters.

Home Page: http://dmytrodanylyk.com/pages/portfolio/portfolio-process-button.html

License: MIT License

Java 100.00%

android-process-button's Introduction

Description Maven Central Android Arsenal

Android Buttons With Built-in Progress Meters.

Wiki

Integration

The lib is available on Maven Central, you can find it with Gradle, please

dependencies {
    compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
}

Sample

Android app on Google Play DevAppsDirect

License

The MIT License (MIT)

Copyright (c) 2014 Danylyk Dmytro

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.

Analytics

android-process-button's People

Contributors

aminelaadhari avatar dmytrodanylyk avatar nirvik66 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  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  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  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

android-process-button's Issues

How to signal error

Hi,

I saw the button xml configuration having option to specify error text and error color background.

Was wondering how to trigger a error so that the button will display the error text declared in xml.

Thanks

Implement state for focused and selected

If user are using hardware navigation to navigate the apps on device such as Android TV, the button will not show any states even user focused on that button, and this confused most of the users. This can be reproduced using android emulator too using keyboard to navigate.

android:state_focused android:state_selected

The text don't change

Hi,

I make an android application and I use your process button for the sign up / sign in. When I push the button, the animation start and the color change. But the text don't change, I have always my basic text that I defined in the layout. However, I set all custom text in the layout :

<com.dd.processbutton.iml.ActionProcessButton android:id="@+id/btnSignIn" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:text="Sign_in" android:textColor="@android:color/white" android:textSize="18sp" custom:pb_colorComplete="@color/green_complete" custom:pb_colorNormal="@color/blue_normal" custom:pb_colorPressed="@color/blue_pressed" custom:pb_colorProgress="@color/purple_progress" custom:pb_textComplete="Success" custom:pb_textProgress="Loading" custom:pb_textError="Error" custom:pb_colorError="@color/red_error" />

In this example, I should have the text "Loading" when I push the button, but it doesn't work.

Do you have any ideas about this ?

Thank you

disable button color

Is that possible to add disable button color when the button is triggered with setEnable(false); or starting status with enable == false?

get Error Text from custom attributes

on ProcessButton class, in the method initAttributes, lack include:
mErrorText = attr.getString(R.styleable.ProcessButton_textError);
to get error text from custom attributes.

Unable start activity

I'm import lib and sample to eclipse when run project I got the error

Unable to start activity ComponentInfo{com.dd.sample/com.dd.sample.SignInActivity}: android.view.InflateException: Binary XML file line #30: Error inflating class com.dd.processbutton.iml.ActionProcessButton

please help me!

Action Process Button will show loading progress animation only on first time

The button loading animation will work for only one click , I think we should add mProgress = 0;

  public void start(final ProcessButton button) {
        final Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                mProgress += 10;
                button.setProgress(mProgress);
                if (mProgress < 100) {
                    handler.postDelayed(this, generateDelay());
                } else {
                    mListener.onComplete();
                    mProgress = 0;
                }
            }
        }, generateDelay());
    }

using ProcessButton in fragment

hi
I would like to use ProcessButton in the fragment. when I want to create an object of ProgressGenerator, an error appears :

=> The constructor ProgressGenerator(FragmentActivity) is undefined

        final ProgressGenerator progressGenerator = new ProgressGenerator(getActivity());
        progressGenerator.start(mybtn);

Button padding are ignored

Solution described here

    @Override
    public void setBackgroundCompat(Drawable drawable) {
        int pL = getPaddingLeft();
        int pT = getPaddingTop();
        int pR = getPaddingRight();
        int pB = getPaddingBottom();

        super.setBackgroundCompat(drawable);
        setPadding(pL, pT, pR, pB);
    }

How to use ActionProcessButton btnSignIn for Endless in AsyncTask

public class LoginActivity extends Activity implements ProgressGenerator.OnCompleteListener  {

   private ActionProcessButton btnSignIn;
    private FloatLabeledEditText mUserName, mPassword;
    private ArrayList<HashMap<String, String>> mLoginList = new ArrayList<HashMap<String,String>>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        init();

        btnSignIn.setMode(ActionProcessButton.Mode.ENDLESS);

        btnSignIn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                new LoginTask().execute();
            }
        });
    }


    public class LoginTask extends AsyncTask<Void, Void, Void>
    {
        ProgressGenerator progressGenerator = new ProgressGenerator(LoginActivity.this);

        @Override
        protected void onPreExecute()
        {
//            progressGenerator.start(btnSignIn);
//
            btnSignIn.setEnabled(false);
            mUserName.setEnabled(false);
            mPassword.setEnabled(false);
        }

        @Override
        protected Void doInBackground(Void... params) {
            // TODO Auto-generated method stub
            String json_string = "";

            ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
            postParameters.add(new BasicNameValuePair("email", mUserName.getText().toString().trim()));
            postParameters.add(new BasicNameValuePair("password", mPassword.getText().toString()));

            WebServiceHandler wshObj = new WebServiceHandler();

                json_string = wshObj.getWebServiceData(Constants.login_url, postParameters);
                Parser parser = new Parser();
                mLoginList = parser.getLoginStatus(json_string);

            return null;
        }

        @Override
        protected void onPostExecute(Void result) {
            // TODO Auto-generated method stub
//            btnSignIn.setProgress(100);
            progressGenerator.dismiss();
//            ProgressGenerator.running = false;
            Log.e("done", "running false");

            if(mLoginList.size()>0)
            {
                if(mLoginList.get(0).get("status").contains("success")) {

                    SharedPreferences settings = getSharedPreferences(Constants.PREFS_LOGIN_DETAILS, 0);
                    SharedPreferences.Editor editor = settings.edit();
                    editor.putString("email", mUserName.getText().toString());
                    editor.putString("password", mPassword.getText().toString());
                    editor.commit();


                }
                else {
                    Toast.makeText(getApplicationContext(), "Invalid username or password.", Toast.LENGTH_SHORT).show();
                }
            }

            else {

                Toast.makeText(getApplicationContext(), mLoginList.get(0).get("status"), Toast.LENGTH_LONG).show();
                mUserName.setText("");
                mPassword.setText("");
            }
        }

    }



    public void init() {
        btnSignIn = (ActionProcessButton) findViewById(R.id.btnSignIn);
        mUserName = (FloatLabeledEditText) findViewById(R.id.activity_login_userName);
        mPassword = (FloatLabeledEditText) findViewById(R.id.activity_login_password);
    }

    @Override
    public void onComplete() {
        Toast.makeText(this, R.string.Loading_Complete, Toast.LENGTH_LONG).show();
    }
}

Error:Attribute "theme" has already been defined

In /app/build/intermediates/exploded-aar/com.google.android.gms/play-services/4.4.52/res/values/wallet_attrs.xml

Error:Attribute "theme" has already been defined

Please tell why this is happening when i am trying to compile your library

Gradle: Could not find element /manifest/application.

Hi,

I've been trying to add this library as a gradle dependency of my project, but gradle is enable to merge manifest files correctly, giving me the above error.

I've been looking around and it seems that even for a library project, the associated AndroidManifest.xml needs an empty

This is a workaround as stated here: https://groups.google.com/forum/#!topic/adt-dev/wFnAOAmYCSs

I'm not sure about what to do about it, either wait for a fix in Gradle, or publish a new version with the missing tag. This is up to you guys.

I'm using IntellijIDEA 13.1.4 with the included gradle wrapper plugin.

Cheers,

AL.

PS: if by any chance I'm missing something, any help will be appreciated

README

Hello,
why does your README say:
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.3
but your release says:
compile 'com.github.dmytrodanylyk.android-process-button:library:0.0.7

Igor

drawable background dosnt work ..

hi
why drawable background dosnt work ...
in Xml looks fine..
but after Running ... button selector corners disappear
am i missing sth !?

<com.dd.processbutton.iml.ActionProcessButton
android:id="@+id/basket_stage3_factor_btn_off"
android:layout_width="wrap_content"
android:layout_height="@dimen/value_40dp"
android:layout_gravity="center"

                                android:background="@drawable/button_selector"

                                android:gravity="center"
                                android:text="@string/save"
                                android:padding="@dimen/value_2dp"
                                custom:pb_colorComplete="@color/btn_login"
                                custom:pb_colorProgress="@color/purple_progress"
                                custom:pb_textComplete="@string/Success_send_coupon"
                                custom:pb_textProgress="@string/Loading"
                                custom:pb_colorError="@color/red_error"
                            />

mNormalText

There is bug when press the button the button will show up the processing text and until in some situation i need to manually change the state to normal and the Normal Text does not come back up instead it shows the default text that is defined in the xml. Are there a better way to show do the setNormalText that will able to be programmed dynamically from manually changes?

Owner, where are you?

Hey @dmytrodanylyk - do you need help with this repo? There are bunch of good pull requests waiting and I would prefer some of them are merged to fix bugs and have unified base version.

Let me know if you need help with administration.

Problem using your code

Hi, I am a student just finishing up a course on Android app development.

I pasted in the correct line to my Gradle and synced it.
When I paste in your code in the layout xml file, my project wouldn't build successfully.
I managed to guess that I had to add xmlns:custom="com.dd.processbutton"
inside the . It now builds properly.
Any help on what I might have missed would be great.

Binary XML file line #212: Binary XML file line #212: Error inflating class com.dd.CircularProgressButton

Im also getting same error im using android studio

here is the java file

it is showing me error on setContentView

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_personal_data);

Process: com.teepe.teepe, PID: 13426
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.teepe.teepe/com.teepe.teepe.KYC.personalData}: android.view.InflateException: Binary XML file line #212: Binary XML file line #212: Error inflating class com.dd.CircularProgressButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: android.view.InflateException: Binary XML file line #212: Binary XML file line #212: Error inflating class com.dd.CircularProgressButton
Caused by: android.view.InflateException: Binary XML file line #212: Error inflating class com.dd.CircularProgressButton

How to change font?

There should be support for changing the font of the button to any custom font both through XML and Java/Kotlin

Single Line True Does Not Show Progress Bar

Hi,

When we site singleLine true to the ActionProcessButton (at least that's what I've tested), it does not show the progressBar (indeterminate at least in my testing) below the button.

Regards,
Daksh.

Button text doesn't appear

I don't see the button text but when I press the button, I see the text progress and the text complete.

screenshot_2014-07-29-13-54-03

I don't know if it's related to my issue but in LogCat I see: E/SpannableStringBuilder(14920): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

The code I use for the button:

<com.dd.processbutton.iml.ActionProcessButton android:id="@+id/btnLogin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:text="@string/login"
            android:textColor="@android:color/white"
            android:textSize="18sp"
            custom:pb_textComplete="@string/login_complete_text_success"
            custom:pb_textProgress="@string/progress_text" />

Rendering problem with Android Studio

Hi!

Android Studio throws the next error rendering ActionProcessButton:

Rendering Problems

The following classes could not be instantiated:
- com.dd.processbutton.iml.ActionProcessButton (Open Class, Show Exception)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE

Exception Details

java.lang.AssertionError   
at android.content.res.BridgeResources.getDimension(BridgeResources.java:335)
at com.dd.processbutton.FlatButton.getDimension(FlatButton.java:103)
at com.dd.processbutton.FlatButton.initAttributes(FlatButton.java:52)
at com.dd.processbutton.FlatButton.init(FlatButton.java:38)
at com.dd.processbutton.FlatButton.(FlatButton.java:27)
at com.dd.processbutton.ProcessButton.(ProcessButton.java:31)
at com.dd.processbutton.iml.ActionProcessButton.(ActionProcessButton.java:64)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)   
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)   
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)   
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)   
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)   
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)

It's just the preview, on runtime works fine.

Any ideas?

thanks!

Layout xml

java.lang.AssertionError
at android.content.res.BridgeResources.getDimension(BridgeResources.java:345)
at com.dd.processbutton.FlatButton.getDimension(FlatButton.java:107)
at com.dd.processbutton.FlatButton.initAttributes(FlatButton.java:52)
at com.dd.processbutton.FlatButton.init(FlatButton.java:38)
at com.dd.processbutton.FlatButton.(FlatButton.java:27)
at com.dd.processbutton.ProcessButton.(ProcessButton.java:31)
at com.dd.processbutton.iml.ActionProcessButton.(ActionProcessButton.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:413)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:177)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:214)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:142)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:413)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:497)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:485)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:485)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:590)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Re-enabling Button for user to click again.

Thanks for sharing. I am facing one problem while using this. If task fails i have set the value to -1(Error) but after 1000ms i have to reset the button for user to re-try and click. I tried setting value to 0 "Normal" but it is not animating if i click it 2nd time can anyone help. below is the code i am using.

public void onFailure(final ProcessButton button) {

button.setEnabled(false);

button.setProgress(-1);

button.setText("Cancellation Failed!! Try Again");

final Handler Failurehandler=new Handler();

Failurehandler.postDelayed(new Runnable() {

@OverRide

public void run() {

mProgressFailure += 10;

if (mProgressFailure < 100) {

Failurehandler.postDelayed(this, generateDelay());

} else {

button.setEnabled(true);

button.setProgress(0);

button.setText("click to cancel");

}

}

},generateDelay());

Toast.makeText(this.getContext(), "Task Failed", Toast.LENGTH_LONG).show();

}

Buggy behavior when an endless button gets resized

Steps to reproduce

  1. Replace android:screenOrientation="portrait" by android:configChanges="orientation|screenSize|smallestScreenSize" at the SignInActivity entry in the AndroidManifest.xml file;
  2. Press Sign in button;
  3. Rotate the screen while the progress is still running.

Observed behavior

The button is resized to fit the larger screen width in landscape mode and the animation is performed only at the left side of the button, assuming that the button width is the same as before rotation.

Expected behavior

The animation should cover the full button width.

setText doesn't modify normal text

In FlatButton line 49you set mNormalText and don't allow modifying it again. When a programmer needs the idle text to change, there's no available method to override that initial value, which is later reused whenever the button changes states.

Solution: expose setNormalText()

Workaround: Subclass ActionProcessButton, add your accessible mNormalText field and override getNormalText() to return it instead.

implement error status and reset to default style

Hi, I think that the library should implement an error state (when a login has been failed by an user or password error), and a reset method for return to initial style (text and drawable).

Sorry my english is bad.

Re-enabling button

I have a ActionProcessButton in my layout. Upon the onComplete function, I check if the button has an 'error' message. If it encounters an error message, it re-enables itself. However, upon re-enabling the button and setting the progress back to 0, the button does not animate when click. Is this the correct way to re-enable the button?

            public void onComplete() {
                if (!bSendPin.getText().toString().equals("Success")) {
                    bSendPin.setEnabled(true);
                    bSendPin.setProgress(0);
                } else {
                    //SUCCESS
                    Toast.makeText(MainActivity.this, "SUCCESS", Toast.LENGTH_SHORT).show();
                }
            }

Start Progress start after task complete ?

hi ,
I used action button to display progress while sending mail
progress display after task is finished so it takes time to wait while nothing appear
I need to display progress while task is running, I want the progress start after click on button and finish after task complete, how can I make this
thanks

Button background is not reset upon setProgress(value) where minValue < value > maxValue

This issue applies to the new version on the dev branch:

When setting the progress to a value that should indicate a progress, the button background stays the same as it was before.

So if the button was in error state, and then you set the progress to 1, the progress bar will appear, but the background will still be red.

The issue is presented in the demo app so it is easy to reproduce and fix.

Just add setBackgroundCompat(mNormalDrawable) in onProgress()

Inflate Exception in xml

Hai..
I am trying to run your sample project. I got this error. Please help me solve this issue.

07-15 11:26:24.416: E/AndroidRuntime(3195): FATAL EXCEPTION: main
07-15 11:26:24.416: E/AndroidRuntime(3195): Process: com.example.processbutton, PID: 3195
07-15 11:26:24.416: E/AndroidRuntime(3195): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.processbutton/com.example.processbutton.MainActivity}: android.view.InflateException: Binary XML file line #25: Error inflating class com.dd.processbutton.iml.SubmitProcessButton
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.ActivityThread.access$800(ActivityThread.java:139)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.os.Handler.dispatchMessage(Handler.java:102)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.os.Looper.loop(Looper.java:136)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.ActivityThread.main(ActivityThread.java:5086)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at java.lang.reflect.Method.invokeNative(Native Method)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at java.lang.reflect.Method.invoke(Method.java:515)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at dalvik.system.NativeStart.main(Native Method)
07-15 11:26:24.416: E/AndroidRuntime(3195): Caused by: android.view.InflateException: Binary XML file line #25: Error inflating class com.dd.processbutton.iml.SubmitProcessButton
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.createView(LayoutInflater.java:620)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.Activity.setContentView(Activity.java:1937)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.example.processbutton.MainActivity.onCreate(MainActivity.java:16)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.Activity.performCreate(Activity.java:5248)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
07-15 11:26:24.416: E/AndroidRuntime(3195):     ... 11 more
07-15 11:26:24.416: E/AndroidRuntime(3195): Caused by: java.lang.reflect.InvocationTargetException
07-15 11:26:24.416: E/AndroidRuntime(3195):     at java.lang.reflect.Constructor.constructNative(Native Method)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at android.view.LayoutInflater.createView(LayoutInflater.java:594)
07-15 11:26:24.416: E/AndroidRuntime(3195):     ... 23 more
07-15 11:26:24.416: E/AndroidRuntime(3195): Caused by: java.lang.NoClassDefFoundError: com.dd.processbutton.R$styleable
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.dd.processbutton.FlatButton.initAttributes(FlatButton.java:45)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.dd.processbutton.FlatButton.init(FlatButton.java:38)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.dd.processbutton.FlatButton.<init>(FlatButton.java:27)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.dd.processbutton.ProcessButton.<init>(ProcessButton.java:31)
07-15 11:26:24.416: E/AndroidRuntime(3195):     at com.dd.processbutton.iml.SubmitProcessButton.<init>(SubmitProcessButton.java:40)
07-15 11:26:24.416: E/AndroidRuntime(3195):     ... 26 more

Question: re-enable button after tot secs

I'm in the situation where I do a http request. If I get an error, I set the progress value to -1 showing the error button.
However, I would like to know how it's possible re enable the button (progress = 0) after a certain amount of seconds.
Does the library provide this mechanism? If not, what could you suggest?
Thanks!!

Custom color button

hei there,

i already tried this library, so far its great library. but, i got problem when to custom color button. i tried to reference color to my atribute but no works.
can u explain me the simple way?

thank u.

Progress color always matching Normal color

This is my button

    <com.dd.processbutton.iml.ActionProcessButton
        pb:pb_colorPressed="@android:color/transparent"
        pb:pb_colorComplete="@color/blue"
        pb:pb_textComplete="@string/complete"
        pb:pb_colorError="@color/red"
        pb:pb_textError="@string/error"
        pb:pb_colorProgress="@color/blue"
        pb:pb_textProgress="@string/progress"
        pb:pb_colorNormal="@color/green"
        android:text="@string/confirm_idle" />

the progress state shows as green for some reason. I'm not setting the colors again in code or anything.

Eclipse Library

Hey,
I love your project, it's really great. Unfortunately I'm not using gradle to build my projects (yet), can you please publish also *.aar / *.jar files?
Many 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.