Skip to content

Commit 59e31ad

Browse files
committed
updates
1 parent e1a1d47 commit 59e31ad

27 files changed

Lines changed: 1666 additions & 1534 deletions

File tree

‎JavaExcelWrite/.classpath‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎JavaExcelWrite/.project‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎JavaExcelWrite/lib/jxl.jar‎

-704 KB
Binary file not shown.
Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:orientation="vertical"
4-
android:layout_width="fill_parent"
5-
android:layout_height="fill_parent"
6-
>
7-
<TextView
8-
android:layout_width="fill_parent"
9-
android:layout_height="wrap_content"
10-
android:text="@string/hello"
11-
/>
3+
android:layout_width="fill_parent" android:layout_height="fill_parent"
4+
android:orientation="vertical" android:background="#C0C0C0">
5+
<EditText android:layout_height="wrap_content" android:id="@+id/editText1"
6+
android:layout_width="match_parent">
7+
<requestFocus></requestFocus>
8+
</EditText>
9+
<Button android:id="@+id/button1" android:text="Show Message"
10+
android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
11+
12+
<RadioGroup android:id="@+id/orientation"
13+
android:layout_height="wrap_content" android:layout_width="match_parent">
14+
<RadioButton android:text="Horizontal"
15+
android:layout_height="wrap_content" android:layout_width="wrap_content"
16+
android:id="@+id/horizontal"></RadioButton>
17+
<RadioButton android:text="Vertical"
18+
android:layout_height="wrap_content" android:layout_width="wrap_content"
19+
android:id="@+id/vertical" android:checked="true"></RadioButton>
20+
</RadioGroup>
21+
<TableLayout android:id="@+id/tableLayout1"
22+
android:layout_width="match_parent" android:layout_height="wrap_content"
23+
android:stretchColumns="1">
24+
<TableRow android:layout_width="match_parent"
25+
android:layout_height="wrap_content" android:id="@+id/tableRow1">
26+
<TextView android:id="@+id/textView1" android:text="User"
27+
android:layout_height="wrap_content" android:layout_width="match_parent"
28+
style="@style/myText"></TextView>
29+
<EditText android:layout_height="wrap_content" android:id="@+id/editText2"
30+
android:layout_width="match_parent" android:padding="3dip"></EditText>
31+
</TableRow>
32+
<TableRow android:layout_width="match_parent"
33+
android:layout_height="wrap_content" android:id="@+id/tableRow2">
34+
<TextView android:id="@+id/textView2"
35+
android:text="Password" android:layout_height="wrap_content"
36+
android:layout_width="match_parent" style="@style/myText"
37+
></TextView>
38+
<EditText android:layout_height="wrap_content" android:id="@+id/editText3"
39+
android:layout_width="match_parent" android:padding="3dip"></EditText>
40+
</TableRow>
41+
</TableLayout>
42+
1243
</LinearLayout>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<style name="myText">
4+
<item name="android:textColor">#000000</item>
5+
<item name="android:textSize">22sp</item>
6+
<item name="android:padding">3dip</item>
7+
</style>
8+
</resources>

‎de.vogella.android.first/src/de/vogella/android/first/TestActivity.java‎

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,39 @@
22

33
import android.app.Activity;
44
import android.os.Bundle;
5+
import android.view.View;
6+
import android.widget.EditText;
7+
import android.widget.LinearLayout;
8+
import android.widget.RadioGroup;
9+
import android.widget.RadioGroup.OnCheckedChangeListener;
10+
import android.widget.Toast;
511

