1)custom_dialog_calcel.xml
===================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="280dp"
android:layout_height="140dp"
android:gravity="center"
android:layout_gravity="center"
android:background="@drawable/ractangle_button_background"
android:orientation="vertical" >
<TextView
android:id="@+id/txtMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="15dp"
android:layout_weight="1"
android:gravity="center"
android:text="Your booking has been canceled successfully"
android:textColor="@android:color/white"
android:textSize="14sp" />
<Button
android:id="@+id/btnOk"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_marginBottom="15dp"
android:background="@drawable/ractangle_button"
android:gravity="center"
android:padding="10dp"
android:text="OK"
android:textColor="@color/blue" />
</LinearLayout>
2)custom_dialog.xml
==============
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/book_now_dialog_width"
android:layout_height="@dimen/book_now_dialog_height"
android:layout_gravity="center"
android:background="@android:color/transparent" >
<!-- Contents will go here.. -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:background="@color/blue"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="1dp"
android:background="@android:color/white"
android:orientation="vertical" >
<TextView
android:id="@+id/txtHeading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/lemon_yellow"
android:gravity="left"
android:padding="5dp"
android:text="Class"
android:textColor="@color/blue"
android:textSize="18dp" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/class_name"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtClassName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/teacher"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtTeacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/date"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/time"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/venue"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtVenue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/class_type"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtClassType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<Button
android:id="@+id/btnBookNow"
android:layout_width="150dp"
android:layout_height="40dp"
android:layout_gravity="center|bottom"
android:layout_margin="15dp"
android:background="@drawable/ractangle_button"
android:gravity="center"
android:text="Book Now"
android:textColor="@color/blue"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/btnClose"
android:layout_width="@dimen/btn_close_width"
android:layout_height="@dimen/btn_close_height"
android:layout_alignParentRight="true"
android:layout_gravity="right|center"
android:layout_marginRight="3dp"
android:background="@drawable/round_button_background"
android:gravity="center_vertical|center_horizontal"
android:text="X"
android:textColor="@color/blue"
android:textSize="12sp"
android:textStyle="bold" />
</RelativeLayout>
3) in drawable folder put
A) ractangle_button_background.xml
=======================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#93772C"/>
<!-- <stroke android:width="3dp" -->
<!-- android:color="#ff000000" -->
<!-- /> -->
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"
/>
<corners android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp" android:topRightRadius="10dp"/>
</shape>
B)ractangle_button.xml
===================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/lemon_yellow"/>
<!-- <stroke android:width="3dp" -->
<!-- android:color="#ff000000" -->
<!-- /> -->
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
</shape>
C) round_button_background.xml
=====================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/lemon_yellow" />
<stroke android:width="2dp" android:color="@color/blue" />
</shape>
4)
public void dialogCancelBooking() {
final Dialog dialog = new Dialog (this,android.R.style.Theme_Translucent_NoTitleBar);
dialog.setContentView(R.layout.custom_dialog_cancel);
Button btnOk = (Button) dialog.findViewById(R.id.btnOk);
TextView txtMsg = (TextView) dialog
.findViewById(R.id.txtMsg);
btnOk.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
===================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="280dp"
android:layout_height="140dp"
android:gravity="center"
android:layout_gravity="center"
android:background="@drawable/ractangle_button_background"
android:orientation="vertical" >
<TextView
android:id="@+id/txtMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="15dp"
android:layout_weight="1"
android:gravity="center"
android:text="Your booking has been canceled successfully"
android:textColor="@android:color/white"
android:textSize="14sp" />
<Button
android:id="@+id/btnOk"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_marginBottom="15dp"
android:background="@drawable/ractangle_button"
android:gravity="center"
android:padding="10dp"
android:text="OK"
android:textColor="@color/blue" />
</LinearLayout>
2)custom_dialog.xml
==============
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/book_now_dialog_width"
android:layout_height="@dimen/book_now_dialog_height"
android:layout_gravity="center"
android:background="@android:color/transparent" >
<!-- Contents will go here.. -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:background="@color/blue"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="1dp"
android:background="@android:color/white"
android:orientation="vertical" >
<TextView
android:id="@+id/txtHeading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/lemon_yellow"
android:gravity="left"
android:padding="5dp"
android:text="Class"
android:textColor="@color/blue"
android:textSize="18dp" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="10dp"
android:layout_weight="1"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/class_name"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtClassName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/teacher"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtTeacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/date"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/time"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/venue"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtVenue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/class_type"
android:textColor="@color/blue"
android:textSize="14sp" />
<TextView
android:id="@+id/txtClassType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message"
android:textColor="@color/Black"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<Button
android:id="@+id/btnBookNow"
android:layout_width="150dp"
android:layout_height="40dp"
android:layout_gravity="center|bottom"
android:layout_margin="15dp"
android:background="@drawable/ractangle_button"
android:gravity="center"
android:text="Book Now"
android:textColor="@color/blue"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/btnClose"
android:layout_width="@dimen/btn_close_width"
android:layout_height="@dimen/btn_close_height"
android:layout_alignParentRight="true"
android:layout_gravity="right|center"
android:layout_marginRight="3dp"
android:background="@drawable/round_button_background"
android:gravity="center_vertical|center_horizontal"
android:text="X"
android:textColor="@color/blue"
android:textSize="12sp"
android:textStyle="bold" />
</RelativeLayout>
3) in drawable folder put
A) ractangle_button_background.xml
=======================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#93772C"/>
<!-- <stroke android:width="3dp" -->
<!-- android:color="#ff000000" -->
<!-- /> -->
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"
/>
<corners android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp" android:topRightRadius="10dp"/>
</shape>
B)ractangle_button.xml
===================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/lemon_yellow"/>
<!-- <stroke android:width="3dp" -->
<!-- android:color="#ff000000" -->
<!-- /> -->
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"/>
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp" android:topRightRadius="7dp"/>
</shape>
C) round_button_background.xml
=====================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/lemon_yellow" />
<stroke android:width="2dp" android:color="@color/blue" />
</shape>
4)
public void dialogCancelBooking() {
final Dialog dialog = new Dialog (this,android.R.style.Theme_Translucent_NoTitleBar);
dialog.setContentView(R.layout.custom_dialog_cancel);
Button btnOk = (Button) dialog.findViewById(R.id.btnOk);
TextView txtMsg = (TextView) dialog
.findViewById(R.id.txtMsg);
btnOk.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
No comments:
Post a Comment