OSDN Git Service

checkin
authorKoushik Dutta <koushd@gmail.com>
Sun, 13 Jan 2013 02:22:26 +0000 (18:22 -0800)
committerKoushik Dutta <koushd@gmail.com>
Sun, 13 Jan 2013 02:22:26 +0000 (18:22 -0800)
43 files changed:
Widgets/.classpath [new file with mode: 0644]
Widgets/.project [moved from .project with 100% similarity]
Widgets/AndroidManifest.xml [moved from AndroidManifest.xml with 100% similarity]
Widgets/gen/com/koushikdutta/widgets/BuildConfig.java [moved from gen/com/koushikdutta/widgets/BuildConfig.java with 100% similarity]
Widgets/gen/com/koushikdutta/widgets/R.java [moved from gen/com/koushikdutta/widgets/R.java with 100% similarity]
Widgets/libs/android-support-v4.jar [moved from libs/android-support-v4.jar with 100% similarity]
Widgets/proguard-project.txt [moved from proguard-project.txt with 100% similarity]
Widgets/project.properties [moved from project.properties with 100% similarity]
Widgets/res/layout-v14/list_item.xml [moved from res/layout-v14/list_item.xml with 100% similarity]
Widgets/res/layout-v14/list_item_small.xml [moved from res/layout-v14/list_item_small.xml with 100% similarity]
Widgets/res/layout/activity_base_fragment.xml [moved from res/layout/activity_base_fragment.xml with 100% similarity]
Widgets/res/layout/list_header.xml [moved from res/layout/list_header.xml with 100% similarity]
Widgets/res/layout/list_item.xml [moved from res/layout/list_item.xml with 100% similarity]
Widgets/res/layout/list_item_small.xml [moved from res/layout/list_item_small.xml with 100% similarity]
Widgets/res/values/color.xml [moved from res/values/color.xml with 100% similarity]
Widgets/src/com/koushikdutta/widgets/ActivityBase.java [new file with mode: 0644]
Widgets/src/com/koushikdutta/widgets/ActivityBaseFragment.java [moved from src/com/koushikdutta/widgets/ActivityBaseFragment.java with 93% similarity]
Widgets/src/com/koushikdutta/widgets/AnimatedView.java [moved from src/com/koushikdutta/widgets/AnimatedView.java with 100% similarity]
Widgets/src/com/koushikdutta/widgets/ListItem.java [moved from src/com/koushikdutta/widgets/ListItem.java with 88% similarity]
Widgets/src/com/koushikdutta/widgets/SeparatedListAdapter.java [moved from src/com/koushikdutta/widgets/SeparatedListAdapter.java with 100% similarity]
WidgetsSample/.classpath [moved from .classpath with 100% similarity]
WidgetsSample/.project [new file with mode: 0644]
WidgetsSample/AndroidManifest.xml [new file with mode: 0644]
WidgetsSample/gen/com/koushikdutta/widgets/R.java [new file with mode: 0644]
WidgetsSample/gen/com/koushikdutta/widgets/sample/BuildConfig.java [new file with mode: 0644]
WidgetsSample/gen/com/koushikdutta/widgets/sample/R.java [new file with mode: 0644]
WidgetsSample/ic_launcher-web.png [new file with mode: 0644]
WidgetsSample/libs/android-support-v4.jar [new file with mode: 0644]
WidgetsSample/lint.xml [new file with mode: 0644]
WidgetsSample/proguard-project.txt [new file with mode: 0644]
WidgetsSample/project.properties [new file with mode: 0644]
WidgetsSample/res/drawable-hdpi/ic_launcher.png [new file with mode: 0644]
WidgetsSample/res/drawable-ldpi/ic_launcher.png [new file with mode: 0644]
WidgetsSample/res/drawable-mdpi/ic_launcher.png [new file with mode: 0644]
WidgetsSample/res/drawable-xhdpi/ic_launcher.png [new file with mode: 0644]
WidgetsSample/res/drawable/box.png [new file with mode: 0644]
WidgetsSample/res/drawable/drive.png [new file with mode: 0644]
WidgetsSample/res/drawable/dropbox.png [new file with mode: 0644]
WidgetsSample/res/drawable/nexusone.png [new file with mode: 0644]
WidgetsSample/res/values/strings.xml [new file with mode: 0644]
WidgetsSample/src/com/koushikdutta/widgets/sample/MainActivity.java [new file with mode: 0644]
WidgetsSample/src/com/koushikdutta/widgets/sample/MainActivityDark.java [new file with mode: 0644]
src/com/koushikdutta/widgets/ActivityBase.java [deleted file]

