Code Monkey home page Code Monkey logo

android-morphing-button's People

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

android-morphing-button's Issues

Gradle Sync Problem

Now, I have some problem import master file.

Error:(10, 0) Unable to find method 'org.gradle.api.internal.project.ProjectInternal.getPluginManager()Lorg/gradle/api/internal/plugins/PluginManagerInternal;'.
Possible causes for this unexpected error include:

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

NullPointerException

Hello!
Why is the 6-th line code may call the exception when try to run app?
And the 7-th line is OK.
The same exception occur, when i try to adress to any resourses like String or Color.

1 MorphingButton.Params sim_m = MorphingButton.Params.create()
2 .duration(500)
3 .cornerRadius(3)
4 .width(135)
5 .height(56)
6 .color(color(R.color.Sim))
7 .colorPressed(Color.parseColor("#00796B"));

I'm sorry, maybe i don't know something...
Thanks you for your MorphingButton!

Weird grey background shows up on Morphing button at random point in ViewPager

Nice work android-morphing button,well-done.I tried adding a morphin button to the bottom of view layouts to be populated in a view pager and while swiping around the viewpager morphing button automatically switches to a grey background in each viewpager item layout and immediately to the default blue background...This is weird...How can I make the grey background white since my default layout background is white,so users won't notice the flickering...Thanks

Circular button not working in release with proguard

Morphing to a circular button is working as intended in my debug builds:

screenshot_1522659640

but as soon as I compile a release build, the button stops changing color and shape. Only the text changes:

screenshot_1522659625

Any idea whats going on?

Ripple Effect

Is there a way to implement ripple effect with this library?

Different Size on every phone

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_marginTop="20dp">

        <com.dd.morphingbutton.impl.IndeterminateProgressButton
            android:id="@+id/btn_login"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:fontFamily="@font/pt_mono"
            android:layout_gravity="center_horizontal"
            android:textSize="18sp"
            android:textColor="@color/colorBackGrey"
            android:text="LOGIN"/>

    </FrameLayout>


private void morphToSquare(final IndeterminateProgressButton btnMorph, int duration){
    MorphingButton.Params circle = MorphingButton.Params.create()
            .duration(duration)
            .cornerRadius(46)
            .height(110)
            .width(FrameLayout.LayoutParams.FILL_PARENT)
            .color(getResources().getColor(R.color.colorAccent))
            .text("LOG IN")
            .colorPressed(getResources().getColor(R.color.accentPressed));
    btnMorph.morph(circle);
}

But it shows different size of button on different android phone

Error when using a vectorDrawable as button icon

I got the following error whin I tried to pass in a vectorDrawable as the button's icon. The code works fine if I'm using a png image.

FATAL EXCEPTION: main
  Process: com.qbes.totobusdriver, PID: 8294
  android.content.res.Resources$NotFoundException: File res/drawable/ic_nope.xml from drawable resource ID #0x7f02007b
	  at android.content.res.Resources.loadDrawable(Resources.java:2101)
	  at android.content.res.Resources.getDrawable(Resources.java:700)
	  at com.dd.morphingbutton.MorphingButton$4.run(MorphingButton.java:210)
	  at android.os.Handler.handleCallback(Handler.java:733)
	  at android.os.Handler.dispatchMessage(Handler.java:95)
	  at android.os.Looper.loop(Looper.java:136)
	  at android.app.ActivityThread.main(ActivityThread.java:5017)
	  at java.lang.reflect.Method.invokeNative(Native Method)
	  at java.lang.reflect.Method.invoke(Method.java:515)
	  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
	  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
	  at dalvik.system.NativeStart.main(Native Method)
   Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector
	  at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933)
	  at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877)
	  at android.content.res.Resources.loadDrawable(Resources.java:2097)
	  at android.content.res.Resources.getDrawable(Resources.java:700) 
	  at com.dd.morphingbutton.MorphingButton$4.run(MorphingButton.java:210) 
	  at android.os.Handler.handleCallback(Handler.java:733) 
	  at android.os.Handler.dispatchMessage(Handler.java:95) 
	  at android.os.Looper.loop(Looper.java:136) 
	  at android.app.ActivityThread.main(ActivityThread.java:5017) 
	  at java.lang.reflect.Method.invokeNative(Native Method) 
	  at java.lang.reflect.Method.invoke(Method.java:515) 
	  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
	  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
	  at dalvik.system.NativeStart.main(Native Method) 

can't import

I get this:

Configuration on demand is an incubating feature.
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\User\Desktop\android-morphing-button\library\build.gradle' line: 10

* What went wrong:
A problem occurred evaluating project ':library'.
> Failed to apply plugin [id 'com.github.dcendents.android-maven']
   > Could not create plugin of type 'AndroidMavenPlugin'.
      > No service of type Factory<LoggingManagerInternal> available in ProjectScopeServices.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

image

how to use this in fragment ??

hello my friend

  .cornerRadius(dimen(R.dimen.mb_corner_radius_2))
                .width(dimen(R.dimen.mb_width_100))
                .height(dimen(R.dimen.mb_height_56))
                .color(color(R.color.mb_blue))

dimen , color , integer connot resolve in fragment

"Unfortunately, <app name> has stopped"

App builds perfectly, but when its executed, A message box with "Unfortunately, has stopped" message shows up.
My MainActivity.java:

package com.something.myproject;

import android.support.annotation.ColorRes;
import android.support.annotation.DimenRes;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.app.;
import android.os.Bundle;
import com.dd.morphingbutton.
;

public class MainActivity extends Activity {
MorphingButton btnlogin = (MorphingButton) findViewById(R.id.button_login);
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

    btnlogin.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View view) {
            MorphingButton.Params circle = MorphingButton.Params.create()
                    .duration(500)
                    .cornerRadius(R.dimen.rgmnt_height_56) // 56 dp
                    .width(R.dimen.rgmnt_height_56) // 56 dp
                    .height(R.dimen.rgmnt_height_56) // 56 dp
                    .color(R.color.rgmnt_green) // normal state color
                    .colorPressed(R.color.rgmnt_green_dark) // pressed state color
                    .icon(R.drawable.ic_done); // icon
            btnlogin.morph(circle);
        }
    });
}

}

Setting a custom background does not work

I tried doing this:

<com.dd.morphingbutton.MorphingButton
            android:id="@+id/buttonSend"
            style="?android:attr/borderlessButtonStyle"
            android:background="@drawable/transact_button_send"
            android:layout_width="?android:attr/actionBarSize"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="@color/white"
            android:text="SEND" />

The background still stays the default blue. What is the reason for this?

Bug: some clicking issues during animations

  1. it allows you to tap during animation, so double tapping actually start and stop the animation back to the original state, or worse: it goes to the next state, and doesn't do anything on the next tap you perform (as it thinks it's on the correct state).
  2. when the button has rounded corners during animation, and you tap on it, it shows rectangle selection.

I think you can avoid both those issues by dis-allowing the user from tapping the button during animation play.

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.