Commits

Ed Crewe  committed 182c16f

fixed layouts using nesting

  • Participants
  • Parent commits 3ed11b0

Comments (0)

Files changed (8)

File android/placeUvote/AndroidManifest.xml

                 <data android:name="vnd.android.cursor.item/vnd.placeUvote.polls" />
             </intent-filter>
         </activity>
-        <activity android:name=".PollVote" android:label="@string/location_name">
+        <activity android:name=".PollVote" android:label="@string/vote_name">
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.EDIT" />

File android/placeUvote/bin/classes.dex

Binary file modified.

File android/placeUvote/bin/placeUvote.apk

Binary file modified.

File android/placeUvote/bin/resources.ap_

Binary file modified.

File android/placeUvote/res/layout/polldetail.xml

 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-android:id="@+id/widget30"
+<LinearLayout
+xmlns:android="http://schemas.android.com/apk/res/android"
+android:id="@+id/TopLL"
+android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
-xmlns:android="http://schemas.android.com/apk/res/android"
+>
+<LinearLayout
+android:id="@+id/SubLL1"
+android:layout_width="fill_parent"
+android:layout_height="fill_parent"
+android:layout_weight="1"
+>
+<TextView
+android:id="@+id/storybox"
+android:layout_width="wrap_content"
+android:layout_height="wrap_content"
+android:text="Poll details go here ...."
+>
+</TextView>
+</LinearLayout>
+<LinearLayout
+android:id="@+id/SubLL2"
+android:layout_width="fill_parent"
+android:layout_height="fill_parent"
+android:layout_weight="1"
 >
 <Button
-android:id="@+id/btnBack"
-android:layout_width="wrap_content"
+android:id="@+id/btnMap"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
-android:layout_marginLeft="10px"
-android:layout_marginRight="10px"
+android:layout_gravity="bottom"
+android:layout_weight="1"
+android:text="Map"
 android:textStyle="bold"
-android:text="Back"
-android:layout_alignParentBottom="true"
-android:layout_alignParentRight="true"
 >
 </Button>
 <Button
 android:id="@+id/btnVote"
-android:layout_width="wrap_content"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
+android:layout_weight="1"
+android:layout_gravity="bottom"
 android:text="Vote"
-android:layout_marginLeft="10px"
-android:layout_marginRight="10px"
 android:textStyle="bold"
-android:layout_alignParentBottom="true"
-android:layout_centerHorizontal="true"
 >
 </Button>
 <Button
-android:id="@+id/btnMap"
-android:layout_width="wrap_content"
+android:id="@+id/btnBack"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
-android:layout_marginLeft="10px"
-android:layout_marginRight="10px"
+android:layout_weight="1"
+android:layout_gravity="bottom"
+android:text="Back"
 android:textStyle="bold"
-android:text="Map"
-android:layout_alignParentBottom="true"
-android:layout_alignParentLeft="true"
 >
 </Button>
-<TextView
-android:id="@+id/storybox"
-android:layout_width="fill_parent"
-android:layout_height="wrap_content"
-android:text="Poll details go here ...."
-android:layout_alignParentTop="true"
-android:layout_alignParentLeft="true"
->
-</TextView>
-</RelativeLayout>
+</LinearLayout>
+</LinearLayout>

File android/placeUvote/res/layout/pollvote.xml

 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-android:id="@+id/widget88"
+<LinearLayout
+xmlns:android="http://schemas.android.com/apk/res/android"
+android:id="@+id/TopLL"
+android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
-xmlns:android="http://schemas.android.com/apk/res/android"
+>
+<LinearLayout
+android:id="@+id/SubLL1"
+android:layout_width="fill_parent"
+android:layout_height="fill_parent"
+android:orientation="vertical"
+android:layout_weight="1"
 >
 <TextView
 android:id="@+id/txtQuestion"
-android:layout_width="300px"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="Question"
-android:layout_alignParentTop="true"
-android:layout_alignParentLeft="true"
+>
+</TextView>
+<TextView
+android:id="@+id/txtCreatedBy"
+android:layout_width="fill_parent"
+android:layout_height="wrap_content"
+android:text="Created by"
+android:textStyle="bold"
+>
+</TextView>
+<TextView
+android:id="@+id/dateCreatedOn"
+android:layout_width="fill_parent"
+android:layout_height="wrap_content"
+android:text="Created on"
+android:textStyle="bold"
 >
 </TextView>
 <TextView
 android:id="@+id/numTotalVotes"
-android:layout_width="300px"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="Total votes"
 android:textStyle="bold"
-android:layout_below="@+id/dateLastVote"
-android:layout_alignParentLeft="true"
 >
 </TextView>
 <TextView
 android:id="@+id/dateLastVote"
-android:layout_width="300px"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="Last vote"
 android:textStyle="bold"
-android:layout_below="@+id/txtCreatedBy"
-android:layout_alignParentLeft="true"
->
-</TextView>
-<TextView
-android:id="@+id/txtCreatedBy"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:text="Created by"
-android:textStyle="bold"
-android:layout_below="@+id/dateCreatedOn"
-android:layout_alignParentLeft="true"
 >
 </TextView>
 <CheckBox
 android:id="@+id/chkPrivate"