diff --git a/Widgets/.classpath b/Widgets/.classpath
new file mode 100644 (file)
index 0000000..3f9691c
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+       <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="gen"/>
+       <classpathentry kind="output" path="bin/classes"/>
+</classpath>
similarity index 100%
rename from .project
rename to Widgets/.project
diff --git a/Widgets/src/com/koushikdutta/widgets/ActivityBase.java b/Widgets/src/com/koushikdutta/widgets/ActivityBase.java
new file mode 100644 (file)
index 0000000..f2f70f9
--- /dev/null
@@ -0,0 +1,66 @@
+package com.koushikdutta.widgets;
+
+import com.koushikdutta.widgets.ActivityBaseFragment.ActivityBaseFragmentListener;
+
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+import android.view.View;
+
+
+
+public class ActivityBase extends FragmentActivity implements ActivityBaseFragmentListener {
+    Class<? extends ActivityBaseFragment> clazz;
+    public ActivityBase(Class<? extends ActivityBaseFragment> clazz) {
+        super();
+        this.clazz = clazz;
+    }
+    
+    public ActivityBase() {
+        super();
+        this.clazz = ActivityBaseFragment.class;
+    }
+    
+    public ActivityBaseFragment getFragment() {
+        return fragment;        
+    }
+    
+    public View getView() {
+        return fragment.getView();
+    }
+    
+    ActivityBaseFragment fragment;
+    protected final void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        
+        try {
+            fragment = (ActivityBaseFragment)clazz.getConstructors()[0].newInstance();
+            fragment.setArguments(getIntent().getExtras());
+            fragment.setListener(this);
+            getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit();
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState, View view) {
+    }
+    
+
+    protected ListItem addItem(int sectionName, ListItem item) {
+        return getFragment().addItem(getString(sectionName), item);
+    }
+
+    protected ListItem addItem(int sectionName, ListItem item, int index) {
+        return getFragment().addItem(getString(sectionName), item, index);
+    }
+    
+    protected ListItem addItem(String sectionName, ListItem item) {
+        return getFragment().addItem(sectionName, item, -1);
+    }
+    
+    public void setEmpty(int res) {
+        getFragment().setEmpty(res);
+    }
+}
@@ -140,7 +140,22 @@ public class ActivityBaseFragment extends Fragment {
         return null;
     }
     
+    private ActivityBaseFragmentListener mListener;
+    public ActivityBaseFragmentListener getListener() {
+        return mListener;
+    }
+    
+    public void setListener(ActivityBaseFragmentListener listener) {
+        mListener = listener;
+    }
+    
+    public static interface ActivityBaseFragmentListener {
+        void onCreate(Bundle savedInstanceState, View view);
+    }
+    
     protected void onCreate(Bundle savedInstanceState, View view) {
+        if (mListener != null)
+            mListener.onCreate(savedInstanceState, view);
     }
     
     TextView mEmpty;
