How to create ICS holo style edit text for older versions? - android

I have searched lot of sites for creating ICS holo style EditText in Android older versions. But the results did not helped me. Please provide me some sample links/code.

Copy the images from the android-sdk folder, and use them.
Search here for textfield_bg_*
/android-sdks/platforms/android-16/data/res/drawable-mdpi

Basically you want to download this xml selector drawable and put it as the background of each EditText:
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/drawable/edit_text_holo_light.xml
(If you want holo dark then just replace each instance of "light" with "dark", obviously.)
Then you need to find each of the drawables referenced in that selector and download them into your res folder in the appropriate size category. You can use that github project to search for them - for example, the xhdpi version of textfield_multiline_default_holo_light can be found at https://github.com/android/platform_frameworks_base/blob/master/core/res/res/drawable-xhdpi/textfield_multiline_default_holo_light.9.png

You should probably use the HoloEveryWhere Library. It allows you to use the Holo themes on older API levels.

Related

how to add material design icons-font to an Android app

In my app there are a lot of places where i have to programmatically add icons into my textviews.
On the Android material design website i saw, that you can use icon fonts, but there is nothing that indicates that you can do this inside an android app, lose from the png and svg icons itself.
http://google.github.io/material-design-icons/
is it possible to use icon-fonts in android? and if it is possible how do i implemented this into my app?
can someone help me with this?.
With the latest version of the Android Studio, you can now generate the Material icon by
In Android Studio, open an Android app project.
In the Project window, select the Android view.
Right-click the res folder and select New > Vector Asset.
Vector images can also be generated by selecting vector image option
More information about vector assets can be found here https://developer.android.com/studio/write/vector-asset-studio
You could have a look at the Android-Ionics library: https://github.com/mikepenz/Android-Iconics
It has many built-in fonts including the Material Design Icon Font and can be used for ImageViews, TextViews and Buttons.
Apart from that you can use the Material Design Icon Font like any other font:
Download .ttf file and save it under main/assets/fonts
Define strings for the unicode values you need, e.g. something like
<string name="myicon"></string>
Load typeface in your application and set typeface for textview
Use string myicon as text in your textview
Unfortunately I can't find built-in solution for this, but you can check this samples with external libs
http://blog.shamanland.com/2013/11/how-to-use-icon-fonts-in-android.html
http://fortawesome.github.io/Font-Awesome/icon/android/
http://code.tutsplus.com/tutorials/how-to-use-fontawesome-in-an-android-app--cms-24167

Is there a default delete icon in Android?

I would like to add a delete icon (trashcan) in my actionbar. Is it a default icon can that an app can use or should the icon be a drawable in the app itself?
You can use #android:drawable/ic_menu_delete in your menu XML. This will show the default delete icon across different versions of Android (meaning it will be different on different OS versions). If you want it to be consistent across all versions, you can also download icons from https://github.com/google/material-design-icons and include them in your project drawables folder.
I would very much recommend this icon pack from Google:
https://github.com/google/material-design-icons/releases
It includes their set of Material design icons.
Navigable here:
https://www.google.com/design/icons/
Update:
This repository is extremely useful, with many Google / Custom icons:
https://materialdesignicons.com/

Where can i found default android xml drawables?

I would like to use the default ice cream sandwich radio button but not with ligth blue color. I would like to recolor it.
Can i somewhere found the original .xml files to recolor and use it in my project?
Look in your SDK folder, API-Level, under data/res/drawable
Take a look in the Android sources:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res
Most of the drawables use styles, so you can just change the colors by setting styles in your app.
Like here:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/styles.xml

How to get some stlyed item from Holo Dark theme to older android versions?

I would like to get the look of an EditText just like the way it is in Holo Dark theme.
Is there a way to somehow "steal" it from the newer look of android and implement it in my project?
I would like this:
You need HoloEverywhere.
Althought If your need is only change background of Editext or any views, you should copy them from newer sdk's sdk/platforms/version/data/res directory and use them into your project
.

Needing a example of how to style an EditText control in the Holo theme to be more like pre Holo

I am trying to more or less copy a PSD that has older controls in it with also using the ActionBar in ICS they like the old style that has the actual box instead of the underline. how would i be able to keep the holo theme and revert a control to the old styles?
Just wanted to show you how i made this happen as quick fix..
http://www.androidworks.com/changing-the-android-edittext-ui-widget
This covers the bases on how to style in depth .. and basically i built my own 9.png files..

Categories

Resources