Skip to content

Commit 66a01d1

Browse files
author
queue-it
committed
Preparing release 2.0.36
1 parent b34b58f commit 66a01d1

File tree

15 files changed

+141
-83
lines changed

15 files changed

+141
-83
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@
1616
.idea
1717
*.gpg
1818
**/build
19+
node_modules
20+
.classpath
21+
.project
22+
*.prefs
23+
dist

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Invoke QueueITEngine as per example below. Parameters `layoutName`, `language` a
2828
```java
2929
QueueITEngine engine = new QueueITEngine(YourActivity.this, customerId, eventIdOrAlias, layoutName, language,
3030
new QueueListener() {
31+
3132
// This callback will be called when the user has been through the queue.
3233
// Here you should store session information, so user will only be sent to queue again if the session has timed out.
3334
@Override

build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ buildscript {
99
}
1010
}
1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.0.0-alpha06'
12+
classpath 'com.android.tools.build:gradle:7.1.1'
1313
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
14-
classpath "gradle.plugin.xyz.tynn.buildsrc:publishing:0.1.2"
1514
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0"
1615
classpath "de.marcphilipp.gradle:nexus-publish-plugin:0.4.0"
1716
}
@@ -37,7 +36,7 @@ allprojects {
3736
groupId = 'com.queue-it.androidsdk'
3837
libraryName = 'com.queue_it.androidsdk'
3938
libraryDescription = 'Android SDK to integrate with Queue-it'
40-
libraryVersion = "2.0.35"
39+
libraryVersion = "2.0.36"
4140
organization = "Queue-it"
4241
organizationUrl = "https://queue-it.com"
4342

@@ -60,4 +59,4 @@ allprojects {
6059

6160
task clean(type: Delete) {
6261
delete rootProject.buildDir
63-
}
62+
}

demoapp/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ android {
1818
}
1919
}
2020

21-
lintOptions {
22-
abortOnError false
23-
}
2421

2522
flavorDimensions "androidx"
2623
productFlavors{
2724
library_androidx
2825
//Note that this requires useAndroidx=false
2926
library
3027
}
28+
lint {
29+
abortOnError false
30+
checkReleaseBuilds false
31+
}
3132
}
3233

3334
dependencies {

demoapp/src/library_androidx/java/com/queue_it/shopdemo/MainActivity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ private void runQueue(QueueITEngine queueITEngine) throws QueueITException {
3535
String enqueueToken = enqueueTokenEditText.getText().toString();
3636
String enqueueKey = enqueueKeyEditText.getText().toString();
3737
if (enqueueToken.length() > 0) {
38-
queueITEngine.runWithEnqueueToken(MainActivity.this, enqueueToken, !enableCacheRadioButton.isChecked());
38+
queueITEngine.runWithEnqueueToken(this, enqueueToken, !enableCacheRadioButton.isChecked());
3939
} else if (enqueueKey.length() > 0) {
40-
queueITEngine.runWithEnqueueKey(MainActivity.this, enqueueKey, !enableCacheRadioButton.isChecked());
40+
queueITEngine.runWithEnqueueKey(this, enqueueKey, !enableCacheRadioButton.isChecked());
4141
} else {
42-
queueITEngine.run(MainActivity.this, !enableCacheRadioButton.isChecked());
42+
queueITEngine.run(this, !enableCacheRadioButton.isChecked());
4343
}
4444
}
4545

@@ -136,8 +136,8 @@ public void onUserExited() {
136136
}
137137

138138
@Override
139-
public void onQueueDisabled() {
140-
showResultActivity("The queue is disabled.", false);
139+
protected void onQueueDisabled(QueueDisabledInfo queueDisabledInfo) {
140+
showResultActivity("The queue is disabled. Your token: " + queueDisabledInfo.getQueueItToken(), false);
141141
queue_button.setEnabled(true);
142142
}
143143

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.example.demowithprotectedapi">
4-
5-
<uses-permission android:name="android.permission.INTERNET" />
6-
<application
7-
android:allowBackup="true"
8-
android:icon="@mipmap/ic_launcher"
9-
android:label="@string/app_name"
10-
android:roundIcon="@mipmap/ic_launcher_round"
11-
android:supportsRtl="true"
12-
android:theme="@style/Theme.Androidwebuisdk"
13-
android:usesCleartextTraffic="true"
14-
>
15-
16-
<activity
17-
android:name=".MainActivity"
18-
android:label="@string/app_name"
19-
android:theme="@style/Theme.Androidwebuisdk.NoActionBar">
20-
<intent-filter>
21-
<action android:name="android.intent.action.MAIN" />
22-
23-
<category android:name="android.intent.category.LAUNCHER" />
24-
</intent-filter>
25-
</activity>
26-
</application>
27-
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.demowithprotectedapi">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
<application
7+
android:allowBackup="true"
8+
android:icon="@mipmap/ic_launcher"
9+
android:label="@string/app_name"
10+
android:roundIcon="@mipmap/ic_launcher_round"
11+
android:supportsRtl="true"
12+
android:theme="@style/Theme.Androidwebuisdk"
13+
android:usesCleartextTraffic="true"
14+
>
15+
16+
<activity
17+
android:name=".MainActivity"
18+
android:label="@string/app_name"
19+
android:theme="@style/Theme.Androidwebuisdk.NoActionBar">
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
</application>
27+
2828
</manifest>

demowithprotectedapi/src/main/java/com/example/demowithprotectedapi/FirstFragment.java

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import com.example.demowithprotectedapi.databinding.FragmentFirstBinding;
1717
import com.example.demowithprotectedapi.exceptions.MustBeQueued;
1818
import com.example.demowithprotectedapi.repos.IProductRepository;
19-
import com.example.demowithprotectedapi.repos.ProductRepository;
2019
import com.example.demowithprotectedapi.repos.RetrofitProductRepository;
2120
import com.queue_it.androidsdk.Error;
21+
import com.queue_it.androidsdk.QueueDisabledInfo;
2222
import com.queue_it.androidsdk.QueueITEngine;
2323
import com.queue_it.androidsdk.QueueITException;
2424
import com.queue_it.androidsdk.QueueListener;
@@ -40,10 +40,10 @@ public class FirstFragment extends Fragment {
4040

4141
@Override
4242
public View onCreateView(
43-
LayoutInflater inflater, ViewGroup container,
43+
@NonNull LayoutInflater inflater, ViewGroup container,
4444
Bundle savedInstanceState
4545
) {
46-
_productRepo = new RetrofitProductRepository();
46+
_productRepo = new RetrofitProductRepository("https://fastly.v3.ticketania.com");
4747
binding = FragmentFirstBinding.inflate(inflater, container, false);
4848
return binding.getRoot();
4949
}
@@ -70,6 +70,16 @@ private void queueUser(String value) {
7070
String wrId = valueUri.getQueryParameter("e");
7171
QueueService.IsTest = true;
7272
final QueueITEngine q = new QueueITEngine(MainActivity.getInstance(), customerId, wrId, "", "", new QueueListener() {
73+
@Override
74+
protected void onSessionRestart(QueueITEngine queueITEngine) {
75+
try {
76+
queueITEngine.run(MainActivity.getInstance());
77+
} catch (QueueITException e) {
78+
e.printStackTrace();
79+
}
80+
81+
}
82+
7383
@Override
7484
protected void onQueuePassed(QueuePassedInfo queuePassedInfo) {
7585
_productRepo.addQueueToken(queuePassedInfo.getQueueItToken());
@@ -91,8 +101,14 @@ public void onUserExited() {
91101
}
92102

93103
@Override
94-
public void onQueueDisabled() {
95-
Toast.makeText(MainActivity.getInstance(), "The queue is disabled.", Toast.LENGTH_SHORT).show();
104+
public void onQueueDisabled(QueueDisabledInfo queueDisabledInfo) {
105+
Toast.makeText(MainActivity.getInstance(), "The queue is disabled. Your token: " + queueDisabledInfo.getQueueItToken()
106+
, Toast.LENGTH_SHORT).show();
107+
_productRepo.addQueueToken(queueDisabledInfo.getQueueItToken());
108+
_queuePassed.set(true);
109+
synchronized (queuedLock) {
110+
queuedLock.notify();
111+
}
96112
}
97113

98114
@Override
@@ -130,9 +146,7 @@ protected Product doInBackground(Void[] objects) {
130146
}
131147
assert e instanceof MustBeQueued;
132148
Handler handler = new Handler(MainActivity.getInstance().getMainLooper());
133-
handler.post(() -> {
134-
queueUser(((MustBeQueued) e).getValue());
135-
});
149+
handler.post(() -> queueUser(((MustBeQueued) e).getValue()));
136150

137151
//Maybe wait for completion and repeat the call? This is optional.
138152
try {

demowithprotectedapi/src/main/java/com/example/demowithprotectedapi/repos/RetrofitProductRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class RetrofitProductRepository implements IProductRepository {
2121
private final String _baseUrl;
2222
private final QueueITInterceptor _queueItInterceptor;
2323

24-
public RetrofitProductRepository() {
25-
_baseUrl = "https://fastly.v3.ticketania.com";
24+
public RetrofitProductRepository(String baseUrl) {
25+
_baseUrl = baseUrl;
2626
CookieStorage cookies = new CookieStorage();
2727
_queueItInterceptor = new QueueITInterceptor(cookies);
2828
OkHttpClient client = new OkHttpClient.Builder()

library/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ android {
77
defaultConfig {
88
minSdkVersion 15
99
targetSdkVersion 30
10-
versionCode 1
11-
versionName libraryVersion
1210

1311
buildConfigField 'String', 'VERSION_NAME', "\"$libraryVersion\""
1412
}
@@ -26,15 +24,15 @@ android {
2624
}
2725
}
2826

29-
lintOptions {
30-
abortOnError false
31-
}
3227

3328
flavorDimensions "androidx"
3429
productFlavors{
3530
library_androidx
3631
library
3732
}
33+
lint {
34+
abortOnError false
35+
}
3836
}
3937

4038
dependencies {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.queue_it.androidsdk;
2+
3+
public class QueueDisabledInfo {
4+
private final String _queueItToken;
5+
6+
public QueueDisabledInfo(String queueItToken) {
7+
_queueItToken = queueItToken;
8+
}
9+
10+
public String getQueueItToken() {
11+
return _queueItToken;
12+
}
13+
}

0 commit comments

Comments
 (0)