Permalink
Browse files

Prepare for 1.3 release

  • Loading branch information...
Sergey
Sergey committed Oct 8, 2012
1 parent 6299fab commit df7e80f32cd298c99552172fe72d3d9d61539344
Showing with 174 additions and 70 deletions.
  1. +1 −1 contrib/ActionBarSherlock
  2. +2 −2 demo/AndroidManifest.xml
  3. +2 −2 library/AndroidManifest.xml
  4. +1 −1 library/res/values/attrs.xml
  5. +7 −0 library/src/android/support/v4/app/_HoloFragment.java
  6. +4 −9 library/src/com/WazaBe/HoloEverywhere/app/Activity.java
  7. +0 −2 library/src/com/WazaBe/HoloEverywhere/app/Base.java
  8. +1 −10 library/src/com/WazaBe/HoloEverywhere/app/DialogFragment.java
  9. +2 −1 library/src/com/WazaBe/HoloEverywhere/app/Fragment.java
  10. +1 −1 library/src/com/WazaBe/HoloEverywhere/preference/PreferenceActivity.java
  11. +1 −1 library/src/com/WazaBe/HoloEverywhere/preference/PreferenceFrameLayout.java
  12. +5 −4 library/src/com/WazaBe/HoloEverywhere/sherlock/SActivity.java
  13. +10 −4 library/src/com/WazaBe/HoloEverywhere/sherlock/SDialogFragment.java
  14. +6 −6 library/src/com/WazaBe/HoloEverywhere/sherlock/SExpandableListActivity.java
  15. +10 −4 library/src/com/WazaBe/HoloEverywhere/sherlock/SFragment.java
  16. +5 −4 library/src/com/WazaBe/HoloEverywhere/sherlock/SListActivity.java
  17. +10 −4 library/src/com/WazaBe/HoloEverywhere/sherlock/SListFragment.java
  18. +5 −4 library/src/com/WazaBe/HoloEverywhere/sherlock/SPreferenceActivity.java
  19. +3 −3 library/src/com/WazaBe/HoloEverywhere/sherlock/SPreferenceFragment.java
  20. +4 −5 library/src/com/WazaBe/HoloEverywhere/widget/CalendarView.java
  21. +1 −2 library/src/com/WazaBe/HoloEverywhere/widget/DatePicker.java
  22. +93 −0 library/src/com/WazaBe/HoloEverywhere/widget/NineFrameLayout.java
