dialog_showroom.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
>
<ScrollView
android:id="@+id/ScrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dip"
>
<ImageView
android:contentDescription="@+id/ImageShowroom"
android:id="@+id/ImageShowroom"
android:layout_width="fill_parent"
android:layout_height="200dip"
android:background="@drawable/main_image"
/>
<TextView
android:layout_marginTop="10dip"
android:text="@string/sr"
android:id="@+id/txtStoreName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/black"
android:gravity="center|center_vertical"
/>
<ImageView
android:contentDescription="@+id/separator1"
android:id="@+id/separator1"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@color/grey"
/>
<TextView
android:layout_marginTop="10dip"
android:text="@string/mob"
android:id="@+id/txtMobShowroom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/black"
android:background="@drawable/main_button"
android:drawableLeft="@drawable/tel"
android:drawablePadding="10dip"
android:drawableRight="@drawable/arrow"
android:gravity="left|center_vertical"
/>
<ImageView
android:contentDescription="@+id/separator2"
android:id="@+id/separator2"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@color/grey"
/>
<TextView
android:text="@string/email"
android:id="@+id/txtEmail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginTop="10dip"
android:textColor="@color/black"
android:background="@drawable/main_button"
android:drawableLeft="@drawable/mail"
android:drawablePadding="10dip"
android:drawableRight="@drawable/arrow"
android:gravity="left|center_vertical"
/>
<ImageView
android:contentDescription="@+id/separator3"
android:id="@+id/separator3"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@color/grey"
/>
<!-- -->
<TextView
android:text="@string/maps"
android:id="@+id/txtMaps"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginTop="10dip"
android:textColor="@color/black"
android:background="@drawable/main_button"
android:drawableLeft="@drawable/map"
android:drawablePadding="10dip"
android:drawableRight="@drawable/arrow"
android:gravity="left|center_vertical"
/>
<ImageView
android:contentDescription="@+id/separator4"
android:id="@+id/separator4"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="@color/grey"
/>
<TextView
android:id="@+id/txt_sr_maps"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textStyle="bold"
android:layout_marginTop="10dip"
android:textColor="@color/txt_grey"
/>
<Button
android:id="@+id/btnClose"
android:padding="10dip"
android:layout_margin="20dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/close"
android:textStyle="bold"
android:textSize="18sp"
android:background="@drawable/btn_dialog"
android:layout_marginTop="10dip"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
DialogShowroom.java
package com.am.np.android;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class DialogShowroom extends Activity {
Button back;
TextView tel, loc, email;
String link_tel="0123";
String link_email="info@mailm";
String link_map ="https://www.google.com.eg/maps/search/nile+projects/@30.58";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_showroom);
back = (Button) findViewById(R.id.btnClose);
tel = (TextView) findViewById(R.id.txtMobShowroom);
loc = (TextView) findViewById(R.id.txtMaps);
email = (TextView) findViewById(R.id.txtEmail);
back.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
finish();
}
});
email.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, link_email);
startActivity(Intent.createChooser(intent, "Choice App to send email:"));
}
});
tel.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:"+link_tel));
startActivity(intent);
}
});
loc.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(link_map));
startActivity(i);
}
});
}
}
برجاء التعديل لانه لا يعمل