612
public class TestActivity extends Activity {
7-
/** Called when the activity is first created. */
8-
@Override
9-
public void onCreate(Bundle savedInstanceState) {
10-
super.onCreate(savedInstanceState);
11-
setContentView(R.layout.main);
12-
}
13+
/** Called when the activity is first created. */
14+
@Override
15+
public void onCreate(Bundle savedInstanceState) {
16+
super.onCreate(savedInstanceState);
17+
setContentView(R.layout.main);
18+
RadioGroup group1 = (RadioGroup) findViewById(R.id.orientation);
19+
group1.setOnCheckedChangeListener(new OnCheckedChangeListener() {
20+
@Override
21+
public void onCheckedChanged(RadioGroup group, int checkedId) {
22+
switch (checkedId) {
23+
case R.id.horizontal:
24+
group.setOrientation(LinearLayout.HORIZONTAL);
25+
break;
26+
case R.id.vertical:
27+
group.setOrientation(LinearLayout.VERTICAL);
28+
break;
29+
}
30+
}
31+
});
32+
33+
}
34+
35+
public void sayHello(View view) {
36+
EditText text = (EditText) findViewById(R.id.editText1);
37+
text.getText().toString();
38+
Toast.makeText(this, "Button 1 pressed", Toast.LENGTH_LONG).show();
39+
}
1340
}

‎de.vogella.android.intent.explicit/src/de/vogella/android/intent/explicit/ActivityTwo.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void onClick(View view) {
3535
public void finish() {
3636
Intent data = new Intent();
3737
data.putExtra("returnKey1", "Swinging on a star. ");
38-
data.putExtra("returnKey2", "You could be bettern then you are. ");
38+
data.putExtra("returnKey2", "You could be better then you are. ");
3939
setResult(RESULT_OK, data);
4040
super.finish();
4141
}

‎de.vogella.android.todos/AndroidManifest.xml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
<activity android:name=".TodoDetails"
1414
android:windowSoftInputMode="stateVisible|adjustResize">
1515
>
16-
17-
</activity>
16+
17+
</activity>
18+
<provider android:name="MyTodoContentProvider"
19+
android:authorities="de.vogella.android.todos.provider"></provider>
1820
</application>
1921
<uses-sdk android:minSdkVersion="9" />
2022

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package de.vogella.android.todos;
2+
3+
import android.content.ContentProvider;
4+
import android.content.ContentValues;
5+
import android.database.Cursor;
6+
import android.net.Uri;
7+
8+
public class MyTodoContentProvider extends ContentProvider {
9+
10+
@Override
11+
public boolean onCreate() {
12+
return false;
13+
}
14+
15+
@Override
16+
public Cursor query(Uri uri, String[] projection, String selection,
17+
String[] selectionArgs, String sortOrder) {
18+
return null;
19+
}
20+
21+
@Override
22+
public String getType(Uri uri) {
23+
return null;
24+
}
25+
26+
@Override
27+
public Uri insert(Uri uri, ContentValues values) {
28+
return null;
29+
}
30+
31+
@Override
32+
public int delete(Uri uri, String selection, String[] selectionArgs) {
33+
return 0;
34+
}
35+
36+
@Override
37+
public int update(Uri uri, ContentValues values, String selection,
38+
String[] selectionArgs) {
39+
return 0;
40+
}
41+
42+
}

‎de.vogella.android.todos/src/de/vogella/android/todos/TodosOverview.java‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected void onListItemClick(ListView l, View v, int position, long id) {
8888
Intent i = new Intent(this, TodoDetails.class);
8989
i.putExtra(TodoDbAdapter.KEY_ROWID, id);
9090
// Activity returns an result if called with startActivityForResult
91-
91+
9292
startActivityForResult(i, ACTIVITY_EDIT);
9393
}
9494

@@ -123,4 +123,12 @@ public void onCreateContextMenu(ContextMenu menu, View v,
123123
super.onCreateContextMenu(menu, v, menuInfo);
124124
menu.add(0, DELETE_ID, 0, R.string.menu_delete);
125125
}
126+
127+
@Override
128+
protected void onDestroy() {
129+
super.onDestroy();
130+
if (dbHelper == null) {
131+
dbHelper.close();
132+
}
133+
}
126134
}

0 commit comments

Comments
 (0)