Skip to content

Instantly share code, notes, and snippets.

@FeherMarcell
Last active December 28, 2015 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FeherMarcell/7482341 to your computer and use it in GitHub Desktop.
Save FeherMarcell/7482341 to your computer and use it in GitHub Desktop.
Mobile Software Development - Android practise
<activity android:name="EditTodoActivity" android:theme="@android:style/Theme.Holo.Light.Dialog"></activity>
<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"
tools:context=".MainActivity" >
<ListView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/todoListView"
/>
<RelativeLayout
android:id="@+id/noTodosLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/createTodoTextview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/no_todo_items"
android:textColor="#666666"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
</RelativeLayout>
</FrameLayout>
<?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="wrap_content"
android:orientation="vertical"
android:padding="10dp" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/titleEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Due date"
android:textAppearance="?android:attr/textAppearanceLarge" />
<DatePicker
android:id="@+id/dueDatePicker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:calendarViewShown="true"
android:spinnersShown="false" />
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="Priority"
android:textAppearance="?android:attr/textAppearanceLarge" />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/priorityRadioGroup" >
<RadioButton
android:id="@+id/radio_low"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Low"
android:textColor="@color/priority_low" />
<RadioButton
android:id="@+id/radio_medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium"
android:textColor="@color/priority_medium" />
<RadioButton
android:id="@+id/radio_high"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="High"
android:textColor="@color/priority_high" />
</RadioGroup>
</TableRow>
</TableLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/cancelBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Cancel" />
<Button
android:id="@+id/okBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Save" />
</LinearLayout>
</LinearLayout>
<?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="wrap_content"
android:orientation="horizontal" >
<View
android:id="@+id/leftColorRibbon"
android:layout_width="8dp"
android:layout_height="match_parent"
android:background="@color/priority_high"
/>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/separator_line"
/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp" >
<TextView
android:id="@+id/todoTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#171717"
android:typeface="serif"
android:text="Title of the todo item" />
<TextView
android:id="@+id/todoDuedate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#666666"
android:typeface="serif"
android:text="Due on 16/11/2013"
/>
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="@color/separator_line"
/>
<View
android:id="@+id/rightColorRibbon"
android:layout_width="8dp"
android:layout_height="match_parent"
android:background="@color/priority_low" />
</LinearLayout>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_create"
android:showAsAction="always"
android:title="@string/action_create"
android:titleCondensed="@string/action_create"
/>
<item
android:id="@+id/action_fill_sample_data"
android:showAsAction="never"
android:title="@string/action_fill_with_sample_data"
/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="priority_low">#1FA657</color>
<color name="priority_medium">#2F9AC4</color>
<color name="priority_high">#FF6505</color>
<color name="separator_line">#ebebeb</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">MyTodoApp</string>
<string name="action_create">New Todo</string>
<string name="action_fill_with_sample_data">Fill with sample data</string>
<string name="hello_world">Hello world!</string>
<string name="no_todo_items">No todo items yet. Create one now?</string>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment