added simple Search functionality;
@@ -14,6 +14,9 @@ public final class R {
|
||||
public static final class attr {
|
||||
}
|
||||
public static final class color {
|
||||
public static final int contentdark=0x7f050004;
|
||||
public static final int light=0x7f050002;
|
||||
public static final int lightdiv=0x7f050003;
|
||||
public static final int transparent=0x7f050000;
|
||||
public static final int white=0x7f050001;
|
||||
}
|
||||
@@ -22,58 +25,77 @@ public final class R {
|
||||
public static final int background_dark=0x7f020001;
|
||||
public static final int background_row=0x7f020002;
|
||||
public static final int background_row_dark=0x7f020003;
|
||||
public static final int friends=0x7f020004;
|
||||
public static final int ic_tab_artists_grey=0x7f020005;
|
||||
public static final int ic_tab_artists_white=0x7f020006;
|
||||
public static final int ic_tab_friends=0x7f020007;
|
||||
public static final int icon=0x7f020008;
|
||||
public static final int logo=0x7f020009;
|
||||
public static final int logout=0x7f02000a;
|
||||
public static final int me=0x7f02000b;
|
||||
public static final int messages=0x7f02000c;
|
||||
public static final int nearby=0x7f02000d;
|
||||
public static final int search=0x7f02000e;
|
||||
public static final int tab_bg_selected=0x7f02000f;
|
||||
public static final int tab_bg_selector=0x7f020010;
|
||||
public static final int tab_bg_unselected=0x7f020011;
|
||||
public static final int tab_divider=0x7f020012;
|
||||
public static final int tab_text_selector=0x7f020013;
|
||||
public static final int bg_top=0x7f020004;
|
||||
public static final int findme_light=0x7f020005;
|
||||
public static final int friends=0x7f020006;
|
||||
public static final int home_button=0x7f020007;
|
||||
public static final int ic_tab_artists_grey=0x7f020008;
|
||||
public static final int ic_tab_artists_white=0x7f020009;
|
||||
public static final int ic_tab_friends=0x7f02000a;
|
||||
public static final int icon=0x7f02000b;
|
||||
public static final int logo=0x7f02000c;
|
||||
public static final int logout=0x7f02000d;
|
||||
public static final int me=0x7f02000e;
|
||||
public static final int messages=0x7f02000f;
|
||||
public static final int nearby=0x7f020010;
|
||||
public static final int search=0x7f020011;
|
||||
public static final int tab_bg_selected=0x7f020012;
|
||||
public static final int tab_bg_selector=0x7f020013;
|
||||
public static final int tab_bg_unselected=0x7f020014;
|
||||
public static final int tab_divider=0x7f020015;
|
||||
public static final int tab_text_selector=0x7f020016;
|
||||
public static final int top_bg=0x7f020017;
|
||||
public static final int user=0x7f020018;
|
||||
}
|
||||
public static final class id {
|
||||
public static final int ButtonLoginUser=0x7f08000d;
|
||||
public static final int ButtonRegisterUser=0x7f080013;
|
||||
public static final int ButtonUserRegistration=0x7f08000f;
|
||||
public static final int EditTextLoginMail=0x7f080009;
|
||||
public static final int EditTextLoginPassword=0x7f08000a;
|
||||
public static final int EditTextRegistrationMail=0x7f080011;
|
||||
public static final int EditTextRegistrationName=0x7f080010;
|
||||
public static final int EditTextRegistrationPassword=0x7f080012;
|
||||
public static final int SpinnerLoginUserStatus=0x7f08000c;
|
||||
public static final int TextViewTitle=0x7f08000b;
|
||||
public static final int ButtonLoginUser=0x7f08000e;
|
||||
public static final int ButtonRegisterUser=0x7f080018;
|
||||
public static final int ButtonUserRegistration=0x7f080010;
|
||||
public static final int EditTextLoginMail=0x7f08000a;
|
||||
public static final int EditTextLoginPassword=0x7f08000b;
|
||||
public static final int EditTextRegistrationMail=0x7f080016;
|
||||
public static final int EditTextRegistrationName=0x7f080015;
|
||||
public static final int EditTextRegistrationPassword=0x7f080017;
|
||||
public static final int SearchInput=0x7f08001c;
|
||||
public static final int SpinnerLoginUserStatus=0x7f08000d;
|
||||
public static final int TextViewTitle=0x7f08000c;
|
||||
public static final int friends=0x7f080001;
|
||||
public static final int friendslist=0x7f080007;
|
||||
public static final int icon=0x7f080016;
|
||||
public static final int icontext=0x7f080018;
|
||||
public static final int friendslist=0x7f080008;
|
||||
public static final int homebutton=0x7f08001f;
|
||||
public static final int icon=0x7f080020;
|
||||
public static final int icontext=0x7f080022;
|
||||
public static final int logout=0x7f080005;
|
||||
public static final int me=0x7f080004;
|
||||
public static final int messages=0x7f080002;
|
||||
public static final int nearby=0x7f080000;
|
||||
public static final int requests=0x7f080008;
|
||||
public static final int nearby_list_text=0x7f080014;
|
||||
public static final int nearbylist=0x7f080012;
|
||||
public static final int requests=0x7f080009;
|
||||
public static final int search=0x7f080003;
|
||||
public static final int tabhost=0x7f080006;
|
||||
public static final int tabsLayout=0x7f080014;
|
||||
public static final int tabsText=0x7f080015;
|
||||
public static final int test_image=0x7f08000e;
|
||||
public static final int text=0x7f080017;
|
||||
public static final int searchList=0x7f08001a;
|
||||
public static final int search_dialog=0x7f08001b;
|
||||
public static final int tabhost=0x7f080007;
|
||||
public static final int tabsLayout=0x7f08001d;
|
||||
public static final int tabsText=0x7f08001e;
|
||||
public static final int test_image=0x7f08000f;
|
||||
public static final int text=0x7f080021;
|
||||
public static final int topbb=0x7f080011;
|
||||
public static final int topbb2=0x7f080006;
|
||||
public static final int topbb2412=0x7f080019;
|
||||
public static final int user_image=0x7f080013;
|
||||
}
|
||||
public static final class layout {
|
||||
public static final int findmemenu=0x7f030000;
|
||||
public static final int friends=0x7f030001;
|
||||
public static final int login=0x7f030002;
|
||||
public static final int main=0x7f030003;
|
||||
public static final int nearby_list_item=0x7f030004;
|
||||
public static final int registration=0x7f030005;
|
||||
public static final int tabs_bg=0x7f030006;
|
||||
public static final int nearby=0x7f030004;
|
||||
public static final int nearby_list_item=0x7f030005;
|
||||
public static final int registration=0x7f030006;
|
||||
public static final int search=0x7f030007;
|
||||
public static final int search_dialog=0x7f030008;
|
||||
public static final int tabs_bg=0x7f030009;
|
||||
public static final int topbar=0x7f03000a;
|
||||
}
|
||||
public static final class menu {
|
||||
public static final int menu=0x7f070000;
|
||||
|
||||
|
Before Width: | Height: | Size: 364 KiB After Width: | Height: | Size: 348 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:startColor="#A8A8A8" android:centerColor="#7F7F7F"
|
||||
android:endColor="#696969" android:angle="-90" />
|
||||
<gradient android:startColor="#2a78b9" android:endColor="#124571" android:angle="-90" />
|
||||
</shape>
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- Active tab -->
|
||||
<item android:state_selected="true" android:state_focused="false"
|
||||
android:state_pressed="false" android:drawable="@drawable/tab_bg_selected" />
|
||||
@@ -8,8 +7,8 @@
|
||||
<item android:state_selected="false" android:state_focused="false"
|
||||
android:state_pressed="false" android:drawable="@drawable/tab_bg_unselected" />
|
||||
<!-- Pressed tab -->
|
||||
<item android:state_pressed="true" android:drawable="@color/transparent" />
|
||||
<item android:state_pressed="true" android:drawable="@color/contentdark" />
|
||||
<!-- Selected tab (using d-pad) -->
|
||||
<item android:state_focused="true" android:state_selected="true"
|
||||
android:state_pressed="false" android:drawable="@color/transparent" />
|
||||
android:state_pressed="false" android:drawable="@color/lightdiv" />
|
||||
</selector>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:startColor="#5C5C5C" android:centerColor="#424242"
|
||||
android:endColor="#222222"
|
||||
<gradient android:startColor="#0c3559" android:endColor="#124571"
|
||||
android:angle="-90" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient android:startColor="#182029" android:endColor="#040608" android:angle="-90" />
|
||||
</shape>
|
||||
@@ -1,8 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/white"
|
||||
android:id="@+id/friends">
|
||||
|
||||
<include android:id="@+id/topbb2" layout="@layout/topbar" />
|
||||
|
||||
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tabhost"
|
||||
@@ -20,13 +24,18 @@
|
||||
<View android:layout_width="fill_parent" android:layout_height="2dip"
|
||||
android:background="#000" />
|
||||
<FrameLayout android:id="@android:id/tabcontent"
|
||||
android:layout_width="fill_parent" android:layout_height="fill_parent">
|
||||
android:layout_width="fill_parent" android:layout_height="fill_parent"
|
||||
android:paddingTop="-6dip">
|
||||
<ListView android:id="@+id/friendslist" android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" android:layout_weight="1"
|
||||
android:divider="@color/lightdiv"
|
||||
android:dividerHeight="1dip"
|
||||
android:visibility="invisible">
|
||||
</ListView>
|
||||
<ListView android:id="@+id/requests" android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" android:layout_weight="1"
|
||||
android:divider="@color/lightdiv"
|
||||
android:dividerHeight="1dip"
|
||||
android:visibility="invisible">
|
||||
</ListView>
|
||||
</FrameLayout>
|
||||
|
||||
@@ -1,61 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:paddingLeft="20px"
|
||||
android:paddingRight="20px">
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="50px">
|
||||
|
||||
<Button
|
||||
android:id="@+id/ButtonNearby"
|
||||
android:text="@string/navigation_nearby"
|
||||
android:onClick="drawNearbyHandler"
|
||||
android:layout_width="70px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_marginBottom="20px">
|
||||
</Button>
|
||||
<Button
|
||||
android:id="@+id/ButtonFriends"
|
||||
android:text="@string/navigation_friends"
|
||||
android:onClick="drawFriendsHandler"
|
||||
android:layout_width="70px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_marginBottom="20px">
|
||||
</Button>
|
||||
<!--<Button
|
||||
android:id="@+id/ButtonChat"
|
||||
android:text="@string/navigation_chat"
|
||||
android:onClick="drawChatHandler"
|
||||
android:layout_width="70px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_marginBottom="20px">
|
||||
</Button>-->
|
||||
<Button
|
||||
android:id="@+id/ButtonSearch"
|
||||
android:text="@string/navigation_search"
|
||||
android:onClick="drawSearchHandler"
|
||||
android:layout_width="70px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_marginBottom="20px">
|
||||
</Button>
|
||||
<Button
|
||||
android:id="@+id/ButtonUpdate"
|
||||
android:text="O"
|
||||
android:onClick="updateLocationHandler"
|
||||
android:layout_width="20px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|left"
|
||||
android:layout_marginBottom="20px">
|
||||
</Button>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/white"
|
||||
android:id="@+id/nearby">
|
||||
|
||||
<include android:id="@+id/topbb" layout="@layout/topbar" />
|
||||
|
||||
<ListView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/nearbylist"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" android:layout_weight="1"
|
||||
android:divider="@color/lightdiv"
|
||||
android:dividerHeight="1dip">
|
||||
</ListView>
|
||||
</LinearLayout>
|
||||
@@ -1,7 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="10dp"
|
||||
android:textSize="16sp" >
|
||||
</TextView>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal" android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/white"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:textColor="@color/contentdark"
|
||||
android:id="@+id/nearby">
|
||||
<ImageView
|
||||
android:id="@+id/user_image"
|
||||
android:src="@drawable/user"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dip"
|
||||
android:layout_gravity="center_vertical"
|
||||
/>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:id="@+id/nearby_list_text"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/contentdark"
|
||||
>
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@color/white"
|
||||
android:id="@+id/search">
|
||||
|
||||
<include android:id="@+id/topbb2412" layout="@layout/topbar" />
|
||||
|
||||
<ListView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/searchList"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" android:layout_weight="1"
|
||||
android:background="@color/white"
|
||||
android:divider="@color/lightdiv"
|
||||
android:dividerHeight="1dip">
|
||||
</ListView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/search_dialog"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:padding="10dp">
|
||||
<EditText
|
||||
android:id="@+id/SearchInput"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Search ..."
|
||||
android:inputType="textPersonName"
|
||||
android:layout_width="fill_parent">
|
||||
</EditText>
|
||||
</LinearLayout>
|
||||
@@ -6,7 +6,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tabsLayout" android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" android:background="@drawable/tab_bg_selector"
|
||||
android:padding="10dip" android:gravity="center" android:orientation="vertical">
|
||||
android:padding="8dip" android:gravity="center" android:orientation="vertical">
|
||||
|
||||
<TextView android:id="@+id/tabsText" android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" android:text="Title"
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:background="@drawable/top_bg"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dip"
|
||||
android:paddingBottom="10dip">
|
||||
<ImageView
|
||||
android:src="@drawable/findme_light"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
android:paddingLeft="20dip"
|
||||
android:paddingTop="6dip"
|
||||
/>
|
||||
<ImageButton android:id="@+id/homebutton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="enterMenuHandler"
|
||||
android:src="@drawable/home_button"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
android:paddingRight="20dip"
|
||||
android:background="@null" />
|
||||
</FrameLayout>
|
||||
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="transparent">#00000000</color>
|
||||
<color name="white">#ffffff</color>
|
||||
<color name="white">#ffffffff</color>
|
||||
<color name="light">#f1f3f5ff</color>
|
||||
<color name="lightdiv">#d2d4d5ff</color>
|
||||
<color name="contentdark">#23262c</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
package com.architects.findme;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class FindMeMenu extends Activity
|
||||
@@ -46,8 +54,37 @@ public class FindMeMenu extends Activity
|
||||
}
|
||||
public void searchMenuHandler(View button)
|
||||
{
|
||||
Intent myIntent = new Intent(button.getContext(), Search.class);
|
||||
startActivity(myIntent);
|
||||
final AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
|
||||
LayoutInflater factory = LayoutInflater.from(this);
|
||||
final View input = factory.inflate(R.layout.search_dialog, null);
|
||||
|
||||
alertbox.setTitle("Search People");
|
||||
alertbox.setView(input);
|
||||
|
||||
alertbox.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
// get the input value
|
||||
EditText mText;
|
||||
mText = (EditText) input.findViewById(R.id.SearchInput);
|
||||
String text = mText.getText().toString();
|
||||
|
||||
// redirect to search results
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("query", text);
|
||||
|
||||
Intent newIntent = new Intent(FindMeMenu.this.getApplicationContext(), Search.class);
|
||||
newIntent.putExtras(bundle);
|
||||
startActivityForResult(newIntent, 0);
|
||||
}
|
||||
});
|
||||
|
||||
alertbox.setNegativeButton("Cancel",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
alertbox.show();
|
||||
}
|
||||
public void logoutMenuHandler(View button)
|
||||
{
|
||||
@@ -66,10 +103,17 @@ public class FindMeMenu extends Activity
|
||||
prefsEditor.clear();
|
||||
prefsEditor.commit();
|
||||
|
||||
Toast.makeText(button.getContext(), "Logout successful", Toast.LENGTH_LONG).show();
|
||||
Intent myIntent = new Intent(button.getContext(), FindMe.class);
|
||||
startActivity(myIntent);
|
||||
Toast.makeText(button.getContext(), "Logout successful", Toast.LENGTH_LONG).show();
|
||||
|
||||
}
|
||||
else Toast.makeText(this, "Logout failed. Try again!", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public void searchHandler(View button)
|
||||
{
|
||||
Intent myIntent = new Intent(button.getContext(), Search.class);
|
||||
startActivity(myIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.architects.helper.*;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
@@ -45,7 +46,6 @@ public class Friends extends Activity {
|
||||
setContentView(R.layout.friends);
|
||||
|
||||
setupTabHost();
|
||||
mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);
|
||||
|
||||
// setup list views
|
||||
friends = (ListView) findViewById(R.id.friendslist);
|
||||
@@ -58,8 +58,10 @@ public class Friends extends Activity {
|
||||
String[] friendslist = FriendsHelper.getFriendsList(mail);
|
||||
String[] requestslist = FriendsHelper.getRequestsList(mail);
|
||||
|
||||
friends.setAdapter(new ArrayAdapter<String>(this, R.layout.nearby_list_item, friendslist));
|
||||
requests.setAdapter(new ArrayAdapter<String>(this, R.layout.nearby_list_item, requestslist));
|
||||
friends.setAdapter(new ArrayAdapter<String>
|
||||
(this, R.layout.nearby_list_item, R.id.nearby_list_text, friendslist));
|
||||
requests.setAdapter(new ArrayAdapter<String>
|
||||
(this, R.layout.nearby_list_item,R.id.nearby_list_text, requestslist));
|
||||
|
||||
setupTab(friends, "Friends");
|
||||
setupTab(requests, "Requests");
|
||||
@@ -83,4 +85,10 @@ public class Friends extends Activity {
|
||||
tv.setText(text);
|
||||
return view;
|
||||
}
|
||||
|
||||
public void enterMenuHandler(View button)
|
||||
{
|
||||
Intent myIntent = new Intent(button.getContext(), FindMeMenu.class);
|
||||
startActivity(myIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ public class Login extends Activity
|
||||
|
||||
Intent myIntent = new Intent(button.getContext(), FindMeMenu.class);
|
||||
startActivity(myIntent);
|
||||
finish();
|
||||
}
|
||||
else Toast.makeText(this, response, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@@ -23,22 +23,25 @@ import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TabHost;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class Nearby extends ListActivity {
|
||||
public class Nearby extends Activity {
|
||||
|
||||
private static final long MINIMUM_DISTANCE_CHANGE_FOR_UPDATES = 1; // in Meters
|
||||
private static final long MINIMUM_TIME_BETWEEN_UPDATES = 100; // in Milliseconds
|
||||
|
||||
private static final String TAG = "test";
|
||||
protected LocationManager locationManager;
|
||||
private ListView nearby;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.nearby);
|
||||
|
||||
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||
locationManager.requestLocationUpdates(
|
||||
@@ -91,13 +94,12 @@ public class Nearby extends ListActivity {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
setListAdapter(new ArrayAdapter<String>(this, R.layout.nearby_list_item, onlineUser));
|
||||
nearby = (ListView) findViewById(R.id.nearbylist);
|
||||
nearby.setAdapter(new ArrayAdapter<String>(this, R.layout.nearby_list_item, R.id.nearby_list_text, onlineUser));
|
||||
|
||||
ListView lv = getListView();
|
||||
lv.setTextFilterEnabled(true);
|
||||
nearby.setTextFilterEnabled(true);
|
||||
|
||||
lv.setOnItemClickListener(new OnItemClickListener() {
|
||||
nearby.setOnItemClickListener(new OnItemClickListener() {
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// When clicked, show a toast with the TextView text
|
||||
Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
|
||||
@@ -123,8 +125,7 @@ public class Nearby extends ListActivity {
|
||||
"Current Location \n Longitude: %1$s \n Latitude: %2$s",
|
||||
location.getLongitude(), location.getLatitude()
|
||||
);
|
||||
Toast.makeText(Nearby.this, message,
|
||||
Toast.LENGTH_LONG).show();
|
||||
// Toast.makeText(Nearby.this, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,12 +136,11 @@ public class Nearby extends ListActivity {
|
||||
"New Location \n Longitude: %1$s \n Latitude: %2$s",
|
||||
location.getLongitude(), location.getLatitude()
|
||||
);
|
||||
Toast.makeText(Nearby.this, message, Toast.LENGTH_LONG).show();
|
||||
//Toast.makeText(Nearby.this, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public void onStatusChanged(String s, int i, Bundle b) {
|
||||
Toast.makeText(Nearby.this, "Provider status changed",
|
||||
Toast.LENGTH_LONG).show();
|
||||
//Toast.makeText(Nearby.this, "Provider status changed", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public void onProviderDisabled(String s) {
|
||||
@@ -179,4 +179,10 @@ public class Nearby extends ListActivity {
|
||||
Intent myIntent = new Intent(button.getContext(), Search.class);
|
||||
startActivity(myIntent);
|
||||
}
|
||||
|
||||
public void enterMenuHandler(View button)
|
||||
{
|
||||
Intent myIntent = new Intent(button.getContext(), FindMeMenu.class);
|
||||
startActivity(myIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.architects.findme;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
public class Profile extends Activity {
|
||||
|
||||
}
|
||||
@@ -1,15 +1,62 @@
|
||||
package com.architects.findme;
|
||||
|
||||
import com.architects.helper.*;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TabHost;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
|
||||
public class Search extends Activity {
|
||||
private ListView resultsList;
|
||||
public static final String PREFS_NAME = "LoginCredentials";
|
||||
private static final String TAG = "findme";
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.search);
|
||||
|
||||
// get search query
|
||||
Bundle bundle = this.getIntent().getExtras();
|
||||
String query = bundle.getString("query");
|
||||
|
||||
// get results list view
|
||||
resultsList = (ListView) findViewById(R.id.searchList);
|
||||
|
||||
// search results to string
|
||||
String[] results = SearchHelper.getResults(query);
|
||||
|
||||
resultsList.setAdapter(new ArrayAdapter<String>(this, R.layout.nearby_list_item, R.id.nearby_list_text, results));
|
||||
|
||||
TextView textview = new TextView(this);
|
||||
textview.setText("Search");
|
||||
setContentView(textview);
|
||||
resultsList.setTextFilterEnabled(true);
|
||||
|
||||
resultsList.setOnItemClickListener(new OnItemClickListener() {
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// When clicked, show a toast with the TextView text
|
||||
Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void enterMenuHandler(View button)
|
||||
{
|
||||
Intent myIntent = new Intent(button.getContext(), FindMeMenu.class);
|
||||
startActivity(myIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,7 @@ public class LocationHelper
|
||||
"Current Location \n Longitude: %1$s \n Latitude: %2$s",
|
||||
location.getLongitude(), location.getLatitude()
|
||||
);
|
||||
Toast.makeText(myContext, message,
|
||||
Toast.LENGTH_LONG).show();
|
||||
//Toast.makeText(myContext, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,12 +63,11 @@ public class LocationHelper
|
||||
"New Location \n Longitude: %1$s \n Latitude: %2$s",
|
||||
location.getLongitude(), location.getLatitude()
|
||||
);
|
||||
Toast.makeText(myContext, message, Toast.LENGTH_LONG).show();
|
||||
//Toast.makeText(myContext, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public void onStatusChanged(String s, int i, Bundle b) {
|
||||
Toast.makeText(myContext, "Provider status changed",
|
||||
Toast.LENGTH_LONG).show();
|
||||
// Toast.makeText(myContext, "Provider status changed", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public void onProviderDisabled(String s) {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.architects.helper;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
public class SearchHelper
|
||||
{
|
||||
private static final String TAG = "test";
|
||||
|
||||
public static String[] getResults(String query)
|
||||
{
|
||||
JSONObject j = new JSONObject();
|
||||
String params = "?query="+query;
|
||||
j = AccountHelper.doHttpGet("search.php", params);
|
||||
Log.v(TAG, j.toString());
|
||||
|
||||
String[] results = new String[j.length()];
|
||||
|
||||
try {
|
||||
JSONObject json_data = null;
|
||||
String x;
|
||||
|
||||
for(int i=0;i<j.length();i++)
|
||||
{
|
||||
x = (new Integer(i)).toString();
|
||||
json_data = j.getJSONObject(x);
|
||||
|
||||
results[i] = json_data.getString("name") + "\n" + json_data.getString("mail");
|
||||
}
|
||||
return results;
|
||||
}
|
||||
catch(Exception e) { return new String[0];}
|
||||
}
|
||||
}
|
||||