Submodule ActionBarSherlock updated from 0584a3 to 90939d
View
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.WazaBe.HoloDemo"
- android:versionCode="13"
- android:versionName="1.2.4" >
+ android:versionCode="20"
+ android:versionName="1.3" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="16" />
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.WazaBe.HoloEverywhere"
- android:versionCode="13"
- android:versionName="1.2.4" >
+ android:versionCode="20"
+ android:versionName="1.3" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="16" />
@@ -14,6 +14,7 @@
<attr name="dropdownListPreferredItemHeight" format="reference" />
<attr name="textAppearanceLargePopupMenu" format="reference" />
<attr name="textAppearanceSmallPopupMenu" format="reference" />
+ <attr name="selectableItemBackground" format="reference" />
-->
<attr name="preferenceFrameLayoutStyle" format="reference" />
<attr name="preferenceScreenStyle" format="reference" />
@@ -38,7 +39,6 @@
<attr name="buttonBarButtonStyle" format="reference" />
<attr name="borderlessButtonStyle" format="reference" />
<attr name="segmentedButtonStyle" format="reference" />
- <attr name="selectableItemBackground" format="reference" />
<attr name="listPreferredItemHeightLarge" format="dimension" />
<attr name="dividerHorizontal" format="reference" />
<attr name="listDividerAlertDialog" format="reference" />
@@ -0,0 +1,7 @@
+package android.support.v4.app;
+
+public class _HoloFragment extends Fragment {
+ protected int internaGetContainerId() {
+ return mContainerId;
+ }
+}
@@ -2,7 +2,7 @@
import android.annotation.SuppressLint;
import android.os.Bundle;
-import android.support.v4.app._ActionBarSherlockTrojanHorse;
+import android.support.v4.app.Watson;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
@@ -13,8 +13,7 @@
import com.WazaBe.HoloEverywhere.internal.BaseSharedPreferences;
import com.WazaBe.HoloEverywhere.preference.SharedPreferences;
-public abstract class Activity extends _ActionBarSherlockTrojanHorse implements
- Base {
+public abstract class Activity extends Watson implements Base {
private boolean forceThemeApply = false;
@Override
@@ -48,6 +47,7 @@ public boolean isForceThemeApply() {
}
@Override
+ @SuppressLint("NewApi")
public void onBackPressed() {
if (!getSupportFragmentManager().popBackStackImmediate()) {
finish();
@@ -56,18 +56,13 @@ public void onBackPressed() {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ getLayoutInflater().setFactory(this);
if (Settings.isUseThemeManager()) {
ThemeManager.applyTheme(this);
}
super.onCreate(savedInstanceState);
}
- @Override
- @SuppressLint("NewApi")
- public void onSupportBackPressed() {
- onBackPressed();
- }
-
@Override
public void setContentView(int layoutResID) {
super.setContentView(FontLoader.inflate(this, layoutResID));
@@ -11,6 +11,4 @@
public boolean isABSSupport();
public boolean isForceThemeApply();
-
- public void onSupportBackPressed();
}
@@ -1,7 +1,5 @@
package com.WazaBe.HoloEverywhere.app;
-import java.lang.reflect.Field;
-
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -177,13 +175,7 @@ public void onCancel(DialogInterface dialog) {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- try {
- Field field = getClass().getField("mContainerId");
- field.setAccessible(true);
- mShowsDialog = (Integer) field.get(field) == 0;
- } catch (Exception e) {
- mShowsDialog = false;
- }
+ mShowsDialog = internaGetContainerId() == 0;
if (savedInstanceState != null) {
mStyle = savedInstanceState.getInt(SAVED_STYLE, STYLE_NORMAL);
mTheme = savedInstanceState.getInt(SAVED_THEME, 0);
@@ -192,7 +184,6 @@ public void onCreate(Bundle savedInstanceState) {
mShowsDialog);
mBackStackId = savedInstanceState.getInt(SAVED_BACK_STACK_ID, -1);
}
-
}
public Dialog onCreateDialog(Bundle savedInstanceState) {
@@ -2,6 +2,7 @@
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
+import android.support.v4.app._HoloFragment;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
@@ -11,7 +12,7 @@
import com.WazaBe.HoloEverywhere.internal.BaseSharedPreferences;
import com.WazaBe.HoloEverywhere.preference.SharedPreferences;
-public class Fragment extends android.support.v4.app.Fragment {
+public class Fragment extends _HoloFragment {
public LayoutInflater getLayoutInflater() {
return LayoutInflater.from(getActivity());
}
@@ -355,7 +355,7 @@ public void finishPreferencePanel(Fragment caller, int resultCode,
setResult(resultCode, resultData);
finish();
} else {
- onSupportBackPressed();
+ onBackPressed();
if (caller != null) {
if (caller.getTargetFragment() != null) {
caller.getTargetFragment().onActivityResult(
@@ -6,7 +6,7 @@
import android.view.View;
import com.WazaBe.HoloEverywhere.R;
-import com.actionbarsherlock.internal.nineoldandroids.widget.NineFrameLayout;
+import com.WazaBe.HoloEverywhere.widget.NineFrameLayout;
public class PreferenceFrameLayout extends NineFrameLayout {
public static class LayoutParams extends NineFrameLayout.LayoutParams {
@@ -8,6 +8,7 @@
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
+import com.WazaBe.HoloEverywhere.FontLoader;
import com.WazaBe.HoloEverywhere.app.Activity;
import com.actionbarsherlock.ActionBarSherlock;
import com.actionbarsherlock.app.ActionBar;
@@ -25,7 +26,7 @@
@Override
public void addContentView(View view, LayoutParams params) {
if (isABSSupport()) {
- getSherlock().addContentView(view, params);
+ getSherlock().addContentView(FontLoader.apply(view), params);
} else {
super.addContentView(view, params);
}
@@ -244,7 +245,7 @@ public void requestWindowFeature(long featureId) {
@Override
public void setContentView(int layoutResId) {
if (isABSSupport()) {
- getSherlock().setContentView(layoutResId);
+ getSherlock().setContentView(FontLoader.inflate(this, layoutResId));
} else {
super.setContentView(layoutResId);
}
@@ -253,7 +254,7 @@ public void setContentView(int layoutResId) {
@Override
public void setContentView(View view) {
if (isABSSupport()) {
- getSherlock().setContentView(view);
+ getSherlock().setContentView(FontLoader.apply(view));
} else {
super.setContentView(view);
}
@@ -262,7 +263,7 @@ public void setContentView(View view) {
@Override
public void setContentView(View view, LayoutParams params) {
if (isABSSupport()) {
- getSherlock().setContentView(view, params);
+ getSherlock().setContentView(FontLoader.apply(view), params);
} else {
super.setContentView(view, params);
}
@@ -1,9 +1,9 @@
package com.WazaBe.HoloEverywhere.sherlock;
import android.os.Build.VERSION;
-import android.support.v4.app._ActionBarSherlockTrojanHorse.OnCreateOptionsMenuListener;
-import android.support.v4.app._ActionBarSherlockTrojanHorse.OnOptionsItemSelectedListener;
-import android.support.v4.app._ActionBarSherlockTrojanHorse.OnPrepareOptionsMenuListener;
+import android.support.v4.app.Watson.OnCreateOptionsMenuListener;
+import android.support.v4.app.Watson.OnOptionsItemSelectedListener;
+import android.support.v4.app.Watson.OnPrepareOptionsMenuListener;
import com.WazaBe.HoloEverywhere.app.Activity;
import com.WazaBe.HoloEverywhere.app.DialogFragment;
@@ -18,10 +18,16 @@
OnOptionsItemSelectedListener {
private SBase mBase;
+ @Deprecated
public SActivity getSherlockActivity() {
return (SActivity) mBase;
}
+ @SuppressWarnings("unchecked")
+ public <T extends Activity & SBase> T getSActivity() {
+ return (T) mBase;
+ }
+
@Override
public boolean isABSSupport() {
return VERSION.SDK_INT >= 7;
@@ -32,7 +38,7 @@ public void onAttach(Activity activity) {
if (isABSSupport()) {
if (!(activity instanceof SBase)) {
throw new IllegalStateException(getClass().getSimpleName()
- + " must be attached to a SActivity.");
+ + " must be attached to a S***Activity.");
}
mBase = (SBase) activity;
}
@@ -8,6 +8,7 @@
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
+import com.WazaBe.HoloEverywhere.FontLoader;
import com.WazaBe.HoloEverywhere.app.ExpandableListActivity;
import com.actionbarsherlock.ActionBarSherlock;
import com.actionbarsherlock.app.ActionBar;
@@ -26,7 +27,7 @@
@Override
public void addContentView(View view, LayoutParams params) {
if (isABSSupport()) {
- getSherlock().addContentView(view, params);
+ getSherlock().addContentView(FontLoader.apply(view), params);
} else {
super.addContentView(view, params);
}
@@ -245,7 +246,7 @@ public void requestWindowFeature(long featureId) {
@Override
public void setContentView(int layoutResId) {
if (isABSSupport()) {
- getSherlock().setContentView(layoutResId);
+ getSherlock().setContentView(FontLoader.inflate(this, layoutResId));
} else {
super.setContentView(layoutResId);
}
@@ -254,7 +255,7 @@ public void setContentView(int layoutResId) {
@Override
public void setContentView(View view) {
if (isABSSupport()) {
- getSherlock().setContentView(view);
+ getSherlock().setContentView(FontLoader.apply(view));
} else {
super.setContentView(view);
}
@@ -263,7 +264,7 @@ public void setContentView(View view) {
@Override
public void setContentView(View view, LayoutParams params) {
if (isABSSupport()) {
- getSherlock().setContentView(view, params);
+ getSherlock().setContentView(FontLoader.apply(view), params);
} else {
super.setContentView(view, params);
}
@@ -322,5 +323,4 @@ public ActionMode startActionMode(ActionMode.Callback callback) {
@Override
public void supportInvalidateOptionsMenu() {
invalidateOptionsMenu();
- }
-}
+ }}
@@ -1,9 +1,9 @@
package com.WazaBe.HoloEverywhere.sherlock;
import android.os.Build.VERSION;
-import android.support.v4.app._ActionBarSherlockTrojanHorse.OnCreateOptionsMenuListener;
-import android.support.v4.app._ActionBarSherlockTrojanHorse.OnOptionsItemSelectedListener;
-import android.support.v4.app._ActionBarSherlockTrojanHorse.OnPrepareOptionsMenuListener;
+import android.support.v4.app.Watson.OnCreateOptionsMenuListener;
+import android.support.v4.app.Watson.OnOptionsItemSelectedListener;
+import android.support.v4.app.Watson.OnPrepareOptionsMenuListener;
import com.WazaBe.HoloEverywhere.app.Activity;
import com.WazaBe.HoloEverywhere.app.Fragment;
@@ -17,10 +17,16 @@
OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
private SBase mBase;
+ @Deprecated
public SActivity getSherlockActivity() {
return (SActivity) mBase;
}
+ @SuppressWarnings("unchecked")
+ public <T extends Activity & SBase> T getSActivity() {
+ return (T) mBase;
+ }
+
@Override
public boolean isABSSupport() {
return VERSION.SDK_INT >= 7;
@@ -31,7 +37,7 @@ public void onAttach(Activity activity) {
if (isABSSupport()) {
if (!(activity instanceof SBase)) {
throw new IllegalStateException(getClass().getSimpleName()
- + " must be attached to a SActivity.");
+ + " must be attached to a S***Activity.");
}
mBase = (SBase) activity;
}
@@ -8,6 +8,7 @@
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
+import com.WazaBe.HoloEverywhere.FontLoader;
import com.WazaBe.HoloEverywhere.app.ListActivity;
import com.actionbarsherlock.ActionBarSherlock;
import com.actionbarsherlock.app.ActionBar;
@@ -25,7 +26,7 @@
@Override
public void addContentView(View view, LayoutParams params) {
if (isABSSupport()) {
- getSherlock().addContentView(view, params);
+ getSherlock().addContentView(FontLoader.apply(view), params);
} else {
super.addContentView(view, params);
}
@@ -244,7 +245,7 @@ public void requestWindowFeature(long featureId) {
@Override
public void setContentView(int layoutResId) {
if (isABSSupport()) {
- getSherlock().setContentView(layoutResId);
+ getSherlock().setContentView(FontLoader.inflate(this, layoutResId));
} else {
super.setContentView(layoutResId);
}
@@ -253,7 +254,7 @@ public void setContentView(int layoutResId) {
@Override
public void setContentView(View view) {
if (isABSSupport()) {
- getSherlock().setContentView(view);
+ getSherlock().setContentView(FontLoader.apply(view));
} else {
super.setContentView(view);
}
@@ -262,7 +263,7 @@ public void setContentView(View view) {
@Override
public void setContentView(View view, LayoutParams params) {
if (isABSSupport()) {
- getSherlock().setContentView(view, params);
+ getSherlock().setContentView(FontLoader.apply(view), params);
} else {
super.setContentView(view, params);
}
Oops, something went wrong.

0 comments on commit df7e80f

Please sign in to comment.