Create rounded imageview in Android

There is a simple way to create rounded image view in Android. We can use a CardView and ImageView together for this. See the below code

<android.support.v7.widget.CardView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:cardCornerRadius="50dp"
    app:cardPreventCornerOverlap="true">

    <ImageView
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:src="@drawable/profile_image" />

</android.support.v7.widget.CardView>

Use the app:cardCornerRadius value exactly half of the image.

rounded_imageview_android
This is how it looks like

Thank you.

How to detect and apply window size to a div using jQuery

In some case we need to apply the window width and height to a div or something like that. Here is a solution for that.

You can detect and insert the screen width to a variable using the following jQuery code,

var screen_width = $(window).width();

Also you can detect and insert the screen height to a variable using the following jQuery code,

var screen_height = $(window).height();

If you want to apply the width or to a div, you can use the following code,

//do something with the width or height value here!
    $("div").width(screen_width);
    $("div").height(screen_height);

If you want to customize your value (example: you want to reduce 10pixels from the screen width), you can use the following code,

var screen_width = $(window).width();
var screen_height = $(window).height();
var reduced_width = parseInt(current_width)- parseInt(10);
var reduced_height = parseInt(current_height)- parseInt(10);
     
//do something with the width or height value here!
    $("div").width(reduced_width);
    $("div").height(reduced_height);

If you liked the script, leave a comment here. 🙂
Enjoy…

How to make rounded corner div using css

In many sites we found rounded corner divs without using images. We can make it in simple way using css. But it will not work in IE up to IE 8. We can use this css on everything, like table, text inputs, buttons, images, etc.

for deferent browsers, the css are,

IE9+ = border-radius: Value;

Mozilla Firefox = -moz-border-radius: Value;

Opera = -o-border-radius: Value;

Crome, safari = -webkit-border-radius: Value;

Konqueror = -khtml-border-radius: Value;

Radius value 10px.

Here is the example for radius value 10px applied for a div

Continue reading How to make rounded corner div using css

How to make Twitter type textfield glow effect using CSS

Twitter have good attractive interface to impress the users. one of them is the textfield. Here I am talking about how we can create that thing.

Its is simple. We can make it using CSS. There used some simple css steps.

But it will not work in explorer. The new version of explorer(IE 9) supports this.

Continue reading How to make Twitter type textfield glow effect using CSS

A trip to Wayanad

After a long time we planned to go for a trip to Wayanad from our club Yuvadhara Arts & Sports Club, Kadampanad. And we fixed it for Pooja holidays. Its was a two day trip. We started the journey on 15-10-2010 evening 8 PM from Ganesavilasam. About 6AM we reached the Adivaram (Wayanad Churam, Thamarassery Churam), we stayed there for morning light, because if there is no light, it is very difficult to travel through the churam, dangerous hairpins are there. And it is a narrow way. about 7 AM we started to travel through the churam. It was a adventurous journey, and we enjoyed a lot. On the way we can see from top, many of vehicles in small size. The are going slowly back to back, very carefully. When we reached the 3/4 th of the churam, we saw the the sunrise. It was a beautiful sight from there. There we stopped to see the beautiful morning and the long sight of Wayanad. Continue reading A trip to Wayanad