Permalink
Browse files

changes

  • Loading branch information...
1 parent 783c0c4 commit 9b0b97a93ad4ce0627bd8bc89ee223b5322370be @varun06 committed Mar 25, 2012
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -0,0 +1,3 @@
+# cache for current jar dependecy. DO NOT EDIT.
+# format is <lastModified> <length> <SHA-1> <path>
+# Encoding is UTF-8
View
Binary file not shown.
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.var.learn.now;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
@@ -11,22 +11,33 @@
public static final class attr {
}
public static final class drawable {
- public static final int ic_launcher=0x7f020000;
- public static final int lunchlist=0x7f020001;
+ public static final int ball_green=0x7f020000;
+ public static final int ball_red=0x7f020001;
+ public static final int ball_yellow=0x7f020002;
+ public static final int ic_launcher=0x7f020003;
+ public static final int list=0x7f020004;
+ public static final int lunchlist=0x7f020005;
+ public static final int restaurant=0x7f020006;
+ public static final int run=0x7f020007;
+ public static final int toast=0x7f020008;
}
public static final class id {
- public static final int addr=0x7f050001;
- public static final int devivery=0x7f050007;
- public static final int name=0x7f050000;
- public static final int save=0x7f050008;
- public static final int sit_down=0x7f050006;
- public static final int tableRow1=0x7f050002;
- public static final int take_out=0x7f050005;
- public static final int textView1=0x7f050003;
- public static final int types=0x7f050004;
+ public static final int addr=0x7f050002;
+ public static final int address=0x7f05000b;
+ public static final int delivery=0x7f050006;
+ public static final int details=0x7f050000;
+ public static final int icon=0x7f050009;
+ public static final int name=0x7f050001;
+ public static final int restaurants=0x7f050008;
+ public static final int save=0x7f050007;
+ public static final int sit_down=0x7f050005;
+ public static final int take_out=0x7f050004;
+ public static final int title=0x7f05000a;
+ public static final int types=0x7f050003;
}
public static final class layout {
public static final int main=0x7f030000;
+ public static final int row=0x7f030001;
}
public static final class string {
public static final int Address=0x7f040003;
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,65 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
-<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:stretchColumns="1"
- >
-
- <TableRow >
- <TextView android:text="Name:"/>
- <EditText android:id="@+id/name"/>
- </TableRow>
-
- <TableRow >
- <TextView android:text="Address:"/>
- <EditText android:id="@+id/addr"/>
- </TableRow>
+ android:layout_height="match_parent" >
- <TableRow
- android:id="@+id/tableRow1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
+ <TableLayout
+ android:id="@+id/details"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:shrinkColumns="1"
+ android:stretchColumns="1" >
- <TextView
- android:id="@+id/textView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Type:" />
+ <TableRow>
+
+ <TextView android:text="Name:" />
+ <EditText android:id="@+id/name" />
+ </TableRow>
+
+ <TableRow>
- <RadioGroup
- android:id="@+id/types"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
+ <TextView android:text="Address:" />
+ <EditText android:id="@+id/addr" />
+ </TableRow>
- <RadioButton
- android:id="@+id/take_out"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:checked="true"
- android:text="Take-Out" />
+ <TableRow>
- <RadioButton
- android:id="@+id/sit_down"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Sit-Down" />
+ <TextView android:text="Type:" />
+ <RadioGroup android:id="@+id/types" >
- <RadioButton
- android:id="@+id/devivery"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Delivery" />
- </RadioGroup>
+ <RadioButton
+ android:id="@+id/take_out"
+ android:checked="true"
+ android:text="Take-Out" />
+
+ <RadioButton
+ android:id="@+id/sit_down"
+ android:text="Sit-Down" />
+
+ <RadioButton
+ android:id="@+id/delivery"
+ android:text="Delivery" />
+ </RadioGroup>
+ </TableRow>
+
+ <Button
+ android:id="@+id/save"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Save" />
+ </TableLayout>
- </TableRow>
-
- <Button
- android:id="@+id/save"
+ <ListView
+ android:id="@+id/restaurants"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="Save"
- />
-
-</TableLayout>
+ android:layout_above="@id/details"
+ android:layout_alignParentTop="true" />
-
+</RelativeLayout>
View
@@ -0,0 +1,40 @@
+
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="4dip" >
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ball_green" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:text="TextView"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/address"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:text="TextView" />
+ </LinearLayout>
+
+ </LinearLayout>
@@ -5,16 +5,20 @@
import android.app.Activity;
import android.os.Bundle;
+import android.view.LayoutInflater;
import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
-import android.widget.RadioButton;
+import android.widget.ImageView;
+import android.widget.ListView;
import android.widget.RadioGroup;
-import android.widget.RadioGroup.LayoutParams;
-import android.widget.TableLayout;
+import android.widget.TextView;
public class Now extends Activity {
List<Restaurant> model = new ArrayList<Restaurant>(); // create a new instance of class
+ RestaurantAdapter adapter = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -24,6 +28,11 @@ public void onCreate(Bundle savedInstanceState) {
Button save = (Button)findViewById(R.id.save);
save.setOnClickListener(onSave);
+
+ ListView list = (ListView)findViewById(R.id.restaurants);
+
+ adapter = new RestaurantAdapter();
+ list.setAdapter(adapter);
}
private View.OnClickListener onSave = new View.OnClickListener() {
@@ -46,11 +55,36 @@ public void onClick(View v) {
case R.id.take_out:
r.setType("take_out");
break;
- case R.id.devivery:
+ case R.id.delivery:
r.setType("delivery");
break;
}
-
+ adapter.add(r);
}
};
+ class RestaurantAdapter extends ArrayAdapter<Restaurant>{
+ RestaurantAdapter(){
+ super(Now.this,
+ android.R.layout.simple_expandable_list_item_1,
+ model);
+ }
+ public View getView(int position,View convertView,ViewGroup parent){
+ View row = convertView;
+
+ if(row == null){
+ LayoutInflater inflater = getLayoutInflater();
+
+ row = inflater.inflate(R.layout.row, null);
+ }
+
+ Restaurant r = model.get(position);
+
+ ((TextView)row.findViewById(R.id.title)).setText(r.getName());
+ ((TextView)row.findViewById(R.id.address)).setText(r.getaddress());
+
+ ImageView icon = (ImageView)row.findViewById(R.id.icon);
+
+
+ }
+ }
}

0 comments on commit 9b0b97a

Please sign in to comment.