I developed Android Application and I want to use extended floating button like floating button on Path Application in my layout. I hope someone can give me example about the code how to make this things. Thank You.
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hellooooo"
app:icon = "#drawable/pass_resource_here"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
</com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton>
Here's a detailed tutorial on how to create a good extended floating button with animations https://www.learn2crack.com/2015/10/android-floating-action-button-animations.html
Try using this library and modify it to your liking by using the sam ple project in the library
https://github.com/oguzbilgener/CircularFloatingActionMenu
Related
I want my ToggleButton to like like this .
But with this code , it always shows me the older toggle button.
Am running the code in Emulator with API 21 only, Am I missing something here. My code snippet is
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
Found a solution.
Using Android support library. Code snippet is..
<android.support.v7.widget.SwitchCompat
android:id="#+id/id_useridview_switch"
android:layout_marginTop="24dp"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:theme="#style/colortoggle"
/>
Thanks Selvin, got a clue from ur and on what to search
In this code you just set the width and height of your toggle button!
for Android L toggle button you should use support libraries to achieve that!
google something like these:
android L Toggle button support libraries
Also search in Github.com
Use Switch instead of toggle button you will get what u need. No need for external libraries
I'm looking at implementing a cardview which has a button with the ripple effect.
I'm talking about something like this :
https://lh5.ggpht.com/uTRdkJMNyy3KasauJsyGTTRHn5EZBtmA3-BVHCaHWiqBIF_XQmJg_MuE8OdisvefdEk=h900-rw)
I'm trying to implement the download/share button as present on those cards.
Should I be using an ImageButton or something else?
Also, how can I extend the same support for pre-lollipop devices?
UPDATE:
This is the code I'm using right now. It gives me an image button but I'n not able to get touch/ripple effects. The android:foreground property works for cardView and gives the ripple effect, but not for ImageButton.
<ImageButton
android:id="#+id/ib_open_map"
android:background="#drawable/ic_directions_grey600_36dp"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
I think this can be interesting for you.
You will have to import or link the library to be able to use it.
Here is the link to the library :
Link to the library
It is easy to use and it is based on imageView.
Hope it helps you :) Let me know
EDIT
Editing my link for your update :)
Take a look at this : MaterialRipple
i want to make view like this with a button at the bottom. how can i do it? i am new to material design. I tried RecyclerView but i don't know whats that button.
you have to use FloatingActionButton try this.
http://developer.android.com/samples/FloatingActionButtonBasic/index.html
Visit https://github.com/vinc3m1/RoundedImageView/
this library can help you.
When you add library to your project write your xml file like that:
<com.makeramen.roundedimageview.RoundedImageView
android:id="#+id/imageViewID"
android:layout_width="40dp"
android:layout_height="40dp"/>
Is it possible to Bind Android TextView to Click event with MvvmCross?
Or as alternative make a button which looks like TextView?
It is turned out that TextView can be bound same way as Button
local:MvxBind="Click DoCommand"
You can bind a text view like this.
<TextView android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
local:MvxBind="Click DoThisCommand" />
height and width you can manage according to your convinience.
Hope this will help you.
As the OP may be interested in methods to achieve click binding from code-behind as opposed to xml I have provided the following for guidance:
using MvvmCross.Platforms.Android.Binding;
var set = this.CreateBindingSet<theActivity,theViewModel>();
imageView1.For(x=> x.BindClick()).To(vm=>vm.imageViewClickCmd);
set.Apply()
The MvvmCross.Platforms.Android.Binding namespace provides the BindClick() extension method. Similar methods can be found for alternative events at the following links https://www.mvvmcross.com/documentation/fundamentals/data-binding#built-in-bindings
Alternatively you can use
imageView1.For("Click").To(vm=>vm.imageViewClickCmd);
i want to make application in android Tablets like in ipad which have spliting screen,
How i can do that ? if any body have idea please send me!
Thank you in advance.
This is achievable using the Fragments API. Fragments are available since Android 3.0, but there's also a Support Library that lets you use these API's from Android 1.6. Hope this helps.
Using fragments: check http://mobile.tutsplus.com/tutorials/android/android-compatibility-working-with-fragments/
it's a tutorial with sample application that uses the compatibility package (allows you to support from API 4), it may help
this is not a 'feature' limited to iOS
you can easily do this in Android by using two vertical LinearLayouts and assigning them equal weight - to split the screen into half or Different weights to achieve something like the image you provided.
And of course, there are a lot of other ways to do that.
This will be the fragment xml file. then you have to write two xml files for CustomerList(Left Part) and CustomerInfo(Right Part). your activity should extends FragmentActivity. try with this:::
<fragment class="ui.misc.Customers$CustomerList"
android:id="#+id/customerlistfragmant" android:layout_weight="1"
android:layout_width="550px"
android:layout_height="wrap_content"
/>
<fragment class="ui.misc.Customers$CustomerInfo"
android:id="#+id/customerinfofragmant" android:layout_weight="1"
android:layout_width="350px" android:layout_height="wrap_content" />
<FrameLayout android:id="#+id/regscreentwo" android:layout_weight="1"
android:layout_width="0px"
android:layout_height="fill_parent"
/>
</LinearLayout>
you can use the APIs described here: Fragments API