@@ -16,41 +16,44 @@ public class ListItem {
 
     public int Icon;
     
-    public void setEnabled(boolean enabled) {
+    public ListItem setEnabled(boolean enabled) {
         Enabled = enabled;
         Context.mAdapter.notifyDataSetChanged();
+        return this;
     }
     
     public boolean getEnabled() {
         return Enabled;
     }
     
-    public void setTitle(int title) {
+    public ListItem setTitle(int title) {
         if (title == 0)
-            setTitle(null);
+            return setTitle(null);
         else
-            setTitle(Context.getString(title));
+            return setTitle(Context.getString(title));
     }
     
     public String getTitle() {
         return Title;
     }
     
-    public void setTitle(String title) {
+    public ListItem setTitle(String title) {
         Title = title;
         Context.mAdapter.notifyDataSetChanged();
+        return this;
     }
 
-    public void setSummary(int summary) {
+    public ListItem setSummary(int summary) {
         if (summary == 0)
-            setSummary(null);
+            return setSummary(null);
         else
-            setSummary(Context.getString(summary));
+            return setSummary(Context.getString(summary));
     }
     
-    public void setSummary(String summary) {
+    public ListItem setSummary(String summary) {
         Summary = summary;
         Context.mAdapter.notifyDataSetChanged();
+        return this;
     }
     
     public ListItem(ActivityBaseFragment context, int title, int summary) {
@@ -80,9 +83,10 @@ public class ListItem {
     private boolean CheckboxVisible = false;
     private boolean checked = false;
     
-    public void setCheckboxVisible(boolean visible) {
+    public ListItem setCheckboxVisible(boolean visible) {
         CheckboxVisible = visible;
         Context.mAdapter.notifyDataSetChanged();
+        return this;
     }
 
     public boolean getCheckboxVisible() {
@@ -93,10 +97,11 @@ public class ListItem {
         return checked;
     }
     
-    public void setChecked(boolean isChecked) {
+    public ListItem setChecked(boolean isChecked) {
         checked = isChecked;
         CheckboxVisible = true;
         Context.mAdapter.notifyDataSetChanged();
+        return this;
     }
 //    
 //    boolean mUseOnOff = false;
similarity index 100%
rename from .classpath
rename to WidgetsSample/.classpath
diff --git a/WidgetsSample/.project b/WidgetsSample/.project
new file mode 100644 (file)
index 0000000..a4999c8
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>WidgetsSample</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/WidgetsSample/AndroidManifest.xml b/WidgetsSample/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..16080d0
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.koushikdutta.widgets.sample"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk
+        android:minSdkVersion="8"
+        android:targetSdkVersion="16" />
+
+    <application
+        android:allowBackup="true"
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:theme="@android:style/Theme.DeviceDefault.Light" >
+        <activity
+            android:name="com.koushikdutta.widgets.sample.MainActivity"
+            android:label="@string/app_name" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        
+        <activity 
+            android:name=".MainActivityDark"
+            android:theme="@android:style/Theme.DeviceDefault"
+            />
+    </application>
+
+</manifest>
\ No newline at end of file
diff --git a/WidgetsSample/gen/com/koushikdutta/widgets/R.java b/WidgetsSample/gen/com/koushikdutta/widgets/R.java
new file mode 100644 (file)
index 0000000..c28b5e2
--- /dev/null
@@ -0,0 +1,32 @@
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+package com.koushikdutta.widgets;
+
+public final class R {
+       public static final class id {
+               public static final int summary = 0x7f060007;
+               public static final int title = 0x7f060006;
+               public static final int title_container = 0x7f060000;
+               public static final int list_header_title = 0x7f060004;
+               public static final int checkbox = 0x7f060008;
+               public static final int empty = 0x7f060002;
+               public static final int image = 0x7f060005;
+               public static final int footer_container = 0x7f060003;
+               public static final int listview = 0x7f060001;
+       }
+       public static final class color {
+               public static final int holo_blue_light = 0x7f040000;
+               public static final int holo_blue_bright = 0x7f040002;
+               public static final int holo_blue_dark = 0x7f040001;
+       }
+       public static final class layout {
+               public static final int list_header = 0x7f030001;
+               public static final int list_item_small = 0x7f030003;
+               public static final int list_item = 0x7f030002;
+               public static final int activity_base_fragment = 0x7f030000;
+       }
+}
diff --git a/WidgetsSample/gen/com/koushikdutta/widgets/sample/BuildConfig.java b/WidgetsSample/gen/com/koushikdutta/widgets/sample/BuildConfig.java
new file mode 100644 (file)
index 0000000..066284a
--- /dev/null
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.koushikdutta.widgets.sample;
+
+public final class BuildConfig {
+    public final static boolean DEBUG = true;
+}
\ No newline at end of file
diff --git a/WidgetsSample/gen/com/koushikdutta/widgets/sample/R.java b/WidgetsSample/gen/com/koushikdutta/widgets/sample/R.java
new file mode 100644 (file)
index 0000000..a6b14a4
--- /dev/null
@@ -0,0 +1,51 @@
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.koushikdutta.widgets.sample;
+
+public final class R {
+    public static final class attr {
+    }
+    public static final class color {
+        public static final int holo_blue_bright=0x7f040002;
+        public static final int holo_blue_dark=0x7f040001;
+        public static final int holo_blue_light=0x7f040000;
+    }
+    public static final class drawable {
+        public static final int box=0x7f020000;
+        public static final int drive=0x7f020001;
+        public static final int dropbox=0x7f020002;
+        public static final int ic_launcher=0x7f020003;
+        public static final int nexusone=0x7f020004;
+    }
+    public static final class id {
+        public static final int checkbox=0x7f060008;
+        public static final int empty=0x7f060002;
+        public static final int footer_container=0x7f060003;
+        public static final int image=0x7f060005;
+        public static final int list_header_title=0x7f060004;
+        public static final int listview=0x7f060001;
+        public static final int summary=0x7f060007;
+        public static final int title=0x7f060006;
+        public static final int title_container=0x7f060000;
+    }
+    public static final class layout {
+        public static final int activity_base_fragment=0x7f030000;
+        public static final int list_header=0x7f030001;
+        public static final int list_item=0x7f030002;
+        public static final int list_item_small=0x7f030003;
+    }
+    public static final class string {
+        public static final int app_name=0x7f050000;
+        public static final int box=0x7f050005;
+        public static final int cloud=0x7f050001;
+        public static final int devices=0x7f050006;
+        public static final int dropbox=0x7f050004;
+        public static final int googledrive=0x7f050002;
+        public static final int googledrive_summary=0x7f050003;
+    }
+}
diff --git a/WidgetsSample/ic_launcher-web.png b/WidgetsSample/ic_launcher-web.png
new file mode 100644 (file)
index 0000000..424f260
Binary files /dev/null and b/WidgetsSample/ic_launcher-web.png differ
diff --git a/WidgetsSample/libs/android-support-v4.jar b/WidgetsSample/libs/android-support-v4.jar
new file mode 100644 (file)
index 0000000..6080877
Binary files /dev/null and b/WidgetsSample/libs/android-support-v4.jar differ
diff --git a/WidgetsSample/lint.xml b/WidgetsSample/lint.xml
new file mode 100644 (file)
index 0000000..7edd00c
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+    <issue id="NewApi" severity="ignore" />
+</lint>
\ No newline at end of file
diff --git a/WidgetsSample/proguard-project.txt b/WidgetsSample/proguard-project.txt
new file mode 100644 (file)
index 0000000..f2fe155
--- /dev/null
@@ -0,0 +1,20 @@
+# 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/WidgetsSample/project.properties b/WidgetsSample/project.properties
new file mode 100644 (file)
index 0000000..ac7a377
--- /dev/null
@@ -0,0 +1,15 @@
+# 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
+android.library.reference.1=../Widgets
diff --git a/WidgetsSample/res/drawable-hdpi/ic_launcher.png b/WidgetsSample/res/drawable-hdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..0e79b18
Binary files /dev/null and b/WidgetsSample/res/drawable-hdpi/ic_launcher.png differ
diff --git a/WidgetsSample/res/drawable-ldpi/ic_launcher.png b/WidgetsSample/res/drawable-ldpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..ebfac7d
Binary files /dev/null and b/WidgetsSample/res/drawable-ldpi/ic_launcher.png differ
diff --git a/WidgetsSample/res/drawable-mdpi/ic_launcher.png b/WidgetsSample/res/drawable-mdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..1183441
Binary files /dev/null and b/WidgetsSample/res/drawable-mdpi/ic_launcher.png differ
diff --git a/WidgetsSample/res/drawable-xhdpi/ic_launcher.png b/WidgetsSample/res/drawable-xhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..c8ab2a1
Binary files /dev/null and b/WidgetsSample/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/WidgetsSample/res/drawable/box.png b/WidgetsSample/res/drawable/box.png
new file mode 100644 (file)
index 0000000..7e1624f
Binary files /dev/null and b/WidgetsSample/res/drawable/box.png differ
diff --git a/WidgetsSample/res/drawable/drive.png b/WidgetsSample/res/drawable/drive.png
new file mode 100644 (file)
index 0000000..3a9fff6
Binary files /dev/null and b/WidgetsSample/res/drawable/drive.png differ
diff --git a/WidgetsSample/res/drawable/dropbox.png b/WidgetsSample/res/drawable/dropbox.png
new file mode 100644 (file)
index 0000000..5133e95
Binary files /dev/null and b/WidgetsSample/res/drawable/dropbox.png differ
diff --git a/WidgetsSample/res/drawable/nexusone.png b/WidgetsSample/res/drawable/nexusone.png
new file mode 100644 (file)
index 0000000..d917650
Binary files /dev/null and b/WidgetsSample/res/drawable/nexusone.png differ
diff --git a/WidgetsSample/res/values/strings.xml b/WidgetsSample/res/values/strings.xml
new file mode 100644 (file)
index 0000000..728bc15
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string name="app_name">WidgetsSample</string>
+
+    <string name="cloud">Cloud</string>
+    <string name="googledrive">Google Drive</string>
+    <string name="googledrive_summary">By the power of Google!</string>
+    <string name="dropbox">Dropbox</string>
+    <string name="box">Box</string>
+    
+    <string name="devices">Devices</string>
+</resources>
\ No newline at end of file
diff --git a/WidgetsSample/src/com/koushikdutta/widgets/sample/MainActivity.java b/WidgetsSample/src/com/koushikdutta/widgets/sample/MainActivity.java
new file mode 100644 (file)
index 0000000..0e1cd46
--- /dev/null
@@ -0,0 +1,41 @@
+package com.koushikdutta.widgets.sample;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Toast;
+
+import com.koushikdutta.widgets.ActivityBase;
+import com.koushikdutta.widgets.ListItem;
+
+
+public class MainActivity extends ActivityBase {
+    @Override
+    public void onCreate(Bundle savedInstanceState, View view) {
+        super.onCreate(savedInstanceState, view);
+        
+        addItem("Theme", new ListItem(getFragment(), "Dark Theme", null, R.drawable.ic_launcher) {
+            @Override
+            public void onClick(View view) {
+                super.onClick(view);
+                startActivity(new Intent(MainActivity.this, MainActivityDark.class));
+            }
+        });
+        
+        addItem(R.string.cloud, new ListItem(getFragment(), R.string.googledrive, R.string.googledrive_summary, R.drawable.drive) {
+            @Override
+            public void onClick(View view) {
+                super.onClick(view);
+                Toast.makeText(MainActivity.this, "You clicked Google Drive!", Toast.LENGTH_SHORT).show();
+            }
+        });
+        addItem(R.string.cloud, new ListItem(getFragment(), R.string.dropbox, 0, R.drawable.dropbox));
+        addItem(R.string.cloud, new ListItem(getFragment(), R.string.box, 0, R.drawable.box));
+        
+        addItem(R.string.devices, new ListItem(getFragment(), "Nexus S", null, R.drawable.nexusone)).setCheckboxVisible(true).setChecked(true);
+        addItem(R.string.devices, new ListItem(getFragment(), "Nexus One", null, R.drawable.nexusone)).setCheckboxVisible(true);
+        addItem(R.string.devices, new ListItem(getFragment(), "Nexus 4", null, R.drawable.nexusone)).setCheckboxVisible(true);
+        addItem(R.string.devices, new ListItem(getFragment(), "Nexus 7", null, R.drawable.nexusone)).setCheckboxVisible(true).setChecked(true);;
+        addItem(R.string.devices, new ListItem(getFragment(), "Nexus 10", null, R.drawable.nexusone)).setCheckboxVisible(true);
+    }
+}
diff --git a/WidgetsSample/src/com/koushikdutta/widgets/sample/MainActivityDark.java b/WidgetsSample/src/com/koushikdutta/widgets/sample/MainActivityDark.java
new file mode 100644 (file)
index 0000000..e3c37df
--- /dev/null
@@ -0,0 +1,6 @@
+package com.koushikdutta.widgets.sample;
+
+
+
+public class MainActivityDark extends MainActivity {
+}
diff --git a/src/com/koushikdutta/widgets/ActivityBase.java b/src/com/koushikdutta/widgets/ActivityBase.java
deleted file mode 100644 (file)
index da56120..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.koushikdutta.widgets;
-
-import android.support.v4.app.FragmentActivity;
-import android.view.View;
-
-
-
-public class ActivityBase extends FragmentActivity {
-    Class<? extends ActivityBaseFragment> clazz;
-    public ActivityBase(Class<? extends ActivityBaseFragment> clazz) {
-        super();
-        this.clazz = clazz;
-    }
-    
-    public ActivityBaseFragment getFragment() {
-        return fragment;        
-    }
-    
-    public View getView() {
-        return fragment.getView();
-    }
-    
-    ActivityBaseFragment fragment;
-    protected void onCreate(android.os.Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        
-        try {
-            fragment = (ActivityBaseFragment)clazz.getConstructors()[0].newInstance();
-            fragment.setArguments(getIntent().getExtras());
-            getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit();
-        }
-        catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}