Skip to content

Commit

Permalink
Preparing release 2.0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
queue-it committed Feb 16, 2022
1 parent b34b58f commit 66a01d1
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 83 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@
.idea
*.gpg
**/build
node_modules
.classpath
.project
*.prefs
dist
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Invoke QueueITEngine as per example below. Parameters `layoutName`, `language` a
```java
QueueITEngine engine = new QueueITEngine(YourActivity.this, customerId, eventIdOrAlias, layoutName, language,
new QueueListener() {

// This callback will be called when the user has been through the queue.
// Here you should store session information, so user will only be sent to queue again if the session has timed out.
@Override
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0-alpha06'
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "gradle.plugin.xyz.tynn.buildsrc:publishing:0.1.2"
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0"
classpath "de.marcphilipp.gradle:nexus-publish-plugin:0.4.0"
}
Expand All @@ -37,7 +36,7 @@ allprojects {
groupId = 'com.queue-it.androidsdk'
libraryName = 'com.queue_it.androidsdk'
libraryDescription = 'Android SDK to integrate with Queue-it'
libraryVersion = "2.0.35"
libraryVersion = "2.0.36"
organization = "Queue-it"
organizationUrl = "https://queue-it.com"

Expand All @@ -60,4 +59,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
7 changes: 4 additions & 3 deletions demoapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ android {
}
}

lintOptions {
abortOnError false
}

flavorDimensions "androidx"
productFlavors{
library_androidx
//Note that this requires useAndroidx=false
library
}
lint {
abortOnError false
checkReleaseBuilds false
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ private void runQueue(QueueITEngine queueITEngine) throws QueueITException {
String enqueueToken = enqueueTokenEditText.getText().toString();
String enqueueKey = enqueueKeyEditText.getText().toString();
if (enqueueToken.length() > 0) {
queueITEngine.runWithEnqueueToken(MainActivity.this, enqueueToken, !enableCacheRadioButton.isChecked());
queueITEngine.runWithEnqueueToken(this, enqueueToken, !enableCacheRadioButton.isChecked());
} else if (enqueueKey.length() > 0) {
queueITEngine.runWithEnqueueKey(MainActivity.this, enqueueKey, !enableCacheRadioButton.isChecked());
queueITEngine.runWithEnqueueKey(this, enqueueKey, !enableCacheRadioButton.isChecked());
} else {
queueITEngine.run(MainActivity.this, !enableCacheRadioButton.isChecked());
queueITEngine.run(this, !enableCacheRadioButton.isChecked());
}
}

Expand Down Expand Up @@ -136,8 +136,8 @@ public void onUserExited() {
}

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

Expand Down
54 changes: 27 additions & 27 deletions demowithprotectedapi/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demowithprotectedapi">

<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Androidwebuisdk"
android:usesCleartextTraffic="true"
>

<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/Theme.Androidwebuisdk.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demowithprotectedapi">

<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Androidwebuisdk"
android:usesCleartextTraffic="true"
>

<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/Theme.Androidwebuisdk.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import com.example.demowithprotectedapi.databinding.FragmentFirstBinding;
import com.example.demowithprotectedapi.exceptions.MustBeQueued;
import com.example.demowithprotectedapi.repos.IProductRepository;
import com.example.demowithprotectedapi.repos.ProductRepository;
import com.example.demowithprotectedapi.repos.RetrofitProductRepository;
import com.queue_it.androidsdk.Error;
import com.queue_it.androidsdk.QueueDisabledInfo;
import com.queue_it.androidsdk.QueueITEngine;
import com.queue_it.androidsdk.QueueITException;
import com.queue_it.androidsdk.QueueListener;
Expand All @@ -40,10 +40,10 @@ public class FirstFragment extends Fragment {

@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container,
@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState
) {
_productRepo = new RetrofitProductRepository();
_productRepo = new RetrofitProductRepository("https://fastly.v3.ticketania.com");
binding = FragmentFirstBinding.inflate(inflater, container, false);
return binding.getRoot();
}
Expand All @@ -70,6 +70,16 @@ private void queueUser(String value) {
String wrId = valueUri.getQueryParameter("e");
QueueService.IsTest = true;
final QueueITEngine q = new QueueITEngine(MainActivity.getInstance(), customerId, wrId, "", "", new QueueListener() {
@Override
protected void onSessionRestart(QueueITEngine queueITEngine) {
try {
queueITEngine.run(MainActivity.getInstance());
} catch (QueueITException e) {
e.printStackTrace();
}

}

@Override
protected void onQueuePassed(QueuePassedInfo queuePassedInfo) {
_productRepo.addQueueToken(queuePassedInfo.getQueueItToken());
Expand All @@ -91,8 +101,14 @@ public void onUserExited() {
}

@Override
public void onQueueDisabled() {
Toast.makeText(MainActivity.getInstance(), "The queue is disabled.", Toast.LENGTH_SHORT).show();
public void onQueueDisabled(QueueDisabledInfo queueDisabledInfo) {
Toast.makeText(MainActivity.getInstance(), "The queue is disabled. Your token: " + queueDisabledInfo.getQueueItToken()
, Toast.LENGTH_SHORT).show();
_productRepo.addQueueToken(queueDisabledInfo.getQueueItToken());
_queuePassed.set(true);
synchronized (queuedLock) {
queuedLock.notify();
}
}

@Override
Expand Down Expand Up @@ -130,9 +146,7 @@ protected Product doInBackground(Void[] objects) {
}
assert e instanceof MustBeQueued;
Handler handler = new Handler(MainActivity.getInstance().getMainLooper());
handler.post(() -> {
queueUser(((MustBeQueued) e).getValue());
});
handler.post(() -> queueUser(((MustBeQueued) e).getValue()));

//Maybe wait for completion and repeat the call? This is optional.
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class RetrofitProductRepository implements IProductRepository {
private final String _baseUrl;
private final QueueITInterceptor _queueItInterceptor;

public RetrofitProductRepository() {
_baseUrl = "https://fastly.v3.ticketania.com";
public RetrofitProductRepository(String baseUrl) {
_baseUrl = baseUrl;
CookieStorage cookies = new CookieStorage();
_queueItInterceptor = new QueueITInterceptor(cookies);
OkHttpClient client = new OkHttpClient.Builder()
Expand Down
8 changes: 3 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 30
versionCode 1
versionName libraryVersion

buildConfigField 'String', 'VERSION_NAME', "\"$libraryVersion\""
}
Expand All @@ -26,15 +24,15 @@ android {
}
}

lintOptions {
abortOnError false
}

flavorDimensions "androidx"
productFlavors{
library_androidx
library
}
lint {
abortOnError false
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.queue_it.androidsdk;

public class QueueDisabledInfo {
private final String _queueItToken;

public QueueDisabledInfo(String queueItToken) {
_queueItToken = queueItToken;
}

public String getQueueItToken() {
return _queueItToken;
}
}
Loading

0 comments on commit 66a01d1

Please sign in to comment.