Skip to content

Commit a60c620

Browse files
committed
Todo example updated
1 parent fa574a6 commit a60c620

22 files changed

Lines changed: 100 additions & 62 deletions

File tree

‎de.vogella.android.listactivity/gen/de/vogella/android/listactivity/R.java‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@ public final class R {
1111
public static final class attr {
1212
}
1313
public static final class drawable {
14-
public static final int icon=0x7f020000;
14+
public static final int alt_window_16=0x7f020000;
15+
public static final int icon=0x7f020001;
16+
public static final int no=0x7f020002;
17+
public static final int ok=0x7f020003;
18+
}
19+
public static final class id {
20+
public static final int icon=0x7f050000;
21+
public static final int label=0x7f050001;
1522
}
1623
public static final class layout {
1724
public static final int main=0x7f030000;
25+
public static final int rowlayout=0x7f030001;
1826
}
1927
public static final class string {
2028
public static final int app_name=0x7f040001;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="wrap_content" android:layout_height="wrap_content">
4-
<ImageView android:id="@+id/icon" android:layout_height="wrap_content" android:src="@drawable/ok" android:layout_width="22px" android:layout_marginTop="4px" android:layout_marginRight="4px" android:layout_marginLeft="4px">
4+
<ImageView android:id="@+id/icon" android:src="@drawable/ok" android:layout_width="22px" android:layout_marginTop="4px" android:layout_marginLeft="4px" android:layout_height="22px" android:layout_marginRight="10px">
55
</ImageView>
66
<TextView android:text="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/label" android:textSize="30px"></TextView>
77
</LinearLayout>

‎de.vogella.android.listactivity/src/de/vogella/android/listactivity/MyArrayAdapter.java‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ public MyArrayAdapter(Activity context, String[] names) {
2222
public View getView(int position, View convertView, ViewGroup parent) {
2323
LayoutInflater inflater = context.getLayoutInflater();
2424
View rowView = inflater.inflate(R.layout.rowlayout, null, true);
25-
25+
2626
TextView label = (TextView) rowView.findViewById(R.id.label);
2727
label.setText(names[position]);
2828
System.out.println(names[position]);
2929
// Change the icon for Windows and iPhone
30-
if (names[position].startsWith("Windows7") || names[position].startsWith("iPhone") ) {
30+
String s = names[position];
31+
if (s.startsWith("Windows7") || s.startsWith("iPhone")
32+
|| s.startsWith("Solaris")) {
3133
ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);
3234
imageView.setImageResource(R.drawable.no);
33-
}
34-
35+
}
36+
3537
return rowView;
3638
}
3739

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="de.vogella.android.todos"
4-
android:versionCode="1"
5-
android:versionName="1.0">
6-
<application android:icon="@drawable/icon" android:label="@string/app_name">
7-
<activity android:name=".Todos"
8-
android:label="@string/app_name">
9-
<intent-filter>
10-
<action android:name="android.intent.action.MAIN" />
11-
<category android:name="android.intent.category.LAUNCHER" />
12-
</intent-filter>
13-
</activity>
3+
package="de.vogella.android.todos" android:versionCode="1"
4+
android:versionName="1.0">
5+
<application android:icon="@drawable/icon" android:label="@string/app_name">
6+
<activity android:name=".Todos" android:label="@string/app_name">
7+
<intent-filter>
8+
<action android:name="android.intent.action.MAIN" />
9+
<category android:name="android.intent.category.LAUNCHER" />
10+
</intent-filter>
11+
</activity>
1412

15-
<activity android:name=".TodoEdit"></activity>
16-
</application>
17-
<uses-sdk android:minSdkVersion="8" />
13+
<activity android:name=".TodoEdit"
14+
android:windowSoftInputMode="stateVisible|adjustResize">
15+
>
16+
17+
</activity>
18+
</application>
19+
<uses-sdk android:minSdkVersion="8" />
1820

1921
</manifest>
9.89 KB
Loading
6.49 KB
Loading

‎de.vogella.android.todos/res/layout/todo_edit.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
<EditText android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:id="@+id/todo_edit_description" android:hint="Description"></EditText>
14-
<DatePicker android:id="@+id/DatePicker01" android:layout_width="wrap_content" android:layout_height="wrap_content"></DatePicker><Button android:layout_width="wrap_content"
14+
<Button android:layout_width="wrap_content"
1515
android:layout_height="wrap_content" android:id="@+id/todo_edit_button"
1616
android:text="@string/todo_edit_confirm"></Button>
1717

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:orientation="vertical" android:layout_width="fill_parent"
4-
android:layout_height="fill_parent">
4+
android:layout_height="fill_parent" android:background="@color/listcolor">
55
<ListView android:id="@android:id/list" android:layout_width="wrap_content"
66
android:layout_height="wrap_content" />
77
<TextView android:id="@android:id/empty" android:layout_width="wrap_content"
88
android:layout_height="wrap_content" android:text="@string/no_todos" />
9-
109
</LinearLayout>
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<TextView android:id="@+id/text1"
3-
xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:layout_width="wrap_content" android:layout_height="wrap_content" />
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="wrap_content" android:layout_height="wrap_content">
4+
<ImageView android:id="@+id/icon" android:src="@drawable/reminder"
5+
android:layout_marginLeft="4px" android:layout_marginRight="8px"
6+
android:layout_height="40px" android:layout_marginTop="8px"
7+
android:layout_width="30px">
8+
</ImageView>
9+
<TextView android:text="@+id/TextView01" android:layout_height="wrap_content" android:id="@+id/label"
10+
android:textSize="40px" android:layout_marginTop="6px" android:layout_width="fill_parent" android:textColor="@color/black"></TextView>
11+
</LinearLayout>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:id="@+id/insert" android:title="Insert"></item>
5+
</menu>

0 commit comments

Comments
 (0)