diff --git a/.gitignore b/.gitignore index 7c8920e24..cbaab4ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ #Android generated bin gen +build +actionbarsherlock/build #Eclipse .project @@ -31,3 +33,5 @@ proguard-project.txt #Other .DS_Store tmp + +/build diff --git a/actionbarsherlock/AndroidManifest.xml b/actionbarsherlock/AndroidManifest.xml index 7b8a84824..4141e909b 100644 --- a/actionbarsherlock/AndroidManifest.xml +++ b/actionbarsherlock/AndroidManifest.xml @@ -1,6 +1,6 @@ - + diff --git a/actionbarsherlock/build.gradle b/actionbarsherlock/build.gradle new file mode 100644 index 000000000..5873ddcfe --- /dev/null +++ b/actionbarsherlock/build.gradle @@ -0,0 +1,37 @@ +buildscript { + repositories { + maven { url 'http://repo1.maven.org/maven2' } + } +} +apply plugin: 'android-library' + +dependencies { + compile 'com.android.support:support-v4:13.0.+' +} + +android { + compileSdkVersion project.hasProperty("android_build_compileSdkVersion")?Integer.parseInt(project.android_build_compileSdkVersion):19 + buildToolsVersion project.hasProperty("android_build_buildToolsVersion")?project.android_build_buildToolsVersion:'19.0.1' + + defaultConfig { + minSdkVersion project.hasProperty("android_build_minSdkVersion")?Integer.parseInt(project.android_build_minSdkVersion):8 + targetSdkVersion project.hasProperty("android_build_targetSdkVersion")?Integer.parseInt(project.android_build_targetSdkVersion):19 + } + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + resources.srcDirs = ['src'] + aidl.srcDirs = ['src'] + renderscript.srcDirs = ['src'] + res.srcDirs = ['res'] + assets.srcDirs = ['assets'] + } + + instrumentTest.setRoot('tests') + } + + lintOptions { + abortOnError false + } +} \ No newline at end of file diff --git a/actionbarsherlock/lint.xml b/actionbarsherlock/lint.xml deleted file mode 100644 index fe7707cf7..000000000 --- a/actionbarsherlock/lint.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/actionbarsherlock/project.properties b/actionbarsherlock/project.properties index 5ca7d6247..0e58ae1c0 100644 --- a/actionbarsherlock/project.properties +++ b/actionbarsherlock/project.properties @@ -9,4 +9,4 @@ android.library=true # Project target. -target=android-14 +target=android-17 diff --git a/actionbarsherlock/src/android/support/v4/app/Watson.java b/actionbarsherlock/src/android/support/v4/app/Watson.java index ff72cdcfe..7cc8b9c7e 100644 --- a/actionbarsherlock/src/android/support/v4/app/Watson.java +++ b/actionbarsherlock/src/android/support/v4/app/Watson.java @@ -3,6 +3,7 @@ import android.util.Log; import android.view.View; import android.view.Window; + import com.actionbarsherlock.ActionBarSherlock.OnCreatePanelMenuListener; import com.actionbarsherlock.ActionBarSherlock.OnMenuItemSelectedListener; import com.actionbarsherlock.ActionBarSherlock.OnPreparePanelListener; @@ -10,21 +11,32 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; + import java.util.ArrayList; -/** I'm in ur package. Stealing ur variables. */ +/** + * I'm in ur package. Stealing ur variables. + */ public abstract class Watson extends FragmentActivity implements OnCreatePanelMenuListener, OnPreparePanelListener, OnMenuItemSelectedListener { private static final String TAG = "Watson"; - /** Fragment interface for menu creation callback. */ + /** + * Fragment interface for menu creation callback. + */ public interface OnCreateOptionsMenuListener { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater); } - /** Fragment interface for menu preparation callback. */ + + /** + * Fragment interface for menu preparation callback. + */ public interface OnPrepareOptionsMenuListener { public void onPrepareOptionsMenu(Menu menu); } - /** Fragment interface for menu item selection callback. */ + + /** + * Fragment interface for menu item selection callback. + */ public interface OnOptionsItemSelectedListener { public boolean onOptionsItemSelected(MenuItem item); } @@ -38,11 +50,13 @@ public interface OnOptionsItemSelectedListener { @Override public boolean onCreatePanelMenu(int featureId, Menu menu) { - if (BuildConfig.DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu); + if (BuildConfig.DEBUG) + Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu); if (featureId == Window.FEATURE_OPTIONS_PANEL) { boolean result = onCreateOptionsMenu(menu); - if (BuildConfig.DEBUG) Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result); + if (BuildConfig.DEBUG) + Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result); MenuInflater inflater = getSupportMenuInflater(); boolean show = false; @@ -52,7 +66,7 @@ public boolean onCreatePanelMenu(int featureId, Menu menu) { Fragment f = mFragments.mAdded.get(i); if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnCreateOptionsMenuListener) { show = true; - ((OnCreateOptionsMenuListener)f).onCreateOptionsMenu(menu, inflater); + ((OnCreateOptionsMenuListener) f).onCreateOptionsMenu(menu, inflater); if (newMenus == null) { newMenus = new ArrayList(); } @@ -72,7 +86,8 @@ public boolean onCreatePanelMenu(int featureId, Menu menu) { mCreatedMenus = newMenus; - if (BuildConfig.DEBUG) Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show); + if (BuildConfig.DEBUG) + Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show); result |= show; if (BuildConfig.DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result); @@ -83,11 +98,13 @@ public boolean onCreatePanelMenu(int featureId, Menu menu) { @Override public boolean onPreparePanel(int featureId, View view, Menu menu) { - if (BuildConfig.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu); + if (BuildConfig.DEBUG) + Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu); if (featureId == Window.FEATURE_OPTIONS_PANEL) { boolean result = onPrepareOptionsMenu(menu); - if (BuildConfig.DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result); + if (BuildConfig.DEBUG) + Log.d(TAG, "[onPreparePanel] activity prepare result: " + result); boolean show = false; if (mFragments.mAdded != null) { @@ -95,7 +112,7 @@ public boolean onPreparePanel(int featureId, View view, Menu menu) { Fragment f = mFragments.mAdded.get(i); if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnPrepareOptionsMenuListener) { show = true; - ((OnPrepareOptionsMenuListener)f).onPrepareOptionsMenu(menu); + ((OnPrepareOptionsMenuListener) f).onPrepareOptionsMenu(menu); } } } @@ -112,7 +129,8 @@ public boolean onPreparePanel(int featureId, View view, Menu menu) { @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { - if (BuildConfig.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item); + if (BuildConfig.DEBUG) + Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item); if (featureId == Window.FEATURE_OPTIONS_PANEL) { if (onOptionsItemSelected(item)) { @@ -123,7 +141,7 @@ public boolean onMenuItemSelected(int featureId, MenuItem item) { for (int i = 0; i < mFragments.mAdded.size(); i++) { Fragment f = mFragments.mAdded.get(i); if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnOptionsItemSelectedListener) { - if (((OnOptionsItemSelectedListener)f).onOptionsItemSelected(item)) { + if (((OnOptionsItemSelectedListener) f).onOptionsItemSelected(item)) { return true; } }