diff --git a/APIVersions/ReadWriteStrict/AndroidManifest.xml b/APIVersions/ReadWriteStrict/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/APIVersions/ReadWriteStrict/res/layout/main.xml b/APIVersions/ReadWriteStrict/res/layout/main.xml
old mode 100755
new mode 100644
index 2a672c6..77998b8
--- a/APIVersions/ReadWriteStrict/res/layout/main.xml
+++ b/APIVersions/ReadWriteStrict/res/layout/main.xml
@@ -1,8 +1,8 @@
+ android:id="@+id/editor"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:singleLine="false"
+ android:gravity="top"
+ />
diff --git a/APIVersions/ReadWriteStrict/res/values/strings.xml b/APIVersions/ReadWriteStrict/res/values/strings.xml
old mode 100755
new mode 100644
index af36c8f..e5be035
--- a/APIVersions/ReadWriteStrict/res/values/strings.xml
+++ b/APIVersions/ReadWriteStrict/res/values/strings.xml
@@ -1,4 +1,4 @@
- ReadWriteFileDemo
+ ReadWriteFileDemo
\ No newline at end of file
diff --git a/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java b/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java
old mode 100755
new mode 100644
index a667631..31f8a49
--- a/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java
+++ b/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.readwrite;
@@ -28,63 +28,63 @@
import java.io.OutputStreamWriter;
public class ReadWriteFileDemo extends Activity {
- private final static String NOTES="notes.txt";
- private EditText editor;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- StrictWrapper.init();
-
- editor=(EditText)findViewById(R.id.editor);
- }
-
- public void onResume() {
- super.onResume();
-
- try {
- InputStream in=openFileInput(NOTES);
-
- if (in!=null) {
- InputStreamReader tmp=new InputStreamReader(in);
- BufferedReader reader=new BufferedReader(tmp);
- String str;
- StringBuilder buf=new StringBuilder();
-
- while ((str = reader.readLine()) != null) {
- buf.append(str+"\n");
- }
-
- in.close();
- editor.setText(buf.toString());
- }
- }
- catch (java.io.FileNotFoundException e) {
- // that's OK, we probably haven't created it yet
- }
- catch (Throwable t) {
- Toast
- .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
- .show();
- }
- }
-
- public void onPause() {
- super.onPause();
-
- try {
- OutputStreamWriter out=
- new OutputStreamWriter(openFileOutput(NOTES, 0));
-
- out.write(editor.getText().toString());
- out.close();
- }
- catch (Throwable t) {
- Toast
- .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
- .show();
- }
- }
+ private final static String NOTES="notes.txt";
+ private EditText editor;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ StrictWrapper.init();
+
+ editor=(EditText)findViewById(R.id.editor);
+ }
+
+ public void onResume() {
+ super.onResume();
+
+ try {
+ InputStream in=openFileInput(NOTES);
+
+ if (in!=null) {
+ InputStreamReader tmp=new InputStreamReader(in);
+ BufferedReader reader=new BufferedReader(tmp);
+ String str;
+ StringBuilder buf=new StringBuilder();
+
+ while ((str = reader.readLine()) != null) {
+ buf.append(str+"\n");
+ }
+
+ in.close();
+ editor.setText(buf.toString());
+ }
+ }
+ catch (java.io.FileNotFoundException e) {
+ // that's OK, we probably haven't created it yet
+ }
+ catch (Throwable t) {
+ Toast
+ .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
+ .show();
+ }
+ }
+
+ public void onPause() {
+ super.onPause();
+
+ try {
+ OutputStreamWriter out=
+ new OutputStreamWriter(openFileOutput(NOTES, 0));
+
+ out.write(editor.getText().toString());
+ out.close();
+ }
+ catch (Throwable t) {
+ Toast
+ .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
+ .show();
+ }
+ }
}
\ No newline at end of file
diff --git a/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictForRealz.java b/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictForRealz.java
index a336189..0c3bda7 100644
--- a/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictForRealz.java
+++ b/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictForRealz.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.readwrite;
@@ -17,10 +17,10 @@
import android.os.StrictMode;
class StrictForRealz extends StrictWrapper {
- StrictForRealz() {
- StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
- .detectAll()
- .penaltyLog()
- .build());
- }
+ StrictForRealz() {
+ StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
+ .detectAll()
+ .penaltyLog()
+ .build());
+ }
}
\ No newline at end of file
diff --git a/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictWrapper.java b/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictWrapper.java
index 1772b75..c217ddd 100644
--- a/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictWrapper.java
+++ b/APIVersions/ReadWriteStrict/src/com/commonsware/android/readwrite/StrictWrapper.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.readwrite;
@@ -17,18 +17,18 @@
import android.os.Build;
abstract class StrictWrapper {
- static private StrictWrapper INSTANCE=null;
-
- static public void init() {
- if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.GINGERBREAD) {
- INSTANCE=new StrictForRealz();
- }
- else {
- INSTANCE=new NotAllThatStrict();
- }
- }
-
- static class NotAllThatStrict extends StrictWrapper {
- // no methods needed
- }
+ static private StrictWrapper INSTANCE=null;
+
+ static public void init() {
+ if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.GINGERBREAD) {
+ INSTANCE=new StrictForRealz();
+ }
+ else {
+ INSTANCE=new NotAllThatStrict();
+ }
+ }
+
+ static class NotAllThatStrict extends StrictWrapper {
+ // no methods needed
+ }
}
\ No newline at end of file
diff --git a/Activities/IntentTab/AndroidManifest.xml b/Activities/IntentTab/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Activities/IntentTab/res/layout/main.xml b/Activities/IntentTab/res/layout/main.xml
old mode 100755
new mode 100644
index 3b808d3..24eeb2a
--- a/Activities/IntentTab/res/layout/main.xml
+++ b/Activities/IntentTab/res/layout/main.xml
@@ -1,12 +1,12 @@
-
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
\ No newline at end of file
diff --git a/Activities/IntentTab/res/values/strings.xml b/Activities/IntentTab/res/values/strings.xml
old mode 100755
new mode 100644
index cac7fa8..091ba6d
--- a/Activities/IntentTab/res/values/strings.xml
+++ b/Activities/IntentTab/res/values/strings.xml
@@ -1,4 +1,4 @@
- IntentTabDemo
+ IntentTabDemo
\ No newline at end of file
diff --git a/Activities/IntentTab/src/com/commonsware/android/intenttab/CWBrowser.java b/Activities/IntentTab/src/com/commonsware/android/intenttab/CWBrowser.java
old mode 100755
new mode 100644
index f7c8d92..90b3eec
--- a/Activities/IntentTab/src/com/commonsware/android/intenttab/CWBrowser.java
+++ b/Activities/IntentTab/src/com/commonsware/android/intenttab/CWBrowser.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.intenttab;
@@ -21,16 +21,16 @@
import android.webkit.WebView;
public class CWBrowser extends Activity {
- public static final String URL="com.commonsware.android.intenttab.URL";
- private WebView browser;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
-
- browser=new WebView(this);
- setContentView(browser);
- browser.loadUrl(getIntent().getStringExtra(URL));
- }
+ public static final String URL="com.commonsware.android.intenttab.URL";
+ private WebView browser;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ browser=new WebView(this);
+ setContentView(browser);
+ browser.loadUrl(getIntent().getStringExtra(URL));
+ }
}
diff --git a/Activities/IntentTab/src/com/commonsware/android/intenttab/IntentTabDemo.java b/Activities/IntentTab/src/com/commonsware/android/intenttab/IntentTabDemo.java
old mode 100755
new mode 100644
index 8b5aefb..8695961
--- a/Activities/IntentTab/src/com/commonsware/android/intenttab/IntentTabDemo.java
+++ b/Activities/IntentTab/src/com/commonsware/android/intenttab/IntentTabDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.intenttab;
@@ -23,22 +23,22 @@
import android.widget.TabHost;
public class IntentTabDemo extends TabActivity {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
- TabHost host=getTabHost();
- Intent i=new Intent(this, CWBrowser.class);
-
- i.putExtra(CWBrowser.URL, "http://commonsware.com");
- host.addTab(host.newTabSpec("one")
- .setIndicator("CW")
- .setContent(i));
-
- i=new Intent(i);
- i.putExtra(CWBrowser.URL, "http://www.android.com");
- host.addTab(host.newTabSpec("two")
- .setIndicator("Android")
- .setContent(i));
- }
+ TabHost host=getTabHost();
+ Intent i=new Intent(this, CWBrowser.class);
+
+ i.putExtra(CWBrowser.URL, "http://commonsware.com");
+ host.addTab(host.newTabSpec("one")
+ .setIndicator("CW")
+ .setContent(i));
+
+ i=new Intent(i);
+ i.putExtra(CWBrowser.URL, "http://www.android.com");
+ host.addTab(host.newTabSpec("two")
+ .setIndicator("Android")
+ .setContent(i));
+ }
}
diff --git a/Activities/Launch/AndroidManifest.xml b/Activities/Launch/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Activities/Launch/res/layout/main.xml b/Activities/Launch/res/layout/main.xml
old mode 100755
new mode 100644
index cc04dbd..e14c492
--- a/Activities/Launch/res/layout/main.xml
+++ b/Activities/Launch/res/layout/main.xml
@@ -1,44 +1,44 @@
-
-
-
-
-
-
-
-
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Activities/Launch/res/values/strings.xml b/Activities/Launch/res/values/strings.xml
old mode 100755
new mode 100644
index 4c55f5e..6872a92
--- a/Activities/Launch/res/values/strings.xml
+++ b/Activities/Launch/res/values/strings.xml
@@ -1,4 +1,4 @@
- LaunchDemo
+ LaunchDemo
\ No newline at end of file
diff --git a/Activities/Launch/src/com/commonsware/android/activities/LaunchDemo.java b/Activities/Launch/src/com/commonsware/android/activities/LaunchDemo.java
old mode 100755
new mode 100644
index 7248b6c..cf5e6a7
--- a/Activities/Launch/src/com/commonsware/android/activities/LaunchDemo.java
+++ b/Activities/Launch/src/com/commonsware/android/activities/LaunchDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.activities;
@@ -22,23 +22,23 @@
import android.widget.EditText;
public class LaunchDemo extends Activity {
- private EditText lat;
- private EditText lon;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- lat=(EditText)findViewById(R.id.lat);
- lon=(EditText)findViewById(R.id.lon);
- }
-
- public void showMe(View v) {
- String _lat=lat.getText().toString();
- String _lon=lon.getText().toString();
- Uri uri=Uri.parse("geo:"+_lat+","+_lon);
-
- startActivity(new Intent(Intent.ACTION_VIEW, uri));
- }
+ private EditText lat;
+ private EditText lon;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ lat=(EditText)findViewById(R.id.lat);
+ lon=(EditText)findViewById(R.id.lon);
+ }
+
+ public void showMe(View v) {
+ String _lat=lat.getText().toString();
+ String _lon=lon.getText().toString();
+ Uri uri=Uri.parse("geo:"+_lat+","+_lon);
+
+ startActivity(new Intent(Intent.ACTION_VIEW, uri));
+ }
}
\ No newline at end of file
diff --git a/Basic/CheckBox/AndroidManifest.xml b/Basic/CheckBox/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Basic/CheckBox/res/layout/main.xml b/Basic/CheckBox/res/layout/main.xml
old mode 100755
new mode 100644
index 0d6f4eb..af29a8a
--- a/Basic/CheckBox/res/layout/main.xml
+++ b/Basic/CheckBox/res/layout/main.xml
@@ -1,6 +1,6 @@
\ No newline at end of file
+ android:id="@+id/check"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="This checkbox is: unchecked" />
\ No newline at end of file
diff --git a/Basic/CheckBox/res/values/strings.xml b/Basic/CheckBox/res/values/strings.xml
old mode 100755
new mode 100644
index 9a37b6d..a38b48b
--- a/Basic/CheckBox/res/values/strings.xml
+++ b/Basic/CheckBox/res/values/strings.xml
@@ -1,4 +1,4 @@
- CheckBoxDemo
+ CheckBoxDemo
\ No newline at end of file
diff --git a/Basic/CheckBox/src/com/commonsware/android/checkbox/CheckBoxDemo.java b/Basic/CheckBox/src/com/commonsware/android/checkbox/CheckBoxDemo.java
old mode 100755
new mode 100644
index 39c1c91..a84f0f3
--- a/Basic/CheckBox/src/com/commonsware/android/checkbox/CheckBoxDemo.java
+++ b/Basic/CheckBox/src/com/commonsware/android/checkbox/CheckBoxDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.checkbox;
@@ -20,25 +20,25 @@
import android.widget.CompoundButton;
public class CheckBoxDemo extends Activity
- implements CompoundButton.OnCheckedChangeListener {
- CheckBox cb;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- cb=(CheckBox)findViewById(R.id.check);
- cb.setOnCheckedChangeListener(this);
- }
-
- public void onCheckedChanged(CompoundButton buttonView,
- boolean isChecked) {
- if (isChecked) {
- cb.setText("This checkbox is: checked");
- }
- else {
- cb.setText("This checkbox is: unchecked");
- }
- }
+ implements CompoundButton.OnCheckedChangeListener {
+ CheckBox cb;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ cb=(CheckBox)findViewById(R.id.check);
+ cb.setOnCheckedChangeListener(this);
+ }
+
+ public void onCheckedChanged(CompoundButton buttonView,
+ boolean isChecked) {
+ if (isChecked) {
+ cb.setText("This checkbox is: checked");
+ }
+ else {
+ cb.setText("This checkbox is: unchecked");
+ }
+ }
}
\ No newline at end of file
diff --git a/Basic/Field/AndroidManifest.xml b/Basic/Field/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Basic/Field/res/layout/main.xml b/Basic/Field/res/layout/main.xml
old mode 100755
new mode 100644
index a1b548d..efc0782
--- a/Basic/Field/res/layout/main.xml
+++ b/Basic/Field/res/layout/main.xml
@@ -1,7 +1,7 @@
\ No newline at end of file
+ android:id="@+id/field"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:singleLine="false"
+ />
\ No newline at end of file
diff --git a/Basic/Field/res/values/strings.xml b/Basic/Field/res/values/strings.xml
old mode 100755
new mode 100644
index ad76cb9..cc79232
--- a/Basic/Field/res/values/strings.xml
+++ b/Basic/Field/res/values/strings.xml
@@ -1,4 +1,4 @@
- FieldDemo
+ FieldDemo
\ No newline at end of file
diff --git a/Basic/Field/src/com/commonsware/android/field/FieldDemo.java b/Basic/Field/src/com/commonsware/android/field/FieldDemo.java
old mode 100755
new mode 100644
index 5565abe..6bec7d3
--- a/Basic/Field/src/com/commonsware/android/field/FieldDemo.java
+++ b/Basic/Field/src/com/commonsware/android/field/FieldDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.field;
@@ -19,16 +19,16 @@
import android.widget.EditText;
public class FieldDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- EditText fld=(EditText)findViewById(R.id.field);
- fld.setText("Licensed under the Apache License, Version 2.0 " +
- "(the \"License\"); you may not use this file " +
- "except in compliance with the License. You may " +
- "obtain a copy of the License at " +
- "http://www.apache.org/licenses/LICENSE-2.0");
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ EditText fld=(EditText)findViewById(R.id.field);
+ fld.setText("Licensed under the Apache License, Version 2.0 " +
+ "(the \"License\"); you may not use this file " +
+ "except in compliance with the License. You may " +
+ "obtain a copy of the License at " +
+ "http://www.apache.org/licenses/LICENSE-2.0");
+ }
}
\ No newline at end of file
diff --git a/Basic/ImageView/AndroidManifest.xml b/Basic/ImageView/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Basic/ImageView/res/layout/main.xml b/Basic/ImageView/res/layout/main.xml
old mode 100755
new mode 100644
index c362cde..38f7506
--- a/Basic/ImageView/res/layout/main.xml
+++ b/Basic/ImageView/res/layout/main.xml
@@ -1,8 +1,8 @@
\ No newline at end of file
+ android:id="@+id/icon"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:adjustViewBounds="true"
+ android:src="@drawable/molecule"
+ />
\ No newline at end of file
diff --git a/Basic/ImageView/res/values/strings.xml b/Basic/ImageView/res/values/strings.xml
old mode 100755
new mode 100644
index 2de54ae..e83f647
--- a/Basic/ImageView/res/values/strings.xml
+++ b/Basic/ImageView/res/values/strings.xml
@@ -1,4 +1,4 @@
- ImageViewDemo
+ ImageViewDemo
\ No newline at end of file
diff --git a/Basic/ImageView/src/com/commonsware/android/image/ImageViewDemo.java b/Basic/ImageView/src/com/commonsware/android/image/ImageViewDemo.java
old mode 100755
new mode 100644
index 65519e5..dbee519
--- a/Basic/ImageView/src/com/commonsware/android/image/ImageViewDemo.java
+++ b/Basic/ImageView/src/com/commonsware/android/image/ImageViewDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.image;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class ImageViewDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
diff --git a/Basic/Label/AndroidManifest.xml b/Basic/Label/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Basic/Label/res/layout/main.xml b/Basic/Label/res/layout/main.xml
old mode 100755
new mode 100644
index 95c8684..d959a2c
--- a/Basic/Label/res/layout/main.xml
+++ b/Basic/Label/res/layout/main.xml
@@ -1,6 +1,6 @@
\ No newline at end of file
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="You were expecting something profound?"
+ />
\ No newline at end of file
diff --git a/Basic/Label/res/values/strings.xml b/Basic/Label/res/values/strings.xml
old mode 100755
new mode 100644
index 0c698e6..743eb92
--- a/Basic/Label/res/values/strings.xml
+++ b/Basic/Label/res/values/strings.xml
@@ -1,4 +1,4 @@
- LabelDemo
+ LabelDemo
\ No newline at end of file
diff --git a/Basic/Label/src/com/commonsware/android/label/LabelDemo.java b/Basic/Label/src/com/commonsware/android/label/LabelDemo.java
old mode 100755
new mode 100644
index cb6253f..9ce3be8
--- a/Basic/Label/src/com/commonsware/android/label/LabelDemo.java
+++ b/Basic/Label/src/com/commonsware/android/label/LabelDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.label;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class LabelDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Basic/RadioButton/AndroidManifest.xml b/Basic/RadioButton/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Basic/RadioButton/res/layout/main.xml b/Basic/RadioButton/res/layout/main.xml
old mode 100755
new mode 100644
index acb2e60..e3c99df
--- a/Basic/RadioButton/res/layout/main.xml
+++ b/Basic/RadioButton/res/layout/main.xml
@@ -1,22 +1,22 @@
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
-
+
-
+
\ No newline at end of file
diff --git a/Basic/RadioButton/res/values/strings.xml b/Basic/RadioButton/res/values/strings.xml
old mode 100755
new mode 100644
index 7f8d40d..ed153ec
--- a/Basic/RadioButton/res/values/strings.xml
+++ b/Basic/RadioButton/res/values/strings.xml
@@ -1,4 +1,4 @@
- RadioButtonDemo
+ RadioButtonDemo
\ No newline at end of file
diff --git a/Basic/RadioButton/src/com/commonsware/android/basic/RadioButtonDemo.java b/Basic/RadioButton/src/com/commonsware/android/basic/RadioButtonDemo.java
old mode 100755
new mode 100644
index e92eaba..21ac816
--- a/Basic/RadioButton/src/com/commonsware/android/basic/RadioButtonDemo.java
+++ b/Basic/RadioButton/src/com/commonsware/android/basic/RadioButtonDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.basic;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class RadioButtonDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Containers/Linear/AndroidManifest.xml b/Containers/Linear/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Containers/Linear/res/layout/main.xml b/Containers/Linear/res/layout/main.xml
old mode 100755
new mode 100644
index 63fde32..2a14afd
--- a/Containers/Linear/res/layout/main.xml
+++ b/Containers/Linear/res/layout/main.xml
@@ -1,35 +1,35 @@
-
-
-
-
-
-
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Containers/Linear/res/values/strings.xml b/Containers/Linear/res/values/strings.xml
old mode 100755
new mode 100644
index 8791881..d025bf9
--- a/Containers/Linear/res/values/strings.xml
+++ b/Containers/Linear/res/values/strings.xml
@@ -1,4 +1,4 @@
- LinearLayoutDemo
+ LinearLayoutDemo
\ No newline at end of file
diff --git a/Containers/Linear/src/com/commonsware/android/linear/LinearLayoutDemo.java b/Containers/Linear/src/com/commonsware/android/linear/LinearLayoutDemo.java
old mode 100755
new mode 100644
index fefcb66..8815a10
--- a/Containers/Linear/src/com/commonsware/android/linear/LinearLayoutDemo.java
+++ b/Containers/Linear/src/com/commonsware/android/linear/LinearLayoutDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.linear;
@@ -23,42 +23,42 @@
import android.widget.EditText;
public class LinearLayoutDemo extends Activity
- implements RadioGroup.OnCheckedChangeListener {
- RadioGroup orientation;
- RadioGroup gravity;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- orientation=(RadioGroup)findViewById(R.id.orientation);
- orientation.setOnCheckedChangeListener(this);
- gravity=(RadioGroup)findViewById(R.id.gravity);
- gravity.setOnCheckedChangeListener(this);
- }
-
- public void onCheckedChanged(RadioGroup group, int checkedId) {
- switch (checkedId) {
- case R.id.horizontal:
- orientation.setOrientation(LinearLayout.HORIZONTAL);
- break;
-
- case R.id.vertical:
- orientation.setOrientation(LinearLayout.VERTICAL);
- break;
-
- case R.id.left:
- gravity.setGravity(Gravity.LEFT);
- break;
-
- case R.id.center:
- gravity.setGravity(Gravity.CENTER_HORIZONTAL);
- break;
-
- case R.id.right:
- gravity.setGravity(Gravity.RIGHT);
- break;
- }
- }
+ implements RadioGroup.OnCheckedChangeListener {
+ RadioGroup orientation;
+ RadioGroup gravity;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ orientation=(RadioGroup)findViewById(R.id.orientation);
+ orientation.setOnCheckedChangeListener(this);
+ gravity=(RadioGroup)findViewById(R.id.gravity);
+ gravity.setOnCheckedChangeListener(this);
+ }
+
+ public void onCheckedChanged(RadioGroup group, int checkedId) {
+ switch (checkedId) {
+ case R.id.horizontal:
+ orientation.setOrientation(LinearLayout.HORIZONTAL);
+ break;
+
+ case R.id.vertical:
+ orientation.setOrientation(LinearLayout.VERTICAL);
+ break;
+
+ case R.id.left:
+ gravity.setGravity(Gravity.LEFT);
+ break;
+
+ case R.id.center:
+ gravity.setGravity(Gravity.CENTER_HORIZONTAL);
+ break;
+
+ case R.id.right:
+ gravity.setGravity(Gravity.RIGHT);
+ break;
+ }
+ }
}
\ No newline at end of file
diff --git a/Containers/LinearPercent/AndroidManifest.xml b/Containers/LinearPercent/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Containers/LinearPercent/res/layout/main.xml b/Containers/LinearPercent/res/layout/main.xml
old mode 100755
new mode 100644
index 8be5b79..4f16be0
--- a/Containers/LinearPercent/res/layout/main.xml
+++ b/Containers/LinearPercent/res/layout/main.xml
@@ -1,26 +1,26 @@
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
+
\ No newline at end of file
diff --git a/Containers/LinearPercent/res/values/strings.xml b/Containers/LinearPercent/res/values/strings.xml
old mode 100755
new mode 100644
index a38c75f..de746c8
--- a/Containers/LinearPercent/res/values/strings.xml
+++ b/Containers/LinearPercent/res/values/strings.xml
@@ -1,4 +1,4 @@
- Linear Percent Demo
+ Linear Percent Demo
\ No newline at end of file
diff --git a/Containers/LinearPercent/src/com/commonsware/android/linearpct/LinearLayoutDemo.java b/Containers/LinearPercent/src/com/commonsware/android/linearpct/LinearLayoutDemo.java
old mode 100755
new mode 100644
index a7ebca7..0598f78
--- a/Containers/LinearPercent/src/com/commonsware/android/linearpct/LinearLayoutDemo.java
+++ b/Containers/LinearPercent/src/com/commonsware/android/linearpct/LinearLayoutDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.linearpct;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class LinearLayoutDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Containers/Relative/AndroidManifest.xml b/Containers/Relative/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Containers/Relative/res/layout/main.xml b/Containers/Relative/res/layout/main.xml
old mode 100755
new mode 100644
index 16ba707..acf9705
--- a/Containers/Relative/res/layout/main.xml
+++ b/Containers/Relative/res/layout/main.xml
@@ -1,32 +1,32 @@
-
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+
+
+
+
\ No newline at end of file
diff --git a/Containers/Relative/res/values/strings.xml b/Containers/Relative/res/values/strings.xml
old mode 100755
new mode 100644
index bc67a2b..5c4dccb
--- a/Containers/Relative/res/values/strings.xml
+++ b/Containers/Relative/res/values/strings.xml
@@ -1,4 +1,4 @@
- RelativeLayoutDemo
+ RelativeLayoutDemo
\ No newline at end of file
diff --git a/Containers/Relative/src/com/commonsware/android/relative/RelativeLayoutDemo.java b/Containers/Relative/src/com/commonsware/android/relative/RelativeLayoutDemo.java
old mode 100755
new mode 100644
index 91eac7f..3d04beb
--- a/Containers/Relative/src/com/commonsware/android/relative/RelativeLayoutDemo.java
+++ b/Containers/Relative/src/com/commonsware/android/relative/RelativeLayoutDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.relative;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class RelativeLayoutDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Containers/RelativeOverlap/AndroidManifest.xml b/Containers/RelativeOverlap/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Containers/RelativeOverlap/res/layout/main.xml b/Containers/RelativeOverlap/res/layout/main.xml
old mode 100755
new mode 100644
index 73c29b3..8c8f17a
--- a/Containers/RelativeOverlap/res/layout/main.xml
+++ b/Containers/RelativeOverlap/res/layout/main.xml
@@ -1,20 +1,20 @@
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
\ No newline at end of file
diff --git a/Containers/RelativeOverlap/res/values/strings.xml b/Containers/RelativeOverlap/res/values/strings.xml
old mode 100755
new mode 100644
index e7d8ea2..9515647
--- a/Containers/RelativeOverlap/res/values/strings.xml
+++ b/Containers/RelativeOverlap/res/values/strings.xml
@@ -1,4 +1,4 @@
- Overlap Demo
+ Overlap Demo
\ No newline at end of file
diff --git a/Containers/RelativeOverlap/src/com/commonsware/android/overlap/OverlapDemo.java b/Containers/RelativeOverlap/src/com/commonsware/android/overlap/OverlapDemo.java
old mode 100755
new mode 100644
index b054ca6..caf551e
--- a/Containers/RelativeOverlap/src/com/commonsware/android/overlap/OverlapDemo.java
+++ b/Containers/RelativeOverlap/src/com/commonsware/android/overlap/OverlapDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.overlap;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class OverlapDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Containers/Scroll/AndroidManifest.xml b/Containers/Scroll/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Containers/Scroll/res/layout/main.xml b/Containers/Scroll/res/layout/main.xml
old mode 100755
new mode 100644
index 3f5ba2c..b67e935
--- a/Containers/Scroll/res/layout/main.xml
+++ b/Containers/Scroll/res/layout/main.xml
@@ -1,67 +1,67 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Containers/Scroll/res/values/strings.xml b/Containers/Scroll/res/values/strings.xml
old mode 100755
new mode 100644
index 962f5a2..e4fc780
--- a/Containers/Scroll/res/values/strings.xml
+++ b/Containers/Scroll/res/values/strings.xml
@@ -1,4 +1,4 @@
- ScrollViewDemo
+ ScrollViewDemo
\ No newline at end of file
diff --git a/Containers/Scroll/src/com/commonsware/android/scroll/ScrollViewDemo.java b/Containers/Scroll/src/com/commonsware/android/scroll/ScrollViewDemo.java
old mode 100755
new mode 100644
index 9dbd688..ce7d3e8
--- a/Containers/Scroll/src/com/commonsware/android/scroll/ScrollViewDemo.java
+++ b/Containers/Scroll/src/com/commonsware/android/scroll/ScrollViewDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.scroll;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class ScrollViewDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Containers/Table/AndroidManifest.xml b/Containers/Table/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Containers/Table/res/layout/main.xml b/Containers/Table/res/layout/main.xml
old mode 100755
new mode 100644
index 77a5a46..29686e0
--- a/Containers/Table/res/layout/main.xml
+++ b/Containers/Table/res/layout/main.xml
@@ -1,23 +1,23 @@
-
-
-
-
-
-
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:stretchColumns="1">
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Containers/Table/res/values/strings.xml b/Containers/Table/res/values/strings.xml
old mode 100755
new mode 100644
index 7a666e5..c7938d9
--- a/Containers/Table/res/values/strings.xml
+++ b/Containers/Table/res/values/strings.xml
@@ -1,5 +1,5 @@
- TableLayoutDemo
- URL:
+ TableLayoutDemo
+ URL:
\ No newline at end of file
diff --git a/Containers/Table/src/com/commonsware/android/containers/TableLayoutDemo.java b/Containers/Table/src/com/commonsware/android/containers/TableLayoutDemo.java
old mode 100755
new mode 100644
index 5dcaff7..38e5137
--- a/Containers/Table/src/com/commonsware/android/containers/TableLayoutDemo.java
+++ b/Containers/Table/src/com/commonsware/android/containers/TableLayoutDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.containers;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class TableLayoutDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Database/Constants/AndroidManifest.xml b/Database/Constants/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Database/Constants/res/layout/add_edit.xml b/Database/Constants/res/layout/add_edit.xml
old mode 100755
new mode 100644
index f137200..20f8c87
--- a/Database/Constants/res/layout/add_edit.xml
+++ b/Database/Constants/res/layout/add_edit.xml
@@ -1,43 +1,43 @@
-
-
-
-
-
-
-
-
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ >
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Database/Constants/res/layout/main.xml b/Database/Constants/res/layout/main.xml
old mode 100755
new mode 100644
index c4f7fb2..f8bd79a
--- a/Database/Constants/res/layout/main.xml
+++ b/Database/Constants/res/layout/main.xml
@@ -1,12 +1,12 @@
-
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
\ No newline at end of file
diff --git a/Database/Constants/res/layout/row.xml b/Database/Constants/res/layout/row.xml
old mode 100755
new mode 100644
index 27941bb..f3fed89
--- a/Database/Constants/res/layout/row.xml
+++ b/Database/Constants/res/layout/row.xml
@@ -1,19 +1,19 @@
-
-
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
\ No newline at end of file
diff --git a/Database/Constants/res/values/strings.xml b/Database/Constants/res/values/strings.xml
old mode 100755
new mode 100644
index 2c98f86..2fc331a
--- a/Database/Constants/res/values/strings.xml
+++ b/Database/Constants/res/values/strings.xml
@@ -1,8 +1,8 @@
- ConstantsBrowser
- OK
- Cancel
- Add Constant
- Delete Constant: Are You Sure?
+ ConstantsBrowser
+ OK
+ Cancel
+ Add Constant
+ Delete Constant: Are You Sure?
\ No newline at end of file
diff --git a/Database/Constants/src/com/commonsware/android/constants/ConstantsBrowser.java b/Database/Constants/src/com/commonsware/android/constants/ConstantsBrowser.java
old mode 100755
new mode 100644
index 00b6343..ac94e0f
--- a/Database/Constants/src/com/commonsware/android/constants/ConstantsBrowser.java
+++ b/Database/Constants/src/com/commonsware/android/constants/ConstantsBrowser.java
@@ -1,18 +1,18 @@
/* Copyright (c) 2008-2011 -- CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
-
+
package com.commonsware.android.constants;
import android.app.AlertDialog;
@@ -32,178 +32,178 @@
import android.widget.SimpleCursorAdapter;
public class ConstantsBrowser extends ListActivity {
- private static final int ADD_ID = Menu.FIRST+1;
- private static final int DELETE_ID = Menu.FIRST+3;
- private DatabaseHelper db=null;
- private Cursor constantsCursor=null;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- db=new DatabaseHelper(this);
- constantsCursor=db
- .getReadableDatabase()
- .rawQuery("SELECT _ID, title, value "+
- "FROM constants ORDER BY title",
- null);
-
- ListAdapter adapter=new SimpleCursorAdapter(this,
- R.layout.row, constantsCursor,
- new String[] {DatabaseHelper.TITLE,
- DatabaseHelper.VALUE},
- new int[] {R.id.title, R.id.value});
-
- setListAdapter(adapter);
- registerForContextMenu(getListView());
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
-
- constantsCursor.close();
- db.close();
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- menu.add(Menu.NONE, ADD_ID, Menu.NONE, "Add")
- .setIcon(R.drawable.add)
- .setAlphabeticShortcut('a');
+ private static final int ADD_ID = Menu.FIRST+1;
+ private static final int DELETE_ID = Menu.FIRST+3;
+ private DatabaseHelper db=null;
+ private Cursor constantsCursor=null;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ db=new DatabaseHelper(this);
+ constantsCursor=db
+ .getReadableDatabase()
+ .rawQuery("SELECT _ID, title, value "+
+ "FROM constants ORDER BY title",
+ null);
+
+ ListAdapter adapter=new SimpleCursorAdapter(this,
+ R.layout.row, constantsCursor,
+ new String[] {DatabaseHelper.TITLE,
+ DatabaseHelper.VALUE},
+ new int[] {R.id.title, R.id.value});
+
+ setListAdapter(adapter);
+ registerForContextMenu(getListView());
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+
+ constantsCursor.close();
+ db.close();
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ menu.add(Menu.NONE, ADD_ID, Menu.NONE, "Add")
+ .setIcon(R.drawable.add)
+ .setAlphabeticShortcut('a');
- return(super.onCreateOptionsMenu(menu));
- }
+ return(super.onCreateOptionsMenu(menu));
+ }
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case ADD_ID:
- add();
- return(true);
- }
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case ADD_ID:
+ add();
+ return(true);
+ }
- return(super.onOptionsItemSelected(item));
- }
-
- @Override
- public void onCreateContextMenu(ContextMenu menu, View v,
- ContextMenu.ContextMenuInfo menuInfo) {
- menu.add(Menu.NONE, DELETE_ID, Menu.NONE, "Delete")
- .setAlphabeticShortcut('d');
- }
+ return(super.onOptionsItemSelected(item));
+ }
+
+ @Override
+ public void onCreateContextMenu(ContextMenu menu, View v,
+ ContextMenu.ContextMenuInfo menuInfo) {
+ menu.add(Menu.NONE, DELETE_ID, Menu.NONE, "Delete")
+ .setAlphabeticShortcut('d');
+ }
- @Override
- public boolean onContextItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case DELETE_ID:
- AdapterView.AdapterContextMenuInfo info=
- (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
+ @Override
+ public boolean onContextItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case DELETE_ID:
+ AdapterView.AdapterContextMenuInfo info=
+ (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
- delete(info.id);
- return(true);
- }
+ delete(info.id);
+ return(true);
+ }
- return(super.onOptionsItemSelected(item));
- }
-
- private void add() {
- LayoutInflater inflater=LayoutInflater.from(this);
- View addView=inflater.inflate(R.layout.add_edit, null);
- final DialogWrapper wrapper=new DialogWrapper(addView);
-
- new AlertDialog.Builder(this)
- .setTitle(R.string.add_title)
- .setView(addView)
- .setPositiveButton(R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int whichButton) {
- processAdd(wrapper);
- }
- })
- .setNegativeButton(R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int whichButton) {
- // ignore, just dismiss
- }
- })
- .show();
- }
-
- private void delete(final long rowId) {
- if (rowId>0) {
- new AlertDialog.Builder(this)
- .setTitle(R.string.delete_title)
- .setPositiveButton(R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int whichButton) {
- processDelete(rowId);
- }
- })
- .setNegativeButton(R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog,
- int whichButton) {
- // ignore, just dismiss
- }
- })
- .show();
- }
- }
-
- private void processAdd(DialogWrapper wrapper) {
- ContentValues values=new ContentValues(2);
-
- values.put(DatabaseHelper.TITLE, wrapper.getTitle());
- values.put(DatabaseHelper.VALUE, wrapper.getValue());
-
- db.getWritableDatabase().insert("constants", DatabaseHelper.TITLE, values);
- constantsCursor.requery();
- }
-
- private void processDelete(long rowId) {
- String[] args={String.valueOf(rowId)};
-
- db.getWritableDatabase().delete("constants", "_ID=?", args);
- constantsCursor.requery();
- }
-
- class DialogWrapper {
- EditText titleField=null;
- EditText valueField=null;
- View base=null;
-
- DialogWrapper(View base) {
- this.base=base;
- valueField=(EditText)base.findViewById(R.id.value);
- }
-
- String getTitle() {
- return(getTitleField().getText().toString());
- }
-
- float getValue() {
- return(new Float(getValueField().getText().toString())
- .floatValue());
- }
-
- private EditText getTitleField() {
- if (titleField==null) {
- titleField=(EditText)base.findViewById(R.id.title);
- }
-
- return(titleField);
- }
-
- private EditText getValueField() {
- if (valueField==null) {
- valueField=(EditText)base.findViewById(R.id.value);
- }
-
- return(valueField);
- }
- }
+ return(super.onOptionsItemSelected(item));
+ }
+
+ private void add() {
+ LayoutInflater inflater=LayoutInflater.from(this);
+ View addView=inflater.inflate(R.layout.add_edit, null);
+ final DialogWrapper wrapper=new DialogWrapper(addView);
+
+ new AlertDialog.Builder(this)
+ .setTitle(R.string.add_title)
+ .setView(addView)
+ .setPositiveButton(R.string.ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog,
+ int whichButton) {
+ processAdd(wrapper);
+ }
+ })
+ .setNegativeButton(R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog,
+ int whichButton) {
+ // ignore, just dismiss
+ }
+ })
+ .show();
+ }
+
+ private void delete(final long rowId) {
+ if (rowId>0) {
+ new AlertDialog.Builder(this)
+ .setTitle(R.string.delete_title)
+ .setPositiveButton(R.string.ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog,
+ int whichButton) {
+ processDelete(rowId);
+ }
+ })
+ .setNegativeButton(R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog,
+ int whichButton) {
+ // ignore, just dismiss
+ }
+ })
+ .show();
+ }
+ }
+
+ private void processAdd(DialogWrapper wrapper) {
+ ContentValues values=new ContentValues(2);
+
+ values.put(DatabaseHelper.TITLE, wrapper.getTitle());
+ values.put(DatabaseHelper.VALUE, wrapper.getValue());
+
+ db.getWritableDatabase().insert("constants", DatabaseHelper.TITLE, values);
+ constantsCursor.requery();
+ }
+
+ private void processDelete(long rowId) {
+ String[] args={String.valueOf(rowId)};
+
+ db.getWritableDatabase().delete("constants", "_ID=?", args);
+ constantsCursor.requery();
+ }
+
+ class DialogWrapper {
+ EditText titleField=null;
+ EditText valueField=null;
+ View base=null;
+
+ DialogWrapper(View base) {
+ this.base=base;
+ valueField=(EditText)base.findViewById(R.id.value);
+ }
+
+ String getTitle() {
+ return(getTitleField().getText().toString());
+ }
+
+ float getValue() {
+ return(new Float(getValueField().getText().toString())
+ .floatValue());
+ }
+
+ private EditText getTitleField() {
+ if (titleField==null) {
+ titleField=(EditText)base.findViewById(R.id.title);
+ }
+
+ return(titleField);
+ }
+
+ private EditText getValueField() {
+ if (valueField==null) {
+ valueField=(EditText)base.findViewById(R.id.value);
+ }
+
+ return(valueField);
+ }
+ }
}
\ No newline at end of file
diff --git a/Database/Constants/src/com/commonsware/android/constants/DatabaseHelper.java b/Database/Constants/src/com/commonsware/android/constants/DatabaseHelper.java
old mode 100755
new mode 100644
index 065f34e..122434a
--- a/Database/Constants/src/com/commonsware/android/constants/DatabaseHelper.java
+++ b/Database/Constants/src/com/commonsware/android/constants/DatabaseHelper.java
@@ -1,18 +1,18 @@
/* Copyright (c) 2008-2011 -- CommonsWare, LLC
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
-
+
package com.commonsware.android.constants;
import android.content.ContentValues;
@@ -22,77 +22,77 @@
import android.hardware.SensorManager;
public class DatabaseHelper extends SQLiteOpenHelper {
- private static final String DATABASE_NAME="db";
- static final String TITLE="title";
- static final String VALUE="value";
-
- public DatabaseHelper(Context context) {
- super(context, DATABASE_NAME, null, 1);
- }
-
- @Override
- public void onCreate(SQLiteDatabase db) {
- db.execSQL("CREATE TABLE constants (_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, value REAL);");
-
- ContentValues cv=new ContentValues();
-
- cv.put(TITLE, "Gravity, Death Star I");
- cv.put(VALUE, SensorManager.GRAVITY_DEATH_STAR_I);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Earth");
- cv.put(VALUE, SensorManager.GRAVITY_EARTH);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Jupiter");
- cv.put(VALUE, SensorManager.GRAVITY_JUPITER);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Mars");
- cv.put(VALUE, SensorManager.GRAVITY_MARS);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Mercury");
- cv.put(VALUE, SensorManager.GRAVITY_MERCURY);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Moon");
- cv.put(VALUE, SensorManager.GRAVITY_MOON);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Neptune");
- cv.put(VALUE, SensorManager.GRAVITY_NEPTUNE);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Pluto");
- cv.put(VALUE, SensorManager.GRAVITY_PLUTO);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Saturn");
- cv.put(VALUE, SensorManager.GRAVITY_SATURN);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Sun");
- cv.put(VALUE, SensorManager.GRAVITY_SUN);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, The Island");
- cv.put(VALUE, SensorManager.GRAVITY_THE_ISLAND);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Uranus");
- cv.put(VALUE, SensorManager.GRAVITY_URANUS);
- db.insert("constants", TITLE, cv);
-
- cv.put(TITLE, "Gravity, Venus");
- cv.put(VALUE, SensorManager.GRAVITY_VENUS);
- db.insert("constants", TITLE, cv);
- }
+ private static final String DATABASE_NAME="db";
+ static final String TITLE="title";
+ static final String VALUE="value";
+
+ public DatabaseHelper(Context context) {
+ super(context, DATABASE_NAME, null, 1);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL("CREATE TABLE constants (_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, value REAL);");
+
+ ContentValues cv=new ContentValues();
+
+ cv.put(TITLE, "Gravity, Death Star I");
+ cv.put(VALUE, SensorManager.GRAVITY_DEATH_STAR_I);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Earth");
+ cv.put(VALUE, SensorManager.GRAVITY_EARTH);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Jupiter");
+ cv.put(VALUE, SensorManager.GRAVITY_JUPITER);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Mars");
+ cv.put(VALUE, SensorManager.GRAVITY_MARS);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Mercury");
+ cv.put(VALUE, SensorManager.GRAVITY_MERCURY);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Moon");
+ cv.put(VALUE, SensorManager.GRAVITY_MOON);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Neptune");
+ cv.put(VALUE, SensorManager.GRAVITY_NEPTUNE);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Pluto");
+ cv.put(VALUE, SensorManager.GRAVITY_PLUTO);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Saturn");
+ cv.put(VALUE, SensorManager.GRAVITY_SATURN);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Sun");
+ cv.put(VALUE, SensorManager.GRAVITY_SUN);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, The Island");
+ cv.put(VALUE, SensorManager.GRAVITY_THE_ISLAND);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Uranus");
+ cv.put(VALUE, SensorManager.GRAVITY_URANUS);
+ db.insert("constants", TITLE, cv);
+
+ cv.put(TITLE, "Gravity, Venus");
+ cv.put(VALUE, SensorManager.GRAVITY_VENUS);
+ db.insert("constants", TITLE, cv);
+ }
- @Override
- public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
- android.util.Log.w("Constants", "Upgrading database, which will destroy all old data");
- db.execSQL("DROP TABLE IF EXISTS constants");
- onCreate(db);
- }
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ android.util.Log.w("Constants", "Upgrading database, which will destroy all old data");
+ db.execSQL("DROP TABLE IF EXISTS constants");
+ onCreate(db);
+ }
}
\ No newline at end of file
diff --git a/Fancy/Chrono/AndroidManifest.xml b/Fancy/Chrono/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fancy/Chrono/res/layout/main.xml b/Fancy/Chrono/res/layout/main.xml
old mode 100755
new mode 100644
index 999c2a1..4aef478
--- a/Fancy/Chrono/res/layout/main.xml
+++ b/Fancy/Chrono/res/layout/main.xml
@@ -1,24 +1,24 @@
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
+
\ No newline at end of file
diff --git a/Fancy/Chrono/res/values/strings.xml b/Fancy/Chrono/res/values/strings.xml
old mode 100755
new mode 100644
index 945d549..e23469d
--- a/Fancy/Chrono/res/values/strings.xml
+++ b/Fancy/Chrono/res/values/strings.xml
@@ -1,4 +1,4 @@
- ChronoDemo
+ ChronoDemo
\ No newline at end of file
diff --git a/Fancy/Chrono/src/com/commonsware/android/chrono/ChronoDemo.java b/Fancy/Chrono/src/com/commonsware/android/chrono/ChronoDemo.java
old mode 100755
new mode 100644
index d957ed8..2777b92
--- a/Fancy/Chrono/src/com/commonsware/android/chrono/ChronoDemo.java
+++ b/Fancy/Chrono/src/com/commonsware/android/chrono/ChronoDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.chrono;
@@ -26,57 +26,57 @@
import java.util.Calendar;
public class ChronoDemo extends Activity {
- DateFormat fmtDateAndTime=DateFormat.getDateTimeInstance();
- TextView dateAndTimeLabel;
- Calendar dateAndTime=Calendar.getInstance();
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- dateAndTimeLabel=(TextView)findViewById(R.id.dateAndTime);
-
- updateLabel();
- }
-
- public void chooseDate(View v) {
- new DatePickerDialog(ChronoDemo.this, d,
- dateAndTime.get(Calendar.YEAR),
- dateAndTime.get(Calendar.MONTH),
- dateAndTime.get(Calendar.DAY_OF_MONTH))
- .show();
- }
-
- public void chooseTime(View v) {
- new TimePickerDialog(ChronoDemo.this, t,
- dateAndTime.get(Calendar.HOUR_OF_DAY),
- dateAndTime.get(Calendar.MINUTE),
- true)
- .show();
- }
-
- private void updateLabel() {
- dateAndTimeLabel.setText(fmtDateAndTime
- .format(dateAndTime.getTime()));
- }
-
- DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() {
- public void onDateSet(DatePicker view, int year, int monthOfYear,
- int dayOfMonth) {
- dateAndTime.set(Calendar.YEAR, year);
- dateAndTime.set(Calendar.MONTH, monthOfYear);
- dateAndTime.set(Calendar.DAY_OF_MONTH, dayOfMonth);
- updateLabel();
- }
- };
-
- TimePickerDialog.OnTimeSetListener t=new TimePickerDialog.OnTimeSetListener() {
- public void onTimeSet(TimePicker view, int hourOfDay,
- int minute) {
- dateAndTime.set(Calendar.HOUR_OF_DAY, hourOfDay);
- dateAndTime.set(Calendar.MINUTE, minute);
- updateLabel();
- }
- };
+ DateFormat fmtDateAndTime=DateFormat.getDateTimeInstance();
+ TextView dateAndTimeLabel;
+ Calendar dateAndTime=Calendar.getInstance();
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ dateAndTimeLabel=(TextView)findViewById(R.id.dateAndTime);
+
+ updateLabel();
+ }
+
+ public void chooseDate(View v) {
+ new DatePickerDialog(ChronoDemo.this, d,
+ dateAndTime.get(Calendar.YEAR),
+ dateAndTime.get(Calendar.MONTH),
+ dateAndTime.get(Calendar.DAY_OF_MONTH))
+ .show();
+ }
+
+ public void chooseTime(View v) {
+ new TimePickerDialog(ChronoDemo.this, t,
+ dateAndTime.get(Calendar.HOUR_OF_DAY),
+ dateAndTime.get(Calendar.MINUTE),
+ true)
+ .show();
+ }
+
+ private void updateLabel() {
+ dateAndTimeLabel.setText(fmtDateAndTime
+ .format(dateAndTime.getTime()));
+ }
+
+ DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() {
+ public void onDateSet(DatePicker view, int year, int monthOfYear,
+ int dayOfMonth) {
+ dateAndTime.set(Calendar.YEAR, year);
+ dateAndTime.set(Calendar.MONTH, monthOfYear);
+ dateAndTime.set(Calendar.DAY_OF_MONTH, dayOfMonth);
+ updateLabel();
+ }
+ };
+
+ TimePickerDialog.OnTimeSetListener t=new TimePickerDialog.OnTimeSetListener() {
+ public void onTimeSet(TimePicker view, int hourOfDay,
+ int minute) {
+ dateAndTime.set(Calendar.HOUR_OF_DAY, hourOfDay);
+ dateAndTime.set(Calendar.MINUTE, minute);
+ updateLabel();
+ }
+ };
}
\ No newline at end of file
diff --git a/Fancy/Clocks/AndroidManifest.xml b/Fancy/Clocks/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fancy/Clocks/res/layout/main.xml b/Fancy/Clocks/res/layout/main.xml
old mode 100755
new mode 100644
index b65f77e..2a31f20
--- a/Fancy/Clocks/res/layout/main.xml
+++ b/Fancy/Clocks/res/layout/main.xml
@@ -1,18 +1,18 @@
-
-
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
\ No newline at end of file
diff --git a/Fancy/Clocks/res/values/strings.xml b/Fancy/Clocks/res/values/strings.xml
old mode 100755
new mode 100644
index 32a53ba..7a3fc5c
--- a/Fancy/Clocks/res/values/strings.xml
+++ b/Fancy/Clocks/res/values/strings.xml
@@ -1,4 +1,4 @@
- ClocksDemo
+ ClocksDemo
\ No newline at end of file
diff --git a/Fancy/Clocks/src/com/commonsware/android/clocks/ClocksDemo.java b/Fancy/Clocks/src/com/commonsware/android/clocks/ClocksDemo.java
old mode 100755
new mode 100644
index 1e6b9c2..44a99de
--- a/Fancy/Clocks/src/com/commonsware/android/clocks/ClocksDemo.java
+++ b/Fancy/Clocks/src/com/commonsware/android/clocks/ClocksDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.clocks;
@@ -18,9 +18,9 @@
import android.os.Bundle;
public class ClocksDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Fancy/DrawerDemo/AndroidManifest.xml b/Fancy/DrawerDemo/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fancy/DrawerDemo/res/layout/main.xml b/Fancy/DrawerDemo/res/layout/main.xml
old mode 100755
new mode 100644
index 5391770..9dc7746
--- a/Fancy/DrawerDemo/res/layout/main.xml
+++ b/Fancy/DrawerDemo/res/layout/main.xml
@@ -1,26 +1,26 @@
-
-
-
-
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="#FF4444CC"
+ >
+
+
+
+
\ No newline at end of file
diff --git a/Fancy/DrawerDemo/res/values/strings.xml b/Fancy/DrawerDemo/res/values/strings.xml
old mode 100755
new mode 100644
index be6c4d3..88aba4e
--- a/Fancy/DrawerDemo/res/values/strings.xml
+++ b/Fancy/DrawerDemo/res/values/strings.xml
@@ -1,4 +1,4 @@
- DrawerDemo
+ DrawerDemo
\ No newline at end of file
diff --git a/Fancy/DrawerDemo/src/com/commonsware/android/drawer/DrawerDemo.java b/Fancy/DrawerDemo/src/com/commonsware/android/drawer/DrawerDemo.java
old mode 100755
new mode 100644
index e631e72..d537a5c
--- a/Fancy/DrawerDemo/src/com/commonsware/android/drawer/DrawerDemo.java
+++ b/Fancy/DrawerDemo/src/com/commonsware/android/drawer/DrawerDemo.java
@@ -5,11 +5,11 @@
public class DrawerDemo extends Activity
{
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Fancy/DynamicTab/AndroidManifest.xml b/Fancy/DynamicTab/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fancy/DynamicTab/res/layout/main.xml b/Fancy/DynamicTab/res/layout/main.xml
old mode 100755
new mode 100644
index 1841747..37c9690
--- a/Fancy/DynamicTab/res/layout/main.xml
+++ b/Fancy/DynamicTab/res/layout/main.xml
@@ -1,25 +1,25 @@
-
-
-
-
-
-
+ android:id="@+id/tabhost"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+
+
+
+
+
diff --git a/Fancy/DynamicTab/res/values/strings.xml b/Fancy/DynamicTab/res/values/strings.xml
old mode 100755
new mode 100644
index fafd250..0f37086
--- a/Fancy/DynamicTab/res/values/strings.xml
+++ b/Fancy/DynamicTab/res/values/strings.xml
@@ -1,4 +1,4 @@
- ActivityTabDemo
+ ActivityTabDemo
\ No newline at end of file
diff --git a/Fancy/DynamicTab/src/com/commonsware/android/dynamictab/DynamicTabDemo.java b/Fancy/DynamicTab/src/com/commonsware/android/dynamictab/DynamicTabDemo.java
old mode 100755
new mode 100644
index d68c43d..58ace92
--- a/Fancy/DynamicTab/src/com/commonsware/android/dynamictab/DynamicTabDemo.java
+++ b/Fancy/DynamicTab/src/com/commonsware/android/dynamictab/DynamicTabDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.dynamictab;
@@ -21,33 +21,33 @@
import android.widget.TabHost;
public class DynamicTabDemo extends Activity {
- private TabHost tabs=null;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
+ private TabHost tabs=null;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
- tabs=(TabHost)findViewById(R.id.tabhost);
- tabs.setup();
-
- TabHost.TabSpec spec=tabs.newTabSpec("buttontab");
-
- spec.setContent(R.id.buttontab);
- spec.setIndicator("Button");
- tabs.addTab(spec);
- }
-
- public void addTab(View v) {
- TabHost.TabSpec spec=tabs.newTabSpec("tag1");
-
- spec.setContent(new TabHost.TabContentFactory() {
- public View createTabContent(String tag) {
- return(new AnalogClock(DynamicTabDemo.this));
- }
- });
-
- spec.setIndicator("Clock");
- tabs.addTab(spec);
- }
+ tabs=(TabHost)findViewById(R.id.tabhost);
+ tabs.setup();
+
+ TabHost.TabSpec spec=tabs.newTabSpec("buttontab");
+
+ spec.setContent(R.id.buttontab);
+ spec.setIndicator("Button");
+ tabs.addTab(spec);
+ }
+
+ public void addTab(View v) {
+ TabHost.TabSpec spec=tabs.newTabSpec("tag1");
+
+ spec.setContent(new TabHost.TabContentFactory() {
+ public View createTabContent(String tag) {
+ return(new AnalogClock(DynamicTabDemo.this));
+ }
+ });
+
+ spec.setIndicator("Clock");
+ tabs.addTab(spec);
+ }
}
diff --git a/Fancy/Flipper1/AndroidManifest.xml b/Fancy/Flipper1/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fancy/Flipper1/res/layout/main.xml b/Fancy/Flipper1/res/layout/main.xml
old mode 100755
new mode 100644
index 1dee018..6cc5038
--- a/Fancy/Flipper1/res/layout/main.xml
+++ b/Fancy/Flipper1/res/layout/main.xml
@@ -1,39 +1,39 @@
-
-
-
-
-
-
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Fancy/Flipper1/res/values/strings.xml b/Fancy/Flipper1/res/values/strings.xml
old mode 100755
new mode 100644
index f310c1e..e872eaf
--- a/Fancy/Flipper1/res/values/strings.xml
+++ b/Fancy/Flipper1/res/values/strings.xml
@@ -1,4 +1,4 @@
- Flipper Demo 1
+ Flipper Demo 1
\ No newline at end of file
diff --git a/Fancy/Flipper1/src/com/commonsware/android/flipper1/FlipperDemo.java b/Fancy/Flipper1/src/com/commonsware/android/flipper1/FlipperDemo.java
old mode 100755
new mode 100644
index e508cd9..e1e6e0c
--- a/Fancy/Flipper1/src/com/commonsware/android/flipper1/FlipperDemo.java
+++ b/Fancy/Flipper1/src/com/commonsware/android/flipper1/FlipperDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.flipper1;
@@ -20,17 +20,17 @@
import android.widget.ViewFlipper;
public class FlipperDemo extends Activity {
- ViewFlipper flipper;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- flipper=(ViewFlipper)findViewById(R.id.details);
- }
-
- public void flip(View v) {
- flipper.showNext();
- }
+ ViewFlipper flipper;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ flipper=(ViewFlipper)findViewById(R.id.details);
+ }
+
+ public void flip(View v) {
+ flipper.showNext();
+ }
}
diff --git a/Fancy/Flipper2/AndroidManifest.xml b/Fancy/Flipper2/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fancy/Flipper2/res/layout/main.xml b/Fancy/Flipper2/res/layout/main.xml
old mode 100755
new mode 100644
index a4b99d0..e09df65
--- a/Fancy/Flipper2/res/layout/main.xml
+++ b/Fancy/Flipper2/res/layout/main.xml
@@ -1,12 +1,12 @@
-
-
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
\ No newline at end of file
diff --git a/Fancy/Flipper2/res/values/strings.xml b/Fancy/Flipper2/res/values/strings.xml
old mode 100755
new mode 100644
index 27242e4..ec5bd3f
--- a/Fancy/Flipper2/res/values/strings.xml
+++ b/Fancy/Flipper2/res/values/strings.xml
@@ -1,4 +1,4 @@
- FlipperDemo2
+ FlipperDemo2
\ No newline at end of file
diff --git a/Fancy/Flipper2/src/com/commonsware/android/flipper2/FlipperDemo2.java b/Fancy/Flipper2/src/com/commonsware/android/flipper2/FlipperDemo2.java
old mode 100755
new mode 100644
index 3ade973..39594e1
--- a/Fancy/Flipper2/src/com/commonsware/android/flipper2/FlipperDemo2.java
+++ b/Fancy/Flipper2/src/com/commonsware/android/flipper2/FlipperDemo2.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.flipper2;
@@ -22,34 +22,34 @@
import android.widget.ViewFlipper;
public class FlipperDemo2 extends Activity {
- static String[] items={"lorem", "ipsum", "dolor", "sit", "amet",
- "consectetuer", "adipiscing", "elit",
- "morbi", "vel", "ligula", "vitae",
- "arcu", "aliquet", "mollis", "etiam",
- "vel", "erat", "placerat", "ante",
- "porttitor", "sodales", "pellentesque",
- "augue", "purus"};
- ViewFlipper flipper;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- flipper=(ViewFlipper)findViewById(R.id.details);
-
- for (String item : items) {
- Button btn=new Button(this);
-
- btn.setText(item);
-
- flipper.addView(btn,
- new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.FILL_PARENT,
- ViewGroup.LayoutParams.FILL_PARENT));
- }
-
- flipper.setFlipInterval(2000);
- flipper.startFlipping();
- }
+ static String[] items={"lorem", "ipsum", "dolor", "sit", "amet",
+ "consectetuer", "adipiscing", "elit",
+ "morbi", "vel", "ligula", "vitae",
+ "arcu", "aliquet", "mollis", "etiam",
+ "vel", "erat", "placerat", "ante",
+ "porttitor", "sodales", "pellentesque",
+ "augue", "purus"};
+ ViewFlipper flipper;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ flipper=(ViewFlipper)findViewById(R.id.details);
+
+ for (String item : items) {
+ Button btn=new Button(this);
+
+ btn.setText(item);
+
+ flipper.addView(btn,
+ new ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.FILL_PARENT));
+ }
+
+ flipper.setFlipInterval(2000);
+ flipper.startFlipping();
+ }
}
diff --git a/Fancy/Tab/AndroidManifest.xml b/Fancy/Tab/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fancy/Tab/res/layout/main.xml b/Fancy/Tab/res/layout/main.xml
old mode 100755
new mode 100644
index 3235518..f4bf30f
--- a/Fancy/Tab/res/layout/main.xml
+++ b/Fancy/Tab/res/layout/main.xml
@@ -1,28 +1,28 @@
-
-
-
-
-
-
-
+ android:id="@+id/tabhost"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+
+
+
+
+
+
diff --git a/Fancy/Tab/res/values/strings.xml b/Fancy/Tab/res/values/strings.xml
old mode 100755
new mode 100644
index 29ccd1a..2a3ee18
--- a/Fancy/Tab/res/values/strings.xml
+++ b/Fancy/Tab/res/values/strings.xml
@@ -1,4 +1,4 @@
- TabDemo
+ TabDemo
\ No newline at end of file
diff --git a/Fancy/Tab/src/com/commonsware/android/fancy/TabDemo.java b/Fancy/Tab/src/com/commonsware/android/fancy/TabDemo.java
old mode 100755
new mode 100644
index 89e2ab9..9e188d6
--- a/Fancy/Tab/src/com/commonsware/android/fancy/TabDemo.java
+++ b/Fancy/Tab/src/com/commonsware/android/fancy/TabDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancy;
@@ -19,24 +19,24 @@
import android.widget.TabHost;
public class TabDemo extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
- TabHost tabs=(TabHost)findViewById(R.id.tabhost);
-
- tabs.setup();
-
- TabHost.TabSpec spec=tabs.newTabSpec("tag1");
-
- spec.setContent(R.id.tab1);
- spec.setIndicator("Clock");
- tabs.addTab(spec);
-
- spec=tabs.newTabSpec("tag2");
- spec.setContent(R.id.tab2);
- spec.setIndicator("Button");
- tabs.addTab(spec);
- }
+ TabHost tabs=(TabHost)findViewById(R.id.tabhost);
+
+ tabs.setup();
+
+ TabHost.TabSpec spec=tabs.newTabSpec("tag1");
+
+ spec.setContent(R.id.tab1);
+ spec.setIndicator("Clock");
+ tabs.addTab(spec);
+
+ spec=tabs.newTabSpec("tag2");
+ spec.setContent(R.id.tab2);
+ spec.setIndicator("Button");
+ tabs.addTab(spec);
+ }
}
\ No newline at end of file
diff --git a/FancyLists/Dynamic/AndroidManifest.xml b/FancyLists/Dynamic/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/FancyLists/Dynamic/res/layout/main.xml b/FancyLists/Dynamic/res/layout/main.xml
old mode 100755
new mode 100644
index a6b4ecc..b3d6407
--- a/FancyLists/Dynamic/res/layout/main.xml
+++ b/FancyLists/Dynamic/res/layout/main.xml
@@ -1,17 +1,17 @@
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+
diff --git a/FancyLists/Dynamic/res/layout/row.xml b/FancyLists/Dynamic/res/layout/row.xml
old mode 100755
new mode 100644
index ff408db..9b9bd57
--- a/FancyLists/Dynamic/res/layout/row.xml
+++ b/FancyLists/Dynamic/res/layout/row.xml
@@ -1,20 +1,20 @@
-
-
+
+
diff --git a/FancyLists/Dynamic/res/values/strings.xml b/FancyLists/Dynamic/res/values/strings.xml
old mode 100755
new mode 100644
index 7e54945..8a69b3e
--- a/FancyLists/Dynamic/res/values/strings.xml
+++ b/FancyLists/Dynamic/res/values/strings.xml
@@ -1,4 +1,4 @@
- DynamicDemo
+ DynamicDemo
\ No newline at end of file
diff --git a/FancyLists/Dynamic/src/com/commonsware/android/fancylists/three/DynamicDemo.java b/FancyLists/Dynamic/src/com/commonsware/android/fancylists/three/DynamicDemo.java
old mode 100755
new mode 100644
index 208e982..6b468db
--- a/FancyLists/Dynamic/src/com/commonsware/android/fancylists/three/DynamicDemo.java
+++ b/FancyLists/Dynamic/src/com/commonsware/android/fancylists/three/DynamicDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.three;
@@ -24,45 +24,45 @@
import android.widget.TextView;
public class DynamicDemo extends ListActivity {
- TextView selection;
- private static final String[] items={"lorem", "ipsum", "dolor",
- "sit", "amet",
- "consectetuer", "adipiscing", "elit", "morbi", "vel",
- "ligula", "vitae", "arcu", "aliquet", "mollis",
- "etiam", "vel", "erat", "placerat", "ante",
- "porttitor", "sodales", "pellentesque", "augue", "purus"};
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- setListAdapter(new IconicAdapter());
- selection=(TextView)findViewById(R.id.selection);
- }
-
- public void onListItemClick(ListView parent, View v,
- int position, long id) {
- selection.setText(items[position]);
- }
-
- class IconicAdapter extends ArrayAdapter {
- IconicAdapter() {
- super(DynamicDemo.this, R.layout.row, R.id.label, items);
- }
-
- public View getView(int position, View convertView,
- ViewGroup parent) {
- View row=super.getView(position, convertView, parent);
- ImageView icon=(ImageView)row.findViewById(R.id.icon);
-
- if (items[position].length()>4) {
- icon.setImageResource(R.drawable.delete);
- }
- else {
- icon.setImageResource(R.drawable.ok);
- }
-
- return(row);
- }
- }
+ TextView selection;
+ private static final String[] items={"lorem", "ipsum", "dolor",
+ "sit", "amet",
+ "consectetuer", "adipiscing", "elit", "morbi", "vel",
+ "ligula", "vitae", "arcu", "aliquet", "mollis",
+ "etiam", "vel", "erat", "placerat", "ante",
+ "porttitor", "sodales", "pellentesque", "augue", "purus"};
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ setListAdapter(new IconicAdapter());
+ selection=(TextView)findViewById(R.id.selection);
+ }
+
+ public void onListItemClick(ListView parent, View v,
+ int position, long id) {
+ selection.setText(items[position]);
+ }
+
+ class IconicAdapter extends ArrayAdapter {
+ IconicAdapter() {
+ super(DynamicDemo.this, R.layout.row, R.id.label, items);
+ }
+
+ public View getView(int position, View convertView,
+ ViewGroup parent) {
+ View row=super.getView(position, convertView, parent);
+ ImageView icon=(ImageView)row.findViewById(R.id.icon);
+
+ if (items[position].length()>4) {
+ icon.setImageResource(R.drawable.delete);
+ }
+ else {
+ icon.setImageResource(R.drawable.ok);
+ }
+
+ return(row);
+ }
+ }
}
diff --git a/FancyLists/DynamicEx/AndroidManifest.xml b/FancyLists/DynamicEx/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/FancyLists/DynamicEx/res/layout/main.xml b/FancyLists/DynamicEx/res/layout/main.xml
old mode 100755
new mode 100644
index a6b4ecc..b3d6407
--- a/FancyLists/DynamicEx/res/layout/main.xml
+++ b/FancyLists/DynamicEx/res/layout/main.xml
@@ -1,17 +1,17 @@
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+
diff --git a/FancyLists/DynamicEx/res/layout/row.xml b/FancyLists/DynamicEx/res/layout/row.xml
old mode 100755
new mode 100644
index ff408db..9b9bd57
--- a/FancyLists/DynamicEx/res/layout/row.xml
+++ b/FancyLists/DynamicEx/res/layout/row.xml
@@ -1,20 +1,20 @@
-
-
+
+
diff --git a/FancyLists/DynamicEx/res/values/strings.xml b/FancyLists/DynamicEx/res/values/strings.xml
old mode 100755
new mode 100644
index 7e54945..8a69b3e
--- a/FancyLists/DynamicEx/res/values/strings.xml
+++ b/FancyLists/DynamicEx/res/values/strings.xml
@@ -1,4 +1,4 @@
- DynamicDemo
+ DynamicDemo
\ No newline at end of file
diff --git a/FancyLists/DynamicEx/src/com/commonsware/android/fancylists/three/DynamicDemo.java b/FancyLists/DynamicEx/src/com/commonsware/android/fancylists/three/DynamicDemo.java
old mode 100755
new mode 100644
index 0aa40f8..be5a999
--- a/FancyLists/DynamicEx/src/com/commonsware/android/fancylists/three/DynamicDemo.java
+++ b/FancyLists/DynamicEx/src/com/commonsware/android/fancylists/three/DynamicDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.three;
@@ -25,50 +25,50 @@
import android.widget.TextView;
public class DynamicDemo extends ListActivity {
- TextView selection;
- private static final String[] items={"lorem", "ipsum", "dolor",
- "sit", "amet",
- "consectetuer", "adipiscing", "elit", "morbi", "vel",
- "ligula", "vitae", "arcu", "aliquet", "mollis",
- "etiam", "vel", "erat", "placerat", "ante",
- "porttitor", "sodales", "pellentesque", "augue", "purus"};
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- setListAdapter(new IconicAdapter());
- selection=(TextView)findViewById(R.id.selection);
- }
-
- public void onListItemClick(ListView parent, View v,
- int position, long id) {
- selection.setText(items[position]);
- }
-
- class IconicAdapter extends ArrayAdapter {
- IconicAdapter() {
- super(DynamicDemo.this, R.layout.row, items);
- }
-
- public View getView(int position, View convertView,
- ViewGroup parent) {
- LayoutInflater inflater=getLayoutInflater();
- View row=inflater.inflate(R.layout.row, parent, false);
- TextView label=(TextView)row.findViewById(R.id.label);
-
- label.setText(items[position]);
-
- ImageView icon=(ImageView)row.findViewById(R.id.icon);
-
- if (items[position].length()>4) {
- icon.setImageResource(R.drawable.delete);
- }
- else {
- icon.setImageResource(R.drawable.ok);
- }
-
- return(row);
- }
- }
+ TextView selection;
+ private static final String[] items={"lorem", "ipsum", "dolor",
+ "sit", "amet",
+ "consectetuer", "adipiscing", "elit", "morbi", "vel",
+ "ligula", "vitae", "arcu", "aliquet", "mollis",
+ "etiam", "vel", "erat", "placerat", "ante",
+ "porttitor", "sodales", "pellentesque", "augue", "purus"};
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ setListAdapter(new IconicAdapter());
+ selection=(TextView)findViewById(R.id.selection);
+ }
+
+ public void onListItemClick(ListView parent, View v,
+ int position, long id) {
+ selection.setText(items[position]);
+ }
+
+ class IconicAdapter extends ArrayAdapter {
+ IconicAdapter() {
+ super(DynamicDemo.this, R.layout.row, items);
+ }
+
+ public View getView(int position, View convertView,
+ ViewGroup parent) {
+ LayoutInflater inflater=getLayoutInflater();
+ View row=inflater.inflate(R.layout.row, parent, false);
+ TextView label=(TextView)row.findViewById(R.id.label);
+
+ label.setText(items[position]);
+
+ ImageView icon=(ImageView)row.findViewById(R.id.icon);
+
+ if (items[position].length()>4) {
+ icon.setImageResource(R.drawable.delete);
+ }
+ else {
+ icon.setImageResource(R.drawable.ok);
+ }
+
+ return(row);
+ }
+ }
}
diff --git a/FancyLists/RateList/AndroidManifest.xml b/FancyLists/RateList/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/FancyLists/RateList/res/layout/row.xml b/FancyLists/RateList/res/layout/row.xml
old mode 100755
new mode 100644
index 85918a0..fb1ba7b
--- a/FancyLists/RateList/res/layout/row.xml
+++ b/FancyLists/RateList/res/layout/row.xml
@@ -1,21 +1,21 @@
-
-
+
+
diff --git a/FancyLists/RateList/res/values/strings.xml b/FancyLists/RateList/res/values/strings.xml
old mode 100755
new mode 100644
index 537a14f..4100fd5
--- a/FancyLists/RateList/res/values/strings.xml
+++ b/FancyLists/RateList/res/values/strings.xml
@@ -1,4 +1,4 @@
- RateListDemo
+ RateListDemo
\ No newline at end of file
diff --git a/FancyLists/RateList/src/com/commonsware/android/fancylists/six/RateListDemo.java b/FancyLists/RateList/src/com/commonsware/android/fancylists/six/RateListDemo.java
old mode 100755
new mode 100644
index 284ce83..7a05483
--- a/FancyLists/RateList/src/com/commonsware/android/fancylists/six/RateListDemo.java
+++ b/FancyLists/RateList/src/com/commonsware/android/fancylists/six/RateListDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.six;
@@ -29,87 +29,87 @@
import java.util.ArrayList;
public class RateListDemo extends ListActivity {
- private static final String[] items={"lorem", "ipsum", "dolor",
- "sit", "amet",
- "consectetuer", "adipiscing", "elit", "morbi", "vel",
- "ligula", "vitae", "arcu", "aliquet", "mollis",
- "etiam", "vel", "erat", "placerat", "ante",
- "porttitor", "sodales", "pellentesque", "augue", "purus"};
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
-
- ArrayList list=new ArrayList();
-
- for (String s : items) {
- list.add(new RowModel(s));
- }
-
- setListAdapter(new RatingAdapter(list));
- }
-
- private RowModel getModel(int position) {
- return(((RatingAdapter)getListAdapter()).getItem(position));
- }
-
- class RatingAdapter extends ArrayAdapter {
- RatingAdapter(ArrayList list) {
- super(RateListDemo.this, R.layout.row, R.id.label, list);
- }
-
- public View getView(int position, View convertView,
- ViewGroup parent) {
- View row=super.getView(position, convertView, parent);
- ViewHolder holder=(ViewHolder)row.getTag();
-
- if (holder==null) {
- holder=new ViewHolder(row);
- row.setTag(holder);
-
- RatingBar.OnRatingBarChangeListener l=
- new RatingBar.OnRatingBarChangeListener() {
- public void onRatingChanged(RatingBar ratingBar,
- float rating,
- boolean fromTouch) {
- Integer myPosition=(Integer)ratingBar.getTag();
- RowModel model=getModel(myPosition);
-
- model.rating=rating;
-
- LinearLayout parent=(LinearLayout)ratingBar.getParent();
- TextView label=(TextView)parent.findViewById(R.id.label);
-
- label.setText(model.toString());
- }
- };
-
- holder.rate.setOnRatingBarChangeListener(l);
- }
+ private static final String[] items={"lorem", "ipsum", "dolor",
+ "sit", "amet",
+ "consectetuer", "adipiscing", "elit", "morbi", "vel",
+ "ligula", "vitae", "arcu", "aliquet", "mollis",
+ "etiam", "vel", "erat", "placerat", "ante",
+ "porttitor", "sodales", "pellentesque", "augue", "purus"};
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ ArrayList list=new ArrayList();
+
+ for (String s : items) {
+ list.add(new RowModel(s));
+ }
+
+ setListAdapter(new RatingAdapter(list));
+ }
+
+ private RowModel getModel(int position) {
+ return(((RatingAdapter)getListAdapter()).getItem(position));
+ }
+
+ class RatingAdapter extends ArrayAdapter {
+ RatingAdapter(ArrayList list) {
+ super(RateListDemo.this, R.layout.row, R.id.label, list);
+ }
+
+ public View getView(int position, View convertView,
+ ViewGroup parent) {
+ View row=super.getView(position, convertView, parent);
+ ViewHolder holder=(ViewHolder)row.getTag();
+
+ if (holder==null) {
+ holder=new ViewHolder(row);
+ row.setTag(holder);
+
+ RatingBar.OnRatingBarChangeListener l=
+ new RatingBar.OnRatingBarChangeListener() {
+ public void onRatingChanged(RatingBar ratingBar,
+ float rating,
+ boolean fromTouch) {
+ Integer myPosition=(Integer)ratingBar.getTag();
+ RowModel model=getModel(myPosition);
+
+ model.rating=rating;
+
+ LinearLayout parent=(LinearLayout)ratingBar.getParent();
+ TextView label=(TextView)parent.findViewById(R.id.label);
+
+ label.setText(model.toString());
+ }
+ };
+
+ holder.rate.setOnRatingBarChangeListener(l);
+ }
- RowModel model=getModel(position);
-
- holder.rate.setTag(new Integer(position));
- holder.rate.setRating(model.rating);
-
- return(row);
- }
- }
-
- class RowModel {
- String label;
- float rating=2.0f;
-
- RowModel(String label) {
- this.label=label;
- }
-
- public String toString() {
- if (rating>=3.0) {
- return(label.toUpperCase());
- }
-
- return(label);
- }
- }
+ RowModel model=getModel(position);
+
+ holder.rate.setTag(new Integer(position));
+ holder.rate.setRating(model.rating);
+
+ return(row);
+ }
+ }
+
+ class RowModel {
+ String label;
+ float rating=2.0f;
+
+ RowModel(String label) {
+ this.label=label;
+ }
+
+ public String toString() {
+ if (rating>=3.0) {
+ return(label.toUpperCase());
+ }
+
+ return(label);
+ }
+ }
}
\ No newline at end of file
diff --git a/FancyLists/RateList/src/com/commonsware/android/fancylists/six/ViewHolder.java b/FancyLists/RateList/src/com/commonsware/android/fancylists/six/ViewHolder.java
old mode 100755
new mode 100644
index 9c2d7a2..ccaec17
--- a/FancyLists/RateList/src/com/commonsware/android/fancylists/six/ViewHolder.java
+++ b/FancyLists/RateList/src/com/commonsware/android/fancylists/six/ViewHolder.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.six;
@@ -18,9 +18,9 @@
import android.widget.RatingBar;
class ViewHolder {
- RatingBar rate=null;
-
- ViewHolder(View base) {
- this.rate=(RatingBar)base.findViewById(R.id.rate);
- }
+ RatingBar rate=null;
+
+ ViewHolder(View base) {
+ this.rate=(RatingBar)base.findViewById(R.id.rate);
+ }
}
diff --git a/FancyLists/Recycling/AndroidManifest.xml b/FancyLists/Recycling/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/FancyLists/Recycling/res/layout/main.xml b/FancyLists/Recycling/res/layout/main.xml
old mode 100755
new mode 100644
index a6b4ecc..b3d6407
--- a/FancyLists/Recycling/res/layout/main.xml
+++ b/FancyLists/Recycling/res/layout/main.xml
@@ -1,17 +1,17 @@
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+
diff --git a/FancyLists/Recycling/res/layout/row.xml b/FancyLists/Recycling/res/layout/row.xml
old mode 100755
new mode 100644
index 629bd65..578e4bd
--- a/FancyLists/Recycling/res/layout/row.xml
+++ b/FancyLists/Recycling/res/layout/row.xml
@@ -1,22 +1,22 @@
-
-
+
+
diff --git a/FancyLists/Recycling/res/values/strings.xml b/FancyLists/Recycling/res/values/strings.xml
old mode 100755
new mode 100644
index 917d4ae..77ccc2c
--- a/FancyLists/Recycling/res/values/strings.xml
+++ b/FancyLists/Recycling/res/values/strings.xml
@@ -1,4 +1,4 @@
- RecyclingDemo
+ RecyclingDemo
\ No newline at end of file
diff --git a/FancyLists/Recycling/src/com/commonsware/android/fancylists/four/RecyclingDemo.java b/FancyLists/Recycling/src/com/commonsware/android/fancylists/four/RecyclingDemo.java
old mode 100755
new mode 100644
index 08a6595..326f840
--- a/FancyLists/Recycling/src/com/commonsware/android/fancylists/four/RecyclingDemo.java
+++ b/FancyLists/Recycling/src/com/commonsware/android/fancylists/four/RecyclingDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.four;
@@ -25,56 +25,56 @@
import android.widget.TextView;
public class RecyclingDemo extends ListActivity {
- private TextView selection;
- private static final String[] items={"lorem", "ipsum", "dolor",
- "sit", "amet",
- "consectetuer", "adipiscing", "elit", "morbi", "vel",
- "ligula", "vitae", "arcu", "aliquet", "mollis",
- "etiam", "vel", "erat", "placerat", "ante",
- "porttitor", "sodales", "pellentesque", "augue", "purus"};
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- setListAdapter(new IconicAdapter());
- selection=(TextView)findViewById(R.id.selection);
- }
-
- public void onListItemClick(ListView parent, View v,
- int position, long id) {
- selection.setText(items[position]);
- }
-
- class IconicAdapter extends ArrayAdapter {
- IconicAdapter() {
- super(RecyclingDemo.this, R.layout.row, items);
- }
-
- public View getView(int position, View convertView,
- ViewGroup parent) {
- View row=convertView;
-
- if (row==null) {
- LayoutInflater inflater=getLayoutInflater();
-
- row=inflater.inflate(R.layout.row, parent, false);
- }
-
- TextView label=(TextView)row.findViewById(R.id.label);
-
- label.setText(items[position]);
+ private TextView selection;
+ private static final String[] items={"lorem", "ipsum", "dolor",
+ "sit", "amet",
+ "consectetuer", "adipiscing", "elit", "morbi", "vel",
+ "ligula", "vitae", "arcu", "aliquet", "mollis",
+ "etiam", "vel", "erat", "placerat", "ante",
+ "porttitor", "sodales", "pellentesque", "augue", "purus"};
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ setListAdapter(new IconicAdapter());
+ selection=(TextView)findViewById(R.id.selection);
+ }
+
+ public void onListItemClick(ListView parent, View v,
+ int position, long id) {
+ selection.setText(items[position]);
+ }
+
+ class IconicAdapter extends ArrayAdapter {
+ IconicAdapter() {
+ super(RecyclingDemo.this, R.layout.row, items);
+ }
+
+ public View getView(int position, View convertView,
+ ViewGroup parent) {
+ View row=convertView;
+
+ if (row==null) {
+ LayoutInflater inflater=getLayoutInflater();
+
+ row=inflater.inflate(R.layout.row, parent, false);
+ }
+
+ TextView label=(TextView)row.findViewById(R.id.label);
+
+ label.setText(items[position]);
- ImageView icon=(ImageView)row.findViewById(R.id.icon);
-
- if (items[position].length()>4) {
- icon.setImageResource(R.drawable.delete);
- }
- else {
- icon.setImageResource(R.drawable.ok);
- }
-
- return(row);
- }
- }
+ ImageView icon=(ImageView)row.findViewById(R.id.icon);
+
+ if (items[position].length()>4) {
+ icon.setImageResource(R.drawable.delete);
+ }
+ else {
+ icon.setImageResource(R.drawable.ok);
+ }
+
+ return(row);
+ }
+ }
}
diff --git a/FancyLists/Static/AndroidManifest.xml b/FancyLists/Static/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/FancyLists/Static/res/layout/main.xml b/FancyLists/Static/res/layout/main.xml
old mode 100755
new mode 100644
index a6b4ecc..b3d6407
--- a/FancyLists/Static/res/layout/main.xml
+++ b/FancyLists/Static/res/layout/main.xml
@@ -1,17 +1,17 @@
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+
diff --git a/FancyLists/Static/res/layout/row.xml b/FancyLists/Static/res/layout/row.xml
old mode 100755
new mode 100644
index ff408db..9b9bd57
--- a/FancyLists/Static/res/layout/row.xml
+++ b/FancyLists/Static/res/layout/row.xml
@@ -1,20 +1,20 @@
-
-
+
+
diff --git a/FancyLists/Static/res/values/strings.xml b/FancyLists/Static/res/values/strings.xml
old mode 100755
new mode 100644
index 8e3153a..50f5a99
--- a/FancyLists/Static/res/values/strings.xml
+++ b/FancyLists/Static/res/values/strings.xml
@@ -1,4 +1,4 @@
- StaticDemo
+ StaticDemo
\ No newline at end of file
diff --git a/FancyLists/Static/src/com/commonsware/android/fancylists/two/StaticDemo.java b/FancyLists/Static/src/com/commonsware/android/fancylists/two/StaticDemo.java
old mode 100755
new mode 100644
index 0c9fa11..571785a
--- a/FancyLists/Static/src/com/commonsware/android/fancylists/two/StaticDemo.java
+++ b/FancyLists/Static/src/com/commonsware/android/fancylists/two/StaticDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.two;
@@ -24,26 +24,26 @@
import android.widget.TextView;
public class StaticDemo extends ListActivity {
- private TextView selection;
- private static final String[] items={"lorem", "ipsum", "dolor",
- "sit", "amet",
- "consectetuer", "adipiscing", "elit", "morbi", "vel",
- "ligula", "vitae", "arcu", "aliquet", "mollis",
- "etiam", "vel", "erat", "placerat", "ante",
- "porttitor", "sodales", "pellentesque", "augue", "purus"};
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- setListAdapter(new ArrayAdapter(this,
- R.layout.row, R.id.label,
- items));
- selection=(TextView)findViewById(R.id.selection);
- }
-
- public void onListItemClick(ListView parent, View v,
- int position, long id) {
- selection.setText(items[position]);
- }
+ private TextView selection;
+ private static final String[] items={"lorem", "ipsum", "dolor",
+ "sit", "amet",
+ "consectetuer", "adipiscing", "elit", "morbi", "vel",
+ "ligula", "vitae", "arcu", "aliquet", "mollis",
+ "etiam", "vel", "erat", "placerat", "ante",
+ "porttitor", "sodales", "pellentesque", "augue", "purus"};
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ setListAdapter(new ArrayAdapter(this,
+ R.layout.row, R.id.label,
+ items));
+ selection=(TextView)findViewById(R.id.selection);
+ }
+
+ public void onListItemClick(ListView parent, View v,
+ int position, long id) {
+ selection.setText(items[position]);
+ }
}
diff --git a/FancyLists/ViewHolder/AndroidManifest.xml b/FancyLists/ViewHolder/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/FancyLists/ViewHolder/res/layout/main.xml b/FancyLists/ViewHolder/res/layout/main.xml
old mode 100755
new mode 100644
index a6b4ecc..b3d6407
--- a/FancyLists/ViewHolder/res/layout/main.xml
+++ b/FancyLists/ViewHolder/res/layout/main.xml
@@ -1,17 +1,17 @@
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+
diff --git a/FancyLists/ViewHolder/res/layout/row.xml b/FancyLists/ViewHolder/res/layout/row.xml
old mode 100755
new mode 100644
index ff408db..9b9bd57
--- a/FancyLists/ViewHolder/res/layout/row.xml
+++ b/FancyLists/ViewHolder/res/layout/row.xml
@@ -1,20 +1,20 @@
-
-
+
+
diff --git a/FancyLists/ViewHolder/res/values/strings.xml b/FancyLists/ViewHolder/res/values/strings.xml
old mode 100755
new mode 100644
index 44426c6..fed9a75
--- a/FancyLists/ViewHolder/res/values/strings.xml
+++ b/FancyLists/ViewHolder/res/values/strings.xml
@@ -1,4 +1,4 @@
- ViewHolder Demo
+ ViewHolder Demo
\ No newline at end of file
diff --git a/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolder.java b/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolder.java
old mode 100755
new mode 100644
index bf3cb66..2af8b3e
--- a/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolder.java
+++ b/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolder.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.five;
@@ -18,9 +18,9 @@
import android.widget.ImageView;
class ViewHolder {
- ImageView icon=null;
-
- ViewHolder(View base) {
- this.icon=(ImageView)base.findViewById(R.id.icon);
- }
+ ImageView icon=null;
+
+ ViewHolder(View base) {
+ this.icon=(ImageView)base.findViewById(R.id.icon);
+ }
}
diff --git a/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolderDemo.java b/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolderDemo.java
old mode 100755
new mode 100644
index 03fc4a6..c30275f
--- a/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolderDemo.java
+++ b/FancyLists/ViewHolder/src/com/commonsware/android/fancylists/five/ViewHolderDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fancylists.five;
@@ -23,55 +23,55 @@
import android.widget.TextView;
public class ViewHolderDemo extends ListActivity {
- private TextView selection;
- private static final String[] items={"lorem", "ipsum", "dolor",
- "sit", "amet",
- "consectetuer", "adipiscing", "elit", "morbi", "vel",
- "ligula", "vitae", "arcu", "aliquet", "mollis",
- "etiam", "vel", "erat", "placerat", "ante",
- "porttitor", "sodales", "pellentesque", "augue", "purus"};
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- setListAdapter(new IconicAdapter());
- selection=(TextView)findViewById(R.id.selection);
- }
-
- private String getModel(int position) {
- return(((IconicAdapter)getListAdapter()).getItem(position));
- }
-
- public void onListItemClick(ListView parent, View v,
- int position, long id) {
- selection.setText(getModel(position));
- }
-
- class IconicAdapter extends ArrayAdapter {
- IconicAdapter() {
- super(ViewHolderDemo.this, R.layout.row, R.id.label,
- items);
- }
-
- public View getView(int position, View convertView,
- ViewGroup parent) {
- View row=super.getView(position, convertView, parent);
- ViewHolder holder=(ViewHolder)row.getTag();
-
- if (holder==null) {
- holder=new ViewHolder(row);
- row.setTag(holder);
- }
-
- if (getModel(position).length()>4) {
- holder.icon.setImageResource(R.drawable.delete);
- }
- else {
- holder.icon.setImageResource(R.drawable.ok);
- }
-
- return(row);
- }
- }
+ private TextView selection;
+ private static final String[] items={"lorem", "ipsum", "dolor",
+ "sit", "amet",
+ "consectetuer", "adipiscing", "elit", "morbi", "vel",
+ "ligula", "vitae", "arcu", "aliquet", "mollis",
+ "etiam", "vel", "erat", "placerat", "ante",
+ "porttitor", "sodales", "pellentesque", "augue", "purus"};
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ setListAdapter(new IconicAdapter());
+ selection=(TextView)findViewById(R.id.selection);
+ }
+
+ private String getModel(int position) {
+ return(((IconicAdapter)getListAdapter()).getItem(position));
+ }
+
+ public void onListItemClick(ListView parent, View v,
+ int position, long id) {
+ selection.setText(getModel(position));
+ }
+
+ class IconicAdapter extends ArrayAdapter {
+ IconicAdapter() {
+ super(ViewHolderDemo.this, R.layout.row, R.id.label,
+ items);
+ }
+
+ public View getView(int position, View convertView,
+ ViewGroup parent) {
+ View row=super.getView(position, convertView, parent);
+ ViewHolder holder=(ViewHolder)row.getTag();
+
+ if (holder==null) {
+ holder=new ViewHolder(row);
+ row.setTag(holder);
+ }
+
+ if (getModel(position).length()>4) {
+ holder.icon.setImageResource(R.drawable.delete);
+ }
+ else {
+ holder.icon.setImageResource(R.drawable.ok);
+ }
+
+ return(row);
+ }
+ }
}
diff --git a/Files/ReadWrite/AndroidManifest.xml b/Files/ReadWrite/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Files/ReadWrite/res/layout/main.xml b/Files/ReadWrite/res/layout/main.xml
old mode 100755
new mode 100644
index 2a672c6..77998b8
--- a/Files/ReadWrite/res/layout/main.xml
+++ b/Files/ReadWrite/res/layout/main.xml
@@ -1,8 +1,8 @@
+ android:id="@+id/editor"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:singleLine="false"
+ android:gravity="top"
+ />
diff --git a/Files/ReadWrite/res/values/strings.xml b/Files/ReadWrite/res/values/strings.xml
old mode 100755
new mode 100644
index af36c8f..e5be035
--- a/Files/ReadWrite/res/values/strings.xml
+++ b/Files/ReadWrite/res/values/strings.xml
@@ -1,4 +1,4 @@
- ReadWriteFileDemo
+ ReadWriteFileDemo
\ No newline at end of file
diff --git a/Files/ReadWrite/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java b/Files/ReadWrite/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java
old mode 100755
new mode 100644
index 9d6e49b..d2fadb7
--- a/Files/ReadWrite/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java
+++ b/Files/ReadWrite/src/com/commonsware/android/readwrite/ReadWriteFileDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.readwrite;
@@ -28,60 +28,60 @@
import java.io.OutputStreamWriter;
public class ReadWriteFileDemo extends Activity {
- private final static String NOTES="notes.txt";
- private EditText editor;
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- editor=(EditText)findViewById(R.id.editor);
- }
-
- public void onResume() {
- super.onResume();
-
- try {
- InputStream in=openFileInput(NOTES);
-
- if (in!=null) {
- InputStreamReader tmp=new InputStreamReader(in);
- BufferedReader reader=new BufferedReader(tmp);
- String str;
- StringBuilder buf=new StringBuilder();
-
- while ((str = reader.readLine()) != null) {
- buf.append(str+"\n");
- }
-
- in.close();
- editor.setText(buf.toString());
- }
- }
- catch (java.io.FileNotFoundException e) {
- // that's OK, we probably haven't created it yet
- }
- catch (Throwable t) {
- Toast
- .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
- .show();
- }
- }
-
- public void onPause() {
- super.onPause();
-
- try {
- OutputStreamWriter out=
- new OutputStreamWriter(openFileOutput(NOTES, 0));
-
- out.write(editor.getText().toString());
- out.close();
- }
- catch (Throwable t) {
- Toast
- .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
- .show();
- }
- }
+ private final static String NOTES="notes.txt";
+ private EditText editor;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ editor=(EditText)findViewById(R.id.editor);
+ }
+
+ public void onResume() {
+ super.onResume();
+
+ try {
+ InputStream in=openFileInput(NOTES);
+
+ if (in!=null) {
+ InputStreamReader tmp=new InputStreamReader(in);
+ BufferedReader reader=new BufferedReader(tmp);
+ String str;
+ StringBuilder buf=new StringBuilder();
+
+ while ((str = reader.readLine()) != null) {
+ buf.append(str+"\n");
+ }
+
+ in.close();
+ editor.setText(buf.toString());
+ }
+ }
+ catch (java.io.FileNotFoundException e) {
+ // that's OK, we probably haven't created it yet
+ }
+ catch (Throwable t) {
+ Toast
+ .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
+ .show();
+ }
+ }
+
+ public void onPause() {
+ super.onPause();
+
+ try {
+ OutputStreamWriter out=
+ new OutputStreamWriter(openFileOutput(NOTES, 0));
+
+ out.write(editor.getText().toString());
+ out.close();
+ }
+ catch (Throwable t) {
+ Toast
+ .makeText(this, "Exception: "+t.toString(), Toast.LENGTH_LONG)
+ .show();
+ }
+ }
}
\ No newline at end of file
diff --git a/Files/Static/AndroidManifest.xml b/Files/Static/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Files/Static/res/layout/main.xml b/Files/Static/res/layout/main.xml
old mode 100755
new mode 100644
index 61cae36..6158fc7
--- a/Files/Static/res/layout/main.xml
+++ b/Files/Static/res/layout/main.xml
@@ -1,17 +1,17 @@
-
-
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+
\ No newline at end of file
diff --git a/Files/Static/res/raw/words.xml b/Files/Static/res/raw/words.xml
old mode 100755
new mode 100644
index 8374b55..6af062c
--- a/Files/Static/res/raw/words.xml
+++ b/Files/Static/res/raw/words.xml
@@ -1,27 +1,27 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Files/Static/res/values/strings.xml b/Files/Static/res/values/strings.xml
old mode 100755
new mode 100644
index ae8fc09..c6066ed
--- a/Files/Static/res/values/strings.xml
+++ b/Files/Static/res/values/strings.xml
@@ -1,4 +1,4 @@
- StaticFileDemo
+ StaticFileDemo
\ No newline at end of file
diff --git a/Files/Static/src/com/commonsware/android/files/StaticFileDemo.java b/Files/Static/src/com/commonsware/android/files/StaticFileDemo.java
old mode 100755
new mode 100644
index 37b4916..9781d6b
--- a/Files/Static/src/com/commonsware/android/files/StaticFileDemo.java
+++ b/Files/Static/src/com/commonsware/android/files/StaticFileDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.files;
@@ -32,42 +32,42 @@
import org.w3c.dom.NodeList;
public class StaticFileDemo extends ListActivity {
- TextView selection;
- ArrayList items=new ArrayList();
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- selection=(TextView)findViewById(R.id.selection);
-
- try {
- InputStream in=getResources().openRawResource(R.raw.words);
- DocumentBuilder builder=DocumentBuilderFactory
- .newInstance()
- .newDocumentBuilder();
- Document doc=builder.parse(in, null);
- NodeList words=doc.getElementsByTagName("word");
-
- for (int i=0;i(this,
- android.R.layout.simple_list_item_1,
- items));
- }
-
- public void onListItemClick(ListView parent, View v, int position,
- long id) {
- selection.setText(items.get(position).toString());
- }
+ TextView selection;
+ ArrayList items=new ArrayList();
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+ selection=(TextView)findViewById(R.id.selection);
+
+ try {
+ InputStream in=getResources().openRawResource(R.raw.words);
+ DocumentBuilder builder=DocumentBuilderFactory
+ .newInstance()
+ .newDocumentBuilder();
+ Document doc=builder.parse(in, null);
+ NodeList words=doc.getElementsByTagName("word");
+
+ for (int i=0;i(this,
+ android.R.layout.simple_list_item_1,
+ items));
+ }
+
+ public void onListItemClick(ListView parent, View v, int position,
+ long id) {
+ selection.setText(items.get(position).toString());
+ }
}
\ No newline at end of file
diff --git a/Fonts/FontSampler/AndroidManifest.xml b/Fonts/FontSampler/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Fonts/FontSampler/res/layout/main.xml b/Fonts/FontSampler/res/layout/main.xml
old mode 100755
new mode 100644
index a32bfc8..5e6e7be
--- a/Fonts/FontSampler/res/layout/main.xml
+++ b/Fonts/FontSampler/res/layout/main.xml
@@ -1,70 +1,70 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:stretchColumns="1">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Fonts/FontSampler/res/values/strings.xml b/Fonts/FontSampler/res/values/strings.xml
old mode 100755
new mode 100644
index c903c28..909c2c3
--- a/Fonts/FontSampler/res/values/strings.xml
+++ b/Fonts/FontSampler/res/values/strings.xml
@@ -1,4 +1,4 @@
- FontSampler
+ FontSampler
\ No newline at end of file
diff --git a/Fonts/FontSampler/src/com/commonsware/android/fonts/FontSampler.java b/Fonts/FontSampler/src/com/commonsware/android/fonts/FontSampler.java
old mode 100755
new mode 100644
index 8ab84dd..bb8fbb4
--- a/Fonts/FontSampler/src/com/commonsware/android/fonts/FontSampler.java
+++ b/Fonts/FontSampler/src/com/commonsware/android/fonts/FontSampler.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.fonts;
@@ -23,28 +23,28 @@
import java.io.File;
public class FontSampler extends Activity {
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- TextView tv=(TextView)findViewById(R.id.custom);
- Typeface face=Typeface.createFromAsset(getAssets(),
- "fonts/HandmadeTypewriter.ttf");
-
- tv.setTypeface(face);
-
- File font=new File(Environment.getExternalStorageDirectory(),
- "MgOpenCosmeticaBold.ttf");
-
- if (font.exists()) {
- tv=(TextView)findViewById(R.id.file);
- face=Typeface.createFromFile(font);
-
- tv.setTypeface(face);
- }
- else {
- findViewById(R.id.filerow).setVisibility(View.GONE);
- }
- }
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.main);
+
+ TextView tv=(TextView)findViewById(R.id.custom);
+ Typeface face=Typeface.createFromAsset(getAssets(),
+ "fonts/HandmadeTypewriter.ttf");
+
+ tv.setTypeface(face);
+
+ File font=new File(Environment.getExternalStorageDirectory(),
+ "MgOpenCosmeticaBold.ttf");
+
+ if (font.exists()) {
+ tv=(TextView)findViewById(R.id.file);
+ face=Typeface.createFromFile(font);
+
+ tv.setTypeface(face);
+ }
+ else {
+ findViewById(R.id.filerow).setVisibility(View.GONE);
+ }
+ }
}
diff --git a/Fragments/EU4You_6/res/layout-large/main.xml b/Fragments/EU4You_6/res/layout-large/main.xml
index f70c197..3ba3094 100644
--- a/Fragments/EU4You_6/res/layout-large/main.xml
+++ b/Fragments/EU4You_6/res/layout-large/main.xml
@@ -1,19 +1,19 @@
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+
\ No newline at end of file
diff --git a/Fragments/EU4You_6/res/layout/details.xml b/Fragments/EU4You_6/res/layout/details.xml
index cb2af62..d3cdb8c 100644
--- a/Fragments/EU4You_6/res/layout/details.xml
+++ b/Fragments/EU4You_6/res/layout/details.xml
@@ -1,7 +1,7 @@
diff --git a/Fragments/EU4You_6/res/layout/details_fragment.xml b/Fragments/EU4You_6/res/layout/details_fragment.xml
index 389f6a1..b42f67e 100644
--- a/Fragments/EU4You_6/res/layout/details_fragment.xml
+++ b/Fragments/EU4You_6/res/layout/details_fragment.xml
@@ -1,7 +1,7 @@
\ No newline at end of file
diff --git a/Fragments/EU4You_6/res/layout/main.xml b/Fragments/EU4You_6/res/layout/main.xml
index a8d06e0..be75e44 100644
--- a/Fragments/EU4You_6/res/layout/main.xml
+++ b/Fragments/EU4You_6/res/layout/main.xml
@@ -1,7 +1,7 @@
diff --git a/Fragments/EU4You_6/res/layout/row.xml b/Fragments/EU4You_6/res/layout/row.xml
index 8732856..e4a03a0 100644
--- a/Fragments/EU4You_6/res/layout/row.xml
+++ b/Fragments/EU4You_6/res/layout/row.xml
@@ -1,21 +1,21 @@
-
-
+
+
diff --git a/Fragments/EU4You_6/res/values-v11/styles.xml b/Fragments/EU4You_6/res/values-v11/styles.xml
index 39f92e5..663decb 100644
--- a/Fragments/EU4You_6/res/values-v11/styles.xml
+++ b/Fragments/EU4You_6/res/values-v11/styles.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/Fragments/EU4You_6/res/values/strings.xml b/Fragments/EU4You_6/res/values/strings.xml
index 497dc4f..0d6092b 100644
--- a/Fragments/EU4You_6/res/values/strings.xml
+++ b/Fragments/EU4You_6/res/values/strings.xml
@@ -1,60 +1,60 @@
- EU4You
+ EU4You
- Austria
- Belgium
- Bulgaria
- Cyprus
- Czech Republic
- Denmark
- Estonia
- Finland
- France
- Germany
- Greece
- Hungary
- Ireland
- Italy
- Latvia
- Lithuania
- Luxembourg
- Malta
- Netherlands
- Poland
- Portugal
- Romania
- Slovakia
- Slovenia
- Spain
- Sweden
- United Kingdom
+ Austria
+ Belgium
+ Bulgaria
+ Cyprus
+ Czech Republic
+ Denmark
+ Estonia
+ Finland
+ France
+ Germany
+ Greece
+ Hungary
+ Ireland
+ Italy
+ Latvia
+ Lithuania
+ Luxembourg
+ Malta
+ Netherlands
+ Poland
+ Portugal
+ Romania
+ Slovakia
+ Slovenia
+ Spain
+ Sweden
+ United Kingdom
- http://en.m.wikipedia.org/wiki/Austria
- http://en.m.wikipedia.org/wiki/Belgium
- http://en.m.wikipedia.org/wiki/Bulgaria
- http://en.m.wikipedia.org/wiki/Cyprus
- http://en.m.wikipedia.org/wiki/Czech_republic
- http://en.m.wikipedia.org/wiki/Denmark
- http://en.m.wikipedia.org/wiki/Estonia
- http://en.m.wikipedia.org/wiki/Finland
- http://en.m.wikipedia.org/wiki/France
- http://en.m.wikipedia.org/wiki/Germany
- http://en.m.wikipedia.org/wiki/Greece
- http://en.m.wikipedia.org/wiki/Hungary
- http://en.m.wikipedia.org/wiki/Ireland
- http://en.m.wikipedia.org/wiki/Italy
- http://en.m.wikipedia.org/wiki/Latvia
- http://en.m.wikipedia.org/wiki/Lithuania
- http://en.m.wikipedia.org/wiki/Luxembourg
- http://en.m.wikipedia.org/wiki/Malta
- http://en.m.wikipedia.org/wiki/Netherlands
- http://en.m.wikipedia.org/wiki/Poland
- http://en.m.wikipedia.org/wiki/Portugal
- http://en.m.wikipedia.org/wiki/Romania
- http://en.m.wikipedia.org/wiki/Slovakia
- http://en.m.wikipedia.org/wiki/Slovenia
- http://en.m.wikipedia.org/wiki/Spain
- http://en.m.wikipedia.org/wiki/Sweden
- http://en.m.wikipedia.org/wiki/United_kingdom
+ http://en.m.wikipedia.org/wiki/Austria
+ http://en.m.wikipedia.org/wiki/Belgium
+ http://en.m.wikipedia.org/wiki/Bulgaria
+ http://en.m.wikipedia.org/wiki/Cyprus
+ http://en.m.wikipedia.org/wiki/Czech_republic
+ http://en.m.wikipedia.org/wiki/Denmark
+ http://en.m.wikipedia.org/wiki/Estonia
+ http://en.m.wikipedia.org/wiki/Finland
+ http://en.m.wikipedia.org/wiki/France
+ http://en.m.wikipedia.org/wiki/Germany
+ http://en.m.wikipedia.org/wiki/Greece
+ http://en.m.wikipedia.org/wiki/Hungary
+ http://en.m.wikipedia.org/wiki/Ireland
+ http://en.m.wikipedia.org/wiki/Italy
+ http://en.m.wikipedia.org/wiki/Latvia
+ http://en.m.wikipedia.org/wiki/Lithuania
+ http://en.m.wikipedia.org/wiki/Luxembourg
+ http://en.m.wikipedia.org/wiki/Malta
+ http://en.m.wikipedia.org/wiki/Netherlands
+ http://en.m.wikipedia.org/wiki/Poland
+ http://en.m.wikipedia.org/wiki/Portugal
+ http://en.m.wikipedia.org/wiki/Romania
+ http://en.m.wikipedia.org/wiki/Slovakia
+ http://en.m.wikipedia.org/wiki/Slovenia
+ http://en.m.wikipedia.org/wiki/Spain
+ http://en.m.wikipedia.org/wiki/Sweden
+ http://en.m.wikipedia.org/wiki/United_kingdom
\ No newline at end of file
diff --git a/Fragments/EU4You_6/res/values/styles.xml b/Fragments/EU4You_6/res/values/styles.xml
index e01843a..3cc2311 100644
--- a/Fragments/EU4You_6/res/values/styles.xml
+++ b/Fragments/EU4You_6/res/values/styles.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountriesFragment.java b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountriesFragment.java
index 89f3f89..abe55b9 100644
--- a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountriesFragment.java
+++ b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountriesFragment.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.eu4you;
@@ -26,155 +26,155 @@
import java.util.ArrayList;
public class CountriesFragment extends ListFragment {
- static private ArrayList EU=new ArrayList();
- static private final String STATE_CHECKED="com.commonsware.android.eu4you.STATE_CHECKED";
- private CountryListener listener=null;
+ static private ArrayList EU=new ArrayList();
+ static private final String STATE_CHECKED="com.commonsware.android.eu4you.STATE_CHECKED";
+ private CountryListener listener=null;
- static {
- EU.add(new Country(R.string.austria, R.drawable.austria,
- R.string.austria_url));
- EU.add(new Country(R.string.belgium, R.drawable.belgium,
- R.string.belgium_url));
- EU.add(new Country(R.string.bulgaria, R.drawable.bulgaria,
- R.string.bulgaria_url));
- EU.add(new Country(R.string.cyprus, R.drawable.cyprus,
- R.string.cyprus_url));
- EU.add(new Country(R.string.czech_republic,
- R.drawable.czech_republic,
- R.string.czech_republic_url));
- EU.add(new Country(R.string.denmark, R.drawable.denmark,
- R.string.denmark_url));
- EU.add(new Country(R.string.estonia, R.drawable.estonia,
- R.string.estonia_url));
- EU.add(new Country(R.string.finland, R.drawable.finland,
- R.string.finland_url));
- EU.add(new Country(R.string.france, R.drawable.france,
- R.string.france_url));
- EU.add(new Country(R.string.germany, R.drawable.germany,
- R.string.germany_url));
- EU.add(new Country(R.string.greece, R.drawable.greece,
- R.string.greece_url));
- EU.add(new Country(R.string.hungary, R.drawable.hungary,
- R.string.hungary_url));
- EU.add(new Country(R.string.ireland, R.drawable.ireland,
- R.string.ireland_url));
- EU.add(new Country(R.string.italy, R.drawable.italy,
- R.string.italy_url));
- EU.add(new Country(R.string.latvia, R.drawable.latvia,
- R.string.latvia_url));
- EU.add(new Country(R.string.lithuania, R.drawable.lithuania,
- R.string.lithuania_url));
- EU.add(new Country(R.string.luxembourg, R.drawable.luxembourg,
- R.string.luxembourg_url));
- EU.add(new Country(R.string.malta, R.drawable.malta,
- R.string.malta_url));
- EU.add(new Country(R.string.netherlands, R.drawable.netherlands,
- R.string.netherlands_url));
- EU.add(new Country(R.string.poland, R.drawable.poland,
- R.string.poland_url));
- EU.add(new Country(R.string.portugal, R.drawable.portugal,
- R.string.portugal_url));
- EU.add(new Country(R.string.romania, R.drawable.romania,
- R.string.romania_url));
- EU.add(new Country(R.string.slovakia, R.drawable.slovakia,
- R.string.slovakia_url));
- EU.add(new Country(R.string.slovenia, R.drawable.slovenia,
- R.string.slovenia_url));
- EU.add(new Country(R.string.spain, R.drawable.spain,
- R.string.spain_url));
- EU.add(new Country(R.string.sweden, R.drawable.sweden,
- R.string.sweden_url));
- EU.add(new Country(R.string.united_kingdom,
- R.drawable.united_kingdom,
- R.string.united_kingdom_url));
- }
-
- @Override
- public void onActivityCreated(Bundle state) {
- super.onActivityCreated(state);
-
- setListAdapter(new CountryAdapter());
-
- if (state!=null) {
- int position=state.getInt(STATE_CHECKED, -1);
-
- if (position>-1) {
- getListView().setItemChecked(position, true);
- }
- }
- }
+ static {
+ EU.add(new Country(R.string.austria, R.drawable.austria,
+ R.string.austria_url));
+ EU.add(new Country(R.string.belgium, R.drawable.belgium,
+ R.string.belgium_url));
+ EU.add(new Country(R.string.bulgaria, R.drawable.bulgaria,
+ R.string.bulgaria_url));
+ EU.add(new Country(R.string.cyprus, R.drawable.cyprus,
+ R.string.cyprus_url));
+ EU.add(new Country(R.string.czech_republic,
+ R.drawable.czech_republic,
+ R.string.czech_republic_url));
+ EU.add(new Country(R.string.denmark, R.drawable.denmark,
+ R.string.denmark_url));
+ EU.add(new Country(R.string.estonia, R.drawable.estonia,
+ R.string.estonia_url));
+ EU.add(new Country(R.string.finland, R.drawable.finland,
+ R.string.finland_url));
+ EU.add(new Country(R.string.france, R.drawable.france,
+ R.string.france_url));
+ EU.add(new Country(R.string.germany, R.drawable.germany,
+ R.string.germany_url));
+ EU.add(new Country(R.string.greece, R.drawable.greece,
+ R.string.greece_url));
+ EU.add(new Country(R.string.hungary, R.drawable.hungary,
+ R.string.hungary_url));
+ EU.add(new Country(R.string.ireland, R.drawable.ireland,
+ R.string.ireland_url));
+ EU.add(new Country(R.string.italy, R.drawable.italy,
+ R.string.italy_url));
+ EU.add(new Country(R.string.latvia, R.drawable.latvia,
+ R.string.latvia_url));
+ EU.add(new Country(R.string.lithuania, R.drawable.lithuania,
+ R.string.lithuania_url));
+ EU.add(new Country(R.string.luxembourg, R.drawable.luxembourg,
+ R.string.luxembourg_url));
+ EU.add(new Country(R.string.malta, R.drawable.malta,
+ R.string.malta_url));
+ EU.add(new Country(R.string.netherlands, R.drawable.netherlands,
+ R.string.netherlands_url));
+ EU.add(new Country(R.string.poland, R.drawable.poland,
+ R.string.poland_url));
+ EU.add(new Country(R.string.portugal, R.drawable.portugal,
+ R.string.portugal_url));
+ EU.add(new Country(R.string.romania, R.drawable.romania,
+ R.string.romania_url));
+ EU.add(new Country(R.string.slovakia, R.drawable.slovakia,
+ R.string.slovakia_url));
+ EU.add(new Country(R.string.slovenia, R.drawable.slovenia,
+ R.string.slovenia_url));
+ EU.add(new Country(R.string.spain, R.drawable.spain,
+ R.string.spain_url));
+ EU.add(new Country(R.string.sweden, R.drawable.sweden,
+ R.string.sweden_url));
+ EU.add(new Country(R.string.united_kingdom,
+ R.drawable.united_kingdom,
+ R.string.united_kingdom_url));
+ }
+
+ @Override
+ public void onActivityCreated(Bundle state) {
+ super.onActivityCreated(state);
+
+ setListAdapter(new CountryAdapter());
+
+ if (state!=null) {
+ int position=state.getInt(STATE_CHECKED, -1);
+
+ if (position>-1) {
+ getListView().setItemChecked(position, true);
+ }
+ }
+ }
- @Override
- public void onListItemClick(ListView l, View v, int position,
- long id) {
- l.setItemChecked(position, true);
-
- if (listener!=null) {
- listener.onCountrySelected(EU.get(position));
- }
- }
-
- @Override
- public void onSaveInstanceState(Bundle state) {
- state.putInt(STATE_CHECKED,
- getListView().getCheckedItemPosition());
- }
-
- public void setCountryListener(CountryListener listener) {
- this.listener=listener;
- }
-
- public void enablePersistentSelection() {
- getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
- }
-
- class CountryAdapter extends ArrayAdapter {
- CountryAdapter() {
- super(getActivity(), R.layout.row, R.id.name, EU);
- }
-
- @Override
- public View getView(int position, View convertView,
- ViewGroup parent) {
- CountryWrapper wrapper=null;
-
- if (convertView==null) {
- convertView=LayoutInflater
- .from(getActivity())
- .inflate(R.layout.row, null);
- wrapper=new CountryWrapper(convertView);
- convertView.setTag(wrapper);
- }
- else {
- wrapper=(CountryWrapper)convertView.getTag();
- }
-
- wrapper.populateFrom(getItem(position));
-
- return(convertView);
- }
- }
+ @Override
+ public void onListItemClick(ListView l, View v, int position,
+ long id) {
+ l.setItemChecked(position, true);
+
+ if (listener!=null) {
+ listener.onCountrySelected(EU.get(position));
+ }
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle state) {
+ state.putInt(STATE_CHECKED,
+ getListView().getCheckedItemPosition());
+ }
+
+ public void setCountryListener(CountryListener listener) {
+ this.listener=listener;
+ }
+
+ public void enablePersistentSelection() {
+ getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
+ }
+
+ class CountryAdapter extends ArrayAdapter {
+ CountryAdapter() {
+ super(getActivity(), R.layout.row, R.id.name, EU);
+ }
+
+ @Override
+ public View getView(int position, View convertView,
+ ViewGroup parent) {
+ CountryWrapper wrapper=null;
+
+ if (convertView==null) {
+ convertView=LayoutInflater
+ .from(getActivity())
+ .inflate(R.layout.row, null);
+ wrapper=new CountryWrapper(convertView);
+ convertView.setTag(wrapper);
+ }
+ else {
+ wrapper=(CountryWrapper)convertView.getTag();
+ }
+
+ wrapper.populateFrom(getItem(position));
+
+ return(convertView);
+ }
+ }
- static class CountryWrapper {
- private TextView name=null;
- private ImageView flag=null;
-
- CountryWrapper(View row) {
- name=(TextView)row.findViewById(R.id.name);
- flag=(ImageView)row.findViewById(R.id.flag);
- }
-
- TextView getName() {
- return(name);
- }
-
- ImageView getFlag() {
- return(flag);
- }
-
- void populateFrom(Country nation) {
- getName().setText(nation.name);
- getFlag().setImageResource(nation.flag);
- }
- }
+ static class CountryWrapper {
+ private TextView name=null;
+ private ImageView flag=null;
+
+ CountryWrapper(View row) {
+ name=(TextView)row.findViewById(R.id.name);
+ flag=(ImageView)row.findViewById(R.id.flag);
+ }
+
+ TextView getName() {
+ return(name);
+ }
+
+ ImageView getFlag() {
+ return(flag);
+ }
+
+ void populateFrom(Country nation) {
+ getName().setText(nation.name);
+ getFlag().setImageResource(nation.flag);
+ }
+ }
}
\ No newline at end of file
diff --git a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/Country.java b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/Country.java
index 608602c..2c421c1 100644
--- a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/Country.java
+++ b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/Country.java
@@ -1,27 +1,27 @@
/***
- Copyright (c) 2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.eu4you;
-
+
public class Country {
- int name;
- int flag;
- int url;
-
- Country(int name, int flag, int url) {
- this.name=name;
- this.flag=flag;
- this.url=url;
- }
+ int name;
+ int flag;
+ int url;
+
+ Country(int name, int flag, int url) {
+ this.name=name;
+ this.flag=flag;
+ this.url=url;
+ }
}
\ No newline at end of file
diff --git a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountryListener.java b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountryListener.java
index 74bcb4a..267e092 100644
--- a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountryListener.java
+++ b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/CountryListener.java
@@ -1,19 +1,19 @@
/***
- Copyright (c) 2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.eu4you;
public interface CountryListener {
- void onCountrySelected(Country c);
+ void onCountrySelected(Country c);
}
\ No newline at end of file
diff --git a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsActivity.java b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsActivity.java
index 5decd75..8b8c309 100644
--- a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsActivity.java
+++ b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsActivity.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.eu4you;
@@ -18,17 +18,17 @@
import android.support.v4.app.FragmentActivity;
public class DetailsActivity extends FragmentActivity {
- public static final String EXTRA_URL="com.commonsware.android.eu4you.EXTRA_URL";
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.details);
-
- DetailsFragment details
- =(DetailsFragment)getSupportFragmentManager()
- .findFragmentById(R.id.details);
-
- details.loadUrl(getIntent().getStringExtra(EXTRA_URL));
- }
+ public static final String EXTRA_URL="com.commonsware.android.eu4you.EXTRA_URL";
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.details);
+
+ DetailsFragment details
+ =(DetailsFragment)getSupportFragmentManager()
+ .findFragmentById(R.id.details);
+
+ details.loadUrl(getIntent().getStringExtra(EXTRA_URL));
+ }
}
\ No newline at end of file
diff --git a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsFragment.java b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsFragment.java
index 0dc1f21..b8bfbc7 100644
--- a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsFragment.java
+++ b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/DetailsFragment.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.eu4you;
@@ -22,13 +22,13 @@
import android.webkit.WebView;
public class DetailsFragment extends Fragment {
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return(inflater.inflate(R.layout.details_fragment, container, false));
- }
-
- public void loadUrl(String url) {
- ((WebView)(getView().findViewById(R.id.browser))).loadUrl(url);
- }
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return(inflater.inflate(R.layout.details_fragment, container, false));
+ }
+
+ public void loadUrl(String url) {
+ ((WebView)(getView().findViewById(R.id.browser))).loadUrl(url);
+ }
}
\ No newline at end of file
diff --git a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/EU4You.java b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/EU4You.java
index 8c8b4c2..ca31eef 100644
--- a/Fragments/EU4You_6/src/com/commonsware/android/eu4you/EU4You.java
+++ b/Fragments/EU4You_6/src/com/commonsware/android/eu4you/EU4You.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.eu4you;
@@ -22,47 +22,47 @@
import android.view.View;
public class EU4You extends FragmentActivity implements CountryListener {
- private boolean detailsInline=false;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- CountriesFragment countries
- =(CountriesFragment)getSupportFragmentManager()
- .findFragmentById(R.id.countries);
-
- countries.setCountryListener(this);
-
- Fragment f=getSupportFragmentManager().findFragmentById(R.id.details);
-
- detailsInline=(f!=null &&
- (getResources().getConfiguration().orientation==
- Configuration.ORIENTATION_LANDSCAPE));
-
- if (detailsInline) {
- countries.enablePersistentSelection();
- }
- else if (f!=null) {
- f.getView().setVisibility(View.GONE);
- }
- }
-
- @Override
- public void onCountrySelected(Country c) {
- String url=getString(c.url);
-
- if (detailsInline) {
- ((DetailsFragment)getSupportFragmentManager()
- .findFragmentById(R.id.details))
- .loadUrl(url);
- }
- else {
- Intent i=new Intent(this, DetailsActivity.class);
-
- i.putExtra(DetailsActivity.EXTRA_URL, url);
- startActivity(i);
- }
- }
+ private boolean detailsInline=false;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ CountriesFragment countries
+ =(CountriesFragment)getSupportFragmentManager()
+ .findFragmentById(R.id.countries);
+
+ countries.setCountryListener(this);
+
+ Fragment f=getSupportFragmentManager().findFragmentById(R.id.details);
+
+ detailsInline=(f!=null &&
+ (getResources().getConfiguration().orientation==
+ Configuration.ORIENTATION_LANDSCAPE));
+
+ if (detailsInline) {
+ countries.enablePersistentSelection();
+ }
+ else if (f!=null) {
+ f.getView().setVisibility(View.GONE);
+ }
+ }
+
+ @Override
+ public void onCountrySelected(Country c) {
+ String url=getString(c.url);
+
+ if (detailsInline) {
+ ((DetailsFragment)getSupportFragmentManager()
+ .findFragmentById(R.id.details))
+ .loadUrl(url);
+ }
+ else {
+ Intent i=new Intent(this, DetailsActivity.class);
+
+ i.putExtra(DetailsActivity.EXTRA_URL, url);
+ startActivity(i);
+ }
+ }
}
diff --git a/InputMethod/IMEDemo1/AndroidManifest.xml b/InputMethod/IMEDemo1/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/InputMethod/IMEDemo1/res/layout/main.xml b/InputMethod/IMEDemo1/res/layout/main.xml
old mode 100755
new mode 100644
index df7ef1a..b15771d
--- a/InputMethod/IMEDemo1/res/layout/main.xml
+++ b/InputMethod/IMEDemo1/res/layout/main.xml
@@ -1,48 +1,48 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:stretchColumns="1"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/InputMethod/IMEDemo1/res/values/strings.xml b/InputMethod/IMEDemo1/res/values/strings.xml
old mode 100755
new mode 100644
index 5cf126a..061c459
--- a/InputMethod/IMEDemo1/res/values/strings.xml
+++ b/InputMethod/IMEDemo1/res/values/strings.xml
@@ -1,4 +1,4 @@
- IMEDemo1
+ IMEDemo1
\ No newline at end of file
diff --git a/InputMethod/IMEDemo1/src/com/commonsware/android/imf/one/IMEDemo1.java b/InputMethod/IMEDemo1/src/com/commonsware/android/imf/one/IMEDemo1.java
old mode 100755
new mode 100644
index 8c7c416..ff9ef50
--- a/InputMethod/IMEDemo1/src/com/commonsware/android/imf/one/IMEDemo1.java
+++ b/InputMethod/IMEDemo1/src/com/commonsware/android/imf/one/IMEDemo1.java
@@ -5,11 +5,11 @@
public class IMEDemo1 extends Activity
{
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/InputMethod/IMEDemo2/AndroidManifest.xml b/InputMethod/IMEDemo2/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/InputMethod/IMEDemo2/res/layout/main.xml b/InputMethod/IMEDemo2/res/layout/main.xml
old mode 100755
new mode 100644
index f3cac39..1bb2822
--- a/InputMethod/IMEDemo2/res/layout/main.xml
+++ b/InputMethod/IMEDemo2/res/layout/main.xml
@@ -1,55 +1,55 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/InputMethod/IMEDemo2/res/values/strings.xml b/InputMethod/IMEDemo2/res/values/strings.xml
old mode 100755
new mode 100644
index e9eadd4..5c7aea1
--- a/InputMethod/IMEDemo2/res/values/strings.xml
+++ b/InputMethod/IMEDemo2/res/values/strings.xml
@@ -1,4 +1,4 @@
- IMEDemo2
+ IMEDemo2
\ No newline at end of file
diff --git a/InputMethod/IMEDemo2/src/com/commonsware/android/imf/two/IMEDemo2.java b/InputMethod/IMEDemo2/src/com/commonsware/android/imf/two/IMEDemo2.java
old mode 100755
new mode 100644
index 8cf1a52..ab87408
--- a/InputMethod/IMEDemo2/src/com/commonsware/android/imf/two/IMEDemo2.java
+++ b/InputMethod/IMEDemo2/src/com/commonsware/android/imf/two/IMEDemo2.java
@@ -5,11 +5,11 @@
public class IMEDemo2 extends Activity
{
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- }
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ }
}
\ No newline at end of file
diff --git a/Internet/Download/res/layout/main.xml b/Internet/Download/res/layout/main.xml
index 0e1c40f..a0d67dd 100644
--- a/Internet/Download/res/layout/main.xml
+++ b/Internet/Download/res/layout/main.xml
@@ -1,32 +1,32 @@
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
+
\ No newline at end of file
diff --git a/Internet/Download/res/values/strings.xml b/Internet/Download/res/values/strings.xml
index 946167f..6452794 100644
--- a/Internet/Download/res/values/strings.xml
+++ b/Internet/Download/res/values/strings.xml
@@ -1,4 +1,4 @@
- Download Demo
+ Download Demo
\ No newline at end of file
diff --git a/Internet/Download/src/com/commonsware/android/download/DownloadDemo.java b/Internet/Download/src/com/commonsware/android/download/DownloadDemo.java
index 8f472ba..701d63f 100644
--- a/Internet/Download/src/com/commonsware/android/download/DownloadDemo.java
+++ b/Internet/Download/src/com/commonsware/android/download/DownloadDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2010-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2010-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.download;
@@ -29,121 +29,121 @@
import android.widget.Toast;
public class DownloadDemo extends Activity {
- private DownloadManager mgr=null;
- private long lastDownload=-1L;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- mgr=(DownloadManager)getSystemService(DOWNLOAD_SERVICE);
- registerReceiver(onComplete,
- new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
- registerReceiver(onNotificationClick,
- new IntentFilter(DownloadManager.ACTION_NOTIFICATION_CLICKED));
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
-
- unregisterReceiver(onComplete);
- unregisterReceiver(onNotificationClick);
- }
-
- public void startDownload(View v) {
- Uri uri=Uri.parse("http://commonsware.com/misc/test.mp4");
-
- Environment
- .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
- .mkdirs();
-
- lastDownload=
- mgr.enqueue(new DownloadManager.Request(uri)
- .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI |
- DownloadManager.Request.NETWORK_MOBILE)
- .setAllowedOverRoaming(false)
- .setTitle("Demo")
- .setDescription("Something useful. No, really.")
- .setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
- "test.mp4"));
-
- v.setEnabled(false);
- findViewById(R.id.query).setEnabled(true);
- }
-
- public void queryStatus(View v) {
- Cursor c=mgr.query(new DownloadManager.Query().setFilterById(lastDownload));
-
- if (c==null) {
- Toast.makeText(this, "Download not found!", Toast.LENGTH_LONG).show();
- }
- else {
- c.moveToFirst();
-
- Log.d(getClass().getName(), "COLUMN_ID: "+
- c.getLong(c.getColumnIndex(DownloadManager.COLUMN_ID)));
- Log.d(getClass().getName(), "COLUMN_BYTES_DOWNLOADED_SO_FAR: "+
- c.getLong(c.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)));
- Log.d(getClass().getName(), "COLUMN_LAST_MODIFIED_TIMESTAMP: "+
- c.getLong(c.getColumnIndex(DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP)));
- Log.d(getClass().getName(), "COLUMN_LOCAL_URI: "+
- c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI)));
- Log.d(getClass().getName(), "COLUMN_STATUS: "+
- c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)));
- Log.d(getClass().getName(), "COLUMN_REASON: "+
- c.getInt(c.getColumnIndex(DownloadManager.COLUMN_REASON)));
-
- Toast.makeText(this, statusMessage(c), Toast.LENGTH_LONG).show();
- }
- }
-
- public void viewLog(View v) {
- startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
- }
-
- private String statusMessage(Cursor c) {
- String msg="???";
-
- switch(c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS))) {
- case DownloadManager.STATUS_FAILED:
- msg="Download failed!";
- break;
-
- case DownloadManager.STATUS_PAUSED:
- msg="Download paused!";
- break;
-
- case DownloadManager.STATUS_PENDING:
- msg="Download pending!";
- break;
-
- case DownloadManager.STATUS_RUNNING:
- msg="Download in progress!";
- break;
-
- case DownloadManager.STATUS_SUCCESSFUL:
- msg="Download complete!";
- break;
-
- default:
- msg="Download is nowhere in sight";
- break;
- }
-
- return(msg);
- }
-
- BroadcastReceiver onComplete=new BroadcastReceiver() {
- public void onReceive(Context ctxt, Intent intent) {
- findViewById(R.id.start).setEnabled(true);
- }
- };
-
- BroadcastReceiver onNotificationClick=new BroadcastReceiver() {
- public void onReceive(Context ctxt, Intent intent) {
- Toast.makeText(ctxt, "Ummmm...hi!", Toast.LENGTH_LONG).show();
- }
- };
+ private DownloadManager mgr=null;
+ private long lastDownload=-1L;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ mgr=(DownloadManager)getSystemService(DOWNLOAD_SERVICE);
+ registerReceiver(onComplete,
+ new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
+ registerReceiver(onNotificationClick,
+ new IntentFilter(DownloadManager.ACTION_NOTIFICATION_CLICKED));
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+
+ unregisterReceiver(onComplete);
+ unregisterReceiver(onNotificationClick);
+ }
+
+ public void startDownload(View v) {
+ Uri uri=Uri.parse("http://commonsware.com/misc/test.mp4");
+
+ Environment
+ .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
+ .mkdirs();
+
+ lastDownload=
+ mgr.enqueue(new DownloadManager.Request(uri)
+ .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI |
+ DownloadManager.Request.NETWORK_MOBILE)
+ .setAllowedOverRoaming(false)
+ .setTitle("Demo")
+ .setDescription("Something useful. No, really.")
+ .setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
+ "test.mp4"));
+
+ v.setEnabled(false);
+ findViewById(R.id.query).setEnabled(true);
+ }
+
+ public void queryStatus(View v) {
+ Cursor c=mgr.query(new DownloadManager.Query().setFilterById(lastDownload));
+
+ if (c==null) {
+ Toast.makeText(this, "Download not found!", Toast.LENGTH_LONG).show();
+ }
+ else {
+ c.moveToFirst();
+
+ Log.d(getClass().getName(), "COLUMN_ID: "+
+ c.getLong(c.getColumnIndex(DownloadManager.COLUMN_ID)));
+ Log.d(getClass().getName(), "COLUMN_BYTES_DOWNLOADED_SO_FAR: "+
+ c.getLong(c.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)));
+ Log.d(getClass().getName(), "COLUMN_LAST_MODIFIED_TIMESTAMP: "+
+ c.getLong(c.getColumnIndex(DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP)));
+ Log.d(getClass().getName(), "COLUMN_LOCAL_URI: "+
+ c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI)));
+ Log.d(getClass().getName(), "COLUMN_STATUS: "+
+ c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)));
+ Log.d(getClass().getName(), "COLUMN_REASON: "+
+ c.getInt(c.getColumnIndex(DownloadManager.COLUMN_REASON)));
+
+ Toast.makeText(this, statusMessage(c), Toast.LENGTH_LONG).show();
+ }
+ }
+
+ public void viewLog(View v) {
+ startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
+ }
+
+ private String statusMessage(Cursor c) {
+ String msg="???";
+
+ switch(c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS))) {
+ case DownloadManager.STATUS_FAILED:
+ msg="Download failed!";
+ break;
+
+ case DownloadManager.STATUS_PAUSED:
+ msg="Download paused!";
+ break;
+
+ case DownloadManager.STATUS_PENDING:
+ msg="Download pending!";
+ break;
+
+ case DownloadManager.STATUS_RUNNING:
+ msg="Download in progress!";
+ break;
+
+ case DownloadManager.STATUS_SUCCESSFUL:
+ msg="Download complete!";
+ break;
+
+ default:
+ msg="Download is nowhere in sight";
+ break;
+ }
+
+ return(msg);
+ }
+
+ BroadcastReceiver onComplete=new BroadcastReceiver() {
+ public void onReceive(Context ctxt, Intent intent) {
+ findViewById(R.id.start).setEnabled(true);
+ }
+ };
+
+ BroadcastReceiver onNotificationClick=new BroadcastReceiver() {
+ public void onReceive(Context ctxt, Intent intent) {
+ Toast.makeText(ctxt, "Ummmm...hi!", Toast.LENGTH_LONG).show();
+ }
+ };
}
diff --git a/Internet/DownloadStrict/res/layout/main.xml b/Internet/DownloadStrict/res/layout/main.xml
index 0e1c40f..a0d67dd 100644
--- a/Internet/DownloadStrict/res/layout/main.xml
+++ b/Internet/DownloadStrict/res/layout/main.xml
@@ -1,32 +1,32 @@
-
-
-
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+
+
+
\ No newline at end of file
diff --git a/Internet/DownloadStrict/res/values/strings.xml b/Internet/DownloadStrict/res/values/strings.xml
index 946167f..6452794 100644
--- a/Internet/DownloadStrict/res/values/strings.xml
+++ b/Internet/DownloadStrict/res/values/strings.xml
@@ -1,4 +1,4 @@
- Download Demo
+ Download Demo
\ No newline at end of file
diff --git a/Internet/DownloadStrict/src/com/commonsware/android/download/DownloadDemo.java b/Internet/DownloadStrict/src/com/commonsware/android/download/DownloadDemo.java
index 49fac79..000f276 100644
--- a/Internet/DownloadStrict/src/com/commonsware/android/download/DownloadDemo.java
+++ b/Internet/DownloadStrict/src/com/commonsware/android/download/DownloadDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2010-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2010-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.download;
@@ -30,126 +30,126 @@
import android.widget.Toast;
public class DownloadDemo extends Activity {
- private DownloadManager mgr=null;
- private long lastDownload=-1L;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
- .detectAll()
- .penaltyLog()
- .build());
-
- mgr=(DownloadManager)getSystemService(DOWNLOAD_SERVICE);
- registerReceiver(onComplete,
- new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
- registerReceiver(onNotificationClick,
- new IntentFilter(DownloadManager.ACTION_NOTIFICATION_CLICKED));
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
-
- unregisterReceiver(onComplete);
- unregisterReceiver(onNotificationClick);
- }
-
- public void startDownload(View v) {
- Uri uri=Uri.parse("http://commonsware.com/misc/test.mp4");
-
- Environment
- .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
- .mkdirs();
-
- lastDownload=
- mgr.enqueue(new DownloadManager.Request(uri)
- .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI |
- DownloadManager.Request.NETWORK_MOBILE)
- .setAllowedOverRoaming(false)
- .setTitle("Demo")
- .setDescription("Something useful. No, really.")
- .setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
- "test.mp4"));
-
- v.setEnabled(false);
- findViewById(R.id.query).setEnabled(true);
- }
-
- public void queryStatus(View v) {
- Cursor c=mgr.query(new DownloadManager.Query().setFilterById(lastDownload));
-
- if (c==null) {
- Toast.makeText(this, "Download not found!", Toast.LENGTH_LONG).show();
- }
- else {
- c.moveToFirst();
-
- Log.d(getClass().getName(), "COLUMN_ID: "+
- c.getLong(c.getColumnIndex(DownloadManager.COLUMN_ID)));
- Log.d(getClass().getName(), "COLUMN_BYTES_DOWNLOADED_SO_FAR: "+
- c.getLong(c.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)));
- Log.d(getClass().getName(), "COLUMN_LAST_MODIFIED_TIMESTAMP: "+
- c.getLong(c.getColumnIndex(DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP)));
- Log.d(getClass().getName(), "COLUMN_LOCAL_URI: "+
- c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI)));
- Log.d(getClass().getName(), "COLUMN_STATUS: "+
- c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)));
- Log.d(getClass().getName(), "COLUMN_REASON: "+
- c.getInt(c.getColumnIndex(DownloadManager.COLUMN_REASON)));
-
- Toast.makeText(this, statusMessage(c), Toast.LENGTH_LONG).show();
- }
- }
-
- public void viewLog(View v) {
- startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
- }
-
- private String statusMessage(Cursor c) {
- String msg="???";
-
- switch(c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS))) {
- case DownloadManager.STATUS_FAILED:
- msg="Download failed!";
- break;
-
- case DownloadManager.STATUS_PAUSED:
- msg="Download paused!";
- break;
-
- case DownloadManager.STATUS_PENDING:
- msg="Download pending!";
- break;
-
- case DownloadManager.STATUS_RUNNING:
- msg="Download in progress!";
- break;
-
- case DownloadManager.STATUS_SUCCESSFUL:
- msg="Download complete!";
- break;
-
- default:
- msg="Download is nowhere in sight";
- break;
- }
-
- return(msg);
- }
-
- BroadcastReceiver onComplete=new BroadcastReceiver() {
- public void onReceive(Context ctxt, Intent intent) {
- findViewById(R.id.start).setEnabled(true);
- }
- };
-
- BroadcastReceiver onNotificationClick=new BroadcastReceiver() {
- public void onReceive(Context ctxt, Intent intent) {
- Toast.makeText(ctxt, "Ummmm...hi!", Toast.LENGTH_LONG).show();
- }
- };
+ private DownloadManager mgr=null;
+ private long lastDownload=-1L;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
+ .detectAll()
+ .penaltyLog()
+ .build());
+
+ mgr=(DownloadManager)getSystemService(DOWNLOAD_SERVICE);
+ registerReceiver(onComplete,
+ new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
+ registerReceiver(onNotificationClick,
+ new IntentFilter(DownloadManager.ACTION_NOTIFICATION_CLICKED));
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+
+ unregisterReceiver(onComplete);
+ unregisterReceiver(onNotificationClick);
+ }
+
+ public void startDownload(View v) {
+ Uri uri=Uri.parse("http://commonsware.com/misc/test.mp4");
+
+ Environment
+ .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
+ .mkdirs();
+
+ lastDownload=
+ mgr.enqueue(new DownloadManager.Request(uri)
+ .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI |
+ DownloadManager.Request.NETWORK_MOBILE)
+ .setAllowedOverRoaming(false)
+ .setTitle("Demo")
+ .setDescription("Something useful. No, really.")
+ .setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
+ "test.mp4"));
+
+ v.setEnabled(false);
+ findViewById(R.id.query).setEnabled(true);
+ }
+
+ public void queryStatus(View v) {
+ Cursor c=mgr.query(new DownloadManager.Query().setFilterById(lastDownload));
+
+ if (c==null) {
+ Toast.makeText(this, "Download not found!", Toast.LENGTH_LONG).show();
+ }
+ else {
+ c.moveToFirst();
+
+ Log.d(getClass().getName(), "COLUMN_ID: "+
+ c.getLong(c.getColumnIndex(DownloadManager.COLUMN_ID)));
+ Log.d(getClass().getName(), "COLUMN_BYTES_DOWNLOADED_SO_FAR: "+
+ c.getLong(c.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR)));
+ Log.d(getClass().getName(), "COLUMN_LAST_MODIFIED_TIMESTAMP: "+
+ c.getLong(c.getColumnIndex(DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP)));
+ Log.d(getClass().getName(), "COLUMN_LOCAL_URI: "+
+ c.getString(c.getColumnIndex(DownloadManager.COLUMN_LOCAL_URI)));
+ Log.d(getClass().getName(), "COLUMN_STATUS: "+
+ c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS)));
+ Log.d(getClass().getName(), "COLUMN_REASON: "+
+ c.getInt(c.getColumnIndex(DownloadManager.COLUMN_REASON)));
+
+ Toast.makeText(this, statusMessage(c), Toast.LENGTH_LONG).show();
+ }
+ }
+
+ public void viewLog(View v) {
+ startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
+ }
+
+ private String statusMessage(Cursor c) {
+ String msg="???";
+
+ switch(c.getInt(c.getColumnIndex(DownloadManager.COLUMN_STATUS))) {
+ case DownloadManager.STATUS_FAILED:
+ msg="Download failed!";
+ break;
+
+ case DownloadManager.STATUS_PAUSED:
+ msg="Download paused!";
+ break;
+
+ case DownloadManager.STATUS_PENDING:
+ msg="Download pending!";
+ break;
+
+ case DownloadManager.STATUS_RUNNING:
+ msg="Download in progress!";
+ break;
+
+ case DownloadManager.STATUS_SUCCESSFUL:
+ msg="Download complete!";
+ break;
+
+ default:
+ msg="Download is nowhere in sight";
+ break;
+ }
+
+ return(msg);
+ }
+
+ BroadcastReceiver onComplete=new BroadcastReceiver() {
+ public void onReceive(Context ctxt, Intent intent) {
+ findViewById(R.id.start).setEnabled(true);
+ }
+ };
+
+ BroadcastReceiver onNotificationClick=new BroadcastReceiver() {
+ public void onReceive(Context ctxt, Intent intent) {
+ Toast.makeText(ctxt, "Ummmm...hi!", Toast.LENGTH_LONG).show();
+ }
+ };
}
diff --git a/Internet/Weather/AndroidManifest.xml b/Internet/Weather/AndroidManifest.xml
old mode 100755
new mode 100644
diff --git a/Internet/Weather/res/layout/main.xml b/Internet/Weather/res/layout/main.xml
old mode 100755
new mode 100644
index 456c258..05a7e16
--- a/Internet/Weather/res/layout/main.xml
+++ b/Internet/Weather/res/layout/main.xml
@@ -1,6 +1,6 @@
\ No newline at end of file
+ android:id="@+id/webkit"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ />
\ No newline at end of file
diff --git a/Internet/Weather/res/values/strings.xml b/Internet/Weather/res/values/strings.xml
old mode 100755
new mode 100644
index b58f053..97baff0
--- a/Internet/Weather/res/values/strings.xml
+++ b/Internet/Weather/res/values/strings.xml
@@ -1,5 +1,5 @@
- WeatherDemo
- http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?&lat=%1$f&lon=%2$f&product=time-series&begin=2004-01-01T00:00:00&end=2011-12-03T00:00:00&temp=temp&icons=icons
+ WeatherDemo
+ http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?&lat=%1$f&lon=%2$f&product=time-series&begin=2004-01-01T00:00:00&end=2011-12-03T00:00:00&temp=temp&icons=icons
\ No newline at end of file
diff --git a/Internet/Weather/src/com/commonsware/android/internet/WeatherDemo.java b/Internet/Weather/src/com/commonsware/android/internet/WeatherDemo.java
old mode 100755
new mode 100644
index 04d97da..df74751
--- a/Internet/Weather/src/com/commonsware/android/internet/WeatherDemo.java
+++ b/Internet/Weather/src/com/commonsware/android/internet/WeatherDemo.java
@@ -1,15 +1,15 @@
/***
- Copyright (c) 2008-2011 CommonsWare, LLC
-
- Licensed under the Apache License, Version 2.0 (the "License"); you may
- not use this file except in compliance with the License. You may obtain
- a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Copyright (c) 2008-2011 CommonsWare, LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may obtain
+ a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
*/
package com.commonsware.android.internet;
@@ -37,171 +37,171 @@
import android.widget.Toast;
public class WeatherDemo extends Activity {
- private LocationManager mgr=null;
- private String format;
- private WebView browser;
- private HttpClient client;
- private List forecasts=new ArrayList();
-
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
-
- mgr=(LocationManager)getSystemService(LOCATION_SERVICE);
- format=getString(R.string.url);
- browser=(WebView)findViewById(R.id.webkit);
- client=new DefaultHttpClient();
- }
-
- @Override
- public void onResume() {
- super.onResume();
-
- mgr.requestLocationUpdates(LocationManager.GPS_PROVIDER,
- 3600000, 1000,
- onLocationChange);
- }
-
- @Override
- public void onPause() {
- super.onPause();
-
- mgr.removeUpdates(onLocationChange);
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
-
- client.getConnectionManager().shutdown();
- }
-
- private void updateForecast(Location loc) {
- String url=String.format(format, loc.getLatitude(),
- loc.getLongitude());
- HttpGet getMethod=new HttpGet(url);
-
- try {
- ResponseHandler responseHandler=new BasicResponseHandler();
- String responseBody=client.execute(getMethod,
- responseHandler);
- buildForecasts(responseBody);
-
- String page=generatePage();
-
- browser.loadDataWithBaseURL(null, page, "text/html",
- "UTF-8", null);
- }
- catch (Throwable t) {
- android.util.Log.e("WeatherDemo", "Exception fetching data", t);
- Toast
- .makeText(this, "Request failed: "+t.toString(), Toast.LENGTH_LONG)
- .show();
- }
- }
-
- void buildForecasts(String raw) throws Exception {
- DocumentBuilder builder=DocumentBuilderFactory
- .newInstance()
- .newDocumentBuilder();
- Document doc=builder.parse(new InputSource(new StringReader(raw)));
- NodeList times=doc.getElementsByTagName("start-valid-time");
-
- for (int i=0;i