Permalink
Browse files

Add support for compatibility-v7-appcompat

  • Loading branch information...
1 parent 98b19f9 commit dfb596366bad6f704c5a1b01b6ad9cfb993b2e66 Mike Burton committed Nov 27, 2013
Showing with 188 additions and 18 deletions.
  1. BIN maven_repo_3rd_party/android/support/compatibility-v4/11/compatibility-v4-11.jar
  2. +0 −1 maven_repo_3rd_party/android/support/compatibility-v4/11/compatibility-v4-11.jar.md5
  3. +0 −1 maven_repo_3rd_party/android/support/compatibility-v4/11/compatibility-v4-11.jar.sha1
  4. +0 −1 maven_repo_3rd_party/android/support/compatibility-v4/11/compatibility-v4-11.pom.md5
  5. +0 −1 maven_repo_3rd_party/android/support/compatibility-v4/11/compatibility-v4-11.pom.sha1
  6. BIN maven_repo_3rd_party/android/support/compatibility-v4/19/compatibility-v4-19-sources.jar
  7. BIN maven_repo_3rd_party/android/support/compatibility-v4/19/compatibility-v4-19.jar
  8. +1 −1 ..._party/android/support/compatibility-v4/{11/compatibility-v4-11.pom → 19/compatibility-v4-19.pom}
  9. +0 −12 maven_repo_3rd_party/android/support/compatibility-v4/maven-metadata-local.xml
  10. BIN ...3rd_party/android/support/compatibility-v7-appcompat/19/compatibility-v7-appcompat-19-sources.jar
  11. BIN ...repo_3rd_party/android/support/compatibility-v7-appcompat/19/compatibility-v7-appcompat-19.apklib
  12. BIN maven_repo_3rd_party/android/support/compatibility-v7-appcompat/19/compatibility-v7-appcompat-19.jar
  13. +9 −0 maven_repo_3rd_party/android/support/compatibility-v7-appcompat/19/compatibility-v7-appcompat-19.pom
  14. BIN maven_repo_3rd_party/android/support/compatibility-v7/19/compatibility-v7-19-sources.jar
  15. BIN maven_repo_3rd_party/android/support/compatibility-v7/19/compatibility-v7-19.apklib
  16. BIN maven_repo_3rd_party/android/support/compatibility-v7/19/compatibility-v7-19.jar
  17. +9 −0 maven_repo_3rd_party/android/support/compatibility-v7/19/compatibility-v7-19.pom
  18. +7 −1 roboguice/pom.xml
  19. +162 −0 roboguice/src/main/java/roboguice/activity/RoboActionBarActivity.java
