Commit beb8d77a authored by Tanmim Hanifa's avatar Tanmim Hanifa

final pushes

parent 4b14f231
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/TravelB.iml" filepath="$PROJECT_DIR$/TravelB.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.mohamed.travelb"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:gridlayout-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\mohamed\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
package com.example.mohamed.travelb;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.mohamed.travelb", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mohamed.travelb">
<uses-permission android:name="android.permission.INTERNET" />
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".RegisterActivity" />
<activity android:name=".UserAreaActivity" />
<activity android:name=".SearchActivity" />
<activity android:name=".PlansActivity" />
<activity android:name=".MessageActivity" />
<activity android:name=".ProfilActivity" />
<activity android:name=".RecyclerViewAdapter" />
<activity android:name=".foundSearch" />
<activity android:name=".addplan" />
<activity android:name=".ContactDtails" />
<activity android:name=".Send_message" />
<activity android:name=".send_message" />
<activity android:name=".MessageDtails" />
<activity android:name=".remove"></activity>
</application>
</manifest>
\ No newline at end of file
package com.example.mohamed.travelb;
import android.util.Log;
/**
* Created by mohamed on 23/04/2017.
*/
public class Contact {
private int image_id;
private String name,username,dob,destination,user_id,plan_id,gender,date;
String my_id;
public Contact(int image_id, String date,String name, String username, String dob, String destination, String user_id, String plan_id, String gender) {
this.image_id = image_id;
this.name = name;
this.username = username;
this.dob = dob;
this.destination = destination;
this.user_id = user_id;
this.plan_id = plan_id;
this.gender = gender;
this.date=date;
}
public Contact(int image_id) {
this.image_id = image_id;
}
public Contact(String id) {
my_id=id;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public int getImage_id() {
return image_id;
}
public void setImage_id(int image_id) {
this.image_id = image_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getPlan_id() {
return plan_id;
}
public void setPlan_id(String plan_id) {
this.plan_id = plan_id;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
}
package com.example.mohamed.travelb;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
/**
* Created by mohamed on 23/04/2017.
*/
public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactViewHolder> {
ArrayList<Contact> contacts = new ArrayList<Contact>();
Context ctx;
public ContactAdapter(ArrayList<Contact> contacts, Context ctx){
this.contacts=contacts;
this.ctx=ctx;
}
@Override
public ContactViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_view_layout,parent,false);
ContactViewHolder contactViewHolder= new ContactViewHolder(view, ctx, contacts);
return contactViewHolder;
}
@Override
public void onBindViewHolder(ContactViewHolder holder, int position) {
Contact CON = contacts.get(position);
holder.person_img.setImageResource(CON.getImage_id());
holder.person_username.setText("username: "+CON.getUsername());
holder.person_dob.setText("date of birth: "+CON.getDob());
holder.person_gender.setText("sex: "+CON.getGender());
holder.person_date.setText("departure on: "+CON.getDate());
}
@Override
public int getItemCount() {
return contacts.size();
}
public static class ContactViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
ImageView person_img;
TextView person_username, person_dob, person_gender,person_date;
ArrayList<Contact> contacts=new ArrayList<Contact>();
Context ctx;
public ContactViewHolder(View view, Context ctx, ArrayList<Contact> contacts){
super(view);
this.contacts=contacts;
this.ctx=ctx;
view.setOnClickListener(this);
person_img= (ImageView) view.findViewById(R.id.person_image);
person_username=(TextView) view.findViewById(R.id.username);
person_dob=(TextView) view.findViewById(R.id.name);
person_gender=(TextView) view.findViewById(R.id.gender);
person_date=(TextView) view.findViewById(R.id.date);
}
@Override
public void onClick(View v) {
int position = getAdapterPosition();
Contact contact= this.contacts.get(position);
Intent intent =new Intent(ctx,ContactDtails.class);
intent.putExtra("img_id",contact.getImage_id());
intent.putExtra("name",contact.getName());
intent.putExtra("username", contact.getUsername());
intent.putExtra("dob", contact.getDob());
intent.putExtra("date",contact.getDate());
intent.putExtra("my_id",contact.my_id);
intent.putExtra("user_id",contact.getUser_id());
intent.putExtra("destination",contact.getDestination());
intent.putExtra("gender",contact.getGender());
this.ctx.startActivity(intent);
}
}
}
package com.example.mohamed.travelb;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import static com.example.mohamed.travelb.R.id.btnRemove;
import static com.example.mohamed.travelb.R.id.imageView;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.Volley;
import org.json.JSONException;
import org.json.JSONObject;
public class ContactDtails extends AppCompatActivity {
ImageView imageView;
TextView tx_name, tx_username, tx_destination,tx_date,tx_dob,tx_gender;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contact_dtails);
final Button remove = (Button) findViewById(R.id.btnRemove);
imageView=(ImageView) findViewById(R.id.image);
tx_name=(TextView) findViewById(R.id.name);
tx_destination=(TextView) findViewById(R.id.destination);
tx_username=(TextView) findViewById(R.id.username);
tx_date=(TextView) findViewById(R.id.date);
tx_dob=(TextView) findViewById(R.id.dob);
tx_gender=(TextView) findViewById(R.id.gender);
imageView.setImageResource(getIntent().getIntExtra("img_id",00));
tx_name.setText("Hi, my name is "+getIntent().getStringExtra("name"));
tx_username.setText(getIntent().getStringExtra("username"));
tx_destination.setText("Iwould like to travel in "+getIntent().getStringExtra("destination"));
tx_date.setText("around "+getIntent().getStringExtra("date"));
tx_dob.setText("I was born on "+getIntent().getStringExtra("dob"));
tx_gender.setText(getIntent().getStringExtra("gender"));