dmytrodanylyk / android-morphing-button Goto Github PK
View Code? Open in Web Editor NEWAndroid Morphing Button
Android Morphing Button
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:
cool
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!
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
how to set icon from drawable?
i'm trying to implement the library but its not working
the gradle not work
You have objects allocations in onDraw() method which in class LinearProgressButton.
Is there a way to implement ripple effect with this library?
i cant sync this lib with gradle
currently the success circle is in middle of the layout . can we move it to the left or right side ??
<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
How can you change the button colour on XML?
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)
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
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
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);
}
});
}
}
is there a way to unmorph the button, show back in its original shape ?
Is there a way to make progress circular? Indeterminate as well as Determinate
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?
I think you can avoid both those issues by dis-allowing the user from tapping the button during animation play.
Is it possible to change the color of the button via XML?
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.