Skip to content

Commit

Permalink
image add button added
Browse files Browse the repository at this point in the history
  • Loading branch information
1405043-kd committed Jun 7, 2017
1 parent f1b9961 commit b1facbb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
17 changes: 16 additions & 1 deletion ToLet/app/src/main/java/com/example/user/tolet/AdPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ protected void onCreate(Bundle savedInstanceState) {
Intent intent = getIntent();
taskItem=(TaskItem)intent.getSerializableExtra("postObject");
//textView2.setText("eijonnoi");
textView1.setText("aa");
String whatToShow="";
if(taskItem.getHouseNo()!=null)
whatToShow+=taskItem.getHouseNo()+"\n";
if(taskItem.getRoadNo()!=null)
whatToShow+=taskItem.getRoadNo()+"\n";
if(taskItem.getThana()!=null)
whatToShow+=taskItem.getThana()+"\n";
if(taskItem.getDistrict()!=null)
whatToShow+=taskItem.getDistrict()+"\n";
if(taskItem.getPostAddress()!=null)
whatToShow+=taskItem.getPostAddress()+"\n";
if(taskItem.getContactNo()!=null)
whatToShow+=taskItem.getContactNo()+"\n";
if(taskItem.getIsBachelor()!=null)
whatToShow+=taskItem.getIsBachelor();
textView1.setText(whatToShow);
}
}
14 changes: 12 additions & 2 deletions ToLet/app/src/main/java/com/example/user/tolet/PostAdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
Expand All @@ -33,7 +34,7 @@ public class PostAdd extends AppCompatActivity {
EditText editText6;
TextView textView;
Button post;
Switch aSwitch;
CheckBox aSwitch;
ImageButton imageButton;
ImageView imageView;
TaskItem taskItem=new TaskItem();
Expand All @@ -50,7 +51,7 @@ protected void onCreate(Bundle savedInstanceState) {
editText6=(EditText) findViewById(R.id.contactNo);
textView=(TextView) findViewById(R.id.currState);
post=(Button)findViewById(R.id.postButton);
aSwitch=(Switch) findViewById(R.id.switcha);
aSwitch=(CheckBox) findViewById(R.id.switcha);
imageButton=(ImageButton) findViewById(R.id.imageButtonPic);
imageView=(ImageView)findViewById(R.id.imageView);
sqLiteHelper=new databaseHelp(this,"adDB.sqlite",null,1);
Expand Down Expand Up @@ -101,6 +102,15 @@ public void sendMessage(View view) {
editText = (EditText) findViewById(R.id.postAddress);
message=editText.getText().toString();
taskItem.PostAddress=message;
editText = (EditText) findViewById(R.id.contactNo);
message=editText.getText().toString();
taskItem.ContactNo=message;
editText = (EditText) findViewById(R.id.postAddress);
message=editText.getText().toString();
taskItem.PostAddress=message;
aSwitch=(CheckBox) findViewById(R.id.switcha);
if(aSwitch.isChecked()) taskItem.isBachelor="Bachelor allowed";
else taskItem.isBachelor="Bachelor not allowed";
// sqLiteHelper.insertData(
// taskItem.getHouseNo().toString().trim(),
// taskItem.getRoadNo().toString().trim()
Expand Down
5 changes: 5 additions & 0 deletions ToLet/app/src/main/java/com/example/user/tolet/TaskItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class TaskItem implements Serializable {
public String District;
public String PostAddress;
public String ContactNo;
public String isBachelor;
public TaskItem(){}
public TaskItem(String house, String road, String thana, String district, String postAddress, String contactNo) {
HouseNo=house;
Expand Down Expand Up @@ -47,6 +48,10 @@ public String getContactNo() {
return ContactNo;
}

public String getIsBachelor() {
return isBachelor;
}

@Override
public String toString() {
return "TaskItem{" +
Expand Down
9 changes: 3 additions & 6 deletions ToLet/app/src/main/res/layout/activity_post_add.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,13 @@
android:hint="Contact No."
android:inputType="phone" />

<Switch
<CheckBox
android:id="@+id/switcha"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="15dp"
android:paddingBottom="20dp"
android:paddingEnd="10dp"
android:text="Bachelor"
android:textSize="24sp" />
android:elevation="24dp"
android:text="Bachelor" />

<LinearLayout
android:layout_width="match_parent"
Expand Down

0 comments on commit b1facbb

Please sign in to comment.