Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use newer tools/SDK + work w/ API >= 8 (ie, Froyo+) #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.android.tools.build:gradle:1.3.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Mon Aug 31 16:06:46 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip
8 changes: 5 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
minSdkVersion 14
minSdkVersion 8
targetSdkVersion 22
versionCode 1
versionName "1.0"
Expand All @@ -20,4 +20,6 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
}
4 changes: 4 additions & 0 deletions library/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class MaterialShowcaseView extends FrameLayout implements View.OnTouchLis
private boolean mShouldRender = false; // flag to decide when we should actually render
private int mMaskColour;
private AnimationFactory mAnimationFactory;
private boolean mShouldAnimate = true;
private boolean mShouldAnimate = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB);
private long mFadeDurationInMillis = ShowcaseConfig.DEFAULT_FADE_TIME;
private Handler mHandler;
private long mDelayInMillis = ShowcaseConfig.DEFAULT_DELAY;
Expand Down Expand Up @@ -246,7 +246,7 @@ public void setTarget(Target target) {
mBottomMargin = getSoftButtonsBarSizePort((Activity) getContext());
FrameLayout.LayoutParams contentLP = (LayoutParams) getLayoutParams();

if (contentLP!=null && contentLP.bottomMargin != mBottomMargin)
if (contentLP != null && contentLP.bottomMargin != mBottomMargin)
contentLP.bottomMargin = mBottomMargin;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int getSequenceStatus() {

void setSequenceStatus(int status) {
SharedPreferences internal = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
internal.edit().putInt(STATUS + showcaseID, status).apply();
internal.edit().putInt(STATUS + showcaseID, status).commit();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should mention that these were changed because .apply() didn't show up until API 9.

}


Expand All @@ -57,12 +57,12 @@ public void resetShowcase() {

static void resetShowcase(Context context, String showcaseID) {
SharedPreferences internal = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
internal.edit().putInt(STATUS + showcaseID, SEQUENCE_NEVER_STARTED).apply();
internal.edit().putInt(STATUS + showcaseID, SEQUENCE_NEVER_STARTED).commit();
}

public static void resetAll(Context context) {
SharedPreferences internal = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
internal.edit().clear().apply();
internal.edit().clear().commit();
}

public void close() {
Expand Down
6 changes: 3 additions & 3 deletions library/src/main/res/layout/showcase_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
android:id="@+id/tv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="20dp" />

<TextView
android:id="@+id/tv_dismiss"
android:background="?android:attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp"
android:textColor="@android:color/white"
android:textSize="22dp" />
</LinearLayout>
12 changes: 6 additions & 6 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 23
buildToolsVersion '23.0.0'

defaultConfig {
applicationId "uk.co.deanwild.materialshowcaseviewsample"
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Expand All @@ -20,7 +20,7 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.0'
compile project(':library')
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package uk.co.deanwild.materialshowcaseviewsample;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import uk.co.deanwild.materialshowcaseview.MaterialShowcaseView;


public class CustomExample extends ActionBarActivity implements View.OnClickListener {
public class CustomExample extends AppCompatActivity implements View.OnClickListener {

private Button mButtonShow;
private Button mButtonReset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import uk.co.deanwild.materialshowcaseview.MaterialShowcaseView;

public class MainActivity extends ActionBarActivity implements View.OnClickListener {
public class MainActivity extends AppCompatActivity implements View.OnClickListener {

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.co.deanwild.materialshowcaseviewsample;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
Expand All @@ -11,7 +11,7 @@
import uk.co.deanwild.materialshowcaseview.ShowcaseConfig;


public class SequenceExample extends ActionBarActivity implements View.OnClickListener {
public class SequenceExample extends AppCompatActivity implements View.OnClickListener {

private Button mButtonOne;
private Button mButtonTwo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package uk.co.deanwild.materialshowcaseviewsample;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import uk.co.deanwild.materialshowcaseview.MaterialShowcaseView;


public class SimpleSingleExample extends ActionBarActivity implements View.OnClickListener {
public class SimpleSingleExample extends AppCompatActivity implements View.OnClickListener {

private Button mButtonShow;
private Button mButtonReset;
Expand Down