JAVA Code
LayoutInflater layoutInflater = (LayoutInflater) OrderActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
popupView = layoutInflater.inflate(R.layout.order_search_popupwindow,null);
order_search_popupwindow_popup = new PopupWindow(popupView,WindowManager.LayoutParams.WRAP_CONTENT,WindowManager.LayoutParams.WRAP_CONTENT,false);
order_search_popupwindow_popup.setFocusable(true);
order_search_popupwindow_popup.setBackgroundDrawable(new BitmapDrawable());
order_search_popupwindow_popup.showAtLocation(v, Gravity.NO_GRAVITY, 10, 150);
XML Of R.layout.order_search_popupwindow
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="500dp"
android:background="@android:color/transparent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/popup_popup_bg"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="60dp"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="2" >
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight=".5"
android:gravity="center" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="From " />
<TextView
android:id="@+id/FromEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:background="@drawable/popup_date_field"
android:gravity="center_vertical"
android:paddingLeft="3dp"
android:textSize="15dp"
/>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="To " />
<TextView
android:id="@+id/ToEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/popup_date_field"
android:gravity="center_vertical"
android:paddingLeft="3dp"
android:layout_marginLeft="25dp"
android:textSize="15dp" />
</TableRow>
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="120dp"
android:gravity="center_vertical"
android:orientation="vertical" >
<EditText
android:id="@+id/searchOrderNo"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:background="@drawable/popup_order_field_active"
android:cursorVisible="false"
android:maxWidth="100dp"
android:imeOptions="actionDone"
android:paddingLeft="3dp"
android:numeric="integer"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@drawable/popup_horizontal_separator"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
>
<ImageView
android:id="@+id/popupwindowSearchBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/popup_btn_search"
android:gravity="center"
android:layout_marginBottom="10dp"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="81dp"
android:id="@+id/searchLayout"
android:background="@drawable/brochure_trans13"
/>
</LinearLayout>
LayoutInflater layoutInflater = (LayoutInflater) OrderActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
popupView = layoutInflater.inflate(R.layout.order_search_popupwindow,null);
order_search_popupwindow_popup = new PopupWindow(popupView,WindowManager.LayoutParams.WRAP_CONTENT,WindowManager.LayoutParams.WRAP_CONTENT,false);
order_search_popupwindow_popup.setFocusable(true);
order_search_popupwindow_popup.setBackgroundDrawable(new BitmapDrawable());
order_search_popupwindow_popup.showAtLocation(v, Gravity.NO_GRAVITY, 10, 150);
XML Of R.layout.order_search_popupwindow
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="500dp"
android:background="@android:color/transparent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/popup_popup_bg"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="60dp"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="2" >
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight=".5"
android:gravity="center" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="From " />
<TextView
android:id="@+id/FromEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:background="@drawable/popup_date_field"
android:gravity="center_vertical"
android:paddingLeft="3dp"
android:textSize="15dp"
/>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="To " />
<TextView
android:id="@+id/ToEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/popup_date_field"
android:gravity="center_vertical"
android:paddingLeft="3dp"
android:layout_marginLeft="25dp"
android:textSize="15dp" />
</TableRow>
</TableLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="120dp"
android:gravity="center_vertical"
android:orientation="vertical" >
<EditText
android:id="@+id/searchOrderNo"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:background="@drawable/popup_order_field_active"
android:cursorVisible="false"
android:maxWidth="100dp"
android:imeOptions="actionDone"
android:paddingLeft="3dp"
android:numeric="integer"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@drawable/popup_horizontal_separator"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
>
<ImageView
android:id="@+id/popupwindowSearchBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/popup_btn_search"
android:gravity="center"
android:layout_marginBottom="10dp"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="81dp"
android:id="@+id/searchLayout"
android:background="@drawable/brochure_trans13"
/>
</LinearLayout>
No comments:
Post a Comment