diff --git a/CirclesFragmentExample/.classpath b/CirclesFragmentExample/.classpath deleted file mode 100644 index a4f1e40..0000000 --- a/CirclesFragmentExample/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/CirclesFragmentExample/.project b/CirclesFragmentExample/.project deleted file mode 100644 index 7b63d2a..0000000 --- a/CirclesFragmentExample/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - CirclesFragmentExample - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/CirclesFragmentExample/AndroidManifest.xml b/CirclesFragmentExample/AndroidManifest.xml deleted file mode 100644 index abfb2c3..0000000 --- a/CirclesFragmentExample/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/ic_launcher-web.png b/CirclesFragmentExample/ic_launcher-web.png deleted file mode 100644 index 1315b31..0000000 Binary files a/CirclesFragmentExample/ic_launcher-web.png and /dev/null differ diff --git a/CirclesFragmentExample/libs/android-support-v4.jar b/CirclesFragmentExample/libs/android-support-v4.jar deleted file mode 100644 index 6080877..0000000 Binary files a/CirclesFragmentExample/libs/android-support-v4.jar and /dev/null differ diff --git a/CirclesFragmentExample/proguard-project.txt b/CirclesFragmentExample/proguard-project.txt deleted file mode 100644 index f2fe155..0000000 --- a/CirclesFragmentExample/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/CirclesFragmentExample/project.properties b/CirclesFragmentExample/project.properties deleted file mode 100644 index a3ee5ab..0000000 --- a/CirclesFragmentExample/project.properties +++ /dev/null @@ -1,14 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-17 diff --git a/CirclesFragmentExample/res/drawable-hdpi/ic_launcher.png b/CirclesFragmentExample/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 0688095..0000000 Binary files a/CirclesFragmentExample/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/CirclesFragmentExample/res/drawable-ldpi/ic_launcher.png b/CirclesFragmentExample/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 4ebf3fb..0000000 Binary files a/CirclesFragmentExample/res/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/CirclesFragmentExample/res/drawable-mdpi/ic_launcher.png b/CirclesFragmentExample/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index e309d3d..0000000 Binary files a/CirclesFragmentExample/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/CirclesFragmentExample/res/drawable-xhdpi/ic_launcher.png b/CirclesFragmentExample/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index b6c7352..0000000 Binary files a/CirclesFragmentExample/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/CirclesFragmentExample/res/drawable/green_circle.xml b/CirclesFragmentExample/res/drawable/green_circle.xml deleted file mode 100644 index 1e59bb0..0000000 --- a/CirclesFragmentExample/res/drawable/green_circle.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/drawable/orange_circle.xml b/CirclesFragmentExample/res/drawable/orange_circle.xml deleted file mode 100644 index c723799..0000000 --- a/CirclesFragmentExample/res/drawable/orange_circle.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/drawable/rainbow_circle.xml b/CirclesFragmentExample/res/drawable/rainbow_circle.xml deleted file mode 100644 index 1cc5dd9..0000000 --- a/CirclesFragmentExample/res/drawable/rainbow_circle.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/drawable/red_circle.xml b/CirclesFragmentExample/res/drawable/red_circle.xml deleted file mode 100644 index 4febc08..0000000 --- a/CirclesFragmentExample/res/drawable/red_circle.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/layout/activity_circle_detail.xml b/CirclesFragmentExample/res/layout/activity_circle_detail.xml deleted file mode 100644 index d0cd7b6..0000000 --- a/CirclesFragmentExample/res/layout/activity_circle_detail.xml +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/CirclesFragmentExample/res/layout/activity_circle_list.xml b/CirclesFragmentExample/res/layout/activity_circle_list.xml deleted file mode 100644 index 79778ef..0000000 --- a/CirclesFragmentExample/res/layout/activity_circle_list.xml +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/CirclesFragmentExample/res/layout/activity_circle_twopane.xml b/CirclesFragmentExample/res/layout/activity_circle_twopane.xml deleted file mode 100644 index 06ab1fe..0000000 --- a/CirclesFragmentExample/res/layout/activity_circle_twopane.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/layout/fragment_circle_detail.xml b/CirclesFragmentExample/res/layout/fragment_circle_detail.xml deleted file mode 100644 index 2460a38..0000000 --- a/CirclesFragmentExample/res/layout/fragment_circle_detail.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/values-v11/styles.xml b/CirclesFragmentExample/res/values-v11/styles.xml deleted file mode 100644 index 9643ba1..0000000 --- a/CirclesFragmentExample/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/values-v14/styles.xml b/CirclesFragmentExample/res/values-v14/styles.xml deleted file mode 100644 index 50251a1..0000000 --- a/CirclesFragmentExample/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/values-w850dp/refs.xml b/CirclesFragmentExample/res/values-w850dp/refs.xml deleted file mode 100644 index b79f741..0000000 --- a/CirclesFragmentExample/res/values-w850dp/refs.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - @layout/activity_circle_twopane - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/values-xlarge-land/refs.xml b/CirclesFragmentExample/res/values-xlarge-land/refs.xml deleted file mode 100644 index b79f741..0000000 --- a/CirclesFragmentExample/res/values-xlarge-land/refs.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - @layout/activity_circle_twopane - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/values/strings.xml b/CirclesFragmentExample/res/values/strings.xml deleted file mode 100644 index 6b957e8..0000000 --- a/CirclesFragmentExample/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - Circles Fragment Example - Circle Detail - - \ No newline at end of file diff --git a/CirclesFragmentExample/res/values/styles.xml b/CirclesFragmentExample/res/values/styles.xml deleted file mode 100644 index 79a39af..0000000 --- a/CirclesFragmentExample/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleDetailActivity.java b/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleDetailActivity.java deleted file mode 100644 index 5963235..0000000 --- a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleDetailActivity.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.mamlambo.circlesfragmentexample; - -import android.os.Bundle; -import android.support.v4.app.FragmentActivity; - -/** - * An activity representing a single Circle detail screen. This activity is only - * used on handset devices. On tablet-size devices, item details are presented - * side-by-side with a list of items in a {@link CircleListActivity}. - *

- * This activity is mostly just a 'shell' activity containing nothing more than - * a {@link CircleDetailFragment}. - */ -public class CircleDetailActivity extends FragmentActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_circle_detail); - - // Not available in legacy apps - // Show the Up button in the action bar. - //getActionBar().setDisplayHomeAsUpEnabled(true); - - // savedInstanceState is non-null when there is fragment state - // saved from previous configurations of this activity - // (e.g. when rotating the screen from portrait to landscape). - // In this case, the fragment will automatically be re-added - // to its container so we don't need to manually add it. - // For more information, see the Fragments API guide at: - // - // http://developer.android.com/guide/components/fragments.html - // - if (savedInstanceState == null) { - // Create the detail fragment and add it to the activity - // using a fragment transaction. - Bundle arguments = new Bundle(); - arguments.putString(CircleDetailFragment.ARG_ITEM_ID, getIntent() - .getStringExtra(CircleDetailFragment.ARG_ITEM_ID)); - CircleDetailFragment fragment = new CircleDetailFragment(); - fragment.setArguments(arguments); - getSupportFragmentManager().beginTransaction() - .add(R.id.circle_detail_container, fragment).commit(); - } - } -/* - *not available in legacy apps - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - // This ID represents the Home or Up button. In the case of this - // activity, the Up button is shown. Use NavUtils to allow users - // to navigate up one level in the application structure. For - // more details, see the Navigation pattern on Android Design: - // - // http://developer.android.com/design/patterns/navigation.html#up-vs-back - // - NavUtils.navigateUpTo(this, new Intent(this, - CircleListActivity.class)); - return true; - } - return super.onOptionsItemSelected(item); - }*/ -} diff --git a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleDetailFragment.java b/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleDetailFragment.java deleted file mode 100644 index e418e57..0000000 --- a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleDetailFragment.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.mamlambo.circlesfragmentexample; - -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.TextView; - -import com.mamlambo.circlesfragmentexample.dummy.DummyContent; - -/** - * A fragment representing a single Circle detail screen. This fragment is - * either contained in a {@link CircleListActivity} in two-pane mode (on - * tablets) or a {@link CircleDetailActivity} on handsets. - */ -public class CircleDetailFragment extends Fragment { - /** - * The fragment argument representing the item ID that this fragment - * represents. - */ - public static final String ARG_ITEM_ID = "item_id"; - - /** - * The dummy content this fragment is presenting. - */ - private DummyContent.DummyItem mItem; - - /** - * Mandatory empty constructor for the fragment manager to instantiate the - * fragment (e.g. upon screen orientation changes). - */ - public CircleDetailFragment() { - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - if (getArguments().containsKey(ARG_ITEM_ID)) { - // Load the dummy content specified by the fragment - // arguments. In a real-world scenario, use a Loader - // to load content from a content provider. - mItem = DummyContent.ITEM_MAP.get(getArguments().getString( - ARG_ITEM_ID)); - } - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_circle_detail, - container, false); - - // Show the dummy content as text in a TextView. - if (mItem != null) { - ((TextView) rootView.findViewById(R.id.circle_detail)) - .setText(mItem.content); - ((ImageView) rootView.findViewById(R.id.circle_view)) - .setImageResource(mItem.resourceId); - } - - return rootView; - } -} diff --git a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleListActivity.java b/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleListActivity.java deleted file mode 100644 index 2e37cf5..0000000 --- a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleListActivity.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.mamlambo.circlesfragmentexample; - -import android.content.Intent; -import android.os.Bundle; -import android.support.v4.app.FragmentActivity; - -/** - * An activity representing a list of Circles. This activity has different - * presentations for handset and tablet-size devices. On handsets, the activity - * presents a list of items, which when touched, lead to a - * {@link CircleDetailActivity} representing item details. On tablets, the - * activity presents the list of items and item details side-by-side using two - * vertical panes. - *