@@ -1 +0,0 @@
-7b5efe58fd28cbc7fa8f9e88ab9c7d65
@@ -1 +0,0 @@
-48c94ae70fa65718b382098237806a5909bb096e
@@ -1 +0,0 @@
-d19de3d1ff1e49a5f31ec5f93bfc5c59
@@ -1 +0,0 @@
-d430922cba75885f944aa47b06fe86de81a6aeb9
@@ -4,6 +4,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
- <version>11</version>
+ <version>19</version>
<description>POM was created from install:install-file</description>
</project>
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.support</groupId>
- <artifactId>compatibility-v4</artifactId>
- <versioning>
- <release>11</release>
- <versions>
- <version>11</version>
- </versions>
- <lastUpdated>20121210201424</lastUpdated>
- </versioning>
-</metadata>
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>android.support</groupId>
+ <artifactId>compatibility-v7-appcompat</artifactId>
+ <version>19</version>
+ <description>POM was created from install:install-file</description>
+</project>
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>android.support</groupId>
+ <artifactId>compatibility-v7</artifactId>
+ <version>19</version>
+ <description>POM was created from install:install-file</description>
+</project>
View
@@ -92,7 +92,13 @@
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
- <version>11</version>
+ <version>19</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>android.support</groupId>
+ <artifactId>compatibility-v7-appcompat</artifactId>
+ <version>19</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2009 Michael Burton
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+package roboguice.activity;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.support.v7.app.ActionBarActivity;
+import com.google.inject.Inject;
+import com.google.inject.Key;
+import roboguice.RoboGuice;
+import roboguice.activity.event.*;
+import roboguice.context.event.OnConfigurationChangedEvent;
+import roboguice.context.event.OnCreateEvent;
+import roboguice.context.event.OnDestroyEvent;
+import roboguice.context.event.OnStartEvent;
+import roboguice.event.EventManager;
+import roboguice.inject.ContentViewListener;
+import roboguice.inject.RoboInjector;
+import roboguice.util.RoboContext;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A {@link RoboActivity} extends from {@link Activity} to provide dynamic
+ * injection of collaborators, using Google Guice.<br />
+ * <br />
+ * Your own activities that usually extend from {@link Activity} should now
+ * extend from {@link RoboActivity}.<br />
+ * <br />
+ * If your activities extend from subclasses of {@link Activity} provided by the
+ * Android SDK, we provided Guice versions as well for the most used : see
+ * {@link RoboExpandableListActivity}, {@link RoboListActivity}, and other
+ * classes located in package <strong>roboguice.activity</strong>.<br />
+ * <br />
+ * If we didn't provide what you need, you have two options : either post an
+ * issue on <a href="http://code.google.com/p/roboguice/issues/list">the bug
+ * tracker</a>, or implement it yourself. Have a look at the source code of this
+ * class ({@link RoboActivity}), you won't have to write that much changes. And
+ * of course, you are welcome to contribute and send your implementations to the
+ * RoboGuice project.<br />
+ * <br />
+ * Please be aware that collaborators are not injected into this until you call
+ * {@link #setContentView(int)} (calling any of the overloads of this methods
+ * will work).<br />
+ * <br />
+ *
+ * @author Mike Burton
+ */
+public class RoboActionBarActivity extends ActionBarActivity implements RoboContext {
+ protected EventManager eventManager;
+ protected HashMap<Key<?>,Object> scopedObjects = new HashMap<Key<?>, Object>();
+
+ @Inject ContentViewListener ignored; // BUG find a better place to put this
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ final RoboInjector injector = RoboGuice.getInjector(this);
+ eventManager = injector.getInstance(EventManager.class);
+ injector.injectMembersWithoutViews(this);
+ super.onCreate(savedInstanceState);
+ eventManager.fire(new OnCreateEvent<Activity>(this,savedInstanceState));
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ eventManager.fire(new OnSaveInstanceStateEvent(this, outState));
+ }
+
+ @Override
+ protected void onRestart() {
+ super.onRestart();
+ eventManager.fire(new OnRestartEvent(this));
+ }
+
+ @Override
+ protected void onStart() {
+ super.onStart();
+ eventManager.fire(new OnStartEvent<Activity>(this));
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ eventManager.fire(new OnResumeEvent(this));
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ eventManager.fire(new OnPauseEvent(this));
+ }
+
+ @Override
+ protected void onNewIntent( Intent intent ) {
+ super.onNewIntent(intent);
+ eventManager.fire(new OnNewIntentEvent(this));
+ }
+
+ @Override
+ protected void onStop() {
+ try {
+ eventManager.fire(new OnStopEvent(this));
+ } finally {
+ super.onStop();
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ try {
+ eventManager.fire(new OnDestroyEvent<Activity>(this));
+ } finally {
+ try {
+ RoboGuice.destroyInjector(this);
+ } finally {
+ super.onDestroy();
+ }
+ }
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ final Configuration currentConfig = getResources().getConfiguration();
+ super.onConfigurationChanged(newConfig);
+ eventManager.fire(new OnConfigurationChangedEvent<Activity>(this,currentConfig, newConfig));
+ }
+
+ @Override
+ public void onSupportContentChanged() {
+ super.onSupportContentChanged();
+ RoboGuice.getInjector(this).injectViewMembers(this);
+ eventManager.fire(new OnContentChangedEvent(this));
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ eventManager.fire(new OnActivityResultEvent(this, requestCode, resultCode, data));
+ }
+
+ @Override
+ public Map<Key<?>, Object> getScopedObjectMap() {
+ return scopedObjects;
+ }
+}

0 comments on commit dfb5963

Please sign in to comment.