<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Fragment.contact_Fragment">
<ImageView
android:id="@+id/bg_img"
android:layout_width="match_parent"
android:layout_height="240dp"
android:scaleType="centerCrop"
android:src="@drawable/contacts"
android:contentDescription="TODO" />
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-15dp"
android:layout_below="@+id/bg_img"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
app:cardCornerRadius="12dp"
android:elevation="12dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="16dp">
<TextView
android:textStyle="bold"
android:id="@+id/contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:layout_marginLeft="22dp"
android:text="@string/contact_us"
android:textColor="@color/black"
android:textSize="28sp" />
<View
android:id="@+id/line_view"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_below="@id/contact"
android:layout_marginStart="18dp"
android:layout_marginLeft="18dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="36dp"
android:layout_marginRight="36dp"
android:background="@color/black" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginStart="22dp"
android:layout_below="@id/line_view"
android:layout_marginTop="16dp">
<ImageView
android:id="@+id/imgg"
android:layout_width="30dp"
android:layout_height="60dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:src="@drawable/phonecall"
android:contentDescription="TODO" />
<LinearLayout
android:id="@+id/lin_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/imgg"
android:layout_toRightOf="@id/imgg"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="0dp"
android:text="@string/phone_no"
android:textStyle="bold"
android:textColor="@android:color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:text="@string/_91_8383066031"
android:textColor="#0277BD"
android:textColorHighlight="@android:color/holo_red_dark"
android:textSize="16sp" />
</LinearLayout>
<ImageView
android:id="@+id/img_mob"
android:layout_width="30dp"
android:layout_height="60dp"
android:layout_below="@id/lin_1"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="15dp"
android:src="@drawable/email"
android:contentDescription="TODO" />
<LinearLayout
android:id="@+id/lin_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@id/lin_1"
android:layout_marginTop="15dp"
android:layout_toRightOf="@id/img_mob"
android:layout_toEndOf="@id/img_mob">
<TextView
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginLeft="12dp"
android:textSize="16sp"
android:layout_marginTop="0dp"
android:textColor="@android:color/black"
android:text="@string/email_address" />
<TextView
android:id="@+id/feedback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:text="@string/info_seekmyvision_in"
android:textColor="#0277BD"
android:textColorHighlight="@color/black"
android:textSize="16sp" />
</LinearLayout>
<ImageView
android:id="@+id/mail_img"
android:layout_width="30dp"
android:layout_height="60dp"
android:layout_below="@id/lin_2"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="15dp"
android:src="@drawable/question"
android:contentDescription="TODO" />
<LinearLayout
android:id="@+id/lin_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@id/lin_2"
android:layout_marginTop="15dp"
android:layout_toRightOf="@id/mail_img"
android:layout_toEndOf="@id/mail_img"
>
<TextView
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="0dp"
android:textSize="16sp"
android:textColor="@android:color/black"
android:text="@string/ask_your_query" />
<TextView
android:id="@+id/send_your_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:text="@string/send_your_message"
android:textColor="#0277BD"
android:textColorHighlight="@color/black"
android:textSize="16sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RelativeLayout
android:layout_marginTop="250dp"
android:id="@+id/imgProfile"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/facebook"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:src="@drawable/facebook" />
<ImageView
android:id="@+id/instagram"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="55dp"
android:contentDescription="TODO"
android:src="@drawable/instagram" />
<ImageView
android:id="@+id/youtube"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="110dp"
android:contentDescription="TODO"
android:src="@drawable/youtube" />
<ImageView
android:id="@+id/share"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="165dp"
android:contentDescription="TODO"
android:src="@drawable/share" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
Step 2 CONTACT US.JAVA
package in.seekmyvision.seekmyvision.Fragment;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import in.seekmyvision.seekmyvision.Home.query_page;
import in.seekmyvision.seekmyvision.R;
public class contact_Fragment extends Fragment {
TextView call,feedback,send_your_message;
ImageView facebook, instagram, youtube,share;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v= inflater.inflate(R.layout.fragment_contact_, container, false);
call = (TextView) v.findViewById(R.id.call);
call.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:+91 8383066031"));
startActivity(callIntent);
}
});
feedback = (TextView) v.findViewById(R.id.feedback);
feedback.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_SENDTO);
String uriText = "mailto:" + Uri.encode("info@seekmyvision.in") + "?subject=" +
Uri.encode("your email id ") + "&body=" + Uri.encode("");
Uri uri = Uri.parse(uriText);
intent.setData(uri);
startActivity(Intent.createChooser(intent, "Send Email"));
}
});
send_your_message = v.findViewById(R.id.send_your_message);
send_your_message.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), query_page.class);
startActivity(intent);
}
});
facebook = v.findViewById(R.id.facebook);
facebook.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
gotoUrl("https://www.facebook.com/seekmyvision");
}
private void gotoUrl(String s) {
Uri uri = Uri.parse(s);
startActivity(new Intent(Intent.ACTION_VIEW,uri));
}
});
youtube = v.findViewById(R.id.youtube);
youtube.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
gotoUrl("https://www.youtube.com/channel/UC9Zs03cVzZzBRNDJ_pmpv9w");
}
private void gotoUrl(String s) {
Uri uri = Uri.parse(s);
startActivity(new Intent(Intent.ACTION_VIEW,uri));
}
});
instagram = v.findViewById(R.id.instagram);
instagram.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
gotoUrl("https://www.instagram.com/seekmyvision.in/");
}
private void gotoUrl(String s) {
Uri uri = Uri.parse(s);
startActivity(new Intent(Intent.ACTION_VIEW,uri));
}
});
share = (ImageView) v.findViewById(R.id.share);
share.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
String sharebody = "look all Programmings";
String subject = "https://play.google.com/store/apps/details?id=in.seekmyvision.seekmyvision";
i.putExtra(Intent.EXTRA_SUBJECT,sharebody);
i.putExtra(Intent.EXTRA_TEXT,subject);
startActivity(Intent.createChooser(i,"Seek my vision"));
}
});
return v;
}
}
GITHUB:https://github.com/LearncodeWithRk/Contact-us-UI-
0 Comments