Browse files

revamped UI for deployment

  • Loading branch information...
1 parent c5bfa4e commit 6d8e695c54f93ee75a999e8472337eeace1c37da @markchang committed Mar 28, 2011
View
9 .idea/libraries/Actionbar.xml
@@ -0,0 +1,9 @@
+<component name="libraryTable">
+ <library name="Actionbar">
+ <CLASSES />
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://$PROJECT_DIR$/../android-actionbar/actionbar/src" />
+ </SOURCES>
+ </library>
+</component>
View
1 .idea/modules.xml
@@ -2,6 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
+ <module fileurl="file://$PROJECT_DIR$/../android-actionbar/actionbar/actionbar.iml" filepath="$PROJECT_DIR$/../android-actionbar/actionbar/actionbar.iml" />
<module fileurl="file://$PROJECT_DIR$/android-instagram.iml" filepath="$PROJECT_DIR$/android-instagram.iml" />
</modules>
</component>
View
293 .idea/workspace.xml
@@ -1,7 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
- <list default="true" id="5ef7de86-783e-40c5-89b1-58b3fa95d7ee" name="Default" comment="" />
+ <list default="true" id="5ef7de86-783e-40c5-89b1-58b3fa95d7ee" name="Default" comment="added some sensible readme infos.">
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../android-actionbar/actionbar/actionbar.iml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/libraries/Actionbar.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/res/layout/dashboard_home.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/res/menu/take_picture_menu.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/res/values/colors.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/res/values/dimens.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/res/values/styles.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/org/acmelab/andgram/DashboardActivity.java" />
+ <change type="DELETED" beforePath="$PROJECT_DIR$/res/menu/main_activity_menu.xml" afterPath="" />
+ <change type="MOVED" beforePath="$PROJECT_DIR$/res/layout/main.xml" afterPath="$PROJECT_DIR$/res/layout/take_picture.xml" />
+ <change type="MOVED" beforePath="$PROJECT_DIR$/src/org/acmelab/andgram/MainActivity.java" afterPath="$PROJECT_DIR$/src/org/acmelab/andgram/TakePictureActivity.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../android-actionbar/actionbar/AndroidManifest.xml" afterPath="$PROJECT_DIR$/../android-actionbar/actionbar/AndroidManifest.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../android-actionbar/actionbar/default.properties" afterPath="$PROJECT_DIR$/../android-actionbar/actionbar/default.properties" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../android-actionbar/actionbar/src/com/markupartist/android/widget/ActionBar.java" afterPath="$PROJECT_DIR$/../android-actionbar/actionbar/src/com/markupartist/android/widget/ActionBar.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/modules.xml" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/AndroidManifest.xml" afterPath="$PROJECT_DIR$/AndroidManifest.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/android-instagram.iml" afterPath="$PROJECT_DIR$/android-instagram.iml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/gen/org/acmelab/andgram/R.java" afterPath="$PROJECT_DIR$/gen/org/acmelab/andgram/R.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/res/layout/image_list.xml" afterPath="$PROJECT_DIR$/res/layout/image_list.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/res/values/strings.xml" afterPath="$PROJECT_DIR$/res/values/strings.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/acmelab/andgram/ImageListActivity.java" afterPath="$PROJECT_DIR$/src/org/acmelab/andgram/ImageListActivity.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/acmelab/andgram/LazyAdapter.java" afterPath="$PROJECT_DIR$/src/org/acmelab/andgram/LazyAdapter.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/acmelab/andgram/LoginActivity.java" afterPath="$PROJECT_DIR$/src/org/acmelab/andgram/LoginActivity.java" />
+ </list>
<ignored path="android-instagram.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
@@ -25,21 +50,6 @@
<disable_hints />
</component>
<component name="DebuggerManager">
- <line_breakpoints>
- <breakpoint url="file://$PROJECT_DIR$/src/org/acmelab/andgram/MainActivity.java" line="372" class="org.acmelab.andgram.MainActivity" package="org.acmelab.andgram">
- <option name="ENABLED" value="true" />
- <option name="LOG_ENABLED" value="false" />
- <option name="LOG_EXPRESSION_ENABLED" value="false" />
- <option name="SUSPEND_POLICY" value="SuspendAll" />
- <option name="COUNT_FILTER_ENABLED" value="false" />
- <option name="COUNT_FILTER" value="0" />
- <option name="CONDITION_ENABLED" value="false" />
- <option name="CLASS_FILTERS_ENABLED" value="false" />
- <option name="INSTANCE_FILTERS_ENABLED" value="false" />
- <option name="CONDITION" value="" />
- <option name="LOG_MESSAGE" value="" />
- </breakpoint>
- </line_breakpoints>
<breakpoint_any>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
@@ -80,10 +90,28 @@
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="README.md" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/README.md">
+ <file leaf-file-name="DashboardActivity.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/DashboardActivity.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="54" column="38" selection-start="2577" selection-end="2577" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="TakePictureActivity.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/TakePictureActivity.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="76" selection-start="393" selection-end="393" vertical-scroll-proportion="0.2">
+ <state line="110" column="34" selection-start="4586" selection-end="4586" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="AndroidManifest.xml" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/AndroidManifest.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="4" column="30" selection-start="204" selection-end="204" vertical-scroll-proportion="0.06584362">
<folding />
</state>
</provider>
@@ -103,22 +131,22 @@
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
- <option value="$PROJECT_DIR$/src/org/acmelab/andgram/ImageDownloader.java" />
- <option value="$PROJECT_DIR$/res/layout/image_list_item.xml" />
- <option value="$PROJECT_DIR$/res/layout/main.xml" />
- <option value="$PROJECT_DIR$/src/org/acmelab/andgram/Utils.java" />
<option value="$PROJECT_DIR$/src/org/acmelab/andgram/LoginActivity.java" />
- <option value="$PROJECT_DIR$/src/org/acmelab/andgram/InstagramImage.java" />
+ <option value="$PROJECT_DIR$/src/org/acmelab/andgram/DashboardLayout.java" />
+ <option value="$PROJECT_DIR$/res/values/dimens.xml" />
+ <option value="$PROJECT_DIR$/res/values/colors.xml" />
+ <option value="$PROJECT_DIR$/res/values/styles.xml" />
+ <option value="$PROJECT_DIR$/res/layout/login.xml" />
+ <option value="$PROJECT_DIR$/src/org/acmelab/andgram/DashboardActivity.java" />
+ <option value="$PROJECT_DIR$/res/layout/dashboard_home.xml" />
+ <option value="$PROJECT_DIR$/res/layout/image_list.xml" />
+ <option value="$PROJECT_DIR$/res/values/strings.xml" />
<option value="$PROJECT_DIR$/src/org/acmelab/andgram/LazyAdapter.java" />
- <option value="$PROJECT_DIR$/src/org/acmelab/andgram/ImageLoader.java" />
<option value="$PROJECT_DIR$/src/org/acmelab/andgram/ImageListActivity.java" />
- <option value="$PROJECT_DIR$/res/layout/login.xml" />
+ <option value="$PROJECT_DIR$/res/menu/take_picture_menu.xml" />
+ <option value="$PROJECT_DIR$/res/layout/take_picture.xml" />
+ <option value="$PROJECT_DIR$/src/org/acmelab/andgram/TakePictureActivity.java" />
<option value="$PROJECT_DIR$/AndroidManifest.xml" />
- <option value="$PROJECT_DIR$/res/values/strings.xml" />
- <option value="$PROJECT_DIR$/src/org/acmelab/andgram/MainActivity.java" />
- <option value="$PROJECT_DIR$/res/layout/image_list.xml" />
- <option value="$PROJECT_DIR$/res/menu/main_activity_menu.xml" />
- <option value="$PROJECT_DIR$/README.md" />
</list>
</option>
</component>
@@ -176,7 +204,32 @@
</navigator>
<panes>
<pane id="Favorites" />
- <pane id="PackagesPane" />
+ <pane id="Scope">
+ <subPane subId="android-instagram">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ <subPane subId="Project Files">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT USER_OBJECT="android-instagram">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT USER_OBJECT="android-instagram">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </pane>
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -285,30 +338,56 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="android-instagram" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="actionbar" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
</subPane>
</pane>
- <pane id="Scope" />
+ <pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="project.structure.last.edited" value="Modules" />
- <property name="GoToFile.includeJavaFiles" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth0" value="67" />
<property name="project.structure.proportion" value="0.15" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth1" value="76" />
<property name="options.splitter.main.proportions" value="0.3" />
- <property name="ExportedApkPath" value="$PROJECT_DIR$/out/android-instagram.apk" />
- <property name="options.lastSelected" value="copyright" />
- <property name="MemberChooser.sorted" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth0" value="73" />
<property name="recentsLimit" value="5" />
+ <property name="MemberChooser.sorted" value="false" />
+ <property name="ExportedApkPath" value="$PROJECT_DIR$/out/android-instagram.apk" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder1" value="1" />
<property name="ExportedModule" value="android-instagram" />
- <property name="project.structure.side.proportion" value="0.2" />
- <property name="MemberChooser.copyJavadoc" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder0" value="0" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth2" value="79" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth3" value="852" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth3" value="856" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth2" value="78" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth1" value="75" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="WebServerToolWindowFactoryState" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder2" value="2" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder3" value="3" />
<property name="AndroidTargetDevices" value="emulator-5554" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
- <property name="options.searchVisible" value="true" />
<property name="options.splitter.details.proportions" value="0.2" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder0" value="0" />
+ <property name="GoToFile.includeJavaFiles" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder3" value="3" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder1" value="1" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder2" value="2" />
+ <property name="options.lastSelected" value="preferences.keymap" />
+ <property name="project.structure.side.proportion" value="0.2" />
+ <property name="MemberChooser.copyJavadoc" value="false" />
+ <property name="options.searchVisible" value="true" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
@@ -508,25 +587,25 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
- <frame x="55" y="22" width="1156" height="878" extended-state="0" />
+ <frame x="20" y="22" width="1156" height="878" extended-state="0" />
<editor active="false" />
<layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298153" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298153" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24909747" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39973614" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298153" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32849604" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32849604" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298153" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39891696" sideWeight="0.6701847" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2463899" sideWeight="0.67150396" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25090253" sideWeight="0.6741425" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32849604" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Android Logcat" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32585752" sideWeight="0.9972924" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3298153" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39973614" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
@@ -587,119 +666,133 @@
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/gen/org/acmelab/andgram/R.java">
+ <entry file="file://$PROJECT_DIR$/res/values/colors.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="30" column="32" selection-start="1230" selection-end="1230" vertical-scroll-proportion="0.33333334" />
+ <state line="43" column="0" selection-start="2212" selection-end="2212" vertical-scroll-proportion="0.9502075">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/Utils.java">
+ <entry file="file://$PROJECT_DIR$/res/values/styles.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="63" column="11" selection-start="2876" selection-end="2876" vertical-scroll-proportion="0.68715084">
+ <state line="35" column="8" selection-start="1976" selection-end="1976" vertical-scroll-proportion="0.75">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/ImageLoader.java">
+ <entry file="file://$PROJECT_DIR$/res/layout/image_list_item.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="33" column="0" selection-start="1973" selection-end="1973" vertical-scroll-proportion="0.55307263">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/ImageListActivity.java">
+ <entry file="file://$PROJECT_DIR$/res/layout/login.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="33" column="0" selection-start="1973" selection-end="1973" vertical-scroll-proportion="0.55307263">
+ <state line="52" column="33" selection-start="1670" selection-end="1678" vertical-scroll-proportion="0.76954734">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/LazyAdapter.java">
+ <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/Utils.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="33" column="0" selection-start="1587" selection-end="1973" vertical-scroll-proportion="0.55307263">
+ <state line="107" column="0" selection-start="4574" selection-end="4733" vertical-scroll-proportion="0.35055867">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/InstagramImage.java">
+ <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/LazyAdapter.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="22" column="19" selection-start="1370" selection-end="1370" vertical-scroll-proportion="0.3621399">
+ <state line="84" column="26" selection-start="3386" selection-end="3386" vertical-scroll-proportion="0.7849162">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/res/layout/login.xml">
+ <entry file="file://$PROJECT_DIR$/res/values/strings.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="20" column="40" selection-start="723" selection-end="723" vertical-scroll-proportion="0.373444">
+ <state line="18" column="39" selection-start="753" selection-end="753" vertical-scroll-proportion="0.2962963">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/LoginActivity.java">
+ <entry file="file://$PROJECT_DIR$/tmp/android-imagedownloader-read-only/build.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="44" selection-start="1192" selection-end="1192" vertical-scroll-proportion="0.48614073">
+ <state line="40" column="24" selection-start="1824" selection-end="1824" vertical-scroll-proportion="0.45679012">
<folding />
</state>
</provider>
</entry>
- <entry file="jar://$PROJECT_DIR$/../android-sdk/platforms/android-2.1/android.jar!/android/content/ContextWrapper.class">
+ <entry file="file://$PROJECT_DIR$/res/menu/take_picture_menu.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="43" selection-start="776" selection-end="776" vertical-scroll-proportion="-5.48">
+ <state line="8" column="0" selection-start="255" selection-end="255" vertical-scroll-proportion="0.13168724">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/AndroidManifest.xml">
+ <entry file="file://$PROJECT_DIR$/res/layout/image_list.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="3" column="28" selection-start="172" selection-end="172" vertical-scroll-proportion="0.0">
+ <state line="7" column="43" selection-start="318" selection-end="318" vertical-scroll-proportion="0.1826087">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/MainActivity.java">
+ <entry file="file://$PROJECT_DIR$/res/layout/dashboard_home.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="125" column="0" selection-start="4946" selection-end="4946" vertical-scroll-proportion="0.33190578">
+ <state line="3" column="73" selection-start="120" selection-end="195" vertical-scroll-proportion="0.075">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/res/values/strings.xml">
+ <entry file="file://$PROJECT_DIR$/res/layout/take_picture.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="42" selection-start="420" selection-end="420" vertical-scroll-proportion="0.2">
+ <state line="41" column="14" selection-start="1494" selection-end="1494" vertical-scroll-proportion="0.825">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/res/layout/main.xml">
+ <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/ImageListActivity.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="74" column="0" selection-start="2419" selection-end="2419" vertical-scroll-proportion="1.85">
+ <state line="92" column="44" selection-start="3869" selection-end="3869" vertical-scroll-proportion="0.102345414">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/res/layout/image_list.xml">
+ <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/DashboardActivity.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="17" column="31" selection-start="682" selection-end="682" vertical-scroll-proportion="0.425">
+ <state line="54" column="38" selection-start="2577" selection-end="2577" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/res/menu/main_activity_menu.xml">
+ <entry file="file://$PROJECT_DIR$/src/org/acmelab/andgram/TakePictureActivity.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="24" column="35" selection-start="777" selection-end="777" vertical-scroll-proportion="0.6">
+ <state line="110" column="34" selection-start="4586" selection-end="4586" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/README.md">
+ <entry file="file://$PROJECT_DIR$/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="8" column="76" selection-start="393" selection-end="393" vertical-scroll-proportion="0.2">
+ <state line="4" column="30" selection-start="204" selection-end="204" vertical-scroll-proportion="0.06584362">
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
+ <state key="ArtifactsStructureConfigurable.UI">
+ <settings>
+ <artifact-editor />
+ <splitter-proportions>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </splitter-proportions>
+ </settings>
+ </state>
<state key="Copyright.UI">
<settings>
<last-edited>Simplified BSD</last-edited>
@@ -712,6 +805,18 @@
</splitter-proportions>
</settings>
</state>
+ <state key="FacetStructureConfigurable.UI">
+ <settings>
+ <last-edited>Android (android-instagram)|Android</last-edited>
+ <splitter-proportions>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </splitter-proportions>
+ </settings>
+ </state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<last-edited>Android 2.2 Google APIs</last-edited>
@@ -724,6 +829,42 @@
</splitter-proportions>
</settings>
</state>
+ <state key="JdkListConfigurable.UI">
+ <settings>
+ <last-edited>1.6</last-edited>
+ <splitter-proportions>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </splitter-proportions>
+ </settings>
+ </state>
+ <state key="ModuleStructureConfigurable.UI">
+ <settings>
+ <last-edited>android-instagram</last-edited>
+ <splitter-proportions>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </splitter-proportions>
+ </settings>
+ </state>
+ <state key="ProjectLibrariesConfigurable.UI">
+ <settings>
+ <last-edited>Apache HTTP</last-edited>
+ <splitter-proportions>
+ <option name="proportions">
+ <list>
+ <option value="0.2" />
+ </list>
+ </option>
+ </splitter-proportions>
+ </settings>
+ </state>
<state key="ScopeChooserConfigurable.UI">
<settings>
<last-edited>android-instagram</last-edited>
View
7 AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.acmelab.andgram"
- android:versionCode="2"
- android:versionName="1.1">
+ android:versionCode="3"
+ android:versionName="1.2">
<uses-feature android:name="android.hardware.camera"></uses-feature>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
@@ -13,7 +13,7 @@
android:icon="@drawable/icon"
android:theme="@android:style/Theme.Light.NoTitleBar"
>
- <activity android:name=".MainActivity">
+ <activity android:name=".TakePictureActivity">
</activity>
<activity android:name=".LoginActivity">
<intent-filter>
@@ -22,5 +22,6 @@
</intent-filter>
</activity>
<activity android:name=".ImageListActivity"/>
+ <activity android:name=".DashboardActivity"/>
</application>
</manifest>
View
1 android-instagram.iml
@@ -31,6 +31,7 @@
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" />
</content>
<orderEntry type="library" name="Apache HTTP" level="project" />
+ <orderEntry type="module" module-name="actionbar" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Android 2.2 Google APIs" level="application" />
View
190 gen/org/acmelab/andgram/R.java
@@ -9,58 +9,162 @@
public final class R {
public static final class attr {
+ /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ */
+ public static final int title=0x7f010000;
+ }
+ public static final class color {
+ public static final int actionbar_background_end=0x7f040003;
+ public static final int actionbar_background_item_pressed_end=0x7f040005;
+ public static final int actionbar_background_item_pressed_start=0x7f040004;
+ public static final int actionbar_background_start=0x7f040002;
+ public static final int actionbar_separator=0x7f040000;
+ public static final int actionbar_title=0x7f040001;
+ public static final int background1=0x7f04000b;
+ public static final int background2=0x7f04000c;
+ public static final int background3=0x7f04000d;
+ public static final int foreground1=0x7f040009;
+ public static final int foreground2=0x7f04000a;
+ public static final int pinned_header_background=0x7f040010;
+ public static final int session_foreground_past=0x7f04000f;
+ public static final int title_background=0x7f040006;
+ public static final int title_separator=0x7f04000e;
+ public static final int title_text=0x7f040007;
+ public static final int title_text_alt=0x7f040008;
+ }
+ public static final class dimen {
+ public static final int actionbar_height=0x7f050000;
+ public static final int actionbar_item_height=0x7f050001;
+ public static final int actionbar_item_width=0x7f050002;
+ public static final int colorstrip_height=0x7f050003;
+ public static final int now_playing_height=0x7f050005;
+ public static final int text_size_large=0x7f050008;
+ public static final int text_size_medium=0x7f050007;
+ public static final int text_size_small=0x7f050006;
+ public static final int title_height=0x7f050004;
}
public static final class drawable {
- public static final int ic_menu_compose=0x7f020000;
- public static final int ic_menu_delete=0x7f020001;
- public static final int ic_menu_login=0x7f020002;
- public static final int ic_menu_preferences=0x7f020003;
- public static final int ic_menu_refresh=0x7f020004;
- public static final int ic_menu_slideshow=0x7f020005;
- public static final int icon=0x7f020006;
- public static final int stub=0x7f020007;
+ public static final int actionbar_back_indicator=0x7f020000;
+ public static final int actionbar_background=0x7f020001;
+ public static final int actionbar_btn=0x7f020002;
+ public static final int actionbar_btn_normal=0x7f020003;
+ public static final int actionbar_btn_pressed=0x7f020004;
+ public static final int ic_menu_camera=0x7f020005;
+ public static final int ic_menu_compose=0x7f020006;
+ public static final int ic_menu_delete=0x7f020007;
+ public static final int ic_menu_login=0x7f020008;
+ public static final int ic_menu_preferences=0x7f020009;
+ public static final int ic_menu_refresh=0x7f02000a;
+ public static final int ic_menu_slideshow=0x7f02000b;
+ public static final int ic_title_camera=0x7f02000c;
+ public static final int ic_title_home_default=0x7f02000d;
+ public static final int icon=0x7f02000e;
+ public static final int stub=0x7f02000f;
}
public static final class id {
- public static final int btnLogin=0x7f060007;
- public static final int btnPicture=0x7f060008;
- public static final int btnUpload=0x7f060009;
- public static final int caption=0x7f060002;
- public static final int captionRow=0x7f06000a;
- public static final int clear=0x7f06000f;
- public static final int comments=0x7f060004;
- public static final int credentials=0x7f060010;
- public static final int image=0x7f060001;
- public static final int imageView=0x7f06000d;
- public static final int lblCaption=0x7f06000b;
- public static final int list=0x7f060000;
- public static final int show_activity=0x7f06000e;
- public static final int txtCaption=0x7f06000c;
- public static final int txtPassword=0x7f060006;
- public static final int txtUsername=0x7f060005;
- public static final int username=0x7f060003;
+ public static final int actionbar_actions=0x7f090006;
+ public static final int actionbar_home=0x7f090001;
+ public static final int actionbar_home_bg=0x7f090003;
+ public static final int actionbar_home_btn=0x7f090004;
+ public static final int actionbar_home_is_back=0x7f090005;
+ public static final int actionbar_home_logo=0x7f090002;
+ public static final int actionbar_item=0x7f090009;
+ public static final int actionbar_progress=0x7f090007;
+ public static final int actionbar_title=0x7f090008;
+ public static final int activity_button=0x7f09000b;
+ public static final int btnLogin=0x7f090016;
+ public static final int btnPicture=0x7f090018;
+ public static final int btnUpload=0x7f090019;
+ public static final int camera_button=0x7f09000c;
+ public static final int caption=0x7f090011;
+ public static final int captionRow=0x7f09001a;
+ public static final int clear=0x7f09001e;
+ public static final int comments=0x7f090013;
+ public static final int dashboardActionbar=0x7f09000a;
+ public static final int image=0x7f090010;
+ public static final int imageListActionbar=0x7f09000e;
+ public static final int imageView=0x7f09001d;
+ public static final int lblCaption=0x7f09001b;
+ public static final int list=0x7f09000f;
+ public static final int login_button=0x7f09000d;
+ public static final int pictureActionbar=0x7f090017;
+ public static final int screen=0x7f090000;
+ public static final int txtCaption=0x7f09001c;
+ public static final int txtPassword=0x7f090015;
+ public static final int txtUsername=0x7f090014;
+ public static final int username=0x7f090012;
}
public static final class layout {
- public static final int image_list=0x7f030000;
- public static final int image_list_item=0x7f030001;
- public static final int login=0x7f030002;
- public static final int main=0x7f030003;
+ public static final int actionbar=0x7f030000;
+ public static final int actionbar_item=0x7f030001;
+ public static final int dashboard_home=0x7f030002;
+ public static final int image_list=0x7f030003;
+ public static final int image_list_item=0x7f030004;
+ public static final int login=0x7f030005;
+ public static final int take_picture=0x7f030006;
}
public static final class menu {
- public static final int main_activity_menu=0x7f050000;
+ public static final int take_picture_menu=0x7f080000;
}
public static final class string {
- public static final int activity=0x7f04000a;
- public static final int app_header=0x7f040006;
- public static final int app_name=0x7f040000;
- public static final int comment=0x7f040008;
- public static final int default_comment=0x7f040009;
- public static final int empty=0x7f04000b;
- public static final int main_menu_clear=0x7f040004;
- public static final int main_menu_credentials=0x7f040001;
- public static final int main_menu_preferences=0x7f040003;
- public static final int main_menu_refresh=0x7f040002;
- public static final int no_registration_disclaimer=0x7f04000c;
- public static final int take_picture=0x7f040005;
- public static final int upload=0x7f040007;
+ public static final int actionbar_activity_not_found=0x7f060002;
+ public static final int activity=0x7f06000c;
+ public static final int app_header=0x7f060003;
+ public static final int app_name=0x7f060001;
+ public static final int comment=0x7f06000a;
+ public static final int dashboard=0x7f06000e;
+ public static final int default_comment=0x7f06000b;
+ public static final int empty=0x7f06000d;
+ public static final int hello=0x7f060000;
+ public static final int login=0x7f06000f;
+ public static final int main_menu_clear=0x7f060007;
+ public static final int main_menu_credentials=0x7f060004;
+ public static final int main_menu_preferences=0x7f060006;
+ public static final int main_menu_refresh=0x7f060005;
+ public static final int no_registration_disclaimer=0x7f060010;
+ public static final int take_picture=0x7f060008;
+ public static final int upload=0x7f060009;
+ }
+ public static final class style {
+ public static final int ActionBar=0x7f070000;
+ public static final int ActionBarHomeItem=0x7f070002;
+ public static final int ActionBarHomeLogo=0x7f070003;
+ public static final int ActionBarItem=0x7f070001;
+ public static final int ActionBarProgressBar=0x7f070004;
+ public static final int DashboardButton=0x7f070005;
}
+ public static final class styleable {
+ /** Attributes that can be used with a ActionBar.
+ <p>Includes the following attributes:</p>
+ <table>
+ <colgroup align="left" />
+ <colgroup align="left" />
+ <tr><th>Attribute</th><th>Description</th></tr>
+ <tr><td><code>{@link #ActionBar_title org.acmelab.andgram:title}</code></td><td></td></tr>
+ </table>
+ @see #ActionBar_title
+ */
+ public static final int[] ActionBar = {
+ 0x7f010000
+ };
+ /**
+ <p>This symbol is the offset where the {@link org.acmelab.andgram.R.attr#title}
+ attribute's value can be found in the {@link #ActionBar} array.
+
+
+ <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
+<p>This may also be a reference to a resource (in the form
+"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
+theme attribute (in the form
+"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
+containing a value of this type.
+ @attr name android:title
+ */
+ public static final int ActionBar_title = 0;
+ };
}
View
BIN res/drawable-hdpi/ic_menu_camera.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-hdpi/ic_title_camera.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-hdpi/ic_title_home_default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-ldpi/ic_menu_camera.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-mdpi/ic_menu_camera.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
71 res/layout/dashboard_home.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res/org.acmelab.andgram"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <com.markupartist.android.widget.ActionBar
+ android:id="@+id/dashboardActionbar"
+ style="@style/ActionBar"
+ app:title="@string/app_name"
+ />
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:padding="6dip">
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <Button android:id="@+id/activity_button"
+ android:onClick="openActivityIntent"
+ style="@style/DashboardButton"
+ android:text="@string/activity"
+ android:drawableTop="@drawable/ic_menu_slideshow"/>
+ <Button android:id="@+id/camera_button"
+ android:onClick="openPictureIntent"
+ style="@style/DashboardButton"
+ android:text="@string/take_picture"
+ android:drawableTop="@drawable/ic_menu_camera"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+ <Button android:id="@+id/login_button"
+ android:onClick="openLoginIntent"
+ style="@style/DashboardButton"
+ android:text="@string/login"
+ android:drawableTop="@drawable/ic_menu_login"/>
+ <!--<Button android:id="@+id/action_four_button"-->
+ <!--style="@style/DashboardButton"-->
+ <!--android:text="@string/upload"-->
+ <!--android:drawableTop="@drawable/ic_menu_camera"/>-->
+ </LinearLayout>
+
+ <!--<LinearLayout-->
+ <!--android:orientation="horizontal"-->
+ <!--android:layout_width="fill_parent"-->
+ <!--android:layout_height="wrap_content"-->
+ <!--android:layout_weight="1">-->
+ <!--<Button android:id="@+id/action_five_button"-->
+ <!--style="@style/DashboardButton"-->
+ <!--android:text="@string/upload"-->
+ <!--android:drawableTop="@drawable/ic_menu_camera"/>-->
+ <!--<Button android:id="@+id/action_six_button"-->
+ <!--style="@style/DashboardButton"-->
+ <!--android:text="@string/upload"-->
+ <!--android:drawableTop="@drawable/ic_menu_camera"/>-->
+
+ <!--</LinearLayout>-->
+ </LinearLayout>
+
+</LinearLayout>
View
13 res/layout/image_list.xml
@@ -3,16 +3,15 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
+
+ <com.markupartist.android.widget.ActionBar
+ android:id="@+id/imageListActionbar"
+ style="@style/ActionBar"
+ />
+
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"/>
- <!--<Button-->
- <!--android:id="@+id/button1"-->
- <!--android:layout_width="fill_parent"-->
- <!--android:layout_height="wrap_content" -->
- <!--android:text="Clear Cache"-->
- <!--android:onClick="clearCache"-->
- <!--/>-->
</LinearLayout>
View
15 res/layout/main.xml → res/layout/take_picture.xml
@@ -7,18 +7,17 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res/org.acmelab.andgram"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/app_header"
- android:textSize="15sp"
- android:textStyle="bold"
- android:textColor="#15317E"
- />
+ <com.markupartist.android.widget.ActionBar
+ android:id="@+id/pictureActionbar"
+ style="@style/ActionBar"
+ app:title="@string/app_name"
+ />
+
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
View
25 res/menu/main_activity_menu.xml
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:id="@+id/show_activity"
- android:title="@string/activity"
- android:icon="@drawable/ic_menu_slideshow"
- />
- <item
- android:id="@+id/clear"
- android:title="@string/main_menu_clear"
- android:icon="@drawable/ic_menu_delete"
- />
- <item
- android:id="@+id/credentials"
- android:title="@string/main_menu_credentials"
- android:icon="@drawable/ic_menu_login"
- />
- <!--<item-->
- <!--android:id="@+id/preferences"-->
- <!--android:title="@string/main_menu_preferences"-->
- <!--android:icon="@drawable/ic_menu_preferences"-->
- <!--/>-->
-
-</menu>
View
9 res/menu/take_picture_menu.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/clear"
+ android:title="@string/main_menu_clear"
+ android:icon="@drawable/ic_menu_delete"
+ />
+</menu>
View
43 res/values/colors.xml
@@ -0,0 +1,43 @@
+<!--
+ ~ Copyright 2011, Mark L. Chang <mark.chang@gmail.com>. All rights reserved.
+ ~
+ ~ Redistribution and use in source and binary forms, with or without modification, are
+ ~ permitted provided that the following conditions are met:
+ ~
+ ~ 1. Redistributions of source code must retain the above copyright notice, this list of
+ ~ conditions and the following disclaimer.
+ ~
+ ~ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ ~ of conditions and the following disclaimer in the documentation and/or other
+ ~ materials provided with the distribution.
+ ~
+ ~ THIS SOFTWARE IS PROVIDED BY Mark L. Chang ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ ~ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MARK L. CHANG OR
+ ~ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ ~ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ ~ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ~ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ ~ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ~ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ~
+ ~ The views and conclusions contained in the software and documentation are those of the
+ ~ authors and should not be interpreted as representing official policies, either expressed
+ ~ or implied, of Mark L. Chang.
+ -->
+
+<resources>
+ <color name="title_background">#ff355689</color>
+ <color name="title_text">#ffffffff</color>
+ <color name="title_text_alt">#ff000000</color>
+ <color name="foreground1">#ff355689</color>
+ <color name="foreground2">#ff7081a3</color>
+ <color name="background1">#ffffffff</color>
+ <color name="background2">#ffd5ddeb</color>
+ <color name="background3">#ffe3e8f1</color>
+ <color name="title_separator">#40ffffff</color>
+
+ <color name="session_foreground_past">#ff999999</color>
+
+ <color name="pinned_header_background">#ff202020</color>
+</resources>
View
36 res/values/dimens.xml
@@ -0,0 +1,36 @@
+<!--
+ ~ Copyright 2011, Mark L. Chang <mark.chang@gmail.com>. All rights reserved.
+ ~
+ ~ Redistribution and use in source and binary forms, with or without modification, are
+ ~ permitted provided that the following conditions are met:
+ ~
+ ~ 1. Redistributions of source code must retain the above copyright notice, this list of
+ ~ conditions and the following disclaimer.
+ ~
+ ~ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ ~ of conditions and the following disclaimer in the documentation and/or other
+ ~ materials provided with the distribution.
+ ~
+ ~ THIS SOFTWARE IS PROVIDED BY Mark L. Chang ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ ~ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MARK L. CHANG OR
+ ~ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ ~ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ ~ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ~ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ ~ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ~ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ~
+ ~ The views and conclusions contained in the software and documentation are those of the
+ ~ authors and should not be interpreted as representing official policies, either expressed
+ ~ or implied, of Mark L. Chang.
+ -->
+
+<resources>
+ <dimen name="colorstrip_height">6dip</dimen>
+ <dimen name="title_height">45dip</dimen>
+ <dimen name="now_playing_height">90dip</dimen>
+ <dimen name="text_size_small">14sp</dimen>
+ <dimen name="text_size_medium">18sp</dimen>
+ <dimen name="text_size_large">22sp</dimen>
+</resources>
View
9 res/values/strings.xml
@@ -1,21 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Andgram</string>
+ <string name="app_header">Andgram v1.1</string>
+
<string name="main_menu_credentials">Credentials</string>
<string name="main_menu_refresh">Refresh</string>
<string name="main_menu_preferences">Preferences</string>
<string name="main_menu_clear">Clear</string>
+
<string name="take_picture">Take Picture</string>
- <string name="app_header">Andgram v1.1</string>
<string name="upload">Upload</string>
<string name="comment">Comment</string>
<string name="default_comment">Taken by Andgram</string>
<string name="activity">Activity</string>
<string name="empty">empty</string>
+
+ <string name="dashboard">Dashboard</string>
+ <string name="login">Login</string>
+
<string name="no_registration_disclaimer">
This application does not support the creation of new Instagram accounts.
That portion of the undocumented API has not yet been reverse-engineered.
You will need to use an iOS device (such as an iPhone) in order to create
an account.
</string>
+
</resources>
View
41 res/values/styles.xml
@@ -0,0 +1,41 @@
+<!--
+ ~ Copyright 2011, Mark L. Chang <mark.chang@gmail.com>. All rights reserved.
+ ~
+ ~ Redistribution and use in source and binary forms, with or without modification, are
+ ~ permitted provided that the following conditions are met:
+ ~
+ ~ 1. Redistributions of source code must retain the above copyright notice, this list of
+ ~ conditions and the following disclaimer.
+ ~
+ ~ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ ~ of conditions and the following disclaimer in the documentation and/or other
+ ~ materials provided with the distribution.
+ ~
+ ~ THIS SOFTWARE IS PROVIDED BY Mark L. Chang ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ ~ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ ~ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MARK L. CHANG OR
+ ~ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ ~ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ ~ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ~ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ ~ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ~ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ~
+ ~ The views and conclusions contained in the software and documentation are those of the
+ ~ authors and should not be interpreted as representing official policies, either expressed
+ ~ or implied, of Mark L. Chang.
+ -->
+
+<resources>
+ <style name="DashboardButton">
+ <item name="android:layout_gravity">center_vertical</item>
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_weight">1</item>
+ <item name="android:gravity">center_horizontal</item>
+ <item name="android:textSize">@dimen/text_size_medium</item>
+ <item name="android:textStyle">bold</item>
+ <item name="android:textColor">@color/foreground1</item>
+ <item name="android:background">@null</item>
+ </style>
+</resources>
View
61 src/org/acmelab/andgram/DashboardActivity.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2011, Mark L. Chang <mark.chang@gmail.com>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Mark L. Chang ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MARK L. CHANG OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of Mark L. Chang.
+ */
+
+package org.acmelab.andgram;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import com.markupartist.android.widget.ActionBar;
+
+public class DashboardActivity extends Activity {
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.dashboard_home);
+
+ final ActionBar actionBar = (ActionBar) findViewById(R.id.dashboardActionbar);
+ final ActionBar.Action takePictureAction = new ActionBar.IntentAction(this,
+ new Intent(this, TakePictureActivity.class), R.drawable.ic_title_camera);
+ actionBar.addAction(takePictureAction);
+
+ }
+
+ public void openPictureIntent(View view) {
+ startActivity(new Intent(DashboardActivity.this, TakePictureActivity.class));
+ }
+
+ public void openActivityIntent(View view) {
+ startActivity(new Intent(DashboardActivity.this, ImageListActivity.class));
+ }
+
+ public void openLoginIntent(View view) {
+ Utils.launchCredentials(getApplicationContext());
+ }
+
+}
View
249 src/org/acmelab/andgram/ImageListActivity.java
@@ -36,10 +36,13 @@
package org.acmelab.andgram;
import android.app.Activity;
+import android.content.Intent;
+import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.*;
+import com.markupartist.android.widget.ActionBar;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
@@ -52,11 +55,14 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
public class ImageListActivity extends Activity {
private static final String TAG = "ANDGRAM";
+ ActionBar actionBar;
ListView list;
LazyAdapter adapter;
ArrayList<InstagramImage> instagramImageList;
@@ -67,142 +73,161 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.image_list);
+ Intent dashboardIntent = new Intent(getApplicationContext(), DashboardActivity.class);
+ dashboardIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ actionBar = (ActionBar) findViewById(R.id.imageListActionbar);
+ actionBar.setTitle(R.string.activity);
+ final ActionBar.Action goHomeAction = new ActionBar.IntentAction(this,
+ dashboardIntent, R.drawable.ic_title_home_default);
+ actionBar.addAction(goHomeAction);
+ list=(ListView)findViewById(R.id.list);
+
httpClient = new DefaultHttpClient();
httpClient.getParams().setParameter("http.useragent", "Instagram");
- list=(ListView)findViewById(R.id.list);
- fetchActivity();
- displayActivity();
+ init();
}
- public boolean fetchActivity() {
- Log.i(Utils.TAG, "Image fetch");
+ private void init() {
+ // set that list to background downloader
+ instagramImageList = new ArrayList<InstagramImage>();
+ adapter = new LazyAdapter(this, instagramImageList);
+ list.setAdapter(adapter);
+ new FetchActivity().execute();
+ }
- if( Utils.isOnline(getApplicationContext()) == false ) {
- Toast.makeText(ImageListActivity.this,
- "No connection to Internet.\nTry again later.",
- Toast.LENGTH_SHORT).show();
- Log.i(Utils.TAG, "No internet, didn't load Activity Feed");
- return false;
- }
+ @Override
+ public void onDestroy()
+ {
+ adapter.imageLoader.stopThread();
+ list.setAdapter(null);
+ super.onDestroy();
+ }
- instagramImageList = new ArrayList<InstagramImage>();
+ public void clearCache(View view) {
+ adapter.imageLoader.clearCache();
+ adapter.notifyDataSetChanged();
+ }
- if( !Utils.doLogin(getApplicationContext(), httpClient) ) {
- Toast.makeText(ImageListActivity.this, "Login failed", Toast.LENGTH_SHORT).show();
- } else {
- try {
- HttpGet httpGet = new HttpGet(Utils.TIMELINE_URL);
- HttpResponse httpResponse = httpClient.execute(httpGet);
-
- // test result code
- if( httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK ) {
- Toast.makeText(ImageListActivity.this, "Login failed.", Toast.LENGTH_LONG).show();
- Log.e(TAG, "Login status code bad.");
- return false;
- }
+ private class FetchActivity extends AsyncTask<Void, String, Boolean> {
+ protected void onPreExecute() {
+ actionBar.setProgressBarVisibility(View.VISIBLE);
+ }
- // test json response
- HttpEntity httpEntity = httpResponse.getEntity();
- if( httpEntity != null ) {
- BufferedReader reader = new BufferedReader(new InputStreamReader(httpEntity.getContent(), "UTF-8"));
- String json = reader.readLine();
- JSONTokener jsonTokener = new JSONTokener(json);
- JSONObject jsonObject = new JSONObject(jsonTokener);
- Log.i(TAG,"JSON: " + jsonObject.toString());
+ protected void onPostExecute(Boolean result) {
+ actionBar.setProgressBarVisibility(View.GONE);
+ if(result) {
+ adapter.notifyDataSetChanged();
+ }
+ }
- String loginStatus = jsonObject.getString("status");
+ protected void onProgressUpdate(String toastText) {
+ Toast.makeText(ImageListActivity.this, toastText, Toast.LENGTH_SHORT).show();
+ }
- if( !loginStatus.equals("ok") ) {
- Toast.makeText(ImageListActivity.this,
- "Activity feed did not return status ok",
- Toast.LENGTH_SHORT).show();
- Log.e(TAG, "JSON status not ok: " + jsonObject.getString("status"));
+ protected Boolean doInBackground(Void... voids) {
+ Log.i(Utils.TAG, "Image fetch");
+ if( Utils.isOnline(getApplicationContext()) == false ) {
+ publishProgress("No connection to Internet.\nTry again later");
+ Log.i(Utils.TAG, "No internet, didn't load Activity Feed");
+ return false;
+ }
+
+ if( !Utils.doLogin(getApplicationContext(), httpClient) ) {
+ publishProgress("Login failed");
+ return false;
+ } else {
+ try {
+ HttpGet httpGet = new HttpGet(Utils.TIMELINE_URL);
+ HttpResponse httpResponse = httpClient.execute(httpGet);
+
+ // test result code
+ if( httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK ) {
+ publishProgress("Login failed.");
+ Log.e(TAG, "Login status code bad.");
return false;
- } else {
- // parse the activity feed
- Log.i(Utils.TAG, "Getting images from activity feed");
- JSONArray items = jsonObject.getJSONArray("items");
-
- // get image URLs and commentary
- JSONObject entry;
- JSONArray imageVersions;
- JSONObject bigImage;
- JSONObject user;
- JSONArray comments;
- JSONObject comment;
- StringBuilder commentString;
-
-
- for( int i=0; i< items.length(); i++ ) {
- // create a new instance
- InstagramImage instagramImage = new InstagramImage();
-
- // image
- entry = (JSONObject)items.get(i);
- imageVersions = entry.getJSONArray("image_versions");
- bigImage = (JSONObject)imageVersions.get(0);
- instagramImage.setUrl(bigImage.getString("url"));
-
- // user
- user = entry.getJSONObject("user");
- instagramImage.setUsername(user.getString("full_name"));
-
- // comments (and caption)
- comments = entry.getJSONArray("comments");
- if( comments != null ) {
- commentString = new StringBuilder();
- for( int c=0; c < comments.length(); c++ ) {
- comment = comments.getJSONObject(c);
- if(c==0) {
- instagramImage.setCaption(comment.getString("text"));
- } else {
- user = comment.getJSONObject("user");
- commentString.append("\n"+user.getString("full_name") + ": ");
- commentString.append(comment.getString("text"));
+ }
+
+ // test json response
+ HttpEntity httpEntity = httpResponse.getEntity();
+ if( httpEntity != null ) {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(httpEntity.getContent(), "UTF-8"));
+ String json = reader.readLine();
+ JSONTokener jsonTokener = new JSONTokener(json);
+ JSONObject jsonObject = new JSONObject(jsonTokener);
+ Log.i(TAG,"JSON: " + jsonObject.toString());
+
+ String loginStatus = jsonObject.getString("status");
+
+ if( !loginStatus.equals("ok") ) {
+ publishProgress("Activity feed did not return status ok");
+ Log.e(TAG, "JSON status not ok: " + jsonObject.getString("status"));
+ return false;
+ } else {
+ // parse the activity feed
+ Log.i(Utils.TAG, "Getting images from activity feed");
+ JSONArray items = jsonObject.getJSONArray("items");
+
+ // get image URLs and commentary
+ JSONObject entry;
+ JSONArray imageVersions;
+ JSONObject bigImage;
+ JSONObject user;
+ JSONArray comments;
+ JSONObject comment;
+ StringBuilder commentString;
+
+
+ for( int i=0; i< items.length(); i++ ) {
+ // create a new instance
+ InstagramImage instagramImage = new InstagramImage();
+
+ // image
+ entry = (JSONObject)items.get(i);
+ imageVersions = entry.getJSONArray("image_versions");
+ bigImage = (JSONObject)imageVersions.get(0);
+ instagramImage.setUrl(bigImage.getString("url"));
+
+ // user
+ user = entry.getJSONObject("user");
+ instagramImage.setUsername(user.getString("full_name"));
+
+ // comments (and caption)
+ comments = entry.getJSONArray("comments");
+ if( comments != null ) {
+ commentString = new StringBuilder();
+ for( int c=0; c < comments.length(); c++ ) {
+ comment = comments.getJSONObject(c);
+ if(c==0) {
+ instagramImage.setCaption(comment.getString("text"));
+ } else {
+ user = comment.getJSONObject("user");
+ commentString.append("\n"+user.getString("full_name") + ": ");
+ commentString.append(comment.getString("text"));
+ }
}
+ instagramImage.setComments(commentString.toString());
}
- instagramImage.setComments(commentString.toString());
- }
+ instagramImageList.add(instagramImage);
+ }
- instagramImageList.add(instagramImage);
+ return true;
}
-
- return true;
+ } else {
+ publishProgress("Improper data returned from Instagram");
+ Log.e(TAG, "instagram returned bad data");
+ return false;
}
- } else {
- Toast.makeText(ImageListActivity.this,
- "Improper data returned from Instagram.", Toast.LENGTH_LONG).show();
- Log.e(TAG, "instagram returned bad data");
+ } catch (Exception e) {
+ e.printStackTrace();
return false;
}
- } catch (Exception e) {
- e.printStackTrace();
- return false;
}
}
- return true;
- }
- public void displayActivity() {
- adapter=new LazyAdapter(this, instagramImageList);
- list.setAdapter(adapter);
- }
-
-
- @Override
- public void onDestroy()
- {
- adapter.imageLoader.stopThread();
- list.setAdapter(null);
- super.onDestroy();
- }
-
- public void clearCache(View view) {
- adapter.imageLoader.clearCache();
- adapter.notifyDataSetChanged();
}
}
View
4 src/org/acmelab/andgram/LazyAdapter.java
@@ -80,9 +80,9 @@ public long getItemId(int position) {
}
public View getView(int position, View convertView, ViewGroup parent) {
- View vi=convertView;
+ View vi = convertView;
ViewHolder holder;
- if(convertView==null){
+ if(convertView == null){
vi = inflater.inflate(R.layout.image_list_item, null);
holder = new ViewHolder();
holder.image = (ImageView)vi.findViewById(R.id.image);
View
5 src/org/acmelab/andgram/LoginActivity.java
@@ -47,15 +47,13 @@
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
-import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
@@ -84,7 +82,8 @@ public void onCreate(Bundle savedInstanceState) {
}
public void openMainActivity() {
- Intent mainIntent = new Intent(LoginActivity.this, MainActivity.class);
+ // Intent mainIntent = new Intent(LoginActivity.this, TakePictureActivity.class);
+ Intent mainIntent = new Intent(LoginActivity.this, DashboardActivity.class);
mainIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(mainIntent);
}
View
49 src/org/acmelab/andgram/MainActivity.java → .../acmelab/andgram/TakePictureActivity.java
@@ -45,6 +45,7 @@
import android.view.MenuItem;
import android.view.View;
import android.widget.*;
+import com.markupartist.android.widget.ActionBar;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
@@ -67,7 +68,7 @@
import java.util.List;
import java.util.Map;
-public class MainActivity extends Activity
+public class TakePictureActivity extends Activity
{
private static final String TAG = Utils.TAG;
@@ -79,13 +80,14 @@
private Uri imageUri = null;
private Uri croppedImageUri = null;
private boolean imageReady = false;
+ private ActionBar actionBar;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
+ setContentView(R.layout.take_picture);
httpClient = new DefaultHttpClient();
httpClient.getParams().setParameter("http.useragent", "Instagram");
@@ -94,38 +96,36 @@ public void onCreate(Bundle savedInstanceState)
imageView = (ImageView)findViewById(R.id.imageView);
uploadButton = (Button)findViewById(R.id.btnUpload);
-
// create the output dir for us
File outputDirectory = new File(Environment.getExternalStorageDirectory(), Utils.OUTPUT_DIR);
outputDirectory.mkdirs();
+
+ Intent dashboardIntent = new Intent(getApplicationContext(), DashboardActivity.class);
+ dashboardIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ actionBar = (ActionBar) findViewById(R.id.pictureActionbar);
+ actionBar.setTitle(R.string.activity);
+ final ActionBar.Action goHomeAction = new ActionBar.IntentAction(this,
+ dashboardIntent, R.drawable.ic_title_home_default);
+ actionBar.addAction(goHomeAction);
+
+ // start camera picture taking intent
+ takePicture(null);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.main_activity_menu, menu);
+ inflater.inflate(R.menu.take_picture_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch( item.getItemId() ) {
- case R.id.show_activity:
- if( Utils.isOnline(getApplicationContext()) == false ) {
- Toast.makeText(MainActivity.this,
- "No connection to Internet.\nTry again later.",
- Toast.LENGTH_SHORT).show();
- Log.i(Utils.TAG, "No internet, didn't start ActivityView");
- return false;
- } else
- startActivity(new Intent(getApplicationContext(), ImageListActivity.class));
- return true;
case R.id.clear:
doClear();
return true;
- case R.id.credentials:
- Utils.launchCredentials(getApplicationContext());
- return true;
default:
return super.onOptionsItemSelected(item);
}
@@ -156,7 +156,7 @@ public void doClear() {
public void startUpload(View view) {
if( Utils.isOnline(getApplicationContext()) == false ) {
- Toast.makeText(MainActivity.this,
+ Toast.makeText(TakePictureActivity.this,
"No connection to Internet.\nTry again later.",
Toast.LENGTH_SHORT);
Log.i(Utils.TAG, "No internet, didn't start upload.");
@@ -165,7 +165,7 @@ public void startUpload(View view) {
Log.i(TAG, "Starting async upload");
if( !Utils.doLogin(getApplicationContext(), httpClient) ) {
- Toast.makeText(MainActivity.this, "Login failed", Toast.LENGTH_SHORT).show();
+ Toast.makeText(TakePictureActivity.this, "Login failed", Toast.LENGTH_SHORT).show();
} else {
new UploadPhotoTask().execute();
}
@@ -356,8 +356,9 @@ private void showCroppedImage() {
// turn on upload button
uploadButton.setEnabled(true);
+
} catch ( Exception e ) {
- Toast.makeText(MainActivity.this, "Camera error", Toast.LENGTH_LONG).show();
+ Toast.makeText(TakePictureActivity.this, "Camera error", Toast.LENGTH_LONG).show();
Log.e(TAG, "Camera error: " + e.toString() );
doClear();
}
@@ -383,16 +384,20 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
private class UploadPhotoTask extends AsyncTask<Void, Void, Map<String, String>> {
protected void onPreExecute() {
- Toast.makeText(MainActivity.this, "Uploading", Toast.LENGTH_SHORT).show();
+ Toast.makeText(TakePictureActivity.this, "Uploading", Toast.LENGTH_SHORT).show();
}
protected Map<String,String> doInBackground(Void... voids) {
return doUpload();
}
protected void onPostExecute(Map<String,String> resultMap) {
- Toast.makeText(MainActivity.this, resultMap.get("result"), Toast.LENGTH_SHORT).show();
+ Toast.makeText(TakePictureActivity.this, resultMap.get("result"), Toast.LENGTH_SHORT).show();
}
}
+ public void onDestroy() {
+ doClear();
+ super.onDestroy();
+ }
}

0 comments on commit 6d8e695

Please sign in to comment.