Skip to content

Instantly share code, notes, and snippets.

@vinodyadav5799
vinodyadav5799 / portrait orientation CSS
Created October 5, 2018 22:06
portrait orientation CSS
@media only screen and (orientation: portrait) {
body {
background-color: red;
}
h1 {color: white;}
p {color: blue;}
}
@vinodyadav5799
vinodyadav5799 / Landscape Orientation CSS
Created October 5, 2018 22:05
Landscape Orientation CSS
@media only screen and (orientation: landscape) {
body {
background-color: lightblue;
}
h1 {color: blue;}
p {color: red;}
}
@vinodyadav5799
vinodyadav5799 / web page orientation
Created October 5, 2018 22:04
device orientation
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
@media only screen and (orientation: landscape) {
body {
background-color: lightblue;
@vinodyadav5799
vinodyadav5799 / CardViewLayout_TextView_Overlapping.xml
Created September 16, 2018 20:46
Textview overlapping to imageview using CardView Layout
<app:android.support.v7.widget.CardView
android:id="@+id/cardview1"
android:layout_width="150dp"
android:layout_height="148dp"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:innerRadius="10dp"
android:shape="ring"
android:thicknessRatio="4"
app:cardCornerRadius="10dp">
@vinodyadav5799
vinodyadav5799 / LinearLayout_TextView_Overlapping.xml
Created September 16, 2018 20:44
Textview overlapping to imageview using LinearLayout
<LinearLayout
android:id="@+id/linearlayout1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:background="@drawable/spiderman"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
@vinodyadav5799
vinodyadav5799 / RelativeLayout_TextView_Overlapping.xml
Created September 16, 2018 20:43
Textview overlapping to imageview using RelativeLayout
<RelativeLayout
android:id="@+id/Relativelayout1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/wonderwoman"/>
@vinodyadav5799
vinodyadav5799 / FrameLayout_TextView_Overlapping.xml
Created September 16, 2018 20:42
Textview overlapping to imageview using FrameLayout
<FrameLayout
android:id="@+id/framelayout1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center">
<ImageView
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="@drawable/ironman"
android:scaleType="matrix"></ImageView>
@vinodyadav5799
vinodyadav5799 / circular_imageview.xml
Created August 17, 2018 22:25
creating the circular imageview using cardview layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<app:android.support.v7.widget.CardView
android:layout_width="150dp"
android:layout_height="148dp"
@vinodyadav5799
vinodyadav5799 / split_layout_into_three_unequal_both.xml
Created August 15, 2018 21:51
splitting the layout into three unequal part for both orientation
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2">
<LinearLayout
android:id="@+id/firstLayout"
android:layout_width="wrap_content"
@vinodyadav5799
vinodyadav5799 / split_layout_into_two_unequal_horizontally.xml
Created August 15, 2018 21:47
splitting the layout into two unequal part horizontally
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1">
<LinearLayout
android:id="@+id/firstLayout"
android:layout_width="wrap_content"