- * The activity makes heavy use of fragments. The list of items is a - * {@link CircleListFragment} and the item details (if present) is a - * {@link CircleDetailFragment}. - *

- * This activity also implements the required - * {@link CircleListFragment.Callbacks} interface to listen for item selections. - */ -public class CircleListActivity extends FragmentActivity implements - CircleListFragment.Callbacks { - - /** - * Whether or not the activity is in two-pane mode, i.e. running on a tablet - * device. - */ - private boolean mTwoPane; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_circle_list); - - if (findViewById(R.id.circle_detail_container) != null) { - // The detail container view will be present only in the - // large-screen layouts (res/values-large and - // res/values-sw600dp). If this view is present, then the - // activity should be in two-pane mode. - mTwoPane = true; - - // In two-pane mode, list items should be given the - // 'activated' state when touched. - ((CircleListFragment) getSupportFragmentManager().findFragmentById( - R.id.circle_list)).setActivateOnItemClick(true); - } - - // TODO: If exposing deep links into your app, handle intents here. - } - - /** - * Callback method from {@link CircleListFragment.Callbacks} indicating that - * the item with the given ID was selected. - */ - @Override - public void onItemSelected(String id) { - if (mTwoPane) { - // In two-pane mode, show the detail view in this activity by - // adding or replacing the detail fragment using a - // fragment transaction. - Bundle arguments = new Bundle(); - arguments.putString(CircleDetailFragment.ARG_ITEM_ID, id); - CircleDetailFragment fragment = new CircleDetailFragment(); - fragment.setArguments(arguments); - getSupportFragmentManager().beginTransaction() - .replace(R.id.circle_detail_container, fragment).commit(); - - } else { - // In single-pane mode, simply start the detail activity - // for the selected item ID. - Intent detailIntent = new Intent(this, CircleDetailActivity.class); - detailIntent.putExtra(CircleDetailFragment.ARG_ITEM_ID, id); - startActivity(detailIntent); - } - } -} diff --git a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleListFragment.java b/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleListFragment.java deleted file mode 100644 index 9a249d5..0000000 --- a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/CircleListFragment.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.mamlambo.circlesfragmentexample; - -import android.app.Activity; -import android.os.Bundle; -import android.support.v4.app.ListFragment; -import android.view.View; -import android.widget.ArrayAdapter; -import android.widget.ListView; - -import com.mamlambo.circlesfragmentexample.dummy.DummyContent; - -/** - * A list fragment representing a list of Circles. This fragment also supports - * tablet devices by allowing list items to be given an 'activated' state upon - * selection. This helps indicate which item is currently being viewed in a - * {@link CircleDetailFragment}. - *

- * Activities containing this fragment MUST implement the {@link Callbacks} - * interface. - */ -public class CircleListFragment extends ListFragment { - - /** - * The serialization (saved instance state) Bundle key representing the - * activated item position. Only used on tablets. - */ - private static final String STATE_ACTIVATED_POSITION = "activated_position"; - - /** - * The fragment's current callback object, which is notified of list item - * clicks. - */ - private Callbacks mCallbacks = sDummyCallbacks; - - /** - * The current activated item position. Only used on tablets. - */ - private int mActivatedPosition = ListView.INVALID_POSITION; - - /** - * A callback interface that all activities containing this fragment must - * implement. This mechanism allows activities to be notified of item - * selections. - */ - public interface Callbacks { - /** - * Callback for when an item has been selected. - */ - public void onItemSelected(String id); - } - - /** - * A dummy implementation of the {@link Callbacks} interface that does - * nothing. Used only when this fragment is not attached to an activity. - */ - private static Callbacks sDummyCallbacks = new Callbacks() { - @Override - public void onItemSelected(String id) { - } - }; - - /** - * Mandatory empty constructor for the fragment manager to instantiate the - * fragment (e.g. upon screen orientation changes). - */ - public CircleListFragment() { - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // TODO: replace with a real list adapter. - setListAdapter(new ArrayAdapter(getActivity(), - android.R.layout.simple_list_item_activated_1, - android.R.id.text1, DummyContent.ITEMS)); - } - - @Override - public void onViewCreated(View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - // Restore the previously serialized activated item position. - if (savedInstanceState != null - && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) { - setActivatedPosition(savedInstanceState - .getInt(STATE_ACTIVATED_POSITION)); - } - } - - @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - - // Activities containing this fragment must implement its callbacks. - if (!(activity instanceof Callbacks)) { - throw new IllegalStateException( - "Activity must implement fragment's callbacks."); - } - - mCallbacks = (Callbacks) activity; - } - - @Override - public void onDetach() { - super.onDetach(); - - // Reset the active callbacks interface to the dummy implementation. - mCallbacks = sDummyCallbacks; - } - - @Override - public void onListItemClick(ListView listView, View view, int position, - long id) { - super.onListItemClick(listView, view, position, id); - - // Notify the active callbacks interface (the activity, if the - // fragment is attached to one) that an item has been selected. - mCallbacks.onItemSelected(DummyContent.ITEMS.get(position).id); - } - - @Override - public void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - if (mActivatedPosition != ListView.INVALID_POSITION) { - // Serialize and persist the activated item position. - outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition); - } - } - - /** - * Turns on activate-on-click mode. When this mode is on, list items will be - * given the 'activated' state when touched. - */ - public void setActivateOnItemClick(boolean activateOnItemClick) { - // When setting CHOICE_MODE_SINGLE, ListView will automatically - // give items the 'activated' state when touched. - getListView().setChoiceMode( - activateOnItemClick ? ListView.CHOICE_MODE_SINGLE - : ListView.CHOICE_MODE_NONE); - } - - private void setActivatedPosition(int position) { - if (position == ListView.INVALID_POSITION) { - getListView().setItemChecked(mActivatedPosition, false); - } else { - getListView().setItemChecked(position, true); - } - - mActivatedPosition = position; - } -} diff --git a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/dummy/DummyContent.java b/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/dummy/DummyContent.java deleted file mode 100644 index 9158942..0000000 --- a/CirclesFragmentExample/src/com/mamlambo/circlesfragmentexample/dummy/DummyContent.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.mamlambo.circlesfragmentexample.dummy; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.mamlambo.circlesfragmentexample.R; - -/** - * Helper class for providing sample content for user interfaces created by - * Android template wizards. - *

- * TODO: Replace all uses of this class before publishing your app. - */ -public class DummyContent { - - /** - * An array of sample (dummy) items. - */ - public static List ITEMS = new ArrayList(); - - /** - * A map of sample (dummy) items, by ID. - */ - public static Map ITEM_MAP = new HashMap(); - - static { - // Add 3 sample items. - addItem(new DummyItem("1", "Red Circle", R.drawable.red_circle)); - addItem(new DummyItem("2", "Orange Circle", R.drawable.orange_circle)); - addItem(new DummyItem("3", "Green Circle", R.drawable.green_circle)); - addItem(new DummyItem("4", "Colorful Circle", R.drawable.rainbow_circle)); - } - - private static void addItem(DummyItem item) { - ITEMS.add(item); - ITEM_MAP.put(item.id, item); - } - - /** - * A dummy item representing a piece of content. - */ - public static class DummyItem { - public String id; - public String content; - public int resourceId; - - public DummyItem(String id, String content, int resourceId) { - this.id = id; - this.content = content; - this.resourceId = resourceId; - } - - @Override - public String toString() { - return content; - } - } -} diff --git a/EasyGridLayout/.classpath b/EasyGridLayout/.classpath deleted file mode 100644 index acafbd3..0000000 --- a/EasyGridLayout/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/EasyGridLayout/.project b/EasyGridLayout/.project deleted file mode 100644 index db476ee..0000000 --- a/EasyGridLayout/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - EasyGridLayout Open - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/EasyGridLayout/AndroidManifest.xml b/EasyGridLayout/AndroidManifest.xml deleted file mode 100644 index 1baefd4..0000000 --- a/EasyGridLayout/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EasyGridLayout/proguard.cfg b/EasyGridLayout/proguard.cfg deleted file mode 100644 index b1cdf17..0000000 --- a/EasyGridLayout/proguard.cfg +++ /dev/null @@ -1,40 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/EasyGridLayout/project.properties b/EasyGridLayout/project.properties deleted file mode 100644 index 730e911..0000000 --- a/EasyGridLayout/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-14 diff --git a/EasyGridLayout/res/drawable-hdpi/ic_launcher.png b/EasyGridLayout/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 8074c4c..0000000 Binary files a/EasyGridLayout/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/EasyGridLayout/res/drawable-ldpi/ic_launcher.png b/EasyGridLayout/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 1095584..0000000 Binary files a/EasyGridLayout/res/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/EasyGridLayout/res/drawable-mdpi/ic_launcher.png b/EasyGridLayout/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index a07c69f..0000000 Binary files a/EasyGridLayout/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/EasyGridLayout/res/drawable/filled_box.xml b/EasyGridLayout/res/drawable/filled_box.xml deleted file mode 100644 index 976bcc9..0000000 --- a/EasyGridLayout/res/drawable/filled_box.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EasyGridLayout/res/layout/main.xml b/EasyGridLayout/res/layout/main.xml deleted file mode 100644 index 7005a85..0000000 --- a/EasyGridLayout/res/layout/main.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EasyGridLayout/res/layout/number_pad.xml b/EasyGridLayout/res/layout/number_pad.xml deleted file mode 100644 index 9db1f25..0000000 --- a/EasyGridLayout/res/layout/number_pad.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/SimpleFocus/res/layout/main_nospecialfocus.xml b/SimpleFocus/res/layout/main_nospecialfocus.xml deleted file mode 100644 index 6883812..0000000 --- a/SimpleFocus/res/layout/main_nospecialfocus.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/SimpleFocus/res/values/strings.xml b/SimpleFocus/res/values/strings.xml deleted file mode 100644 index 61ffe7e..0000000 --- a/SimpleFocus/res/values/strings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - Hello World, SimpleFocusActivity! - SimpleFocus - diff --git a/SimpleFocus/res/values/styles.xml b/SimpleFocus/res/values/styles.xml deleted file mode 100644 index 1808292..0000000 --- a/SimpleFocus/res/values/styles.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - diff --git a/SimpleFocus/src/com/mamlambo/simplefocus/SimpleFocusActivity.java b/SimpleFocus/src/com/mamlambo/simplefocus/SimpleFocusActivity.java deleted file mode 100644 index d30156a..0000000 --- a/SimpleFocus/src/com/mamlambo/simplefocus/SimpleFocusActivity.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.mamlambo.simplefocus; - -import android.app.Activity; -import android.os.Bundle; -import android.view.View; -import android.widget.Button; -import android.widget.Toast; - -public class SimpleFocusActivity extends Activity { - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - } - - public void numClicked(View v) { - - Button butClicked = (Button)v; - String strButton = butClicked.getText().toString(); - Toast.makeText(getApplicationContext(), - "Clicked " + strButton, Toast.LENGTH_SHORT).show(); - } -} \ No newline at end of file diff --git a/SimpleViewPager/.classpath b/SimpleViewPager/.classpath deleted file mode 100644 index 529d67f..0000000 --- a/SimpleViewPager/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/SimpleViewPager/.project b/SimpleViewPager/.project deleted file mode 100644 index 5fa7cf2..0000000 --- a/SimpleViewPager/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - SimpleViewPager - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/SimpleViewPager/AndroidManifest.xml b/SimpleViewPager/AndroidManifest.xml deleted file mode 100644 index 9486f12..0000000 --- a/SimpleViewPager/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SimpleViewPager/default.properties b/SimpleViewPager/default.properties deleted file mode 100644 index fd1cedd..0000000 --- a/SimpleViewPager/default.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=Google Inc.:Google APIs:10 diff --git a/SimpleViewPager/libs/android-support-v4.jar b/SimpleViewPager/libs/android-support-v4.jar deleted file mode 100644 index b9a4279..0000000 Binary files a/SimpleViewPager/libs/android-support-v4.jar and /dev/null differ diff --git a/SimpleViewPager/proguard.cfg b/SimpleViewPager/proguard.cfg deleted file mode 100644 index b1cdf17..0000000 --- a/SimpleViewPager/proguard.cfg +++ /dev/null @@ -1,40 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/SimpleViewPager/res/drawable-hdpi/icon.png b/SimpleViewPager/res/drawable-hdpi/icon.png deleted file mode 100644 index 8074c4c..0000000 Binary files a/SimpleViewPager/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/SimpleViewPager/res/drawable-ldpi/icon.png b/SimpleViewPager/res/drawable-ldpi/icon.png deleted file mode 100644 index 1095584..0000000 Binary files a/SimpleViewPager/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/SimpleViewPager/res/drawable-mdpi/icon.png b/SimpleViewPager/res/drawable-mdpi/icon.png deleted file mode 100644 index a07c69f..0000000 Binary files a/SimpleViewPager/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/SimpleViewPager/res/drawable/elebutton.png b/SimpleViewPager/res/drawable/elebutton.png deleted file mode 100644 index 152914f..0000000 Binary files a/SimpleViewPager/res/drawable/elebutton.png and /dev/null differ diff --git a/SimpleViewPager/res/drawable/left.png b/SimpleViewPager/res/drawable/left.png deleted file mode 100644 index 1d68182..0000000 Binary files a/SimpleViewPager/res/drawable/left.png and /dev/null differ diff --git a/SimpleViewPager/res/drawable/middle.png b/SimpleViewPager/res/drawable/middle.png deleted file mode 100644 index cf23433..0000000 Binary files a/SimpleViewPager/res/drawable/middle.png and /dev/null differ diff --git a/SimpleViewPager/res/drawable/right.png b/SimpleViewPager/res/drawable/right.png deleted file mode 100644 index 6e4f9b0..0000000 Binary files a/SimpleViewPager/res/drawable/right.png and /dev/null differ diff --git a/SimpleViewPager/res/layout/farleft.xml b/SimpleViewPager/res/layout/farleft.xml deleted file mode 100644 index 1ff2706..0000000 --- a/SimpleViewPager/res/layout/farleft.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/SimpleViewPager/res/layout/farright.xml b/SimpleViewPager/res/layout/farright.xml deleted file mode 100644 index 0866166..0000000 --- a/SimpleViewPager/res/layout/farright.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - diff --git a/SimpleViewPager/res/layout/left.xml b/SimpleViewPager/res/layout/left.xml deleted file mode 100644 index 22f056a..0000000 --- a/SimpleViewPager/res/layout/left.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/SimpleViewPager/res/layout/main.xml b/SimpleViewPager/res/layout/main.xml deleted file mode 100644 index a89645d..0000000 --- a/SimpleViewPager/res/layout/main.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - diff --git a/SimpleViewPager/res/layout/middle.xml b/SimpleViewPager/res/layout/middle.xml deleted file mode 100644 index 13a8224..0000000 --- a/SimpleViewPager/res/layout/middle.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/SimpleViewPager/res/layout/right.xml b/SimpleViewPager/res/layout/right.xml deleted file mode 100644 index f46857a..0000000 --- a/SimpleViewPager/res/layout/right.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/SimpleViewPager/res/values/strings.xml b/SimpleViewPager/res/values/strings.xml deleted file mode 100644 index 161c77c..0000000 --- a/SimpleViewPager/res/values/strings.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - SimpleViewPager - - - I am the far right pane. I have an ImageButton control. - Lion looking right in the right pane. - MONKEY in the middle pane. - Zebra leaping left in the left pane. - I am the far left pane. I have a Button. - - - diff --git a/SimpleViewPager/src/com/mamlambo/simpleviewpager/SimpleViewPagerActivity.java b/SimpleViewPager/src/com/mamlambo/simpleviewpager/SimpleViewPagerActivity.java deleted file mode 100644 index dd1499b..0000000 --- a/SimpleViewPager/src/com/mamlambo/simpleviewpager/SimpleViewPagerActivity.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.mamlambo.simpleviewpager; - -import android.app.Activity; -import android.content.Context; -import android.os.Bundle; -import android.os.Parcelable; -import android.support.v4.view.PagerAdapter; -import android.support.v4.view.ViewPager; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.Toast; - -public class SimpleViewPagerActivity extends Activity { - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - - MyPagerAdapter adapter = new MyPagerAdapter(); - ViewPager myPager = (ViewPager) findViewById(R.id.myfivepanelpager); - myPager.setAdapter(adapter); - myPager.setCurrentItem(2); - } - - public void farLeftButtonClick(View v) - { - Toast.makeText(this, "Far Left Button Clicked", Toast.LENGTH_SHORT).show(); - - } - - public void farRightButtonClick(View v) - { - Toast.makeText(this, "Far Right Elephant Button Clicked", Toast.LENGTH_SHORT).show(); - - } - - private class MyPagerAdapter extends PagerAdapter { - - public int getCount() { - return 5; - } - - public Object instantiateItem(View collection, int position) { - - LayoutInflater inflater = (LayoutInflater) collection.getContext() - .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - - int resId = 0; - switch (position) { - case 0: - resId = R.layout.farleft; - break; - case 1: - resId = R.layout.left; - break; - case 2: - resId = R.layout.middle; - break; - case 3: - resId = R.layout.right; - break; - case 4: - resId = R.layout.farright; - break; - } - - View view = inflater.inflate(resId, null); - - ((ViewPager) collection).addView(view, 0); - - return view; - } - - @Override - public void destroyItem(View arg0, int arg1, Object arg2) { - ((ViewPager) arg0).removeView((View) arg2); - - } - - @Override - public void finishUpdate(View arg0) { - // TODO Auto-generated method stub - - } - - @Override - public boolean isViewFromObject(View arg0, Object arg1) { - return arg0 == ((View) arg1); - - } - - @Override - public void restoreState(Parcelable arg0, ClassLoader arg1) { - // TODO Auto-generated method stub - - } - - @Override - public Parcelable saveState() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void startUpdate(View arg0) { - // TODO Auto-generated method stub - - } - - } - -} \ No newline at end of file diff --git a/SuperSimpleDialogs/.classpath b/SuperSimpleDialogs/.classpath deleted file mode 100644 index 609aa00..0000000 --- a/SuperSimpleDialogs/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/SuperSimpleDialogs/.project b/SuperSimpleDialogs/.project deleted file mode 100644 index a03cae4..0000000 --- a/SuperSimpleDialogs/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - SuperSimpleDialogs Open - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/SuperSimpleDialogs/AndroidManifest.xml b/SuperSimpleDialogs/AndroidManifest.xml deleted file mode 100644 index 2f97588..0000000 --- a/SuperSimpleDialogs/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SuperSimpleDialogs/default.properties b/SuperSimpleDialogs/default.properties deleted file mode 100644 index fd1cedd..0000000 --- a/SuperSimpleDialogs/default.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=Google Inc.:Google APIs:10 diff --git a/SuperSimpleDialogs/proguard.cfg b/SuperSimpleDialogs/proguard.cfg deleted file mode 100644 index b1cdf17..0000000 --- a/SuperSimpleDialogs/proguard.cfg +++ /dev/null @@ -1,40 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/SuperSimpleDialogs/res/drawable-hdpi/icon.png b/SuperSimpleDialogs/res/drawable-hdpi/icon.png deleted file mode 100644 index 8074c4c..0000000 Binary files a/SuperSimpleDialogs/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/SuperSimpleDialogs/res/drawable-ldpi/icon.png b/SuperSimpleDialogs/res/drawable-ldpi/icon.png deleted file mode 100644 index 1095584..0000000 Binary files a/SuperSimpleDialogs/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/SuperSimpleDialogs/res/drawable-mdpi/icon.png b/SuperSimpleDialogs/res/drawable-mdpi/icon.png deleted file mode 100644 index a07c69f..0000000 Binary files a/SuperSimpleDialogs/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/SuperSimpleDialogs/res/layout/main.xml b/SuperSimpleDialogs/res/layout/main.xml deleted file mode 100644 index 7101cd1..0000000 --- a/SuperSimpleDialogs/res/layout/main.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/SuperSimpleDialogs/res/values/strings.xml b/SuperSimpleDialogs/res/values/strings.xml deleted file mode 100644 index 3b07eea..0000000 --- a/SuperSimpleDialogs/res/values/strings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Click the button to launch a sample toast or dialog. - - SuperSimpleDialogs - Warning! - Are you sure you want to move to Siberia? - Display Toast - Launch Dialog - Launch DatePickerDialog - diff --git a/SuperSimpleDialogs/src/com/mamlambo/supersimpledialogs/SuperSimpleDialogsActivity.java b/SuperSimpleDialogs/src/com/mamlambo/supersimpledialogs/SuperSimpleDialogsActivity.java deleted file mode 100644 index 32110de..0000000 --- a/SuperSimpleDialogs/src/com/mamlambo/supersimpledialogs/SuperSimpleDialogsActivity.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.mamlambo.supersimpledialogs; - -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; - -import android.app.Activity; -import android.app.AlertDialog; -import android.app.DatePickerDialog; -import android.app.Dialog; -import android.content.DialogInterface; -import android.os.Bundle; -import android.text.format.DateFormat; -import android.text.format.Time; -import android.view.View; -import android.widget.DatePicker; -import android.widget.Toast; - -public class SuperSimpleDialogsActivity extends Activity { - - private static final int MY_SUPER_SIMPLE_DIALOG_ID = 0; - private static final int MY_SIMPLE_DIALOG_ID = 1; - private static final int MY_DIALOG_ID = 2; - - private static final int MY_DATE_DIALOG_ID = 3; - - private Date mCurrentTime; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - } - - public void onToastButtonClick(View v) { - Toast.makeText(getApplicationContext(), "Clicked!", Toast.LENGTH_SHORT) - .show(); - } - - public void onDialogButtonClick(View v) { - - Date dt = new Date(); // Gets the current date/time - if (dt.getSeconds() % 3 == 0) { - showDialog(MY_SUPER_SIMPLE_DIALOG_ID); - } else if (dt.getSeconds() % 3 == 1) { - showDialog(MY_SIMPLE_DIALOG_ID); - } else { - mCurrentTime = dt; - showDialog(MY_DIALOG_ID); - } - } - - public void onDateDialogButtonClick(View v) { - showDialog(MY_DATE_DIALOG_ID); - } - - @Override - protected Dialog onCreateDialog(int id) { - switch (id) { - case MY_SUPER_SIMPLE_DIALOG_ID: - Dialog superSimpleDlg = new Dialog(this); - superSimpleDlg.setTitle(R.string.dialog_title); - return superSimpleDlg; - - case MY_SIMPLE_DIALOG_ID: - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.dialog_title); - builder.setMessage(R.string.dialog_message); - builder.setIcon(android.R.drawable.btn_star); - builder.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - Toast.makeText(getApplicationContext(), - "Clicked OK!", Toast.LENGTH_SHORT).show(); - return; - } - }); - return builder.create(); - - case MY_DIALOG_ID: - AlertDialog.Builder builder2 = new AlertDialog.Builder(this); - builder2.setTitle(R.string.dialog_title); - builder2.setIcon(android.R.drawable.btn_star); - builder2.setMessage(""); - builder2.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - Toast.makeText(getApplicationContext(), - "Clicked OK!", Toast.LENGTH_SHORT).show(); - return; - } - }); - - builder2.setNegativeButton(android.R.string.cancel, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - Toast.makeText(getApplicationContext(), - "Clicked Cancel!", Toast.LENGTH_SHORT) - .show(); - return; - } - }); - - return builder2.create(); - - - case MY_DATE_DIALOG_ID: - DatePickerDialog dateDlg = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() { - public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { - Time chosenDate = new Time(); - chosenDate.set(dayOfMonth, monthOfYear, year); - long dtDob = chosenDate.toMillis(true); - CharSequence strDate = DateFormat.format("MMMM dd, yyyy", dtDob); - Toast.makeText(SuperSimpleDialogsActivity.this, "Date picked: " + strDate, Toast.LENGTH_SHORT).show(); - } - }, 2011,0, 1); - - dateDlg.setMessage("When's Your Birthday?"); - - return dateDlg; - } - return null; - - } - - @Override - protected void onPrepareDialog(int id, Dialog dialog) { - super.onPrepareDialog(id, dialog); - switch (id) { - case MY_SUPER_SIMPLE_DIALOG_ID: - // Static dialog contents. No initialization needed - break; - case MY_SIMPLE_DIALOG_ID: - // Static dialog contents. No initialization needed - break; - case MY_DIALOG_ID: - // Some initialization needed. Date/time changes each time this - // dialog is displayed, so update its contents in prepare (not - // create) - AlertDialog myDialog = (AlertDialog) dialog; - SimpleDateFormat dFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm:ss", Locale.getDefault()); - myDialog.setMessage("This dialog was launched at " - + dFormat.format(mCurrentTime)); - break; - - case MY_DATE_DIALOG_ID: - DatePickerDialog dateDlg = (DatePickerDialog) dialog; - int iDay,iMonth,iYear; - - // Always init the date picker to today's date - Calendar cal = Calendar.getInstance(); - iDay = cal.get(Calendar.DAY_OF_MONTH); - iMonth = cal.get(Calendar.MONTH); - iYear = cal.get(Calendar.YEAR); - dateDlg.updateDate(iYear, iMonth, iDay); - break; - } - return; - } - -} \ No newline at end of file