-android:layout_width="wrap_content"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="Private"
-android:layout_above="@+id/chkAnonymous"
-android:layout_alignParentLeft="true"
 >
 </CheckBox>
 <CheckBox
 android:id="@+id/chkOneChoice"
-android:layout_width="wrap_content"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="Single choice only"
-android:layout_below="@+id/chkAnonymous"
-android:layout_alignParentLeft="true"
 >
 </CheckBox>
 <CheckBox
 android:id="@+id/chkAnonymous"
-android:layout_width="wrap_content"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="Anonymous voting"
-android:layout_centerVertical="true"
-android:layout_alignParentLeft="true"
 >
 </CheckBox>
 <TextView
-android:id="@+id/dateCreatedOn"
-android:layout_width="300px"
-android:layout_height="wrap_content"
-android:text="Created on"
-android:textStyle="bold"
-android:layout_below="@+id/txtQuestion"
-android:layout_alignParentLeft="true"
->
-</TextView>
-<TextView
 android:id="@+id/txtKey"
-android:layout_width="300px"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="URL key"
 android:textStyle="bold"
-android:layout_below="@+id/chkOneChoice"
-android:layout_alignParentLeft="true"
 >
 </TextView>
-
+</LinearLayout>
+<LinearLayout
+android:id="@+id/SubLL2"
+android:layout_width="fill_parent"
+android:layout_height="fill_parent"
+android:layout_weight="1"
+>
 <Button
-android:id="@+id/btnBack"
-android:layout_width="wrap_content"
+android:id="@+id/btnMap"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
-android:layout_marginLeft="10px"
-android:layout_marginRight="10px"
+android:layout_weight="1"
+android:layout_gravity="bottom"
+android:text="Map"
 android:textStyle="bold"
-android:text="Back"
-android:layout_alignParentBottom="true"
-android:layout_alignParentRight="true"
 >
 </Button>
 <Button
 android:id="@+id/btnVote"
-android:layout_width="wrap_content"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
+android:layout_weight="1"
+android:layout_gravity="bottom"
 android:text="Vote"
-android:layout_marginLeft="10px"
-android:layout_marginRight="10px"
 android:textStyle="bold"
-android:layout_alignParentBottom="true"
-android:layout_centerHorizontal="true"
 >
 </Button>
 <Button
-android:id="@+id/btnMap"
-android:layout_width="wrap_content"
+android:id="@+id/btnBack"
+android:layout_width="fill_parent"
 android:layout_height="wrap_content"
-android:layout_marginLeft="10px"
-android:layout_marginRight="10px"
+android:layout_weight="1"
+android:layout_gravity="bottom"
+android:text="Back"
 android:textStyle="bold"
-android:text="Map"
-android:layout_alignParentBottom="true"
-android:layout_alignParentLeft="true"
 >
 </Button>
-
-
-</RelativeLayout>
+</LinearLayout>
+</LinearLayout>

File android/placeUvote/res/values/strings.xml

     <string name="poll_map">Poll map</string>
     <string name="show_list">Show list of locations</string>
     <string name="list_name">List of polls</string>
+    <string name="vote_name">Vote in the poll</string>
     <string name="location_name">Location details</string>
     <string name="poll_name">Poll details</string>
     <string name="add_location">Add location</string>

File android/placeUvote/src/com/placeuvote/android/PollVote.java

     private static TextView txtUser;
     private static TextView txtEmail;
     private static TextView txtQuestion;
+    private static Button btnMap; 
+    private static Button btnVote; 
     private static Button btnBack;
     
     PUVDatabase db;
         numTotalVotes = (TextView) findViewById(R.id.numTotalVotes);
         txtQuestion = (TextView) findViewById(R.id.txtQuestion);
         btnBack = (Button) findViewById(R.id.btnBack);
+        btnMap = (Button) findViewById(R.id.btnMap);
+
 
         // get the poll_id for this poll from the bundle passed by PollList
         Bundle bIn = this.getIntent().getExtras();
         // txtUser.setText(poll.getColUser());
         txtQuestion.setText(poll.getColQuestion());
 
-    }
+        btnBack = (Button) findViewById(R.id.btnBack);
+        btnBack.setOnClickListener(btnBackClick);
+        btnMap = (Button) findViewById(R.id.btnMap);
+        btnMap.setOnClickListener(btnMapClick);
+      
+     }
 
+    
+    private final Button.OnClickListener btnBackClick = new Button.OnClickListener() 
+    {
+        public void onClick(View v) 
+        {
+        	finish();
+        }
+    };  
+    
+    private final Button.OnClickListener btnMapClick = new Button.OnClickListener() {
+        public void onClick(View v) {
+            Intent i = new Intent(PollVote.this, PollMap.class);
+            Bundle b = new Bundle();
+            b.putInt("poll_id", (int) 1);
+            i.putExtras(b);
+
+            startActivity(i);
+        }
+    };  
     /**
      * Setup menus for this page.
      *
         }
     }
     
-    private final Button.OnClickListener btnBackClick = new Button.OnClickListener() 
-    {
-        public void onClick(View v) 
-        {
-        	finish();
-        }
-    };  
 }