<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical"
android:weightSum="11" >
<ListView
android:id="@+id/listview"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:cacheColorHint="#00000000"
android:overScrollMode="never"
android:choiceMode="singleChoice" >
</ListView>
<FrameLayout
android:background="@color/tabs_color"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp"
android:orientation="horizontal">
<Button
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:background="@drawable/menu_button_selector"
android:id="@+id/OptionsButton"
android:layout_gravity="start|center_vertical"/>
<Button
android:layout_height="30dp"
android:layout_width="30dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/add_button_selector"
android:layout_gravity="end|center_vertical"
android:id="@+id/CreateListButton"/>
</FrameLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/ListEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="4dp"
android:textSize="@dimen/listTextSize" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/lists_layout"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center_horizontal|bottom"
android:background="#C9F0A8"
android:gravity="center|bottom"
android:orientation="horizontal" >
<Button
android:id="@+id/EditButton"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="Edit" />
<Button
android:id="@+id/OptionsButton"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="Options" />
<Button
android:id="@+id/CreateListButton"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="New" />
</LinearLayout>
</FrameLayout>
boolean editMode;
editButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!editMode)
{
editMode=true;
for (View view : allEds){
view.setClickable(false);
view.setFocusable(false);
view.setFocusableInTouchMode(false);
EditText text = (EditText) view.findViewById(R.id.ListEditText);
text.setClickable(true);
text.setFocusable(true);
text.setFocusableInTouchMode(true);
}
}
else{
editMode=false;
for (View view : allEds){
view.setClickable(true);
view.setFocusable(true);
view.setFocusableInTouchMode(true);
EditText text = (EditText) view.findViewById(R.id.ListEditText);
text.setClickable(false);
text.setFocusable(false);
text.setFocusableInTouchMode(false);
}
}
}
});