Panagiotis Triantafyllou

plugin configuration

Showing 697 changed files with 311 additions and 1297 deletions
...@@ -43,7 +43,7 @@ android { ...@@ -43,7 +43,7 @@ android {
43 43
44 dependencies { 44 dependencies {
45 implementation fileTree(dir: 'libs', include: ['*.jar']) 45 implementation fileTree(dir: 'libs', include: ['*.jar'])
46 - implementation project(':libraries:warply_android_sdk') 46 + implementation project(':warply_android_sdk')
47 47
48 //Support 48 //Support
49 implementation 'androidx.appcompat:appcompat:1.4.1' 49 implementation 'androidx.appcompat:appcompat:1.4.1'
......
...@@ -5,11 +5,13 @@ buildscript { ...@@ -5,11 +5,13 @@ buildscript {
5 mavenCentral() 5 mavenCentral()
6 google() 6 google()
7 maven { url 'https://developer.huawei.com/repo/' } 7 maven { url 'https://developer.huawei.com/repo/' }
8 + maven { url 'https://plugins.gradle.org/m2/' }
8 } 9 }
9 dependencies { 10 dependencies {
10 classpath 'com.android.tools.build:gradle:7.0.4' 11 classpath 'com.android.tools.build:gradle:7.0.4'
11 classpath 'com.google.gms:google-services:4.3.10' 12 classpath 'com.google.gms:google-services:4.3.10'
12 classpath 'com.huawei.agconnect:agcp:1.6.2.300' 13 classpath 'com.huawei.agconnect:agcp:1.6.2.300'
14 + classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
13 15
14 // NOTE: Do not place your application dependencies here; they belong 16 // NOTE: Do not place your application dependencies here; they belong
15 // in the individual module build.gradle files 17 // in the individual module build.gradle files
...@@ -21,5 +23,9 @@ allprojects { ...@@ -21,5 +23,9 @@ allprojects {
21 mavenCentral() 23 mavenCentral()
22 google() 24 google()
23 maven { url 'https://developer.huawei.com/repo/' } 25 maven { url 'https://developer.huawei.com/repo/' }
26 + maven { url 'https://plugins.gradle.org/m2/' }
24 } 27 }
25 } 28 }
29 +
30 +apply plugin: 'io.github.gradle-nexus.publish-plugin'
31 +apply from: "${rootDir}/scripts/publish-root.gradle"
...\ No newline at end of file ...\ No newline at end of file
......
1 -package ly.warp.sdk.views;
2 -
3 -import android.content.Context;
4 -import androidx.fragment.app.Fragment;
5 -import androidx.fragment.app.FragmentActivity;
6 -import androidx.fragment.app.FragmentManager;
7 -import androidx.fragment.app.FragmentTransaction;
8 -import android.text.TextUtils;
9 -
10 -import ly.warp.sdk.BuildConfig;
11 -import ly.warp.sdk.Warply;
12 -import ly.warp.sdk.fragments.WarpViewFragment;
13 -import ly.warp.sdk.io.callbacks.CallbackReceiver;
14 -import ly.warp.sdk.io.callbacks.SimpleCallbackReceiver;
15 -import ly.warp.sdk.io.models.CampaignList;
16 -import ly.warp.sdk.io.request.WarplyInboxRequest;
17 -
18 -public class CampaignViewLoader implements CallbackReceiver<CampaignList> {
19 -
20 - // ===========================================================
21 - // Constants
22 - // ===========================================================
23 -
24 - // ===========================================================
25 - // Fields
26 - // ===========================================================
27 -
28 - private DisplayBuilder mLastDisplayBuilder;
29 - private SimpleCallbackReceiver<CampaignList> mExternalListener;
30 -
31 - // ===========================================================
32 - // Constructors
33 - // ===========================================================
34 -
35 - public CampaignViewLoader(Context context) {
36 - Warply.getInitializer(context).init();
37 - }
38 -
39 - // ===========================================================
40 - // Methods for/from SuperClass/Interfaces
41 - // ===========================================================
42 -
43 - @Override
44 - public void onSuccess(CampaignList result) {
45 -
46 - if (result != null && result.size() > 0) {
47 - showWarplyFragment(mLastDisplayBuilder, result.get(0).getSessionUUID());
48 - }
49 - notifySuccessExternalListener(result);
50 - }
51 -
52 - @Override
53 - public void onFailure(int errorCode) {
54 -
55 - notifyFailureExternalListener(errorCode);
56 - }
57 -
58 - // ===========================================================
59 - // Methods
60 - // ===========================================================
61 -
62 - private void requestCampaignsIfNeed(DisplayBuilder builder, WarplyInboxRequest request, String sessionUuid) {
63 -
64 - if (request != null && TextUtils.isEmpty(sessionUuid)) {
65 - mLastDisplayBuilder = builder;
66 - Warply.getInbox(request, this);
67 - } else if (!TextUtils.isEmpty(sessionUuid)) {
68 - showWarplyFragment(builder, sessionUuid);
69 - notifySuccessExternalListener(null);
70 - }
71 - }
72 -
73 - private void showWarplyFragment(DisplayBuilder builder, String sessionUuid) {
74 -
75 - if (builder != null && builder.fragmentManager != null) {
76 -
77 - WarpViewFragment warpFragment = WarpViewFragment.newInstance(sessionUuid, builder.isUseProgress, builder.isShowCloseBtn);
78 - FragmentTransaction transaction = builder.fragmentManager.beginTransaction()
79 - .replace(builder.containerId, warpFragment,
80 - WarpViewFragment.class.getSimpleName())
81 - .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
82 -
83 - if (builder.isAddToBackStack) {
84 - transaction.addToBackStack(null);
85 - }
86 -
87 - try {
88 - transaction.commit();
89 - } catch (IllegalStateException e) {
90 - if (BuildConfig.DEBUG) {
91 - e.printStackTrace();
92 - }
93 - }
94 - }
95 - }
96 -
97 - private void notifySuccessExternalListener(CampaignList campaigns) {
98 -
99 - if (mExternalListener != null) {
100 - mExternalListener.onSuccess(campaigns);
101 - }
102 - }
103 -
104 - private void notifyFailureExternalListener(int errorCode) {
105 -
106 - if (mExternalListener != null) {
107 - mExternalListener.onFailure(errorCode);
108 - }
109 - }
110 -
111 - // ===========================================================
112 - // Getter & Setter
113 - // ===========================================================
114 -
115 - public void setCampaignsListener(SimpleCallbackReceiver<CampaignList> listener) {
116 - this.mExternalListener = listener;
117 - }
118 -
119 - public DisplayBuilder DisplayBuilder() {
120 - return new DisplayBuilder();
121 - }
122 -
123 - // ===========================================================
124 - // Inner and Anonymous Classes
125 - // ===========================================================
126 -
127 - public class DisplayBuilder {
128 -
129 - private boolean isUseProgress = false;
130 - private boolean isShowCloseBtn = true;
131 - private boolean isAddToBackStack = true;
132 -
133 - private FragmentManager fragmentManager;
134 - private int containerId;
135 -
136 - public void display(FragmentActivity activity, WarplyInboxRequest request) {
137 -
138 - if (activity != null && !activity.isFinishing()) {
139 - display(activity, android.R.id.content, request);
140 - }
141 - }
142 -
143 - public void display(FragmentActivity activity, int containerId, WarplyInboxRequest request) {
144 -
145 - if (activity != null && !activity.isFinishing()) {
146 - this.fragmentManager = activity.getSupportFragmentManager();
147 - this.containerId = containerId;
148 - requestCampaignsIfNeed(this, request, null);
149 - }
150 - }
151 -
152 - public void display(Fragment parentFragment, int containerId, WarplyInboxRequest request) {
153 -
154 - if (parentFragment != null && parentFragment.getActivity() != null && !parentFragment.getActivity().isFinishing()) {
155 - this.fragmentManager = parentFragment.getChildFragmentManager();
156 - this.containerId = containerId;
157 - requestCampaignsIfNeed(this, request, null);
158 - }
159 - }
160 -
161 - public void display(FragmentActivity activity, String sessionUuid) {
162 -
163 - if (activity != null && !activity.isFinishing()) {
164 - display(activity, android.R.id.content, sessionUuid);
165 - }
166 - }
167 -
168 - public void display(FragmentActivity activity, int containerId, String sessionUuid) {
169 -
170 - if (activity != null && !activity.isFinishing()) {
171 - this.fragmentManager = activity.getSupportFragmentManager();
172 - this.containerId = containerId;
173 - requestCampaignsIfNeed(this, null, sessionUuid);
174 - }
175 - }
176 -
177 - public void display(Fragment parentFragment, int containerId, String sessionUuid) {
178 -
179 - if (parentFragment != null && parentFragment.getActivity() != null && !parentFragment.getActivity().isFinishing()) {
180 - this.fragmentManager = parentFragment.getChildFragmentManager();
181 - this.containerId = containerId;
182 - requestCampaignsIfNeed(this, null, sessionUuid);
183 - }
184 - }
185 -
186 - public DisplayBuilder setUseProgress(boolean use) {
187 - this.isUseProgress = use;
188 - return this;
189 - }
190 -
191 - public DisplayBuilder setShowCloseBtn(boolean show) {
192 - this.isShowCloseBtn = show;
193 - return this;
194 - }
195 -
196 - public DisplayBuilder setAddToBackStack(boolean add) {
197 - this.isAddToBackStack = add;
198 - return this;
199 - }
200 -
201 - }
202 -}
1 -package ly.warp.sdk.views.adapters.mix;
2 -
3 -import android.os.AsyncTask;
4 -import androidx.annotation.NonNull;
5 -
6 -import java.util.ArrayList;
7 -import java.util.HashSet;
8 -import java.util.List;
9 -import java.util.Set;
10 -
11 -import ly.warp.sdk.io.models.Campaign;
12 -import ly.warp.sdk.utils.WarpUtils;
13 -import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
14 -
15 -/**
16 - * Helper class that used within the {@Link CampaignsMixController}
17 - * and allow to track native campaigns events.
18 - * Mix adapters monitor 2 types of events: view campaign in list and click on campaign item.
19 - */
20 -public class CampaignsMixTracker {
21 -
22 - // ===========================================================
23 - // Constants
24 - // ===========================================================
25 -
26 - private enum TrackEvent {
27 -
28 - CAMPAIGN_VIEW("native_campaign_view"), CAMPAIGN_CLICK("native_campaign_click");
29 -
30 - private String type;
31 -
32 - TrackEvent(String type) {
33 - this.type = type;
34 - }
35 -
36 - public String getTrackMessage(@NonNull Campaign campaign) {
37 - return type + ":" + campaign.getSessionUUID();
38 - }
39 - }
40 -
41 - // ===========================================================
42 - // Fields
43 - // ===========================================================
44 -
45 - private CampaignsMixController mMixController;
46 - private int mOldFirstVisibleItem = -1;
47 - private HashSet<Integer> mVisibleCampaignIndexes;
48 - private Set<Integer> mNewCampaignIndexes;
49 - private Set<Integer> mUpdatedCampaignIndexes;
50 -
51 - // ===========================================================
52 - // Constructors
53 - // ===========================================================
54 -
55 - public CampaignsMixTracker(@NonNull CampaignsMixController mixController) {
56 -
57 - mMixController = mixController;
58 - mVisibleCampaignIndexes = new HashSet<>();
59 - mNewCampaignIndexes = new HashSet<>();
60 - mUpdatedCampaignIndexes = new HashSet<>();
61 - }
62 -
63 - // ===========================================================
64 - // Methods for/from SuperClass/Interfaces
65 - // ===========================================================
66 -
67 - // ===========================================================
68 - // Methods
69 - // ===========================================================
70 -
71 - // ===========================================================
72 - // Getter & Setter
73 - // ===========================================================
74 -
75 - /**
76 - * call in onScroll for correct results
77 - *
78 - * @param firstVisiblePosition - first visible position in global adapter
79 - * @param lastVisibleItemPosition - last visible position in global adapter
80 - */
81 - public void trackCampaignsView(int firstVisiblePosition, int lastVisibleItemPosition) {
82 -
83 - if (lastVisibleItemPosition >= firstVisiblePosition && mOldFirstVisibleItem != firstVisiblePosition) {
84 - mOldFirstVisibleItem = firstVisiblePosition;
85 -
86 - /*Log.i("list_view_scroll", "first: " + firstVisibleItem + " visibleCount: " + visibleItemCount +
87 - " last: " +lastVisibleItem);*/
88 -
89 - mNewCampaignIndexes.clear();
90 - mUpdatedCampaignIndexes.clear();
91 - for (int i = firstVisiblePosition; i < lastVisibleItemPosition + 1; i++) {
92 - if (mMixController.getItemViewType(i) == mMixController.getCampaignItemViewType()) {
93 - // if new campaign index
94 - if (mVisibleCampaignIndexes.add(i)) {
95 - mNewCampaignIndexes.add(i);
96 - } else {
97 - mUpdatedCampaignIndexes.add(i);
98 - }
99 - }
100 - }
101 -
102 - // retain only visible indexes
103 - mVisibleCampaignIndexes.clear();
104 - mVisibleCampaignIndexes.addAll(mUpdatedCampaignIndexes);
105 - mVisibleCampaignIndexes.addAll(mNewCampaignIndexes);
106 -
107 - // update new campaigns
108 - if (mNewCampaignIndexes.size() > 0) {
109 - new TrackCampaignsTask(mNewCampaignIndexes, TrackEvent.CAMPAIGN_VIEW).execute();
110 - }
111 - }
112 - }
113 -
114 - public void trackCampaignClick(Campaign campaign) {
115 -
116 - if (campaign != null) {
117 - new TrackCampaignsTask(campaign, TrackEvent.CAMPAIGN_CLICK).execute();
118 - }
119 -
120 - }
121 -
122 - // ===========================================================
123 - // Inner and Anonymous Classes
124 - // ===========================================================
125 -
126 - private class TrackCampaignsTask extends AsyncTask<Void, Void, Void> {
127 -
128 - private List<Campaign> mmTrackCampaigns;
129 - private TrackEvent mmTrackEvent;
130 -
131 - private TrackCampaignsTask(Set<Integer> indexes, TrackEvent event) {
132 -
133 - mmTrackEvent = event;
134 - if (indexes != null && indexes.size() > 0) {
135 - mmTrackCampaigns = new ArrayList<>(indexes.size());
136 - for (int index : indexes) {
137 - Campaign camp = mMixController.getCampaignItem(index);
138 - if (camp != null) {
139 - mmTrackCampaigns.add(camp);
140 - }
141 - }
142 - }
143 - }
144 -
145 - private TrackCampaignsTask(Campaign campaign, TrackEvent event) {
146 -
147 - mmTrackEvent = event;
148 - if (campaign != null) {
149 - mmTrackCampaigns = new ArrayList<>(1);
150 - mmTrackCampaigns.add(campaign);
151 - }
152 - }
153 -
154 - @Override
155 - protected Void doInBackground(Void... params) {
156 -
157 - if (mmTrackCampaigns != null) {
158 - for (Campaign campaign : mmTrackCampaigns) {
159 -
160 - WarplyAnalyticsManager.logEvent(null, mmTrackEvent.getTrackMessage(campaign), null);
161 - WarpUtils.log("track_campaigns - " + mmTrackEvent.getTrackMessage(campaign) + " - " + campaign.getTitle());
162 - }
163 - }
164 - return null;
165 - }
166 - }
167 -}
1 -package ly.warp.sdk.views.dialogs;
2 -
3 -import android.content.Context;
4 -
5 -import androidx.appcompat.app.AlertDialog;
6 -import android.view.Gravity;
7 -import android.view.LayoutInflater;
8 -import android.view.View;
9 -import android.widget.ImageView;
10 -import android.widget.LinearLayout;
11 -import android.widget.TextView;
12 -
13 -import com.bumptech.glide.Glide;
14 -
15 -import ly.warp.sdk.R;
16 -import ly.warp.sdk.activities.WarpViewActivity;
17 -import ly.warp.sdk.io.models.Campaign;
18 -
19 -/**
20 - * Created by Panagiotis Triantafyllou on 28-Mar-19.
21 - */
22 -
23 -public class InAppDialog {
24 -
25 - // ===========================================================
26 - // Constants
27 - // ===========================================================
28 -
29 - // ===========================================================
30 - // Fields
31 - // ===========================================================
32 -
33 - private static Context mContext;
34 - private static AlertDialog mInAppDialog;
35 -
36 - // ===========================================================
37 - // Methods for/from SuperClass/Interfaces
38 - // ===========================================================
39 -
40 - // ===========================================================
41 - // Methods
42 - // ===========================================================
43 -
44 - public static void showDefaultInAppDialog(Context context, Campaign campaignToShow, boolean showViewBtn, int v) {
45 - mContext = context;
46 - showDefaultInAppDialog(context, campaignToShow, showViewBtn);
47 - }
48 -
49 - private static void showDefaultInAppDialog(final Context context, final Campaign campaignToShow, boolean showViewBtn) {
50 - if (mInAppDialog != null && mInAppDialog.isShowing()) {
51 - mInAppDialog.dismiss();
52 - }
53 -
54 - LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
55 - View customView = inflater.inflate(R.layout.layout_inapp_alert_dialog_default, null);
56 -
57 - LinearLayout customButtonsView = customView.findViewById(R.id.ll_custom_buttons_view);
58 - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
59 - params.gravity = Gravity.RIGHT | Gravity.END;
60 -
61 - ImageView campaignImage = customView.findViewById(R.id.iv_inapp_image);
62 - TextView campaignTitle = customView.findViewById(R.id.tv_inapp_title);
63 - TextView campaignSubtitle = customView.findViewById(R.id.tv_inapp_subtitle);
64 -
65 - Glide
66 - .with(context)
67 - .load(campaignToShow.getLogoUrl())
68 - .placeholder(R.drawable.ic_default_campaign)
69 - .into(campaignImage);
70 - campaignTitle.setText(campaignToShow.getTitle());
71 - campaignSubtitle.setText(campaignToShow.getSubtitle());
72 -
73 - if (showViewBtn) {
74 - String[] items = {"View", "Close"};
75 - TextView viewBtn = new TextView(context);
76 - viewBtn.setId(0);
77 - viewBtn.setTag(items[0]);
78 - viewBtn.setText(items[0]);
79 - viewBtn.setTextAppearance(context, R.style.InAppButtonsStyle);
80 - viewBtn.setOnClickListener(new View.OnClickListener() {
81 - @Override
82 - public void onClick(View v) {
83 - context.startActivity(WarpViewActivity.createIntentFromSessionUUID(mContext,
84 - campaignToShow.getSessionUUID()));
85 - mInAppDialog.dismiss();
86 - }
87 - });
88 - customButtonsView.addView(viewBtn, params);
89 -
90 -// dialog.setItems(items, new DialogInterface.OnClickListener() {
91 -// public void onClick(DialogInterface dialog, int which) {
92 -// switch (which) {
93 -// case 0:
94 -// context.startActivity(WarpViewActivity.createIntentFromSessionUUID(context,
95 -// campaignToShow.getSessionUUID()));
96 -// break;
97 -//
98 -// case 1:
99 -// break;
100 -// }
101 -// }
102 -// });
103 - mInAppDialog = new AlertDialog.Builder(context)
104 - .setView(customView)
105 - .create();
106 - mInAppDialog.show();
107 - } else {
108 -// AlertDialog.Builder dialog = new AlertDialog.Builder(context);
109 -// mInAppDialog.setView(customView);
110 -// mInAppDialog.setNegativeButton("Close", new DialogInterface.OnClickListener() {
111 -// public void onClick(DialogInterface dialog, int id) {
112 -// }
113 -// });
114 -// mInAppDialog = new AlertDialog.Builder(context)
115 -// .create();
116 -// mInAppDialog.show();
117 - }
118 - }
119 -
120 - // ===========================================================
121 - // Inner and Anonymous Classes
122 - // ===========================================================
123 -}
1 -package ly.warp.sdk.views.dialogs;
2 -
3 -public interface OnClickButtonListener {
4 -
5 - void onClickButton(int which);
6 -
7 -}
...\ No newline at end of file ...\ No newline at end of file
1 -package ly.warp.sdk.views.dialogs;
2 -
3 -import android.app.Activity;
4 -import android.content.Context;
5 -import android.view.View;
6 -
7 -import java.util.Date;
8 -
9 -public class RateDialog {
10 -
11 - private static RateDialog singleton;
12 -
13 - private Context context;
14 -
15 - private final RateDialogOptions options = new RateDialogOptions();
16 -
17 - private int installDate = -1;
18 -
19 - private int launchTimes = -1;
20 -
21 - private int remindInterval = 1;
22 -
23 - private int eventsTimes = -1;
24 -
25 - private boolean isDebug = false;
26 -
27 - public RateDialog(Context context) {
28 - this.context = context;
29 - }
30 -
31 - public static RateDialog with(Context context) {
32 - if (singleton == null) {
33 - synchronized (RateDialog.class) {
34 - if (singleton == null) {
35 - singleton = new RateDialog(context);
36 - }
37 - }
38 - }
39 - return singleton;
40 - }
41 -
42 - public void launch() {
43 - if(RatePreferenceHelper.isFirstLaunch(context)) {
44 - RatePreferenceHelper.setInstallDate(context);
45 - }
46 -
47 - RatePreferenceHelper.setLaunchTimes(context, RatePreferenceHelper.getLaunchTimes(context) + 1);
48 - }
49 -
50 - public static boolean showRateDialogIfMeetsConditions(Activity activity) {
51 - boolean isMeetsConditions = singleton.isDebug || singleton.shouldShowRateDialog();
52 - if (isMeetsConditions) {
53 - singleton.showRateDialog(activity);
54 - }
55 - return isMeetsConditions;
56 - }
57 -
58 - public static boolean passSignificantEventAndConditions(Activity activity) {
59 - return passSignificantEvent(activity, singleton.shouldShowRateDialog());
60 - }
61 -
62 - private static boolean passSignificantEvent(Activity activity, boolean shouldShow) {
63 - int eventTimes = RatePreferenceHelper.getEventTimes(activity);
64 - RatePreferenceHelper.setEventTimes(activity, ++eventTimes);
65 - boolean isMeetsConditions = singleton.isDebug || (singleton.isOverEventTimes() && shouldShow);
66 - if (isMeetsConditions) {
67 - singleton.showRateDialog(activity);
68 - }
69 - return isMeetsConditions;
70 - }
71 -
72 - public RateDialog clearPreferenceSettings() {
73 - RatePreferenceHelper.setAgreeShowDialog(context, true);
74 - RatePreferenceHelper.clearSharedPreferences(context);
75 - return this;
76 - }
77 -
78 - private static boolean isOverDate(long targetDate, int threshold) {
79 - return new Date().getTime() - targetDate >= threshold * 24 * 60 * 60 * 1000;
80 - }
81 -
82 - public boolean shouldShowRateDialog() {
83 - return RatePreferenceHelper.getIsAgreeShowDialog(context) &&
84 - isOverLaunchTimes() &&
85 - isOverInstallDate() &&
86 - isOverIntervalDate();
87 - }
88 -
89 - public boolean isOverInstallDate() {
90 - if(installDate == -1)
91 - return true;
92 -
93 - return isOverDate(RatePreferenceHelper.getInstallDate(context), installDate);
94 - }
95 -
96 - public boolean isOverIntervalDate() {
97 - return isOverDate(RatePreferenceHelper.getRemindIntervalDate(context), remindInterval);
98 - }
99 -
100 - public boolean isOverLaunchTimes() {
101 - if(launchTimes == -1)
102 - return true;
103 -
104 - return RatePreferenceHelper.getLaunchTimes(context) >= launchTimes;
105 - }
106 -
107 - public boolean isOverEventTimes() {
108 - if(eventsTimes == -1)
109 - return true;
110 -
111 - return RatePreferenceHelper.getEventTimes(context) >= launchTimes;
112 - }
113 -
114 - public RateDialog setInstallDate(int installDate) {
115 - this.installDate = installDate;
116 - return this;
117 - }
118 -
119 - public RateDialog setLaunchTimes(int launchTimes) {
120 - this.launchTimes = launchTimes;
121 - return this;
122 - }
123 -
124 - public RateDialog setRemindInterval(int remindInterval) {
125 - this.remindInterval = remindInterval;
126 - return this;
127 - }
128 -
129 - public RateDialog setEventsTimes(int eventsTimes) {
130 - this.eventsTimes = eventsTimes;
131 - return this;
132 - }
133 -
134 - public RateDialog setShowNeutralButton(boolean isShowNeutralButton) {
135 - options.setShowNeutralButton(isShowNeutralButton);
136 - return this;
137 - }
138 -
139 - public RateDialog setShowTitle(boolean isShowTitle) {
140 - options.setShowTitle(isShowTitle);
141 - return this;
142 - }
143 -
144 - public RateDialog setView(View view) {
145 - options.setView(view);
146 - return this;
147 - }
148 -
149 - public RateDialog setOnClickButtonListener(OnClickButtonListener listener) {
150 - options.setListener(listener);
151 - return this;
152 - }
153 -
154 - public RateDialog setTitle(int resourceId) {
155 - options.setTitleResId(resourceId);
156 - return this;
157 - }
158 -
159 - public RateDialog setTitle(String title) {
160 - options.setTitleText(title);
161 - return this;
162 - }
163 -
164 - public RateDialog setMessage(int resourceId) {
165 - options.setMessageResId(resourceId);
166 - return this;
167 - }
168 -
169 - public RateDialog setMessage(String message) {
170 - options.setMessageText(message);
171 - return this;
172 - }
173 -
174 - public RateDialog setTextPositive(int resourceId) {
175 - options.setTextPositiveResId(resourceId);
176 - return this;
177 - }
178 -
179 - public RateDialog setTextPositive(String positiveText) {
180 - options.setPositiveText(positiveText);
181 - return this;
182 - }
183 -
184 - public RateDialog setTextNeutral(int resourceId) {
185 - options.setTextNeutralResId(resourceId);
186 - return this;
187 - }
188 -
189 - public RateDialog setTextNeutral(String neutralText) {
190 - options.setNeutralText(neutralText);
191 - return this;
192 - }
193 -
194 - public RateDialog setTextNegative(int resourceId) {
195 - options.setTextNegativeResId(resourceId);
196 - return this;
197 - }
198 -
199 - public RateDialog setTextNegative(String negativeText) {
200 - options.setNegativeText(negativeText);
201 - return this;
202 - }
203 -
204 - public RateDialog setCancelable(boolean cancelable) {
205 - options.setCancelable(cancelable);
206 - return this;
207 - }
208 -
209 - public RateDialog setPackageType(String packageType) {
210 - options.setPackageType(packageType);
211 - return this;
212 - }
213 -
214 - public RateDialog setPackageId(String packageId) {
215 - options.setPackageId(packageId);
216 - return this;
217 - }
218 -
219 - public RateDialog setDialogStyle(int style) {
220 - options.setDialogStyleResId(style);
221 - return this;
222 - }
223 -
224 - public RateDialog setIsDebug(boolean isDebug) {
225 - this.isDebug = isDebug;
226 - return this;
227 - }
228 -
229 - public void showRateDialog(Activity activity) {
230 - if (!activity.isFinishing()) {
231 - RateDialogManager.with(activity).create(options).show();
232 - }
233 - }
234 -}
1 -package ly.warp.sdk.views.dialogs;
2 -
3 -import android.app.AlertDialog;
4 -import android.app.Dialog;
5 -import android.content.Context;
6 -import android.content.DialogInterface;
7 -import android.content.Intent;
8 -import android.os.Build;
9 -import android.view.View;
10 -import android.widget.Button;
11 -import android.widget.LinearLayout;
12 -
13 -import static ly.warp.sdk.utils.constants.WarpConstants.PACKAGE_TITLE_GOOGLE;
14 -
15 -final class RateDialogManager {
16 -
17 - private static RateDialogManager singleton;
18 -
19 - private static Context context;
20 -
21 - static Dialog dialog = null;
22 -
23 - private RateDialogManager() {
24 - }
25 -
26 - private RateDialogManager(Context context) {
27 - this.context = context;
28 - }
29 -
30 - public static RateDialogManager with(Context context) {
31 - if (singleton == null) {
32 - synchronized (RateDialogManager.class) {
33 - if (singleton == null) {
34 - singleton = new RateDialogManager(context);
35 - }
36 - }
37 - }
38 - return singleton;
39 - }
40 -
41 - public RateDialogManager create(final RateDialogOptions options) {
42 - if (dialog != null)
43 - return this;
44 -
45 - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
46 - dialog = createDialog(context, options);
47 - } else {
48 - dialog = createMaterialDialog(context, options);
49 - }
50 -
51 - return this;
52 - }
53 -
54 - public void show() {
55 - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
56 - showDialog();
57 - } else {
58 - showMaterialDialog();
59 - }
60 - }
61 -
62 - static private void showDialog() {
63 - AlertDialog alertDialog = (AlertDialog) dialog;
64 - alertDialog.show();
65 -
66 - try {
67 - final Button button = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
68 - LinearLayout linearLayout = (LinearLayout) button.getParent();
69 - linearLayout.setOrientation(LinearLayout.HORIZONTAL);
70 - } catch (Exception ex) {
71 - }
72 - }
73 -
74 - static private void showMaterialDialog() {
75 - androidx.appcompat.app.AlertDialog alertDialog = (androidx.appcompat.app.AlertDialog) dialog;
76 - alertDialog.show();
77 -
78 - try {
79 - final Button button = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
80 - LinearLayout linearLayout = (LinearLayout) button.getParent();
81 - linearLayout.setOrientation(LinearLayout.HORIZONTAL);
82 - } catch (Exception ex) {
83 - }
84 - }
85 -
86 - static private AlertDialog.Builder getDialogBuilder(final Context context) {
87 - return new AlertDialog.Builder(context);
88 - }
89 -
90 - static private androidx.appcompat.app.AlertDialog.Builder getMaterialDialogBuilder(final Context context, final RateDialogOptions options) {
91 - return new androidx.appcompat.app.AlertDialog.Builder(context, options.getDialogStyleResId());
92 - }
93 -
94 - static private Dialog createDialog(final Context context, final RateDialogOptions options) {
95 - AlertDialog.Builder builder = getDialogBuilder(context);
96 -
97 - builder.setMessage(options.getMessageText(context));
98 -
99 - if (options.shouldShowTitle()) builder.setTitle(options.getTitleText(context));
100 -
101 - builder.setCancelable(options.getCancelable());
102 -
103 - View view = options.getView();
104 - if (view != null) builder.setView(view);
105 -
106 - final OnClickButtonListener listener = options.getListener();
107 -
108 - builder.setPositiveButton(options.getPositiveText(context), new DialogInterface.OnClickListener() {
109 - @Override
110 - public void onClick(DialogInterface dialog, int which) {
111 - Intent intentToAppstore = null;
112 -
113 - if (options.getPackageType() == PACKAGE_TITLE_GOOGLE)
114 - intentToAppstore = IntentHelper.createIntentForGooglePlay(context);
115 -
116 - context.startActivity(intentToAppstore);
117 - RatePreferenceHelper.setAgreeShowDialog(context, false);
118 - if (listener != null) listener.onClickButton(which);
119 - }
120 - });
121 -
122 - if (options.shouldShowNeutralButton()) {
123 - builder.setNeutralButton(options.getNeutralText(context), new DialogInterface.OnClickListener() {
124 - @Override
125 - public void onClick(DialogInterface dialog, int which) {
126 - RatePreferenceHelper.setRemindIntervalDate(context);
127 - if (listener != null) listener.onClickButton(which);
128 - }
129 - });
130 - }
131 -
132 - builder.setNegativeButton(options.getNegativeText(context), new DialogInterface.OnClickListener() {
133 - @Override
134 - public void onClick(DialogInterface dialog, int which) {
135 - RatePreferenceHelper.setAgreeShowDialog(context, false);
136 - if (listener != null) listener.onClickButton(which);
137 - }
138 - });
139 -
140 - return builder.create();
141 - }
142 -
143 - static private Dialog createMaterialDialog(final Context context, final RateDialogOptions options) {
144 - androidx.appcompat.app.AlertDialog.Builder builder = getMaterialDialogBuilder(context, options);
145 -
146 - builder.setMessage(options.getMessageText(context));
147 -
148 - if (options.shouldShowTitle()) builder.setTitle(options.getTitleText(context));
149 -
150 - builder.setCancelable(options.getCancelable());
151 -
152 - View view = options.getView();
153 - if (view != null) builder.setView(view);
154 -
155 - final OnClickButtonListener listener = options.getListener();
156 -
157 - builder.setPositiveButton(options.getPositiveText(context), new DialogInterface.OnClickListener() {
158 - @Override
159 - public void onClick(DialogInterface dialog, int which) {
160 - Intent intentToAppstore = null;
161 -
162 - if (options.getPackageType() == PACKAGE_TITLE_GOOGLE)
163 - intentToAppstore = IntentHelper.createIntentForGooglePlay(context);
164 -
165 - context.startActivity(intentToAppstore);
166 - RatePreferenceHelper.setAgreeShowDialog(context, false);
167 - if (listener != null) listener.onClickButton(which);
168 - }
169 - });
170 -
171 - if (options.shouldShowNeutralButton()) {
172 - builder.setNeutralButton(options.getNeutralText(context), new DialogInterface.OnClickListener() {
173 - @Override
174 - public void onClick(DialogInterface dialog, int which) {
175 - RatePreferenceHelper.setRemindIntervalDate(context);
176 - if (listener != null) listener.onClickButton(which);
177 - }
178 - });
179 - }
180 -
181 - builder.setNegativeButton(options.getNegativeText(context), new DialogInterface.OnClickListener() {
182 - @Override
183 - public void onClick(DialogInterface dialog, int which) {
184 - RatePreferenceHelper.setAgreeShowDialog(context, false);
185 - if (listener != null) listener.onClickButton(which);
186 - }
187 - });
188 -
189 - return builder.create();
190 - }
191 -}
...\ No newline at end of file ...\ No newline at end of file
1 -package ly.warp.sdk.views.dialogs;
2 -
3 -import android.content.Context;
4 -import android.view.View;
5 -
6 -import ly.warp.sdk.R;
7 -
8 -import static ly.warp.sdk.utils.constants.WarpConstants.PACKAGE_TITLE_GOOGLE;
9 -
10 -final class RateDialogOptions {
11 -
12 - private boolean showNeutralButton = true;
13 -
14 - private boolean showTitle = true;
15 -
16 - private boolean cancelable = false;
17 -
18 - private String packageType = PACKAGE_TITLE_GOOGLE;
19 -
20 - private String packageId = "";
21 -
22 - private int titleResId = R.string.rate_dialog_title;
23 -
24 - private int messageResId = R.string.rate_dialog_message;
25 -
26 - private int textPositiveResId = R.string.rate_dialog_positive;
27 -
28 - private int textNeutralResId = R.string.rate_diloag_neutral;
29 -
30 - private int textNegativeResId = R.string.rate_dialog_negative;
31 -
32 - private int dialogStyleResId = R.style.AppCompatAlertDialogStyle;
33 -
34 - private String titleText = null;
35 -
36 - private String messageText = null;
37 -
38 - private String positiveText = null;
39 -
40 - private String neutralText = null;
41 -
42 - private String negativeText = null;
43 -
44 - private View view;
45 -
46 - private OnClickButtonListener listener;
47 -
48 - public boolean shouldShowNeutralButton() {
49 - return showNeutralButton;
50 - }
51 -
52 - public void setShowNeutralButton(boolean showNeutralButton) {
53 - this.showNeutralButton = showNeutralButton;
54 - }
55 -
56 - public boolean shouldShowTitle() {
57 - return showTitle;
58 - }
59 -
60 - public void setShowTitle(boolean showTitle) {
61 - this.showTitle = showTitle;
62 - }
63 -
64 - public boolean getCancelable() {
65 - return cancelable;
66 - }
67 -
68 - public void setCancelable(boolean cancelable) {
69 - this.cancelable = cancelable;
70 - }
71 -
72 - public String getPackageType() {
73 - return packageType;
74 - }
75 -
76 - public void setPackageType(String packageType) {
77 - this.packageType = packageType;
78 - }
79 -
80 - public String getPackageId() {
81 - return packageId;
82 - }
83 -
84 - public void setPackageId(String packageId) {
85 - this.packageId = packageId;
86 - }
87 -
88 - public int getTitleResId() {
89 - return titleResId;
90 - }
91 -
92 - public void setTitleResId(int titleResId) {
93 - this.titleResId = titleResId;
94 - }
95 -
96 - public int getMessageResId() {
97 - return messageResId;
98 - }
99 -
100 - public void setMessageResId(int messageResId) {
101 - this.messageResId = messageResId;
102 - }
103 -
104 - public int getTextPositiveResId() {
105 - return textPositiveResId;
106 - }
107 -
108 - public void setTextPositiveResId(int textPositiveResId) {
109 - this.textPositiveResId = textPositiveResId;
110 - }
111 -
112 - public int getTextNeutralResId() {
113 - return textNeutralResId;
114 - }
115 -
116 - public void setTextNeutralResId(int textNeutralResId) {
117 - this.textNeutralResId = textNeutralResId;
118 - }
119 -
120 - public int getTextNegativeResId() {
121 - return textNegativeResId;
122 - }
123 -
124 - public void setTextNegativeResId(int textNegativeResId) {
125 - this.textNegativeResId = textNegativeResId;
126 - }
127 -
128 - public int getDialogStyleResId() {
129 - return dialogStyleResId;
130 - }
131 -
132 - public void setDialogStyleResId(int dialogStyleResId) {
133 - this.dialogStyleResId = dialogStyleResId;
134 - }
135 -
136 - public View getView() {
137 - return view;
138 - }
139 -
140 - public void setView(View view) {
141 - this.view = view;
142 - }
143 -
144 - public OnClickButtonListener getListener() {
145 - return listener;
146 - }
147 -
148 - public void setListener(OnClickButtonListener listener) {
149 - this.listener = listener;
150 - }
151 -
152 - public String getTitleText(Context context) {
153 - if (titleText == null) {
154 - return context.getString(titleResId);
155 - }
156 - return titleText;
157 - }
158 -
159 - public void setTitleText(String titleText) {
160 - this.titleText = titleText;
161 - }
162 -
163 - public String getMessageText(Context context) {
164 - if (messageText == null) {
165 - return context.getString(messageResId);
166 - }
167 - return messageText;
168 - }
169 -
170 - public void setMessageText(String messageText) {
171 - this.messageText = messageText;
172 - }
173 -
174 - public String getPositiveText(Context context) {
175 - if (positiveText == null) {
176 - return context.getString(textPositiveResId);
177 - }
178 - return positiveText;
179 - }
180 -
181 - public void setPositiveText(String positiveText) {
182 - this.positiveText = positiveText;
183 - }
184 -
185 - public String getNeutralText(Context context) {
186 - if (neutralText == null) {
187 - return context.getString(textNeutralResId);
188 - }
189 - return neutralText;
190 - }
191 -
192 - public void setNeutralText(String neutralText) {
193 - this.neutralText = neutralText;
194 - }
195 -
196 - public String getNegativeText(Context context) {
197 - if (negativeText == null) {
198 - return context.getString(textNegativeResId);
199 - }
200 - return negativeText;
201 - }
202 -
203 - public void setNegativeText(String negativeText) {
204 - this.negativeText = negativeText;
205 - }
206 -}
...\ No newline at end of file ...\ No newline at end of file
1 -package ly.warp.sdk.views.dialogs;
2 -
3 -import android.content.Context;
4 -import android.content.SharedPreferences;
5 -
6 -import java.util.Date;
7 -
8 -final class RatePreferenceHelper {
9 -
10 - private static final String PREF_FILE_NAME = "ratedialog_rate_pref_file";
11 - private static final String PREF_KEY_INSTALL_DATE = "ratedialog_rate_install_date";
12 - private static final String PREF_KEY_LAUNCH_TIMES = "ratedialog_rate_launch_times";
13 - private static final String PREF_KEY_IS_AGREE_SHOW_DIALOG = "ratedialog_rate_is_agree_show_dialog";
14 - private static final String PREF_KEY_REMIND_INTERVAL = "ratedialog_rate_remind_interval";
15 - private static final String PREF_KEY_EVENT_TIMES = "ratedialog_rate_event_times";
16 -
17 - private RatePreferenceHelper() {
18 - }
19 -
20 - static SharedPreferences getPreferences(Context context) {
21 - return context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);
22 - }
23 -
24 - static SharedPreferences.Editor getPreferencesEditor(Context context) {
25 - return getPreferences(context).edit();
26 - }
27 -
28 - /**
29 - * Clear data in shared preferences
30 - *
31 - * @param context context
32 - */
33 - static void clearSharedPreferences(Context context) {
34 - SharedPreferences.Editor editor = getPreferencesEditor(context);
35 - editor.remove(PREF_KEY_INSTALL_DATE);
36 - editor.remove(PREF_KEY_LAUNCH_TIMES);
37 - editor.remove(PREF_KEY_REMIND_INTERVAL);
38 - editor.remove(PREF_KEY_EVENT_TIMES);
39 - editor.apply();
40 - }
41 -
42 - /**
43 - * Set agree flag about show dialog.
44 - * If it is false, rate dialog will never shown unless data is cleared.
45 - *
46 - * @param context context
47 - * @param isAgree agree with showing rate dialog
48 - */
49 - static void setAgreeShowDialog(Context context, boolean isAgree) {
50 - SharedPreferences.Editor editor = getPreferencesEditor(context);
51 - editor.putBoolean(PREF_KEY_IS_AGREE_SHOW_DIALOG, isAgree);
52 - editor.apply();
53 - }
54 -
55 - /**
56 - * get agree flag about show dialog.
57 - * If it is false, rate dialog will never shown unless data is cleared.
58 - *
59 - * @param context context
60 - */
61 - static boolean getIsAgreeShowDialog(Context context) {
62 - return getPreferences(context).getBoolean(PREF_KEY_IS_AGREE_SHOW_DIALOG, true);
63 - }
64 -
65 - /**
66 - * set remind interval date.
67 - * If remind interval date is over than setting days, rate dialog will appear.
68 - *
69 - * @param context context
70 - */
71 - static void setRemindIntervalDate(Context context) {
72 - SharedPreferences.Editor editor = getPreferencesEditor(context);
73 - editor.remove(PREF_KEY_REMIND_INTERVAL);
74 - editor.putLong(PREF_KEY_REMIND_INTERVAL, new Date().getTime());
75 - editor.apply();
76 - }
77 -
78 - /**
79 - * get remind interval date.
80 - * If remind interval date is over than setting days, rate dialog will appear.
81 - *
82 - * @param context context
83 - */
84 - static long getRemindIntervalDate(Context context) {
85 - return getPreferences(context).getLong(PREF_KEY_REMIND_INTERVAL, 0);
86 - }
87 -
88 - /**
89 - * set install date.
90 - * If install date is over than setting days, rate dialog will appear.
91 - *
92 - * @param context context
93 - */
94 - static void setInstallDate(Context context) {
95 - SharedPreferences.Editor editor = getPreferencesEditor(context);
96 - editor.putLong(PREF_KEY_INSTALL_DATE, new Date().getTime());
97 - editor.apply();
98 - }
99 -
100 - /**
101 - * get install date.
102 - * If install date is over than setting days, rate dialog will appear.
103 - *
104 - * @param context context
105 - */
106 - static long getInstallDate(Context context) {
107 - return getPreferences(context).getLong(PREF_KEY_INSTALL_DATE, 0);
108 - }
109 -
110 - /**
111 - * set luanch times date.
112 - * If launch time is over than setting times, rate dialog will appear.
113 - *
114 - * @param context context
115 - * @param launchTimes launchTimes
116 - */
117 - static void setLaunchTimes(Context context, int launchTimes) {
118 - SharedPreferences.Editor editor = getPreferencesEditor(context);
119 - editor.putInt(PREF_KEY_LAUNCH_TIMES, launchTimes);
120 - editor.apply();
121 - }
122 -
123 - /**
124 - * get luanch times date.
125 - * If launch time is over than setting times, rate dialog will appear.
126 - *
127 - * @param context context
128 - */
129 - static int getLaunchTimes(Context context) {
130 - return getPreferences(context).getInt(PREF_KEY_LAUNCH_TIMES, 0);
131 - }
132 -
133 - /**
134 - * check if first launch or not.
135 - * If launching first time, andialog will set luanch date.
136 - *
137 - * @param context context
138 - */
139 - static boolean isFirstLaunch(Context context) {
140 - return getPreferences(context).getLong(PREF_KEY_INSTALL_DATE, 0) == 0L;
141 - }
142 -
143 - /**
144 - * set event times date.
145 - * If event time is over than setting times, rate dialog will appear.
146 - *
147 - * @param context context
148 - */
149 - static int getEventTimes(Context context) {
150 - return getPreferences(context).getInt(PREF_KEY_EVENT_TIMES, 0);
151 - }
152 -
153 - /**
154 - * set event times date.
155 - * If event time is over than setting times, rate dialog will appear.
156 - *
157 - * @param context context
158 - */
159 - static void setEventTimes(Context context, int eventTimes) {
160 - SharedPreferences.Editor editor = getPreferencesEditor(context);
161 - editor.putInt(PREF_KEY_EVENT_TIMES, eventTimes);
162 - editor.apply();
163 - }
164 -
165 -}
...\ No newline at end of file ...\ No newline at end of file
1 +apply plugin: 'maven-publish'
2 +apply plugin: 'signing'
3 +
4 +task androidSourcesJar(type: Jar) {
5 + archiveClassifier.set('sources')
6 + if (project.plugins.findPlugin("com.android.library")) {
7 + // For Android libraries
8 + from android.sourceSets.main.java.srcDirs
9 + from android.sourceSets.main.kotlin.srcDirs
10 + } else {
11 + // For pure Kotlin libraries, in case you have them
12 + from sourceSets.main.java.srcDirs
13 + from sourceSets.main.kotlin.srcDirs
14 + }
15 +}
16 +artifacts {
17 + archives androidSourcesJar
18 +}
19 +
20 +group = PUBLISH_GROUP_ID
21 +version = PUBLISH_VERSION
22 +
23 +afterEvaluate {
24 + publishing {
25 + publications {
26 + release(MavenPublication) {
27 + // The coordinates of the library, being set from variables that
28 + // we'll set up later
29 + groupId PUBLISH_GROUP_ID
30 + artifactId PUBLISH_ARTIFACT_ID
31 + version PUBLISH_VERSION
32 +
33 + // Two artifacts, the `aar` (or `jar`) and the sources
34 + if (project.plugins.findPlugin("com.android.library")) {
35 + from components.release
36 + } else {
37 + from components.java
38 + }
39 +
40 + artifact androidSourcesJar
41 +// artifact javadocJar
42 +
43 + // Mostly self-explanatory metadata
44 + pom {
45 + name = PUBLISH_ARTIFACT_ID
46 + description = 'Warply Android SDK Maven Plugin'
47 + url = 'https://git.warp.ly/open-source/warply_android_sdk_maven_plugin'
48 + licenses {
49 + license {
50 + name = 'Warply Ltd. All rights reserved'
51 + url = 'https://git.warp.ly/open-source/warply_android_sdk_maven_plugin'
52 + }
53 + }
54 + developers {
55 + developer {
56 + id = 'panostr'
57 + name = 'Panagiotis Triantafyllou'
58 + email = 'panost@warp.ly'
59 + }
60 + // Add all other devs here...
61 + }
62 +
63 + // Version control info - if you're using GitHub, follow the
64 + // format as seen here
65 + scm {
66 + connection = 'scm:git:git.warp.ly/open-source/warply_android_sdk_maven_plugin.git'
67 + developerConnection = 'scm:git:ssh://git.warp.ly/open-source/warply_android_sdk_maven_plugin.git'
68 + url = 'https://git.warp.ly/open-source/warply_android_sdk_maven_plugin/tree/master'
69 + }
70 + }
71 + }
72 + }
73 + }
74 +}
75 +
76 +signing {
77 + useInMemoryPgpKeys(
78 + rootProject.ext["signing.keyId"],
79 + rootProject.ext["signing.key"],
80 + rootProject.ext["signing.password"],
81 + )
82 + sign publishing.publications
83 +}
...\ No newline at end of file ...\ No newline at end of file
1 +// Create variables with empty default values
2 +
3 +// keyId is the last 8 characters of the GPG key
4 +ext["signing.keyId"] = ''
5 +// password is the passphrase of the GPG key
6 +ext["signing.password"] = ''
7 +// key is the base64 private GPG key
8 +ext["signing.key"] = ''
9 +// osshrUsername and ossrhPassword are the account details for MavenCentral
10 +// which we’ve chosen at the Jira registration step (Sonatype site))
11 +ext["ossrhUsername"] = ''
12 +ext["ossrhPassword"] = ''
13 +ext["sonatypeStagingProfileId"] = ''
14 +
15 +File secretPropsFile = project.rootProject.file('local.properties')
16 +if (secretPropsFile.exists()) {
17 + // Read local.properties file first if it exists
18 + Properties p = new Properties()
19 + new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
20 + p.each { name, value -> ext[name] = value }
21 +} else {
22 + // Use system environment variables
23 + ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
24 + ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
25 + ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
26 + ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
27 + ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
28 + ext["signing.key"] = System.getenv('SIGNING_KEY')
29 +}
30 +
31 +// Set up Sonatype repository
32 +nexusPublishing {
33 + repositories {
34 + sonatype {
35 + stagingProfileId = sonatypeStagingProfileId
36 + username = ossrhUsername
37 + password = ossrhPassword
38 + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
39 + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
40 + }
41 + }
42 +}
...\ No newline at end of file ...\ No newline at end of file
1 include ':app' 1 include ':app'
2 -include 'libraries:warply_android_sdk' 2 +include ':warply_android_sdk'
......
1 apply plugin: 'com.android.library' 1 apply plugin: 'com.android.library'
2 2
3 +ext {
4 + PUBLISH_GROUP_ID = 'ly.warp'
5 + PUBLISH_VERSION = '4.5.0'
6 + PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 +}
8 +
9 +apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
10 +
3 android { 11 android {
4 12
5 compileSdkVersion 31 13 compileSdkVersion 31
......
1 +/**
2 + * Automatically generated file. DO NOT MODIFY
3 + */
4 +package ly.warp.sdk;
5 +
6 +public final class BuildConfig {
7 + public static final boolean DEBUG = false;
8 + public static final String LIBRARY_PACKAGE_NAME = "ly.warp.sdk";
9 + public static final String BUILD_TYPE = "release";
10 +}
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 + package="ly.warp.sdk" >
4 +
5 + <uses-sdk
6 + android:minSdkVersion="23"
7 + android:targetSdkVersion="31" />
8 +
9 + <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
10 + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
11 + <uses-permission android:name="android.permission.READ_PHONE_STATE" />
12 + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
13 + <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
14 + <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
15 + <uses-permission android:name="android.permission.BLUETOOTH" />
16 + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
17 + <uses-permission android:name="com.google.android.c2dm.permission.SEND" />
18 +
19 + <application>
20 +
21 + <!-- For Huawei Push -->
22 + <meta-data
23 + android:name="push_kit_auto_init_enabled"
24 + android:value="true" />
25 + <meta-data
26 + android:name="com.huawei.hms.client.channel.androidMarket"
27 + android:value="false" />
28 +
29 + <activity
30 + android:name="ly.warp.sdk.activities.WarpViewActivity"
31 + android:exported="false"
32 + android:screenOrientation="portrait" />
33 + <activity
34 + android:name="ly.warp.sdk.dexter.PermissionsActivity"
35 + android:exported="false"
36 + android:launchMode="singleInstance"
37 + android:screenOrientation="portrait"
38 + android:theme="@android:style/Theme.Light.NoTitleBar" />
39 +
40 + <!-- Service used for updating user's location. -->
41 + <service
42 + android:name="ly.warp.sdk.services.UpdateUserLocationService"
43 + android:exported="false"
44 + android:permission="android.permission.BIND_JOB_SERVICE" />
45 + <service
46 + android:name="ly.warp.sdk.services.WarplyBeaconsRangingService"
47 + android:exported="false" />
48 +
49 + <!-- Service used for in app notification. -->
50 + <service
51 + android:name="ly.warp.sdk.services.WarpInAppNotificationService"
52 + android:exported="false" />
53 +
54 + <!-- FCM Service for push notifications -->
55 + <service
56 + android:name="ly.warp.sdk.services.FCMBaseMessagingService"
57 + android:exported="false" >
58 + <intent-filter>
59 + <action android:name="com.google.firebase.MESSAGING_EVENT" />
60 + </intent-filter>
61 + </service>
62 +
63 + <!-- Service used for handling Huawei Push Notifications, comment if we are in Google build -->
64 + <service
65 + android:name="ly.warp.sdk.services.HMSBaseMessagingService"
66 + android:exported="false" >
67 + <intent-filter>
68 + <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
69 + </intent-filter>
70 + </service>
71 +
72 + <receiver
73 + android:name="ly.warp.sdk.receivers.LocationChangedReceiver"
74 + android:exported="false" />
75 + <receiver
76 + android:name="ly.warp.sdk.receivers.ConnectivityChangedReceiver"
77 + android:exported="false" >
78 + <intent-filter>
79 + <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
80 +
81 + <category android:name="dollar_openBracket_applicationId_closeBracket" />
82 + </intent-filter>
83 + </receiver>
84 + <receiver
85 + android:name="ly.warp.sdk.receivers.BluetoothStateChangeReceiver"
86 + android:exported="false" >
87 + <intent-filter>
88 + <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
89 + </intent-filter>
90 + </receiver>
91 + <receiver
92 + android:name="ly.warp.sdk.receivers.WarplyInAppNotificationReceiver"
93 + android:exported="false" />
94 + </application>
95 +
96 +</manifest>
...\ No newline at end of file ...\ No newline at end of file
1 +{
2 + "version": 3,
3 + "artifactType": {
4 + "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5 + "kind": "Directory"
6 + },
7 + "applicationId": "ly.warp.sdk",
8 + "variantName": "release",
9 + "elements": [
10 + {
11 + "type": "SINGLE",
12 + "filters": [],
13 + "attributes": [],
14 + "outputFile": "AndroidManifest.xml"
15 + }
16 + ],
17 + "elementType": "File"
18 +}
...\ No newline at end of file ...\ No newline at end of file
1 +aarFormatVersion=1.0
2 +aarMetadataVersion=1.0
3 +minCompileSdk=1
1 +{"compiler-4.12.0.jar (com.github.bumptech.glide:compiler:4.12.0)":true}
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\jniLibs"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\release\jniLibs"/></dataSet></merger>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\shaders"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\release\shaders"/></dataSet></merger>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\assets"/><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\build\intermediates\shader_assets\release\out"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\release\assets"/></dataSet></merger>
...\ No newline at end of file ...\ No newline at end of file
1 +#Fri Jan 28 15:22:24 EET 2022
2 +C\:\\Users\\Warply\\Documents\\Warply\\Android\\warply_android_sdk_maven_plugin\\warply_android_sdk\\src\\main\\res\\drawable-xhdpi\\ic_default_campaign.png=C\:\\Users\\Warply\\Documents\\Warply\\Android\\warply_android_sdk_maven_plugin\\warply_android_sdk\\build\\intermediates\\packaged_res\\release\\drawable-xhdpi-v4\\ic_default_campaign.png
3 +C\:\\Users\\Warply\\Documents\\Warply\\Android\\warply_android_sdk_maven_plugin\\warply_android_sdk\\src\\main\\res\\layout\\layout_inapp_alert_dialog_default.xml=C\:\\Users\\Warply\\Documents\\Warply\\Android\\warply_android_sdk_maven_plugin\\warply_android_sdk\\build\\intermediates\\packaged_res\\release\\layout\\layout_inapp_alert_dialog_default.xml
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<resources>
3 + <color name="colorAccent">#044C86</color>
4 + <color name="colorPrimary">#0a1a50</color>
5 + <color name="colorPrimaryDark">#0a1a50</color>
6 + <string name="rate_dialog_message">If you enjoy using this app, would you mind taking a moment to rate it? It won\'t take more than a minute. Thanks for your support!</string>
7 + <string name="rate_dialog_negative">No, Thanks</string>
8 + <string name="rate_dialog_positive">Rate Now</string>
9 + <string name="rate_dialog_title">Rate App</string>
10 + <string name="rate_diloag_neutral">Remind Me Later</string>
11 + <style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
12 + <item name="android:layout_gravity">right</item>
13 + <!--<item name="colorAccent">#23a890</item>-->
14 + <item name="colorAccent">@color/colorAccent</item>
15 + <item name="android:textColorPrimary">@android:color/black</item>
16 + <item name="android:background">@android:color/white</item>
17 + </style>
18 + <style name="InAppButtonsStyle" parent="@android:style/Widget.TextView">
19 + <item name="android:textSize">18sp</item>
20 + <item name="android:textStyle">bold</item>
21 + </style>
22 +</resources>
...\ No newline at end of file ...\ No newline at end of file
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\res"/><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\build\generated\res\rs\release"/><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\res"><file name="ic_default_campaign" path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\res\drawable-xhdpi\ic_default_campaign.png" qualifiers="xhdpi-v4" type="drawable"/><file name="layout_inapp_alert_dialog_default" path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\res\layout\layout_inapp_alert_dialog_default.xml" qualifiers="" type="layout"/><file path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\res\values\colors.xml" qualifiers=""><color name="colorPrimary">#0a1a50</color><color name="colorAccent">#044C86</color><color name="colorPrimaryDark">#0a1a50</color></file><file path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\res\values\strings.xml" qualifiers=""><string name="rate_dialog_title">Rate App</string><string name="rate_dialog_message">If you enjoy using this app, would you mind taking a moment to rate it? It won\'t take more than a minute. Thanks for your support!</string><string name="rate_dialog_positive">Rate Now</string><string name="rate_diloag_neutral">Remind Me Later</string><string name="rate_dialog_negative">No, Thanks</string></file><file path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\main\res\values\styles.xml" qualifiers=""><style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
3 + <item name="android:layout_gravity">right</item>
4 +
5 + <item name="colorAccent">@color/colorAccent</item>
6 + <item name="android:textColorPrimary">@android:color/black</item>
7 + <item name="android:background">@android:color/white</item>
8 + </style><style name="InAppButtonsStyle" parent="@android:style/Widget.TextView">
9 + <item name="android:textSize">18sp</item>
10 + <item name="android:textStyle">bold</item>
11 + </style></file></source><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\build\generated\res\rs\release"/><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\release\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release" generated-set="release$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="C:\Users\Warply\Documents\Warply\Android\warply_android_sdk_maven_plugin\warply_android_sdk\src\release\res"/></dataSet><mergedItems/></merger>
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.