Best way to create custom android button [closed] - android

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am new at Android UI development and was curious to know if anyone had any simple approaches to creating a button with an image on the top, and some text with a solid background near the bottom of the button. What would be your approach to this?
I have considered creating a button with an image background, and then placing a label with the text 'Send' with a solid background color directly underneath the button. However, I assume this may render differently and not line up properly on different devices/versions of Android.

You basically create a layout with your image, bar and label (in a layout file..) and then you use the <include> tag to make that "button" accessible in other xml layouts.
You can just use regular OnClickListener's for layouts.

For this, I would create a linearLayout with an ImageView(if I have that arrow image) and a TextView underneath it. Can set the onClickListener either on the layout or the ImageView or the TextView. If you want an effect like a ripple you can always add a background with a custom style.

Related

Is using a TextView to create separation between two page elements ill-advised? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm a student in an android development program. I've built a few apps and I had an idea to use a very simple TextView to draw a line across the screen to visually separate a page element. The TextView would hold no text, it has no function or use other than to separate two elements with a horizontal rule. I'm using it in a ConstraintLayout.
Can anyone give me a reason as to why this is NOT a good idea? What would the best practices be otherwise? Is it normal to use an empty TextView in this manner?
It's perfectly fine to do that, but it's unnecessary to use a TextView specifically: A TextView with no text is just a View.
You can just create a View with whatever height and background color and use that:
<View
android:layout_width="match_parent"
android:layout_width="1dp"
android:background="#color/my_divider_color" />
Replace 1dp with whatever height you want and #color/my_divider_color with whatever color you want the divider to be.

How to add an blocks in Android [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to create an landing view for my application a user log in they need to land on this activity page (Image 1) if they click on any of the icon they will be take to the activity page of that activity. I want it needed to be change when user turn their screen to vertical or horizontal. But I don't know where to start.
Below I have added two images to show what I want to implement in my application. This is for my college project. In the landing view it have alert box and another box text from MySQL database but I am stuck in all points.
Image 1
Image 2
what you need is a dashboard activity/ fragment...
something like this.
the rotation of the screen is not a big problem, in fact, with the sdk you can design your activities and define behaviours of completely other layouts depending on the screen size, orienttation etc...
The work to do is not complicated but you need to do couple of stuff first, (define some layouts, classese etc,)
my recomendation is to take a look at this tutorial, and develope your app by following this steps
1 -
you can do it by set ImageButton in your main layout when click in any image will open new layout
show this link is simple code but he use button you can make some code and use ImageButton not Button only convert type name from button to ImageButton
this is link= : https://stackoverflow.com/a/10936133/4967569
2 -
screen to vertical or horizonta
i think you need use any size by Formula "dp"
3 -
sorry i cant help you in Database I have No experience

xml layout in android [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
So i'm having some issues with getting my application to look the way i want it to.
So the first issue i'm having is, i want to have small icons on the left side which is always visable to the end user. And they have the option to take it out (pull the icons to the right), and look what they do (i'll add text on the left side of the icons). What kind of view would i have to use?
Also whenever i try to make icons they always get a grey background eventhough i have transparent background in ps.
finally, how do i get a photo to show up from a website? i'll have my own database of photos i want to be shown, but how do i get those to appear? i tried things such as imageview, but that's something different..
Thanks in advance
For partially visible navigation drawer, follow the link : Android - How to implement a NavigationDrawer that is partially visible at all times?
For clickable icons, you are probably using android:src for ImageButton. Instead set image as android:background
For images to be loaded from the web, use WebView and simply using <img src="example.com/xyz.jpg"> will do the work.

How do I create a button with the same visual appearance as the Google Play sign in button`? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I want to style my sign out button so it looks like the Google Play Service sign in button. Anyone have an ide how I can style a button like the screenshot below. Im using the standard google play sign in button. What Im after is a red (#dd4b39) button with an custom icon, a separator and a white text in the right size and padding. Anyone got a example how to do this?
There are 2 ways to do it.
1st is to get it done through the web designer and apply the back
round png to the button
2nd is to use 2 buttons and align them side by side and on first
button write text g+ and on second button write Whatever text you want
and apply red background color to both
I solved it by using the nine patch image I found on this page, https://developers.google.com/+/branding-guidelines and used them as a background drawable on a regular button.

How to create slider same as android inbuilt lock slider? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
i need creating slider same as like iphone or android inbuilt lock slider in home screen app. for this functionality i will use any inbuilt control or create custom layout for this. anyone has info. regarding this than pls send me any link or details.
You will have to make a custom slider:
Use a seekbar widget.
Then, on the onStopTrackingTouch listener, reset the seekbar position to ZERO unless the rightmost value has been reached. This will have a "snapping" effect. You can also code an animation to bring it back to the initial position smoothly instead of the "snapping" effect. If the rightmost value has been reached, you can do whatever you wanted to do.
You can use custom 9-patch graphics too!

Categories

Resources