Skip to content
Permalink
Browse files

add landscape screen mode support

  • Loading branch information...
guy-4444 committed May 6, 2019
1 parent 46e3058 commit 14a912b6e22b55bf08fb97cbb47d6cd8c33055bc
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
@@ -70,6 +70,25 @@ public void onClick(View view) {
, 4
);

SmartRate.Rate(MainActivity.this
, "Rate Us"
, "Tell others what you think about this app"
, "Continue"
, "Please take a moment and rate us on Google Play"
, "click here"
, "Cancel"
, "Thanks for the feedback"
, Color.parseColor("#2196F3")
, 4
, new SmartRate.CallBack_UserRating() {
@Override
public void userRating(int rating) {
// Do something
// from now disable this option
}
}
);

// SmartRate.Rate(MainActivity.this
// , "דרג אותנו"
// , "שתף עם אחרים מה אתה חושב עלינו"
@@ -7,7 +7,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.4.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -1,6 +1,6 @@
#Tue Mar 05 15:29:36 IST 2019
#Mon May 06 17:53:44 IDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
@@ -24,6 +24,10 @@

public class SmartRate {

public interface CallBack_UserRating {
void userRating(int rating);
}

private static final long DONT_ASK_AGAIN_VALUE = -1;
private static final String SP_LIBRARY_NAME = "SP_RATE_LIBRARY";
private static final String SP_KEY_LAST_ASK_TIME = "SP_KEY_LAST_ASK_TIME";
@@ -69,6 +73,35 @@ public static void Rate(
, -1);
}

public static void Rate(
final Activity activity
, final String _title
, final String _content
, final String _continue_text
, final String _googlePlay_text
, final String _clickHere_text
, final String _cancel_text
, final String _thanksForFeedback
, final int mainColor
, final int openStoreFromXStars
, CallBack_UserRating callBack_userRating
) {
Rate(activity
, _title
, _content
, _continue_text
, _googlePlay_text
, _clickHere_text
, _cancel_text
, ""
, _thanksForFeedback
, mainColor
, openStoreFromXStars
, -1
, -1
, callBack_userRating);
}

public static void Rate(
final Activity activity
, final String _title
@@ -84,6 +117,38 @@ public static void Rate(
, final int _hoursBetweenCalls
, final int _hoursDelayToActivate
) {
Rate(activity
, _title
, _content
, _continue_text
, _googlePlay_text
, _clickHere_text
, _later_text
, _stop_text
, _thanksForFeedback
, mainColor
, openStoreFromXStars
, -1
, -1
, null);
}

public static void Rate(
final Activity activity
, final String _title
, final String _content
, final String _continue_text
, final String _googlePlay_text
, final String _clickHere_text
, final String _later_text
, final String _stop_text
, final String _thanksForFeedback
, final int mainColor
, final int openStoreFromXStars
, final int _hoursBetweenCalls
, final int _hoursDelayToActivate
, final CallBack_UserRating callBack_userRating
) {

final String title = (_title != null && !_title.equals("")) ? _title : DEFAULT_TEXT_TITLE;
final String content = (_content != null && !_content.equals("")) ? _content : DEFAULT_TEXT_CONTENT;
@@ -227,6 +292,10 @@ public void onClick(View view) {
}
}

if (callBack_userRating != null) {
callBack_userRating.userRating(selectedStar);
}

}
});
} else {

0 comments on commit 14a912b

Please sign in to comment.
You can’t perform that action at this time.