Compare commits
3 Commits
v.6.6.8
...
master_融云升
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c0b126072 | ||
|
|
8cf6271dc3 | ||
|
|
0be4e3440c |
@@ -1,12 +1,18 @@
|
|||||||
apply plugin: 'com.android.library'
|
//apply plugin: 'com.android.library'
|
||||||
apply plugin: 'img-optimizer'
|
//apply plugin: 'img-optimizer'
|
||||||
apply plugin: 'kotlin-android'
|
//apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
//apply plugin: 'kotlin-android-extensions'
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-parcelize'
|
||||||
|
id 'img-optimizer'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
namespace "com.yunbao.faceunity"
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -48,8 +54,11 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_18
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_18
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
buildConfig = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.yunbao.faceunity;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import androidx.test.platform.app.Instrimport com.yunbao.common.utils.MobclickAgent;ntationRegistry;
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.yunbao.faceunity"
|
|
||||||
>
|
>
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
@@ -11,7 +10,9 @@
|
|||||||
|
|
||||||
<application
|
<application
|
||||||
android:icon="@mipmap/ico_home_animoji"
|
android:icon="@mipmap/ico_home_animoji"
|
||||||
android:allowBackup="true">
|
android:allowBackup="true"
|
||||||
|
tools:replace="allowBackup"
|
||||||
|
>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
namespace "com.samsung.android.sdk.iap.lib"
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion minSdkVersion
|
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
consumerProguardFiles "consumer-rules.pro"
|
consumerProguardFiles "consumer-rules.pro"
|
||||||
versionCode versionCode
|
versionCode rootProject.ext.android.versionCode
|
||||||
versionName versionName
|
versionName rootProject.ext.android.versionName
|
||||||
targetSdkVersion targetSdkVersion
|
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@@ -18,7 +18,15 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
buildFeatures {
|
||||||
|
buildConfig = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
flatDir {
|
||||||
|
dirs 'libs', '../libs'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
}
|
}
|
||||||
BIN
IAP6Helper/libs/samsung-iap-6.1.1.aar
Normal file
BIN
IAP6Helper/libs/samsung-iap-6.1.1.aar
Normal file
Binary file not shown.
@@ -1,30 +1,31 @@
|
|||||||
<manifest
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.samsung.android.sdk.iap.lib"
|
|
||||||
android:versionCode="601000004"
|
android:versionCode="601000004"
|
||||||
android:versionName="6.1.0">
|
android:versionName="6.1.0">
|
||||||
<!-- version code [Major/Minor/Bug fix release/Build number ] : x xx xxx xxx -->
|
<!-- version code [Major/Minor/Bug fix release/Build number ] : x xx xxx xxx -->
|
||||||
|
|
||||||
<application>
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
tools:replace="allowBackup">
|
||||||
<!-- IAP 라이브러리 내 Activity 선언 시작-->
|
<!-- IAP 라이브러리 내 Activity 선언 시작-->
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib.activity.DialogActivity"
|
android:name="com.samsung.android.sdk.iap.lib2.activity.DialogActivity"
|
||||||
android:theme="@style/Theme.Empty"
|
android:theme="@style/Theme.Empty"
|
||||||
android:configChanges="orientation|screenSize"/>
|
android:configChanges="orientation|screenSize"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib.activity.CheckPackageActivity"
|
android:name="com.samsung.android.sdk.iap.lib2.activity.CheckPackageActivity"
|
||||||
android:theme="@style/Theme.Empty"
|
android:theme="@style/Theme.Empty"
|
||||||
android:configChanges="orientation|screenSize"/>
|
android:configChanges="orientation|screenSize"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib.activity.AccountActivity"
|
android:name="com.samsung.android.sdk.iap.lib2.activity.AccountActivity"
|
||||||
android:theme="@style/Theme.Transparent"
|
android:theme="@style/Theme.Transparent"
|
||||||
android:configChanges="orientation|screenSize"/>
|
android:configChanges="orientation|screenSize"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.samsung.android.sdk.iap.lib.activity.PaymentActivity"
|
android:name="com.samsung.android.sdk.iap.lib2.activity.PaymentActivity"
|
||||||
android:theme="@style/Theme.Empty"
|
android:theme="@style/Theme.Empty"
|
||||||
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|locale|uiMode|fontScale|density"/>
|
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|locale|uiMode|fontScale|density"/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.listener;
|
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
|
||||||
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback Interface used with {@link GetOwnedListTask}
|
|
||||||
*/
|
|
||||||
public interface OnGetOwnedListListener {
|
|
||||||
/**
|
|
||||||
* Callback method to be invoked when {@link GetOwnedListTask} has been finished.
|
|
||||||
*
|
|
||||||
* @param _errorVO
|
|
||||||
* @param _ownedList
|
|
||||||
*/
|
|
||||||
void onGetOwnedProducts(ErrorVo _errorVO, ArrayList<OwnedProductVo> _ownedList);
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.listener;
|
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
|
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ProductVo;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback Interface used with {@link GetProductsDetailsTask}
|
|
||||||
*/
|
|
||||||
public interface OnGetProductsDetailsListener {
|
|
||||||
/**
|
|
||||||
* Callback method to be invoked when {@link GetProductsDetailsTask} has been finished.
|
|
||||||
*
|
|
||||||
* @param _errorVO
|
|
||||||
* @param _productList
|
|
||||||
*/
|
|
||||||
void onGetProducts(ErrorVo _errorVO, ArrayList<ProductVo> _productList);
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.activity;
|
package com.samsung.android.sdk.iap.lib2.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-03-06.
|
* Created by sangbum7.kim on 2018-03-06.
|
||||||
@@ -16,12 +16,11 @@ import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
|||||||
public class AccountActivity extends Activity {
|
public class AccountActivity extends Activity {
|
||||||
private static final String TAG = AccountActivity.class.getSimpleName();
|
private static final String TAG = AccountActivity.class.getSimpleName();
|
||||||
|
|
||||||
IapHelper mIapHelper = null;
|
com.samsung.android.sdk.iap.lib2.helper.IapHelper mIapHelper = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
mIapHelper = IapHelper.getInstance(this);
|
mIapHelper = IapHelper.getInstance(this);
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
// 1. If IAP package is installed and valid, start SamsungAccount
|
// 1. If IAP package is installed and valid, start SamsungAccount
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.activity;
|
package com.samsung.android.sdk.iap.lib2.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -8,25 +8,25 @@ import android.util.Log;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.dialog.BaseDialogFragment;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.PurchaseVo;
|
import com.samsung.android.sdk.iap.lib2.vo.PurchaseVo;
|
||||||
|
|
||||||
|
|
||||||
public abstract class BaseActivity extends Activity {
|
public abstract class BaseActivity extends Activity {
|
||||||
private static final String TAG = BaseActivity.class.getSimpleName();
|
private static final String TAG = BaseActivity.class.getSimpleName();
|
||||||
|
|
||||||
protected ErrorVo mErrorVo = new ErrorVo();
|
protected com.samsung.android.sdk.iap.lib2.vo.ErrorVo mErrorVo = new com.samsung.android.sdk.iap.lib2.vo.ErrorVo();
|
||||||
private Dialog mProgressDialog = null;
|
private Dialog mProgressDialog = null;
|
||||||
protected PurchaseVo mPurchaseVo = null;
|
protected com.samsung.android.sdk.iap.lib2.vo.PurchaseVo mPurchaseVo = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper Class between IAPService and 3rd Party Application
|
* Helper Class between IAPService and 3rd Party Application
|
||||||
*/
|
*/
|
||||||
IapHelper mIapHelper = null;
|
com.samsung.android.sdk.iap.lib2.helper.IapHelper mIapHelper = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag value to show successful pop-up. Error pop-up appears whenever it fails or not.
|
* Flag value to show successful pop-up. Error pop-up appears whenever it fails or not.
|
||||||
@@ -64,15 +64,15 @@ public abstract class BaseActivity extends Activity {
|
|||||||
public boolean checkAppsPackage(Activity _activity) {
|
public boolean checkAppsPackage(Activity _activity) {
|
||||||
// 1. If Galaxy Store is installed
|
// 1. If Galaxy Store is installed
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
if (HelperUtil.isInstalledAppsPackage(this)) {
|
if (com.samsung.android.sdk.iap.lib2.helper.HelperUtil.isInstalledAppsPackage(this)) {
|
||||||
// 1) If Galaxy Store is enabled
|
// 1) If Galaxy Store is enabled
|
||||||
// ================================================================
|
// ================================================================
|
||||||
if (!HelperUtil.isEnabledAppsPackage(this)) {
|
if (!com.samsung.android.sdk.iap.lib2.helper.HelperUtil.isEnabledAppsPackage(this)) {
|
||||||
HelperUtil.showEnableGalaxyStoreDialog(_activity);
|
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showEnableGalaxyStoreDialog(_activity);
|
||||||
// ================================================================
|
// ================================================================
|
||||||
// 2) If Galaxy Store is valid
|
// 2) If Galaxy Store is valid
|
||||||
// ================================================================
|
// ================================================================
|
||||||
} else if (HelperUtil.isValidAppsPackage(this)) {
|
} else if (com.samsung.android.sdk.iap.lib2.helper.HelperUtil.isValidAppsPackage(this)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Set error to notify result to third-party application
|
// Set error to notify result to third-party application
|
||||||
@@ -84,7 +84,7 @@ public abstract class BaseActivity extends Activity {
|
|||||||
R.string.dream_ph_body_contact_p1sscustomer_servicep2ss_for_more_information_n_nerror_code_c_p3ss),
|
R.string.dream_ph_body_contact_p1sscustomer_servicep2ss_for_more_information_n_nerror_code_c_p3ss),
|
||||||
"", "", ERROR_ISSUER_IAP_CLIENT + ERROR_CODE_INVALID_GALAXY_STORE);
|
"", "", ERROR_ISSUER_IAP_CLIENT + ERROR_CODE_INVALID_GALAXY_STORE);
|
||||||
mErrorVo.setError(HelperDefine.IAP_PAYMENT_IS_CANCELED, errorString);
|
mErrorVo.setError(HelperDefine.IAP_PAYMENT_IS_CANCELED, errorString);
|
||||||
HelperUtil.showInvalidGalaxyStoreDialog(this);
|
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showInvalidGalaxyStoreDialog(this);
|
||||||
}
|
}
|
||||||
// ================================================================
|
// ================================================================
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ public abstract class BaseActivity extends Activity {
|
|||||||
// 2. If Galaxy Store is not installed
|
// 2. If Galaxy Store is not installed
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
} else {
|
} else {
|
||||||
HelperUtil.installAppsPackage(this);
|
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.installAppsPackage(this);
|
||||||
}
|
}
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
return false;
|
return false;
|
||||||
@@ -161,12 +161,12 @@ public abstract class BaseActivity extends Activity {
|
|||||||
else {
|
else {
|
||||||
Log.e(TAG, "finishPurchase: " + mErrorVo.dump());
|
Log.e(TAG, "finishPurchase: " + mErrorVo.dump());
|
||||||
if (mShowErrorDialog) {
|
if (mShowErrorDialog) {
|
||||||
HelperUtil.showIapErrorDialog(
|
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showIapErrorDialog(
|
||||||
this,
|
this,
|
||||||
getString(R.string.dream_ph_pheader_couldnt_complete_purchase),
|
getString(R.string.dream_ph_pheader_couldnt_complete_purchase),
|
||||||
mErrorVo.getErrorString(),
|
mErrorVo.getErrorString(),
|
||||||
mErrorVo.getErrorDetailsString(),
|
mErrorVo.getErrorDetailsString(),
|
||||||
new BaseDialogFragment.OnClickListener() {
|
new com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick() {
|
||||||
finish();
|
finish();
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.activity;
|
package com.samsung.android.sdk.iap.lib2.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-03-07.
|
* Created by sangbum7.kim on 2018-03-07.
|
||||||
@@ -27,12 +27,12 @@ public class CheckPackageActivity extends Activity {
|
|||||||
int DialogType = extras.getInt("DialogType");
|
int DialogType = extras.getInt("DialogType");
|
||||||
switch (DialogType) {
|
switch (DialogType) {
|
||||||
case HelperDefine.DIALOG_TYPE_INVALID_PACKAGE: {
|
case HelperDefine.DIALOG_TYPE_INVALID_PACKAGE: {
|
||||||
HelperUtil.showInvalidGalaxyStoreDialog(this);
|
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showInvalidGalaxyStoreDialog(this);
|
||||||
mFinishFlag = false;
|
mFinishFlag = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HelperDefine.DIALOG_TYPE_DISABLE_APPLICATION: {
|
case HelperDefine.DIALOG_TYPE_DISABLE_APPLICATION: {
|
||||||
HelperUtil.showEnableGalaxyStoreDialog(this);
|
com.samsung.android.sdk.iap.lib2.helper.HelperUtil.showEnableGalaxyStoreDialog(this);
|
||||||
mFinishFlag = false;
|
mFinishFlag = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1,16 +1,12 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.activity;
|
package com.samsung.android.sdk.iap.lib2.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ActivityNotFoundException;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.dialog.BaseDialogFragment;
|
import com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperUtil;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-03-05.
|
* Created by sangbum7.kim on 2018-03-05.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.activity;
|
package com.samsung.android.sdk.iap.lib2.activity;
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -9,9 +9,9 @@ import android.util.Log;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperListenerManager;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperListenerManager;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
|
import com.samsung.android.sdk.iap.lib2.listener.OnPaymentListener;
|
||||||
|
|
||||||
public class PaymentActivity extends BaseActivity {
|
public class PaymentActivity extends BaseActivity {
|
||||||
private static final String TAG = PaymentActivity.class.getSimpleName();
|
private static final String TAG = PaymentActivity.class.getSimpleName();
|
||||||
@@ -56,7 +56,7 @@ public class PaymentActivity extends BaseActivity {
|
|||||||
super.preDestory();
|
super.preDestory();
|
||||||
if (isFinishing()) {
|
if (isFinishing()) {
|
||||||
OnPaymentListener onPaymentListener =
|
OnPaymentListener onPaymentListener =
|
||||||
HelperListenerManager.getInstance().getOnPaymentListener();
|
com.samsung.android.sdk.iap.lib2.helper.HelperListenerManager.getInstance().getOnPaymentListener();
|
||||||
HelperListenerManager.getInstance().setOnPaymentListener(null);
|
HelperListenerManager.getInstance().setOnPaymentListener(null);
|
||||||
if (null != onPaymentListener) {
|
if (null != onPaymentListener) {
|
||||||
onPaymentListener.onPayment(mErrorVo, mPurchaseVo);
|
onPaymentListener.onPayment(mErrorVo, mPurchaseVo);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.dialog;
|
package com.samsung.android.sdk.iap.lib2.dialog;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@@ -8,7 +8,6 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.util.Log;
|
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper;
|
package com.samsung.android.sdk.iap.lib2.helper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-07-17.
|
* Created by sangbum7.kim on 2017-07-17.
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper;
|
package com.samsung.android.sdk.iap.lib2.helper;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask;
|
import com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
import com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
|
import com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
import com.samsung.android.sdk.iap.lib2.listener.OnPaymentListener;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
import com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnGetProductsDetailsListener;
|
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
|
import com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-08-29.
|
* Created by sangbum7.kim on 2017-08-29.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper;
|
package com.samsung.android.sdk.iap.lib2.helper;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -14,9 +14,9 @@ import android.text.Html;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.activity.BaseActivity;
|
import com.samsung.android.sdk.iap.lib2.activity.BaseActivity;
|
||||||
import com.samsung.android.sdk.iap.lib.dialog.BaseDialogFragment;
|
import com.samsung.android.sdk.iap.lib2.dialog.BaseDialogFragment;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-08-17.
|
* Created by sangbum7.kim on 2017-08-17.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper;
|
package com.samsung.android.sdk.iap.lib2.helper;
|
||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -12,20 +12,20 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.activity.CheckPackageActivity;
|
import com.samsung.android.sdk.iap.lib2.activity.CheckPackageActivity;
|
||||||
import com.samsung.android.sdk.iap.lib.activity.PaymentActivity;
|
import com.samsung.android.sdk.iap.lib2.activity.PaymentActivity;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.ConsumePurchasedItemsTask;
|
import com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
import com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.GetProductsDetailsTask;
|
import com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
import com.samsung.android.sdk.iap.lib2.listener.OnPaymentListener;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
import com.samsung.android.sdk.iap.lib2.service.BaseService;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnGetProductsDetailsListener;
|
import com.samsung.android.sdk.iap.lib2.service.ConsumePurchasedItems;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
|
import com.samsung.android.sdk.iap.lib2.service.OwnedProduct;
|
||||||
import com.samsung.android.sdk.iap.lib.service.BaseService;
|
import com.samsung.android.sdk.iap.lib2.service.ProductsDetails;
|
||||||
import com.samsung.android.sdk.iap.lib.service.ConsumePurchasedItems;
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
import com.samsung.android.sdk.iap.lib.service.OwnedProduct;
|
import com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask;
|
||||||
import com.samsung.android.sdk.iap.lib.service.ProductsDetails;
|
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -46,9 +46,9 @@ public class IapHelper extends HelperDefine {
|
|||||||
|
|
||||||
// AsyncTask for API
|
// AsyncTask for API
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
private GetProductsDetailsTask mGetProductsDetailsTask = null;
|
private com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask mGetProductsDetailsTask = null;
|
||||||
private GetOwnedListTask mGetOwnedListTask = null;
|
private com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask mGetOwnedListTask = null;
|
||||||
private ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
|
private com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask mConsumePurchasedItemsTask = null;
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
|
|
||||||
private ArrayList<BaseService> mServiceQueue = new ArrayList<BaseService>();
|
private ArrayList<BaseService> mServiceQueue = new ArrayList<BaseService>();
|
||||||
@@ -267,7 +267,7 @@ public class IapHelper extends HelperDefine {
|
|||||||
if (mIapConnector == null || mContext == null) {
|
if (mIapConnector == null || mContext == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
mGetProductsDetailsTask = new GetProductsDetailsTask(_baseService,
|
mGetProductsDetailsTask = new com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask(_baseService,
|
||||||
mIapConnector,
|
mIapConnector,
|
||||||
mContext,
|
mContext,
|
||||||
_productIDs,
|
_productIDs,
|
||||||
@@ -344,7 +344,7 @@ public class IapHelper extends HelperDefine {
|
|||||||
if (mIapConnector == null || mContext == null) {
|
if (mIapConnector == null || mContext == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
mGetOwnedListTask = new GetOwnedListTask(_baseService,
|
mGetOwnedListTask = new com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask(_baseService,
|
||||||
mIapConnector,
|
mIapConnector,
|
||||||
mContext,
|
mContext,
|
||||||
_productType,
|
_productType,
|
||||||
@@ -417,7 +417,7 @@ public class IapHelper extends HelperDefine {
|
|||||||
mConsumePurchasedItemsTask.cancel(true);
|
mConsumePurchasedItemsTask.cancel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
mConsumePurchasedItemsTask = new ConsumePurchasedItemsTask(_baseService,
|
mConsumePurchasedItemsTask = new com.samsung.android.sdk.iap.lib2.helper.task.ConsumePurchasedItemsTask(_baseService,
|
||||||
mIapConnector,
|
mIapConnector,
|
||||||
mContext,
|
mContext,
|
||||||
_purchaseIds,
|
_purchaseIds,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper.task;
|
package com.samsung.android.sdk.iap.lib2.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
@@ -6,9 +6,8 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.service.BaseService;
|
||||||
import com.samsung.android.sdk.iap.lib.service.BaseService;
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2017-09-01.
|
* Created by sangbum7.kim on 2017-09-01.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper.task;
|
package com.samsung.android.sdk.iap.lib2.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -6,9 +6,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.service.ConsumePurchasedItems;
|
import com.samsung.android.sdk.iap.lib2.service.ConsumePurchasedItems;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ConsumeVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper.task;
|
package com.samsung.android.sdk.iap.lib2.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -6,9 +6,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.service.OwnedProduct;
|
import com.samsung.android.sdk.iap.lib2.service.OwnedProduct;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
import com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.helper.task;
|
package com.samsung.android.sdk.iap.lib2.helper.task;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -6,9 +6,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.samsung.android.iap.IAPConnector;
|
import com.samsung.android.iap.IAPConnector;
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.service.ProductsDetails;
|
import com.samsung.android.sdk.iap.lib2.service.ProductsDetails;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ProductVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.listener;
|
package com.samsung.android.sdk.iap.lib2.listener;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.helper.task.GetOwnedListTask;
|
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ConsumeVo;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback Interface used with {@link GetOwnedListTask}
|
* Callback Interface used with {@link com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask}
|
||||||
*/
|
*/
|
||||||
public interface OnConsumePurchasedItemsListener {
|
public interface OnConsumePurchasedItemsListener {
|
||||||
/**
|
/**
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.samsung.android.sdk.iap.lib2.listener;
|
||||||
|
|
||||||
|
import com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask;
|
||||||
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
|
import com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback Interface used with {@link com.samsung.android.sdk.iap.lib2.helper.task.GetOwnedListTask}
|
||||||
|
*/
|
||||||
|
public interface OnGetOwnedListListener {
|
||||||
|
/**
|
||||||
|
* Callback method to be invoked when {@link GetOwnedListTask} has been finished.
|
||||||
|
*
|
||||||
|
* @param _errorVO
|
||||||
|
* @param _ownedList
|
||||||
|
*/
|
||||||
|
void onGetOwnedProducts(ErrorVo _errorVO, ArrayList<OwnedProductVo> _ownedList);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.samsung.android.sdk.iap.lib2.listener;
|
||||||
|
|
||||||
|
import com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask;
|
||||||
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
|
import com.samsung.android.sdk.iap.lib2.vo.ProductVo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback Interface used with {@link com.samsung.android.sdk.iap.lib2.helper.task.GetProductsDetailsTask}
|
||||||
|
*/
|
||||||
|
public interface OnGetProductsDetailsListener {
|
||||||
|
/**
|
||||||
|
* Callback method to be invoked when {@link GetProductsDetailsTask} has been finished.
|
||||||
|
*
|
||||||
|
* @param _errorVO
|
||||||
|
* @param _productList
|
||||||
|
*/
|
||||||
|
void onGetProducts(ErrorVo _errorVO, ArrayList<ProductVo> _productList);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.listener;
|
package com.samsung.android.sdk.iap.lib2.listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback Interface to be invoked when bind to IAPService has been finished.
|
* Callback Interface to be invoked when bind to IAPService has been finished.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.listener;
|
package com.samsung.android.sdk.iap.lib2.listener;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.PurchaseVo;
|
import com.samsung.android.sdk.iap.lib2.vo.PurchaseVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback Interface to be invoked when payment has been finished.
|
* Callback Interface to be invoked when payment has been finished.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.listener;
|
package com.samsung.android.sdk.iap.lib2.listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-02-28.
|
* Created by sangbum7.kim on 2018-02-28.
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.service;
|
package com.samsung.android.sdk.iap.lib2.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.activity.AccountActivity;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.activity.DialogActivity;
|
import com.samsung.android.sdk.iap.lib2.activity.AccountActivity;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.activity.DialogActivity;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ErrorVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by sangbum7.kim on 2018-02-28.
|
* Created by sangbum7.kim on 2018-02-28.
|
||||||
@@ -18,8 +18,8 @@ import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
|||||||
public abstract class BaseService {
|
public abstract class BaseService {
|
||||||
private static final String TAG = BaseService.class.getSimpleName();
|
private static final String TAG = BaseService.class.getSimpleName();
|
||||||
|
|
||||||
protected ErrorVo mErrorVo = new ErrorVo();
|
protected com.samsung.android.sdk.iap.lib2.vo.ErrorVo mErrorVo = new com.samsung.android.sdk.iap.lib2.vo.ErrorVo();
|
||||||
protected IapHelper mIapHelper = null;
|
protected com.samsung.android.sdk.iap.lib2.helper.IapHelper mIapHelper = null;
|
||||||
protected Context mContext = null;
|
protected Context mContext = null;
|
||||||
|
|
||||||
public BaseService(IapHelper _iapHelper, Context _context) {
|
public BaseService(IapHelper _iapHelper, Context _context) {
|
||||||
@@ -28,7 +28,7 @@ public abstract class BaseService {
|
|||||||
mErrorVo.setError(HelperDefine.IAP_ERROR_INITIALIZATION, mContext.getString(R.string.mids_sapps_pop_unknown_error_occurred));
|
mErrorVo.setError(HelperDefine.IAP_ERROR_INITIALIZATION, mContext.getString(R.string.mids_sapps_pop_unknown_error_occurred));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ErrorVo getErrorVo() {
|
public com.samsung.android.sdk.iap.lib2.vo.ErrorVo getErrorVo() {
|
||||||
return mErrorVo;
|
return mErrorVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.service;
|
package com.samsung.android.sdk.iap.lib2.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
import com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ConsumeVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ import java.util.ArrayList;
|
|||||||
public class ConsumePurchasedItems extends BaseService {
|
public class ConsumePurchasedItems extends BaseService {
|
||||||
private static final String TAG = ConsumePurchasedItems.class.getSimpleName();
|
private static final String TAG = ConsumePurchasedItems.class.getSimpleName();
|
||||||
|
|
||||||
private OnConsumePurchasedItemsListener mOnConsumePurchasedItemsListener = null;
|
private com.samsung.android.sdk.iap.lib2.listener.OnConsumePurchasedItemsListener mOnConsumePurchasedItemsListener = null;
|
||||||
private static String mPurchaseIds = "";
|
private static String mPurchaseIds = "";
|
||||||
protected ArrayList<ConsumeVo> mConsumeList = null;
|
protected ArrayList<com.samsung.android.sdk.iap.lib2.vo.ConsumeVo> mConsumeList = null;
|
||||||
|
|
||||||
public ConsumePurchasedItems(IapHelper _iapHelper, Context _context, OnConsumePurchasedItemsListener _onConsumePurchasedItemsListener) {
|
public ConsumePurchasedItems(IapHelper _iapHelper, Context _context, OnConsumePurchasedItemsListener _onConsumePurchasedItemsListener) {
|
||||||
super(_iapHelper, _context);
|
super(_iapHelper, _context);
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.service;
|
package com.samsung.android.sdk.iap.lib2.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
import com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
import com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ import java.util.ArrayList;
|
|||||||
public class OwnedProduct extends BaseService {
|
public class OwnedProduct extends BaseService {
|
||||||
private static final String TAG = OwnedProduct.class.getSimpleName();
|
private static final String TAG = OwnedProduct.class.getSimpleName();
|
||||||
|
|
||||||
private OnGetOwnedListListener mOnGetOwnedListListener = null;
|
private com.samsung.android.sdk.iap.lib2.listener.OnGetOwnedListListener mOnGetOwnedListListener = null;
|
||||||
private static String mProductType = "";
|
private static String mProductType = "";
|
||||||
protected ArrayList<OwnedProductVo> mOwnedList = null;
|
protected ArrayList<com.samsung.android.sdk.iap.lib2.vo.OwnedProductVo> mOwnedList = null;
|
||||||
|
|
||||||
public OwnedProduct(IapHelper _iapHelper, Context _context, OnGetOwnedListListener _onGetOwnedListListener) {
|
public OwnedProduct(IapHelper _iapHelper, Context _context, OnGetOwnedListListener _onGetOwnedListListener) {
|
||||||
super(_iapHelper, _context);
|
super(_iapHelper, _context);
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.service;
|
package com.samsung.android.sdk.iap.lib2.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.R;
|
import com.samsung.android.sdk.iap.lib.R;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib2.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnGetProductsDetailsListener;
|
import com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ProductVo;
|
import com.samsung.android.sdk.iap.lib2.vo.ProductVo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -18,9 +18,9 @@ import java.util.ArrayList;
|
|||||||
public class ProductsDetails extends BaseService {
|
public class ProductsDetails extends BaseService {
|
||||||
private static final String TAG = ProductsDetails.class.getSimpleName();
|
private static final String TAG = ProductsDetails.class.getSimpleName();
|
||||||
|
|
||||||
private OnGetProductsDetailsListener mOnGetProductsDetailsListener = null;
|
private com.samsung.android.sdk.iap.lib2.listener.OnGetProductsDetailsListener mOnGetProductsDetailsListener = null;
|
||||||
private static String mProductIds = "";
|
private static String mProductIds = "";
|
||||||
protected ArrayList<ProductVo> mProductsDetails = null;
|
protected ArrayList<com.samsung.android.sdk.iap.lib2.vo.ProductVo> mProductsDetails = null;
|
||||||
|
|
||||||
public ProductsDetails(IapHelper _iapHelper, Context _context, OnGetProductsDetailsListener _onGetProductsDetailsListener) {
|
public ProductsDetails(IapHelper _iapHelper, Context _context, OnGetProductsDetailsListener _onGetProductsDetailsListener) {
|
||||||
super(_iapHelper, _context);
|
super(_iapHelper, _context);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.vo;
|
package com.samsung.android.sdk.iap.lib2.vo;
|
||||||
|
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.vo;
|
package com.samsung.android.sdk.iap.lib2.vo;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.vo;
|
package com.samsung.android.sdk.iap.lib2.vo;
|
||||||
|
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib2.helper.HelperDefine;
|
||||||
|
|
||||||
public class ErrorVo {
|
public class ErrorVo {
|
||||||
private int mErrorCode = HelperDefine.IAP_PAYMENT_IS_CANCELED;
|
private int mErrorCode = HelperDefine.IAP_PAYMENT_IS_CANCELED;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.vo;
|
package com.samsung.android.sdk.iap.lib2.vo;
|
||||||
|
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.vo;
|
package com.samsung.android.sdk.iap.lib2.vo;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.samsung.android.sdk.iap.lib.vo;
|
package com.samsung.android.sdk.iap.lib2.vo;
|
||||||
|
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
|
||||||
@@ -1,12 +1,18 @@
|
|||||||
apply plugin: 'com.android.library'
|
//apply plugin: 'com.android.library'
|
||||||
apply plugin: 'img-optimizer'
|
//apply plugin: 'img-optimizer'
|
||||||
apply plugin: 'kotlin-android'
|
//apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
//apply plugin: 'kotlin-android-extensions'
|
||||||
|
plugins {
|
||||||
|
id 'com.android.library'
|
||||||
|
id 'kotlin-android'
|
||||||
|
id 'kotlin-parcelize'
|
||||||
|
id 'img-optimizer'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
namespace "com.pdlive.shayu"
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -48,8 +54,11 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_18
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_18
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
buildConfig = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.pdlive.shayu">
|
>
|
||||||
|
|
||||||
<queries>
|
<queries>
|
||||||
<package android:name="com.pdlive.shayu"/>
|
<package android:name="com.pdlive.shayu"/>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
tools:ignore="ExportedContentProvider" />
|
tools:ignore="ExportedContentProvider" />
|
||||||
|
|
||||||
</queries>
|
</queries>
|
||||||
<application android:allowBackup="true">
|
<application>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.facebook.FacebookActivity"
|
android:name="com.facebook.FacebookActivity"
|
||||||
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
|
||||||
|
|||||||
17
Share/src/test/java/com/yunbao/share/ExampleUnitTest.java
Normal file
17
Share/src/test/java/com/yunbao/share/ExampleUnitTest.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.yunbao.share;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
public class ExampleUnitTest {
|
||||||
|
@Test
|
||||||
|
public void addition_isCorrect() {
|
||||||
|
assertEquals(4, 2 + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,32 +4,10 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'com.alibaba.arouter'
|
apply plugin: 'com.alibaba.arouter'
|
||||||
android {
|
android {
|
||||||
|
namespace "com.pandoralive.shayu"
|
||||||
dexOptions {
|
dexOptions {
|
||||||
jumboMode = true
|
jumboMode = true
|
||||||
}
|
}
|
||||||
project.tasks.getByName("tasks").doFirst {
|
|
||||||
|
|
||||||
}
|
|
||||||
/* flavorDimensions "packageApk"
|
|
||||||
productFlavors {
|
|
||||||
LinkTest {
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
|
||||||
}
|
|
||||||
LinkOfficial {
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:0,isPluginModel:true]
|
|
||||||
}
|
|
||||||
GoogleTest {
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://ceshi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
|
||||||
}
|
|
||||||
GoogleOfficial{
|
|
||||||
dimension "packageApk"
|
|
||||||
manifestPlaceholders = [serverHost: "https://napi.yaoulive.com",isGooglePlay:1,isPluginModel:false]
|
|
||||||
}
|
|
||||||
|
|
||||||
}*/
|
|
||||||
/* applicationVariants.all { variant ->
|
/* applicationVariants.all { variant ->
|
||||||
variant.mergeAssetsProvider.configure {
|
variant.mergeAssetsProvider.configure {
|
||||||
doLast {
|
doLast {
|
||||||
@@ -53,9 +31,7 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -125,8 +101,11 @@ android {
|
|||||||
|
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_18
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_18
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
buildConfig = true
|
||||||
}
|
}
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
println "清空build文件夹";
|
println "清空build文件夹";
|
||||||
@@ -139,27 +118,14 @@ android {
|
|||||||
processManifestTask.doLast { pm ->
|
processManifestTask.doLast { pm ->
|
||||||
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
||||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
||||||
println "谷歌版本:" + isGooglePlay
|
if (file(manifestPath).exists() && isGooglePlay) {
|
||||||
println "文件存在" + file(manifestPath).exists()
|
|
||||||
println "" + (isGooglePlay != 0)
|
|
||||||
println "" + (file(manifestPath).exists() && isGooglePlay != 0)
|
|
||||||
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
|
||||||
def manifestContent = file(manifestPath).getText()
|
def manifestContent = file(manifestPath).getText()
|
||||||
println "移除权限"
|
|
||||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
||||||
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
|
||||||
file(manifestPath).write(manifestContent)
|
file(manifestPath).write(manifestContent)
|
||||||
} else {
|
} else {
|
||||||
print "not Exists = " + manifestPath
|
print "not Exists = " + manifestPath
|
||||||
}
|
}
|
||||||
manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml"
|
|
||||||
if (file(manifestPath).exists() && isGooglePlay != 0) {
|
|
||||||
def manifestContent = file(manifestPath).getText()
|
|
||||||
println "移除权限2"
|
|
||||||
manifestContent = manifestContent.replace('<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />', '')
|
|
||||||
manifestContent = manifestContent.replace('android.permission.REQUEST_INSTALL_PACKAGES', '')
|
|
||||||
file(manifestPath).write(manifestContent)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
variant.mergeAssetsProvider.configure {
|
variant.mergeAssetsProvider.configure {
|
||||||
doLast {
|
doLast {
|
||||||
@@ -204,7 +170,7 @@ android {
|
|||||||
isGoogle = "谷歌"
|
isGoogle = "谷歌"
|
||||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 2) {
|
||||||
isGoogle = "Huawei"
|
isGoogle = "Huawei"
|
||||||
} else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
}else if (rootProject.ext.manifestPlaceholders.isGooglePlay == 3) {
|
||||||
isGoogle = "Samsung"
|
isGoogle = "Samsung"
|
||||||
}
|
}
|
||||||
def isPlugin = "完整"
|
def isPlugin = "完整"
|
||||||
@@ -216,6 +182,7 @@ android {
|
|||||||
isTest = "正式服"
|
isTest = "正式服"
|
||||||
}
|
}
|
||||||
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
outputFileName = "[${new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("GMT+8"))}]PDLive-${defaultConfig.versionName}-${isGoogle}-${isPlugin}-${variant.buildType.name}-${isTest}.apk"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
17
app/proguard-rules.pro
vendored
17
app/proguard-rules.pro
vendored
@@ -194,9 +194,12 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
-keep public class com.alibaba.android.arouter.facade.**{*;}
|
||||||
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
|
||||||
|
|
||||||
# If you use the byType method to obtain Service, add the following rules to protect the interface:
|
# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口
|
||||||
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||||
|
|
||||||
|
# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
|
||||||
|
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||||
|
|
||||||
# If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation
|
# If single-type injection is used, that is, no interface is defined to implement IProvider, the following rules need to be added to protect the implementation
|
||||||
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider
|
||||||
|
|
||||||
@@ -275,18 +278,6 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
-keep class tech.sud.mgp.hello.ui.main.settings.model.** {*;}
|
-keep class tech.sud.mgp.hello.ui.main.settings.model.** {*;}
|
||||||
-keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;}
|
-keep class tech.sud.mgp.hello.ui.main.nft.model.** {*;}
|
||||||
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
-keep class tech.sud.mgp.hello.common.event.model.** {*;}
|
||||||
-keep class tech.sud.mgp.**{*;}
|
|
||||||
|
|
||||||
-keep class bitter.jnibridge.** { *; }
|
|
||||||
-keep class com.google.androidgamesdk.** { *; }
|
|
||||||
-keep class com.unity3d.** { *; }
|
|
||||||
-keep class do.do.do.** { *; }
|
|
||||||
-keep class do.if.do.** { *; }
|
|
||||||
-keep class for.do.** { *; }
|
|
||||||
-keep class if.do.do.do.** { *; }
|
|
||||||
-keep class org.fmod.** { *; }
|
|
||||||
-keep class tech.sud.** { *; }
|
|
||||||
-keep class tech.unity3d.** { *; }
|
|
||||||
|
|
||||||
-keep class com.yunbao.common.sud.** {*;}
|
-keep class com.yunbao.common.sud.** {*;}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="myname.pdlive.shayu">
|
>
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.CALL_PHONE"
|
android:name="android.permission.CALL_PHONE"
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
|||||||
import com.tencent.imsdk.v2.V2TIMManager;
|
import com.tencent.imsdk.v2.V2TIMManager;
|
||||||
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
|
import com.umeng.commonsdk.UMConfigure;
|
||||||
import com.yunbao.common.BuildConfig;
|
import com.yunbao.common.BuildConfig;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.bean.AnchorStartLiveBean;
|
import com.yunbao.common.bean.AnchorStartLiveBean;
|
||||||
import com.yunbao.common.bean.CrashSaveBean;
|
import com.yunbao.common.bean.CrashSaveBean;
|
||||||
import com.yunbao.common.dialog.DebugDialog;
|
|
||||||
import com.yunbao.common.event.SudGameSocketImEvent;
|
import com.yunbao.common.event.SudGameSocketImEvent;
|
||||||
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
import com.yunbao.common.manager.imrongcloud.InstructorSendReward;
|
||||||
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
||||||
@@ -142,7 +142,6 @@ public class AppContext extends CommonAppContext {
|
|||||||
registerError();
|
registerError();
|
||||||
registerFirebaseCrash();
|
registerFirebaseCrash();
|
||||||
LogUtils.start(this);
|
LogUtils.start(this);
|
||||||
//DebugDialog.getInstance().setParams("初始化","启动");
|
|
||||||
sInstance = this;
|
sInstance = this;
|
||||||
L.setDeBug(BuildConfig.DEBUG);
|
L.setDeBug(BuildConfig.DEBUG);
|
||||||
AppEventsLogger.activateApp(this);
|
AppEventsLogger.activateApp(this);
|
||||||
@@ -165,20 +164,20 @@ public class AppContext extends CommonAppContext {
|
|||||||
OpenInstall.init(this);
|
OpenInstall.init(this);
|
||||||
}
|
}
|
||||||
//设置LOG开关,默认为false
|
//设置LOG开关,默认为false
|
||||||
//UMConfigure.setLogEnabled(true);
|
UMConfigure.setLogEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
//友盟正式初始化
|
//友盟正式初始化
|
||||||
//UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
UMConfigure.init(getApplicationContext(), "64e40ee55488fe7b3afa2c96", "PDLive", UMConfigure.DEVICE_TYPE_PHONE, "64e40ee55488fe7b3afa2c96");
|
||||||
|
|
||||||
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
//集成umeng-crash-vx.x.x.aar,则需要关闭原有统计SDK异常捕获功能
|
||||||
MobclickAgent.setCatchUncaughtExceptions(false);
|
MobclickAgent.setCatchUncaughtExceptions(false);
|
||||||
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
//PushSDK初始化(如使用推送SDK,必须调用此方法)
|
||||||
|
|
||||||
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
//统计SDK是否支持采集在子进程中打点的自定义事件,默认不支持
|
||||||
//UMConfigure.setProcessEvent(true);//支持多进程打点
|
UMConfigure.setProcessEvent(true);//支持多进程打点
|
||||||
//MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
|
||||||
//UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
UMConfigure.submitPolicyGrantResult(getApplicationContext(), true);
|
||||||
|
|
||||||
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
|
||||||
//初始化 AndroidUtilCode
|
//初始化 AndroidUtilCode
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import androidx.core.app.NotificationManagerCompat;
|
|||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.pandoralive.shayu.R;
|
||||||
import com.shayu.phonelive.AppContext;
|
import com.shayu.phonelive.AppContext;
|
||||||
import com.tencent.rtmp.ITXLivePlayListener;
|
import com.tencent.rtmp.ITXLivePlayListener;
|
||||||
import com.tencent.rtmp.TXLiveBase;
|
import com.tencent.rtmp.TXLiveBase;
|
||||||
@@ -72,7 +73,6 @@ import java.io.File;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import myname.pdlive.shayu.R;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/9/17.
|
* Created by cxf on 2018/9/17.
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import com.bumptech.glide.request.target.SimpleTarget;
|
|||||||
import com.bumptech.glide.request.target.Target;
|
import com.bumptech.glide.request.target.Target;
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
|
import com.pandoralive.shayu.R;
|
||||||
import com.shayu.phonelive.AppContext;
|
import com.shayu.phonelive.AppContext;
|
||||||
import com.shayu.phonelive.activity.LauncherActivity;
|
import com.shayu.phonelive.activity.LauncherActivity;
|
||||||
import com.yunbao.common.bean.NotificationMsgBean;
|
import com.yunbao.common.bean.NotificationMsgBean;
|
||||||
@@ -51,7 +52,6 @@ import io.rong.imlib.ConnectChangeReceiver;
|
|||||||
import io.rong.push.PushType;
|
import io.rong.push.PushType;
|
||||||
import io.rong.push.notification.PushMessageReceiver;
|
import io.rong.push.notification.PushMessageReceiver;
|
||||||
import io.rong.push.notification.PushNotificationMessage;
|
import io.rong.push.notification.PushNotificationMessage;
|
||||||
import myname.pdlive.shayu.R;
|
|
||||||
|
|
||||||
public class CustomMessageReceiver extends PushMessageReceiver {
|
public class CustomMessageReceiver extends PushMessageReceiver {
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ apply plugin: 'img-optimizer'
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
targetSdk rootProject.ext.android.buildToolsVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -42,8 +42,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_18
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_18
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.yunbao.baidu"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ apply plugin: 'img-optimizer'
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
targetSdk rootProject.ext.android.buildToolsVersion
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
pickFirst "lib/armeabi/libyuvutils.so"
|
pickFirst "lib/armeabi/libyuvutils.so"
|
||||||
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
pickFirst "lib/arm64-v8a/libyuvutils.so"
|
||||||
@@ -45,8 +45,8 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_18
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_18
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.yunbao.beauty"/>
|
/>
|
||||||
|
|||||||
15
build.gradle
15
build.gradle
@@ -4,27 +4,28 @@ apply from: "dependencies.gradle"
|
|||||||
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.6.20'
|
ext.kotlin_version = '1.8.22'
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://mvn.mob.com/android" }
|
maven { url "https://mvn.mob.com/android" }
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
maven { url 'https://maven.fabric.io/public' }
|
||||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||||
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
||||||
maven {url 'https://developer.huawei.com/repo/'}
|
maven {url 'https://developer.huawei.com/repo/'}
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.2'
|
classpath 'com.android.tools.build:gradle:8.3.1'
|
||||||
//一键压缩png工具
|
//一键压缩png工具
|
||||||
classpath 'com.chenenyu:img-optimizer:1.3.0'
|
classpath 'com.chenenyu:img-optimizer:1.3.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22"
|
||||||
classpath 'com.google.gms:google-services:4.3.3'
|
classpath 'com.google.gms:google-services:4.3.3'
|
||||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
|
||||||
classpath "com.alibaba:arouter-register:1.0.2"
|
classpath "com.github.jadepeakpoet.ARouter:arouter-register:1.0.3"
|
||||||
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,9 +41,9 @@ allprojects {
|
|||||||
maven { url "https://mvn.mob.com/android" }
|
maven { url "https://mvn.mob.com/android" }
|
||||||
maven { url 'https://maven.aliyun.com/repository/public' }
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
||||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||||
maven { url 'http://developer.huawei.com/repo'}//华为库
|
maven { url 'https://developer.huawei.com/repo'}//华为库
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
maven { url 'https://maven.fabric.io/public' }
|
||||||
maven { url 'http://maven.faceunity.com/repository/maven-public/' }//美颜库
|
maven { url 'https://maven.faceunity.com/repository/maven-public/' }//美颜库
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
maven { url 'https://repo1.maven.org/maven2/' }//埋点
|
||||||
google() // Google's Maven repository
|
google() // Google's Maven repository
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ apply plugin: 'img-optimizer'
|
|||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
namespace "com.yunbao.common"
|
||||||
buildToolsVersion rootProject.ext.android.buildToolsVersion
|
compileSdk rootProject.ext.android.compileSdkVersion
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||||
@@ -53,8 +53,11 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_18
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_18
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
buildConfig = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
@@ -158,14 +161,14 @@ dependencies {
|
|||||||
//腾讯im
|
//腾讯im
|
||||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||||
api 'com.google.code.gson:gson:2.8.8'
|
api 'com.google.code.gson:gson:2.8.8'
|
||||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.0' // 音视频通话基础能力库
|
api 'cn.rongcloud.sdk:rtc_lib:5.6.9' // 音视频通话基础能力库
|
||||||
//此处以集成 5.1.2 版本为例
|
//此处以集成 5.1.2 版本为例
|
||||||
api 'cn.rongcloud.sdk:im_lib:5.2.0.2'
|
api 'cn.rongcloud.sdk:im_lib:5.6.10'
|
||||||
|
|
||||||
//此处以集成 5.1.2 版本为例
|
//此处以集成 5.1.2 版本为例
|
||||||
api 'cn.rongcloud.sdk:im_kit:5.2.5.4' // 即时通讯 UI 基础组件
|
api 'cn.rongcloud.sdk:im_kit:5.6.10' // 即时通讯 UI 基础组件
|
||||||
//融云小视频模块
|
//融云小视频模块
|
||||||
api 'cn.rongcloud.sdk:sight:5.2.5.4'
|
api 'cn.rongcloud.sdk:sight:5.6.10'
|
||||||
api 'com.facebook.android:facebook-android-sdk:15.2.0'
|
api 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||||
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
|
implementation 'com.facebook.android:facebook-android-sdk:15.2.0'
|
||||||
|
|
||||||
@@ -200,7 +203,9 @@ dependencies {
|
|||||||
//自定义圆角图片
|
//自定义圆角图片
|
||||||
api 'com.makeramen:roundedimageview:2.3.0'
|
api 'com.makeramen:roundedimageview:2.3.0'
|
||||||
// 友盟统计SDK
|
// 友盟统计SDK
|
||||||
// api(name: 'umeng-common-9.6.8+000', ext: 'aar')
|
api 'com.umeng.umsdk:common:9.6.3'// 必选
|
||||||
|
api 'com.umeng.umsdk:asms:1.8.0'// 必选
|
||||||
|
api 'com.umeng.umsdk:uyumao:1.1.2'
|
||||||
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
//高级运营分析功能依赖库,使用卸载分析、开启反作弊能力请务必集成,以免影响高级功能使用。common需搭配v9.6.3及以上版本,asms需搭配v1.7.0及以上版本。需更新隐私声明。
|
||||||
// 标准版本SudMGP SDK
|
// 标准版本SudMGP SDK
|
||||||
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
api 'tech.sud.mgp:SudMGP:1.3.3.1158'
|
||||||
@@ -217,7 +222,7 @@ dependencies {
|
|||||||
api project(':lib_google')
|
api project(':lib_google')
|
||||||
|
|
||||||
//samsung插件包
|
//samsung插件包
|
||||||
api project(':IAP6Helper')
|
//api project(':IAP6Helper')
|
||||||
|
|
||||||
//文字渐变色
|
//文字渐变色
|
||||||
api 'com.github.FlyJingFish:GradientTextView:1.2.4'
|
api 'com.github.FlyJingFish:GradientTextView:1.2.4'
|
||||||
|
|||||||
BIN
common/libs/samsung-iap-6.1.1.aar
Normal file
BIN
common/libs/samsung-iap-6.1.1.aar
Normal file
Binary file not shown.
@@ -1,11 +1,14 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.yunbao.common">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||||
|
|
||||||
<application android:allowBackup="true">
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
tools:replace="allowBackup"
|
||||||
|
>
|
||||||
|
|
||||||
<!-- <meta-data-->
|
<!-- <meta-data-->
|
||||||
<!-- android:name="com.google.ar.core"-->
|
<!-- android:name="com.google.ar.core"-->
|
||||||
|
|||||||
@@ -272,8 +272,6 @@ public class Constants {
|
|||||||
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦
|
||||||
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦
|
||||||
|
|
||||||
public static final String SOCKET_LIVE_ANCHOR_PK_DIALOG="GuildCompetitionNotice";//公会赛弹窗
|
|
||||||
|
|
||||||
//视频举报获取位置
|
//视频举报获取位置
|
||||||
public static int xIndex = 0;
|
public static int xIndex = 0;
|
||||||
public static int yindex = 0;
|
public static int yindex = 0;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class HtmlConfig {
|
|||||||
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
public static final String TURNTABLE_URL = CommonAppConfig.HOST + "/Appapi/Turntable/index";
|
||||||
|
|
||||||
//在线商城
|
//在线商城
|
||||||
public static final String SHOP = CommonAppConfig.HOST + "/h5/shop/index.html";
|
public static final String SHOP = CommonAppConfig.HOST + "/h5/shoppingMall.html";
|
||||||
|
|
||||||
//社区
|
//社区
|
||||||
public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ";
|
public static final String ENCOURAGE = CommonAppConfig.HOST + "/h5/shequ/index.html#/h5/shequ";
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import android.content.Intent;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.Typeface;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -25,12 +24,13 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.interfaces.LifeCycleListener;
|
import com.yunbao.common.interfaces.LifeCycleListener;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.ClickUtil;
|
import com.yunbao.common.utils.ClickUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -92,8 +92,7 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
protected void main() {
|
protected void main() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
protected void create(){
|
||||||
protected void create() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,17 +107,6 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setTitleBold(boolean bold) {
|
|
||||||
TextView titleView = (TextView) findViewById(R.id.titleView);
|
|
||||||
if (titleView != null) {
|
|
||||||
if (bold) {
|
|
||||||
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
|
||||||
} else {
|
|
||||||
titleView.setTypeface(Typeface.DEFAULT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void backClick(View v) {
|
public void backClick(View v) {
|
||||||
if (v.getId() == R.id.btn_back) {
|
if (v.getId() == R.id.btn_back) {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@@ -193,14 +181,14 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
//友盟统计
|
//友盟统计
|
||||||
// MobclickAgent.onResume(this);
|
// MobclickAgent.onResume(this);
|
||||||
MobclickAgent.onPageStart(this.mTag);
|
MobclickAgent.onPageStart(this.mTag);
|
||||||
Log.e("MobclickAgent", "MobclickAgent:_onResume_" + this.mTag);
|
Log.e("MobclickAgent","MobclickAgent:_onResume_"+this.mTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
MobclickAgent.onPageEnd(this.mTag);
|
MobclickAgent.onPageEnd(this.mTag);
|
||||||
Log.e("MobclickAgent", "MobclickAgent:_onPause_" + this.mTag);
|
Log.e("MobclickAgent","MobclickAgent:_onPause_"+this.mTag);
|
||||||
if (mLifeCycleListeners != null) {
|
if (mLifeCycleListeners != null) {
|
||||||
for (LifeCycleListener listener : mLifeCycleListeners) {
|
for (LifeCycleListener listener : mLifeCycleListeners) {
|
||||||
listener.onPause();
|
listener.onPause();
|
||||||
@@ -394,12 +382,11 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public boolean isKefu(String url){
|
||||||
public boolean isKefu(String url) {
|
if(url.contains("kefu")){
|
||||||
if (url.contains("kefu")) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (url.contains("https://newkf.yaoulive.com/")) {
|
if(url.contains("https://newkf.yaoulive.com/")){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return url.startsWith("https://kefu.yaoulive.com");
|
return url.startsWith("https://kefu.yaoulive.com");
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.lxj.xpopup.XPopup;
|
|||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.HtmlConfig;
|
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||||
@@ -101,6 +100,7 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
ft_title = (FrameLayout) findViewById(R.id.ft_title);
|
||||||
v_spacing = (View) findViewById(R.id.v_spacing);
|
v_spacing = (View) findViewById(R.id.v_spacing);
|
||||||
mWebView = findViewById(R.id.webView);
|
mWebView = findViewById(R.id.webView);
|
||||||
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
params.topMargin = DpUtil.dp2px(1);
|
params.topMargin = DpUtil.dp2px(1);
|
||||||
// mWebView.setLayoutParams(params);
|
// mWebView.setLayoutParams(params);
|
||||||
@@ -136,17 +136,11 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
if (url.contains("for")) {
|
if (url.contains("for")) {
|
||||||
mWebView.loadUrl("javascript:goAnchorTab()");
|
mWebView.loadUrl("javascript:goAnchorTab()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(url.startsWith(HtmlConfig.SHOP)){
|
|
||||||
//商店页不做动态变换
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
//真实屏幕高度-(ft_title的高度+导航栏高度)
|
||||||
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
//屏蔽掉是因为在线客服页面 AndroidBug5497Workaround会失效
|
||||||
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
int height = DeviceUtils.getScreenRealHeight(mContext) - DpUtil.dp2px(72) - getCurrentNavigationBarHeight(mContext);
|
||||||
if (!navigationGestureEnabled(mContext)) {
|
if (!navigationGestureEnabled(mContext)) {
|
||||||
// view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
view.loadUrl("javascript:window.androidObject.setHeight(" + height + ",0,false)");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -200,8 +194,6 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
mWebView.getSettings().setAllowFileAccess(true);
|
mWebView.getSettings().setAllowFileAccess(true);
|
||||||
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
mWebView.getSettings().setUseWideViewPort(true); // 关键点
|
||||||
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
mWebView.getSettings().setAllowFileAccess(true); // 允许访问文件
|
||||||
mWebView.setHorizontalScrollBarEnabled(false);
|
|
||||||
mWebView.setVerticalScrollBarEnabled(false);
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
@@ -221,9 +213,6 @@ public class WebViewActivity extends AbsActivity {
|
|||||||
ft_title.setVisibility(View.VISIBLE);
|
ft_title.setVisibility(View.VISIBLE);
|
||||||
v_spacing.setVisibility(View.GONE);
|
v_spacing.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(url)&&url.startsWith(HtmlConfig.SHOP)){
|
|
||||||
ft_title.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
package com.yunbao.common.adapter;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.DebugViewHolder> {
|
|
||||||
TreeMap<String, String> paramMap = new TreeMap<>();
|
|
||||||
private Context mContext;
|
|
||||||
|
|
||||||
public DebugDialogAdapter(Context mContext) {
|
|
||||||
this.mContext = mContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParamMap(TreeMap<String, String> paramMap) {
|
|
||||||
Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size());
|
|
||||||
this.paramMap = paramMap;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public DebugViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
||||||
return new DebugViewHolder(new TextView(mContext));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(@NonNull DebugViewHolder holder, int position) {
|
|
||||||
List<String> list = new ArrayList<>(paramMap.keySet());
|
|
||||||
Log.i("debug弹窗", "onBindViewHolder: 添加值到view " + list.size() + "|" + paramMap.size());
|
|
||||||
holder.setData(list.get(position), paramMap.get(list.get(position)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
Log.i("debug弹窗", "getItemCount: " + paramMap.size());
|
|
||||||
return paramMap.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class DebugViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
public DebugViewHolder(@NonNull View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setData(String tag, String msg) {
|
|
||||||
Log.i("debug弹窗", "setData: 添加值到view " + tag + "|" + msg);
|
|
||||||
((TextView) itemView).setText(tag + ":" + msg);
|
|
||||||
((TextView) itemView).setTextColor(Color.BLACK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
package com.yunbao.common.adapter;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.PagerSnapHelper;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.yunbao.common.R;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2018/11/28.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ImagePreviewAdapter extends RecyclerView.Adapter<ImagePreviewAdapter.Vh> {
|
|
||||||
|
|
||||||
private LayoutInflater mInflater;
|
|
||||||
private ActionListener mActionListener;
|
|
||||||
private int mPageCount;
|
|
||||||
private LinearLayoutManager mLayoutManager;
|
|
||||||
private int mCurPosition;
|
|
||||||
|
|
||||||
public ImagePreviewAdapter(Context context, int pageCount) {
|
|
||||||
mPageCount = pageCount;
|
|
||||||
mInflater = LayoutInflater.from(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
||||||
return new Vh(mInflater.inflate(R.layout.item_preview_img, parent, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(@NonNull Vh vh, int position) {
|
|
||||||
vh.setData(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return mPageCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class Vh extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
ImageView mImg;
|
|
||||||
|
|
||||||
public Vh(View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
mImg = (ImageView) itemView;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setData(int position) {
|
|
||||||
if (mActionListener != null) {
|
|
||||||
mActionListener.loadImage(mImg, position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setActionListener(ActionListener actionListener) {
|
|
||||||
mActionListener = actionListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurPosition(int curPosition) {
|
|
||||||
mCurPosition = curPosition;
|
|
||||||
if (mActionListener != null) {
|
|
||||||
mActionListener.onPageChanged(curPosition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCurPosition(){
|
|
||||||
return mCurPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
|
||||||
super.onAttachedToRecyclerView(recyclerView);
|
|
||||||
mLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
|
|
||||||
PagerSnapHelper pagerSnapHelper = new PagerSnapHelper();
|
|
||||||
pagerSnapHelper.attachToRecyclerView(recyclerView);
|
|
||||||
recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
||||||
@Override
|
|
||||||
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
|
||||||
int position = mLayoutManager.findFirstCompletelyVisibleItemPosition();
|
|
||||||
if (position >= 0 && mCurPosition != position) {
|
|
||||||
mCurPosition = position;
|
|
||||||
if (mActionListener != null) {
|
|
||||||
mActionListener.onPageChanged(position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public interface ActionListener {
|
|
||||||
void onPageChanged(int position);
|
|
||||||
|
|
||||||
void loadImage(ImageView imageView, int position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,14 +18,10 @@ import com.yunbao.common.views.InteractionGamesChildViewHolder;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* 侧边栏游戏列表适配器,改游戏列表数量在这里改
|
|
||||||
*/
|
|
||||||
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private boolean rigts;
|
private boolean rigts;
|
||||||
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
private List<CustomSidebarChildModel> child = new ArrayList<>();
|
||||||
private List<CustomSidebarChildModel> srcChild = new ArrayList<>();
|
|
||||||
|
|
||||||
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
public InteractionGamesAdapter(Context mContext, boolean rigts) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
@@ -50,7 +46,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
long activityID = TextUtils.isEmpty(model.getSrc()) ? 0 : Long.parseLong(model.getSrc());
|
||||||
if (activityID != 0) {
|
if (activityID != 0) {
|
||||||
Bus.get().post(new CustomDrawerPopupEvent()
|
Bus.get().post(new CustomDrawerPopupEvent()
|
||||||
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild));
|
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(child));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -65,7 +61,6 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||||
child.clear();
|
child.clear();
|
||||||
srcChild.clear();
|
|
||||||
if (mChild.size() > 8) {
|
if (mChild.size() > 8) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
child.add(mChild.get(i));
|
child.add(mChild.get(i));
|
||||||
@@ -73,7 +68,6 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
} else {
|
} else {
|
||||||
child.addAll(mChild);
|
child.addAll(mChild);
|
||||||
}
|
}
|
||||||
srcChild.addAll(mChild);
|
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,14 +67,13 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
|
|
||||||
public void updateData(List<CustomSidebarChildModel> mChild) {
|
public void updateData(List<CustomSidebarChildModel> mChild) {
|
||||||
child.clear();
|
child.clear();
|
||||||
/* if (mChild.size() > 8) {
|
if (mChild.size() > 8) {
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
child.add(mChild.get(i));
|
child.add(mChild.get(i));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
child.addAll(mChild);
|
child.addAll(mChild);
|
||||||
}*/
|
}
|
||||||
child.addAll(mChild);
|
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
import com.yunbao.common.utils.WordUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机器人助手IM消息
|
* 机器人助手IM消息
|
||||||
@@ -24,9 +21,6 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
//标签图片
|
//标签图片
|
||||||
@SerializedName("icon")
|
@SerializedName("icon")
|
||||||
private String icon;
|
private String icon;
|
||||||
@SerializedName("icon_en")
|
|
||||||
@JSONField(name = "icon_en")
|
|
||||||
private String iconEn;
|
|
||||||
//气泡背景
|
//气泡背景
|
||||||
@SerializedName("system_bubble")
|
@SerializedName("system_bubble")
|
||||||
private String systemBubble;
|
private String systemBubble;
|
||||||
@@ -41,7 +35,7 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getAiName() {
|
public String getAiName() {
|
||||||
return aiName + ":";
|
return aiName+":";
|
||||||
}
|
}
|
||||||
|
|
||||||
public AiAutomaticSpeechModel setAiName(String aiName) {
|
public AiAutomaticSpeechModel setAiName(String aiName) {
|
||||||
@@ -49,15 +43,6 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIconEn() {
|
|
||||||
return iconEn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AiAutomaticSpeechModel setIconEn(String iconEn) {
|
|
||||||
this.iconEn = iconEn;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getContent() {
|
public String getContent() {
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
@@ -77,9 +62,6 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIcon() {
|
public String getIcon() {
|
||||||
if (!WordUtil.isNewZh() && !StringUtil.isEmpty(iconEn)) {
|
|
||||||
return iconEn;
|
|
||||||
}
|
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.yunbao.common.bean;
|
|
||||||
|
|
||||||
public class AvatarBean extends BaseModel {
|
|
||||||
private String avatar;
|
|
||||||
private String avatarThumb;
|
|
||||||
|
|
||||||
public AvatarBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAvatar() {
|
|
||||||
return avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAvatar(String avatar) {
|
|
||||||
this.avatar = avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAvatarThumb() {
|
|
||||||
return avatarThumb;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAvatarThumb(String avatarThumb) {
|
|
||||||
this.avatarThumb = avatarThumb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,21 +7,12 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class LiveBattlePassRewardsBean extends BaseModel{
|
public class LiveBattlePassRewardsBean extends BaseModel{
|
||||||
private int level;
|
private int level;
|
||||||
private int is_received;
|
|
||||||
private List<BattlePassType> live_battle_pass_type;
|
private List<BattlePassType> live_battle_pass_type;
|
||||||
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
private Map<Integer,Map<Integer,LiveBattlePassReward>> live_battle_pass_rewards;
|
||||||
|
|
||||||
public LiveBattlePassRewardsBean() {
|
public LiveBattlePassRewardsBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIs_received() {
|
|
||||||
return is_received;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIs_received(int is_received) {
|
|
||||||
this.is_received = is_received;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,16 +49,6 @@ public class RedPacketInfoModel extends BaseModel {
|
|||||||
//超级红包ID
|
//超级红包ID
|
||||||
@SerializedName("super_jackpot_id")
|
@SerializedName("super_jackpot_id")
|
||||||
private String superJackpotId;
|
private String superJackpotId;
|
||||||
@SerializedName("red_packet_type")
|
|
||||||
private int redPacketType;// 1.普通红包 2.特殊红包
|
|
||||||
|
|
||||||
public int getRedPacketType() {
|
|
||||||
return redPacketType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRedPacketType(int redPacketType) {
|
|
||||||
this.redPacketType = redPacketType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSuperJackpotId() {
|
public String getSuperJackpotId() {
|
||||||
return superJackpotId;
|
return superJackpotId;
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ public class UserBean implements Parcelable {
|
|||||||
//随机天梯排位赛PK img,仅在主播PK时使用
|
//随机天梯排位赛PK img,仅在主播PK时使用
|
||||||
private String mRankPkImgUrl;
|
private String mRankPkImgUrl;
|
||||||
//是否填写完整资料
|
//是否填写完整资料
|
||||||
|
@SerializedName("user_info_complete")
|
||||||
private int user_info_complete;
|
private int user_info_complete;
|
||||||
//粉丝团等级
|
//粉丝团等级
|
||||||
private int fansLevel;
|
private int fansLevel;
|
||||||
@@ -109,6 +110,14 @@ public class UserBean implements Parcelable {
|
|||||||
return user_info_complete;
|
return user_info_complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getUser_info_complete() {
|
||||||
|
return user_info_complete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_info_complete(int user_info_complete) {
|
||||||
|
this.user_info_complete = user_info_complete;
|
||||||
|
}
|
||||||
|
|
||||||
public UserBean seUserInfoComplete(int userInfoComplete) {
|
public UserBean seUserInfoComplete(int userInfoComplete) {
|
||||||
this.user_info_complete = userInfoComplete;
|
this.user_info_complete = userInfoComplete;
|
||||||
return this;
|
return this;
|
||||||
@@ -865,20 +874,11 @@ public class UserBean implements Parcelable {
|
|||||||
private String medal;
|
private String medal;
|
||||||
private String bubble;
|
private String bubble;
|
||||||
private String medal_new;
|
private String medal_new;
|
||||||
private String medal_new_en;
|
|
||||||
|
|
||||||
public String getMedal_new() {
|
public String getMedal_new() {
|
||||||
return medal_new;
|
return medal_new;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMedal_new_en() {
|
|
||||||
return medal_new_en;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMedal_new_en(String medal_new_en) {
|
|
||||||
this.medal_new_en = medal_new_en;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMedal_new(String medal_new) {
|
public void setMedal_new(String medal_new) {
|
||||||
this.medal_new = medal_new;
|
this.medal_new = medal_new;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.lxj.xpopup.core.CenterPopupView;
|
import com.lxj.xpopup.core.CenterPopupView;
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.CoolConfig;
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
|
|||||||
@@ -45,9 +45,6 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
|
||||||
* 半屏创建游戏房间
|
|
||||||
*/
|
|
||||||
public class CreateSudGamePopup extends BottomPopupView {
|
public class CreateSudGamePopup extends BottomPopupView {
|
||||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||||
private TextView createGameType, selectCurrencyType;
|
private TextView createGameType, selectCurrencyType;
|
||||||
@@ -315,15 +312,6 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
animator.setDuration(animDuration);
|
animator.setDuration(animDuration);
|
||||||
animator.setInterpolator(new LinearInterpolator());
|
animator.setInterpolator(new LinearInterpolator());
|
||||||
animator.start();
|
animator.start();
|
||||||
if (hasMoveUp) {
|
|
||||||
InputMethodManager imm = getSystemService(getContext(), InputMethodManager.class);
|
|
||||||
if (imm != null) {
|
|
||||||
imm.hideSoftInputFromWindow(roomName.getWindowToken(), 0);
|
|
||||||
imm.hideSoftInputFromWindow(gameSill.getWindowToken(), 0);
|
|
||||||
}
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
||||||
builder.hasShadowBg(false)
|
builder.hasShadowBg(false)
|
||||||
.isDestroyOnDismiss(true)
|
.isDestroyOnDismiss(true)
|
||||||
@@ -338,27 +326,6 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.show();
|
.show();
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
}else {
|
|
||||||
XPopup.Builder builder = new XPopup.Builder(getContext()).atView(findViewById(R.id.currency_type));
|
|
||||||
builder.hasShadowBg(false)
|
|
||||||
.isDestroyOnDismiss(true)
|
|
||||||
.isLightStatusBar(false)
|
|
||||||
.popupPosition(PopupPosition.Bottom)
|
|
||||||
.asCustom(new SudGameListSelectPopup(getContext(), 5, currencyTypeName,isYuanbao)
|
|
||||||
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
|
||||||
@Override
|
|
||||||
public void onDismiss(DialogInterface dialog) {
|
|
||||||
closeAnimSudGameListEvent();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
package com.yunbao.common.dialog;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Looper;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.lzf.easyfloat.EasyFloat;
|
|
||||||
import com.lzf.easyfloat.enums.ShowPattern;
|
|
||||||
import com.lzf.easyfloat.interfaces.OnPermissionResult;
|
|
||||||
import com.lzf.easyfloat.permission.PermissionUtils;
|
|
||||||
import com.yunbao.common.adapter.DebugDialogAdapter;
|
|
||||||
import com.yunbao.common.utils.AppManager;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
|
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
|
|
||||||
public class DebugDialog {
|
|
||||||
RecyclerView recyclerView;
|
|
||||||
TreeMap<String, String> params;
|
|
||||||
DebugDialogAdapter adapter;
|
|
||||||
private static DebugDialog debugDialog;
|
|
||||||
Context mContext;
|
|
||||||
|
|
||||||
public static DebugDialog getInstance() {
|
|
||||||
if (debugDialog == null) {
|
|
||||||
debugDialog = new DebugDialog();
|
|
||||||
}
|
|
||||||
return debugDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DebugDialog clear() {
|
|
||||||
params.clear();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParams(String tag, String msg) {
|
|
||||||
Log.i("debug弹窗", "setParams: "+tag+"|"+msg);
|
|
||||||
params.put(tag, msg);
|
|
||||||
if (adapter != null)
|
|
||||||
adapter.setParamMap(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
private DebugDialog() {
|
|
||||||
if(params==null) {
|
|
||||||
Log.i("debug弹窗", "DebugDialog: 初始化参数");
|
|
||||||
params = new TreeMap<>();
|
|
||||||
}
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
private void init(){
|
|
||||||
this.mContext = AppManager.getInstance().getMainActivity();
|
|
||||||
if (mContext == null) {
|
|
||||||
startWaitMainActivity();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (PermissionUtils.checkPermission(mContext)) {
|
|
||||||
createView();
|
|
||||||
} else {
|
|
||||||
PermissionUtils.requestPermission((Activity) mContext, new OnPermissionResult() {
|
|
||||||
@Override
|
|
||||||
public void permissionResult(boolean b) {
|
|
||||||
ToastUtil.show("悬浮权限" + b);
|
|
||||||
if (b) {
|
|
||||||
createView();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// createView();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startWaitMainActivity() {
|
|
||||||
new Timer().schedule(new TimerTask() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Log.i("debug弹窗", "run: "+AppManager.getInstance().getMainActivity());
|
|
||||||
if (AppManager.getInstance().getMainActivity() != null) {
|
|
||||||
init();
|
|
||||||
cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 0,1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void createView() {
|
|
||||||
recyclerView = new RecyclerView(mContext);
|
|
||||||
adapter = new DebugDialogAdapter(mContext);
|
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
|
||||||
recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT));
|
|
||||||
recyclerView.setAdapter(adapter);
|
|
||||||
recyclerView.setBackgroundColor(Color.WHITE);
|
|
||||||
EasyFloat.with(mContext)
|
|
||||||
.setTag("debug")
|
|
||||||
.setShowPattern(ShowPattern.FOREGROUND)
|
|
||||||
.setLayout(recyclerView)
|
|
||||||
.show();
|
|
||||||
if(!params.isEmpty()){
|
|
||||||
|
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
adapter.setParamMap(params);
|
|
||||||
}
|
|
||||||
},1000);
|
|
||||||
Log.i("debug弹窗", "createView: 有值");
|
|
||||||
}
|
|
||||||
Log.i("debug弹窗", "createView: 创建");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,160 +0,0 @@
|
|||||||
package com.yunbao.common.dialog;
|
|
||||||
|
|
||||||
import android.animation.Animator;
|
|
||||||
import android.animation.AnimatorListenerAdapter;
|
|
||||||
import android.animation.ValueAnimator;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.Window;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.yunbao.common.R;
|
|
||||||
import com.yunbao.common.adapter.ImagePreviewAdapter;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Martin on 2024/3/15.
|
|
||||||
* 图片预览弹窗
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ImagePreviewDialog extends AbsDialogFragment implements View.OnClickListener {
|
|
||||||
|
|
||||||
private View mBg;
|
|
||||||
private RecyclerView mRecyclerView;
|
|
||||||
private ValueAnimator mAnimator;
|
|
||||||
private int mPosition;
|
|
||||||
private int mPageCount;
|
|
||||||
private ActionListener mActionListener;
|
|
||||||
private TextView mCount;
|
|
||||||
private ImagePreviewAdapter mAdapter;
|
|
||||||
private boolean mNeedDelete;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutId() {
|
|
||||||
return R.layout.view_preview_image;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getDialogStyle() {
|
|
||||||
return R.style.dialog2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean canCancel() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setWindowAttributes(Window window) {
|
|
||||||
WindowManager.LayoutParams params = window.getAttributes();
|
|
||||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
||||||
params.height = WindowManager.LayoutParams.MATCH_PARENT;
|
|
||||||
window.setAttributes(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
|
||||||
mBg = mRootView.findViewById(R.id.bg);
|
|
||||||
mCount = (TextView) findViewById(R.id.count);
|
|
||||||
findViewById(R.id.btn_close).setOnClickListener(this);
|
|
||||||
if (mNeedDelete) {
|
|
||||||
View btnDelete = findViewById(R.id.btn_delete);
|
|
||||||
btnDelete.setVisibility(View.VISIBLE);
|
|
||||||
btnDelete.setOnClickListener(this);
|
|
||||||
}
|
|
||||||
mRecyclerView = mRootView.findViewById(R.id.recyclerView);
|
|
||||||
mRecyclerView.setHasFixedSize(true);
|
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
|
||||||
mAnimator = ValueAnimator.ofFloat(0, 1);
|
|
||||||
mAnimator.setDuration(150);
|
|
||||||
mAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
|
||||||
mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationUpdate(ValueAnimator animation) {
|
|
||||||
float v = (float) animation.getAnimatedValue();
|
|
||||||
mBg.setAlpha(v);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mAnimator.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
if (mRecyclerView != null && mPageCount > 0) {
|
|
||||||
ImagePreviewAdapter adapter = new ImagePreviewAdapter(mContext, mPageCount);
|
|
||||||
mAdapter = adapter;
|
|
||||||
adapter.setActionListener(new ImagePreviewAdapter.ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void onPageChanged(int position) {
|
|
||||||
if (mCount != null) {
|
|
||||||
mCount.setText(StringUtil.contact(String.valueOf(position + 1), "/", String.valueOf(mPageCount)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void loadImage(ImageView imageView, int position) {
|
|
||||||
if (mActionListener != null) {
|
|
||||||
mActionListener.loadImage(imageView, position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mRecyclerView.setAdapter(adapter);
|
|
||||||
if (mPosition >= 0 && mPosition < mPageCount) {
|
|
||||||
adapter.setCurPosition(mPosition);
|
|
||||||
mRecyclerView.scrollToPosition(mPosition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mAnimator.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImageInfo(int pageCount, int position, boolean needDelete, ActionListener actionListener) {
|
|
||||||
mActionListener = actionListener;
|
|
||||||
mPageCount = pageCount;
|
|
||||||
mPosition = position;
|
|
||||||
mNeedDelete = needDelete;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
if (mAnimator != null) {
|
|
||||||
mAnimator.cancel();
|
|
||||||
}
|
|
||||||
mContext = null;
|
|
||||||
mActionListener = null;
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
int i = v.getId();
|
|
||||||
if (i == R.id.btn_close) {
|
|
||||||
dismiss();
|
|
||||||
} else if (i == R.id.btn_delete) {
|
|
||||||
delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void delete() {
|
|
||||||
if (mAdapter != null && mActionListener != null) {
|
|
||||||
mActionListener.onDeleteClick(mAdapter.getCurPosition());
|
|
||||||
}
|
|
||||||
dismiss();
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface ActionListener {
|
|
||||||
void loadImage(ImageView imageView, int position);
|
|
||||||
|
|
||||||
void onDeleteClick(int position);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
//游戏弹窗
|
|
||||||
public class LiveNewRolePopup extends BottomPopupView {
|
public class LiveNewRolePopup extends BottomPopupView {
|
||||||
private boolean showRed = false;
|
private boolean showRed = false;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import com.yunbao.common.event.LiveSudGameHistoryEvent;
|
|||||||
import com.yunbao.common.event.RoomHolderTypeEvent;
|
import com.yunbao.common.event.RoomHolderTypeEvent;
|
||||||
import com.yunbao.common.event.SudGameListEvent;
|
import com.yunbao.common.event.SudGameListEvent;
|
||||||
import com.yunbao.common.event.SudGameListSillEvent;
|
import com.yunbao.common.event.SudGameListSillEvent;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||||
|
|
||||||
@@ -88,11 +87,6 @@ public class SudGameListSelectPopup extends AttachPopupView {
|
|||||||
if (mType == 0 || mType == 4) {
|
if (mType == 0 || mType == 4) {
|
||||||
topSelect.setText(getContext().getString(R.string.interactive_game_room_all));
|
topSelect.setText(getContext().getString(R.string.interactive_game_room_all));
|
||||||
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
for (int i = 0; i < customSidebarChildModels.size(); i++) {
|
||||||
/* if (!IMLoginManager.get(getContext()).getUserInfo().anchorUserType()) {
|
|
||||||
if ("1490944230389182466".equals(customSidebarChildModels.get(i).getSrc())) {//友尽闯关
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
selectString.add(customSidebarChildModels.get(i).getTitle());
|
selectString.add(customSidebarChildModels.get(i).getTitle());
|
||||||
if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) {
|
if (TextUtils.equals(String.valueOf(interactionID), customSidebarChildModels.get(i).getSrc())) {
|
||||||
index = i;
|
index = i;
|
||||||
|
|||||||
@@ -115,36 +115,6 @@ public class SendBlindGiftEvent extends BaseModel {
|
|||||||
private String liveGiftNotify;
|
private String liveGiftNotify;
|
||||||
@SerializedName("userNiceName")
|
@SerializedName("userNiceName")
|
||||||
private String userNiceName;
|
private String userNiceName;
|
||||||
@SerializedName("special_gift")
|
|
||||||
private int specialGift;
|
|
||||||
@SerializedName("special_gift_name")
|
|
||||||
private String specialGiftName;
|
|
||||||
@SerializedName("special_gift_name_en")
|
|
||||||
private String specialGiftNameEn;
|
|
||||||
|
|
||||||
public int getSpecialGift() {
|
|
||||||
return specialGift;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpecialGift(int specialGift) {
|
|
||||||
this.specialGift = specialGift;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSpecialGiftName() {
|
|
||||||
return specialGiftName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpecialGiftName(String specialGiftName) {
|
|
||||||
this.specialGiftName = specialGiftName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSpecialGiftNameEn() {
|
|
||||||
return specialGiftNameEn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpecialGiftNameEn(String specialGiftNameEn) {
|
|
||||||
this.specialGiftNameEn = specialGiftNameEn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserNiceName() {
|
public String getUserNiceName() {
|
||||||
return userNiceName;
|
return userNiceName;
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
package com.yunbao.common.event;
|
|
||||||
|
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
|
||||||
|
|
||||||
public class SubGameEvent {
|
|
||||||
int type;
|
|
||||||
HttpCallbackModel model;
|
|
||||||
String dataJson;
|
|
||||||
|
|
||||||
public SubGameEvent(int type, HttpCallbackModel model, String dataJson) {
|
|
||||||
this.type = type;
|
|
||||||
this.model = model;
|
|
||||||
this.dataJson = dataJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(int type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HttpCallbackModel getModel() {
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModel(HttpCallbackModel model) {
|
|
||||||
this.model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataJson() {
|
|
||||||
return dataJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "SubGameEvent{" +
|
|
||||||
"type=" + type +
|
|
||||||
", model=" + model +
|
|
||||||
", dataJson='" + dataJson + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -42,7 +42,7 @@ import java.util.Locale;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class CommonHttpUtil {
|
public class CommonHttpUtil {
|
||||||
public static final String GET_UPLOAD_QI_NIU_TOKEN = "getUploadQiNiuToken";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化
|
* 初始化
|
||||||
@@ -450,16 +450,6 @@ public class CommonHttpUtil {
|
|||||||
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
public static void getUserBaseinfo(String touid, HttpCallback callback) {
|
||||||
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
HttpClient.getInstance().get("User.getUserBaseinfo", CommonHttpConsts.GET_USER_BASEINFO).params("touid", touid).execute(callback);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 上传文件 获取七牛云token的接口
|
|
||||||
*/
|
|
||||||
public static void getUploadQiNiuToken(HttpCallback callback, boolean isImg) {
|
|
||||||
HttpClient.getInstance().get("Pdluserhome.getQiNiuToken2", "Pdluserhome.getQiNiuToken2")
|
|
||||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
|
||||||
.params("token", CommonAppConfig.getInstance().getToken())
|
|
||||||
.params("ext", isImg ? ".jpeg" : ".mp4")
|
|
||||||
.execute(callback);
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// //埋点唯一性
|
// //埋点唯一性
|
||||||
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
// public static void setAdvertisingChannels(String operation, HttpCallback callback) {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||||
import com.yunbao.common.bean.AvatarBean;
|
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.BattlePassPoints;
|
import com.yunbao.common.bean.BattlePassPoints;
|
||||||
import com.yunbao.common.bean.BattlePassTask;
|
import com.yunbao.common.bean.BattlePassTask;
|
||||||
@@ -83,13 +82,10 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.MultipartBody;
|
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.Multipart;
|
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Part;
|
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
import retrofit2.http.QueryMap;
|
import retrofit2.http.QueryMap;
|
||||||
|
|
||||||
@@ -115,7 +111,7 @@ public interface PDLiveApi {
|
|||||||
@Field("uuid_Device") String uuidDevice,
|
@Field("uuid_Device") String uuidDevice,
|
||||||
@Field("pushid") String pushid,
|
@Field("pushid") String pushid,
|
||||||
@Field("lastlogindevice") String lastlogindevice,
|
@Field("lastlogindevice") String lastlogindevice,
|
||||||
@Field("langue") String langue
|
@Field("langue")String langue
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1190,46 +1186,10 @@ public interface PDLiveApi {
|
|||||||
|
|
||||||
@GET("/api/public/?service=Guard.participateMoneyLong")
|
@GET("/api/public/?service=Guard.participateMoneyLong")
|
||||||
Observable<ResponseModel<String>> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
Observable<ResponseModel<String>> participateMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||||
|
|
||||||
@GET("/api/public/?service=Guard.endSendMoneyLong")
|
@GET("/api/public/?service=Guard.endSendMoneyLong")
|
||||||
Observable<ResponseModel<SendMoneyLongModel>> endSendMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
Observable<ResponseModel<SendMoneyLongModel>> endSendMoneyLong(@Query("liveuid") String liveUid, @Query("send_money_long_key") String sendMoneyLongKey);
|
||||||
|
|
||||||
@GET("/api/public/?service=Guard.checkUpgrades")
|
@GET("/api/public/?service=Guard.checkUpgrades")
|
||||||
Observable<ResponseModel<CheckUpgradesModel>> checkUpgrades(@Query("liveuid") String liveUid);
|
Observable<ResponseModel<CheckUpgradesModel>> checkUpgrades(@Query("liveuid") String liveUid);
|
||||||
|
|
||||||
@GET("/api/public/?service=Guard.getRewards")
|
@GET("/api/public/?service=Guard.getRewards")
|
||||||
Observable<ResponseModel<Object>> guardGetRewards(@Query("guard_level") String guardLevel, @Query("liveuid") String liveUid);
|
Observable<ResponseModel<Object>> guardGetRewards(@Query("guard_level") String guardLevel,@Query("liveuid") String liveUid);
|
||||||
|
|
||||||
@Multipart
|
|
||||||
@POST("/api/public/?service=Pdlinfos.updateAvatar")
|
|
||||||
Observable<ResponseModel<AvatarBean>> updateFile(@Part MultipartBody.Part file, @Query("uid") String uid, @Query("token") String token);
|
|
||||||
|
|
||||||
@GET("/api/public/?service=User.userFeedback")
|
|
||||||
Observable<ResponseModel<List<BaseModel>>> feedback(@Query("problem_description") String content, @Query("problem_image") String images, @Query("contact_information") String ci);
|
|
||||||
|
|
||||||
|
|
||||||
@GET("/api/public/?service=User.userFeedbackRestrict")
|
|
||||||
Observable<ResponseModel<List<BaseModel>>> checkFeedback();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param roomId 房间ID
|
|
||||||
* @param cmd 事件名称 生命值:addHeart 自动跳:hit
|
|
||||||
* @param value 价格
|
|
||||||
* @param gameId 游戏ID
|
|
||||||
* @param fromUid 付费用户uid
|
|
||||||
* @param toUid 目标用户uid
|
|
||||||
* @param payload 附加值
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GET("/api/public/?service=Sudgameserver.createOrder")
|
|
||||||
Observable<ResponseModel<List<BaseModel>>> createGameOrder(
|
|
||||||
@Query("room_id")String roomId,
|
|
||||||
@Query("cmd")String cmd,
|
|
||||||
@Query("value")String value,
|
|
||||||
@Query("mg_id")String gameId,
|
|
||||||
@Query("from_uid")String fromUid,
|
|
||||||
@Query("to_uid")String toUid,
|
|
||||||
@Query("payload")String payload
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,9 @@ import android.content.Context;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.ActiveModel;
|
import com.yunbao.common.bean.ActiveModel;
|
||||||
import com.yunbao.common.bean.AvatarBean;
|
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
import com.yunbao.common.bean.BattlePassPoints;
|
import com.yunbao.common.bean.BattlePassPoints;
|
||||||
import com.yunbao.common.bean.BattlePassTask;
|
import com.yunbao.common.bean.BattlePassTask;
|
||||||
@@ -82,7 +79,6 @@ import com.yunbao.common.http.base.CheckLiveCallBack;
|
|||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -92,10 +88,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
|||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.functions.Consumer;
|
import io.reactivex.functions.Consumer;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import okhttp3.MediaType;
|
|
||||||
import okhttp3.MultipartBody;
|
|
||||||
import okhttp3.RequestBody;
|
|
||||||
import retrofit2.http.Query;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3168,123 +3160,6 @@ public class LiveNetManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateFile(File file, HttpCallback<AvatarBean> callback) {
|
|
||||||
MultipartBody.Part uploadFile = createUploadFile(file);
|
|
||||||
API.get().pdLiveApi(mContext)
|
|
||||||
.updateFile(uploadFile, CommonAppConfig.getInstance().getUid(), CommonAppConfig.getInstance().getToken())
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new Consumer<ResponseModel<AvatarBean>>() {
|
|
||||||
@Override
|
|
||||||
public void accept(ResponseModel<AvatarBean> model) throws Exception {
|
|
||||||
if (callback != null) {
|
|
||||||
callback.onSuccess(model.getData().getInfo());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Consumer<Throwable>() {
|
|
||||||
@Override
|
|
||||||
public void accept(Throwable throwable) throws Exception {
|
|
||||||
if (callback != null) {
|
|
||||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).isDisposed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void feedback(
|
|
||||||
String content,
|
|
||||||
JSONArray images,
|
|
||||||
String ci
|
|
||||||
, HttpCallback<HttpCallbackModel> callback) {
|
|
||||||
API.get().pdLiveApi(mContext)
|
|
||||||
.feedback(content, images.toString(), ci)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
|
||||||
@Override
|
|
||||||
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
|
||||||
if (callback != null) {
|
|
||||||
HttpCallbackModel model = new HttpCallbackModel();
|
|
||||||
model.setCode(responseModel.getData().getCode());
|
|
||||||
model.setMsg(responseModel.getData().getMsg());
|
|
||||||
callback.onSuccess(model);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Consumer<Throwable>() {
|
|
||||||
@Override
|
|
||||||
public void accept(Throwable throwable) throws Exception {
|
|
||||||
if (callback != null) {
|
|
||||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).isDisposed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void checkFeedback(
|
|
||||||
HttpCallback<HttpCallbackModel> callback) {
|
|
||||||
API.get().pdLiveApi(mContext)
|
|
||||||
.checkFeedback()
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
|
||||||
@Override
|
|
||||||
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
|
||||||
if (callback != null) {
|
|
||||||
HttpCallbackModel model = new HttpCallbackModel();
|
|
||||||
model.setCode(responseModel.getData().getCode());
|
|
||||||
model.setMsg(responseModel.getData().getMsg());
|
|
||||||
callback.onSuccess(model);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Consumer<Throwable>() {
|
|
||||||
@Override
|
|
||||||
public void accept(Throwable throwable) throws Exception {
|
|
||||||
if (callback != null) {
|
|
||||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).isDisposed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void createGameOrder(
|
|
||||||
String roomId,
|
|
||||||
String cmd,
|
|
||||||
String value,
|
|
||||||
String gameId,
|
|
||||||
String fromUid,
|
|
||||||
String toUid,
|
|
||||||
String roundId,
|
|
||||||
String payload
|
|
||||||
, HttpCallback<HttpCallbackModel> callback) {
|
|
||||||
API.get().pdLiveApi(mContext)
|
|
||||||
.createGameOrder(roomId, cmd, value, gameId, fromUid, toUid,payload)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
|
|
||||||
@Override
|
|
||||||
public void accept(ResponseModel<List<BaseModel>> responseModel) {
|
|
||||||
if (callback != null) {
|
|
||||||
HttpCallbackModel model = new HttpCallbackModel();
|
|
||||||
model.setCode(responseModel.getData().getCode());
|
|
||||||
model.setMsg(responseModel.getData().getMsg());
|
|
||||||
callback.onSuccess(model);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Consumer<Throwable>() {
|
|
||||||
@Override
|
|
||||||
public void accept(Throwable throwable) throws Exception {
|
|
||||||
if (callback != null) {
|
|
||||||
callback.onError(mContext.getString(com.yunbao.common.R.string.net_error));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).isDisposed();
|
|
||||||
}
|
|
||||||
|
|
||||||
private MultipartBody.Part createUploadFile(File file) {
|
|
||||||
RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
|
||||||
return MultipartBody.Part.createFormData("file", file.getName(), requestBody);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播间取消网络请求
|
* 直播间取消网络请求
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,62 +1,16 @@
|
|||||||
package com.yunbao.common.interfaces;
|
package com.yunbao.common.interfaces;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import com.yunbao.common.CommonAppContext;
|
|
||||||
import com.yunbao.common.bean.AvatarBean;
|
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
|
||||||
import com.yunbao.common.upload.UploadBean;
|
|
||||||
import com.yunbao.common.upload.UploadCallback;
|
|
||||||
import com.yunbao.common.upload.UploadQnImpl;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/9/29.
|
* Created by cxf on 2018/9/29.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class ImageResultCallback {
|
public interface ImageResultCallback {
|
||||||
//跳转相机前执行
|
//跳转相机前执行
|
||||||
public void beforeCamera() {
|
void beforeCamera();
|
||||||
}
|
|
||||||
|
|
||||||
public void onSuccess(File file) {
|
void onSuccess(File file);
|
||||||
}
|
|
||||||
|
|
||||||
public void onFailure() {
|
void onFailure();
|
||||||
}
|
|
||||||
|
|
||||||
public void onSuccessToUrl(File file, OnItemClickListener<String> listener) {
|
|
||||||
LiveNetManager.get(CommonAppContext.getTopActivity())
|
|
||||||
.updateFile(file, new com.yunbao.common.http.base.HttpCallback<AvatarBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(AvatarBean data) {
|
|
||||||
listener.onItemClick(data.getAvatar(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
listener.onItemClick(error, -1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onSuccessToQiNiuUrl(Context mContext, File file, OnItemClickListener<String> listener) {
|
|
||||||
UploadQnImpl mUploadStrategy = new UploadQnImpl(mContext);
|
|
||||||
List<UploadBean> beans = new ArrayList<>();
|
|
||||||
beans.add(new UploadBean(file, UploadBean.IMG));
|
|
||||||
mUploadStrategy.upload(beans, true, new UploadCallback() {
|
|
||||||
@Override
|
|
||||||
public void onFinish(List<UploadBean> list, boolean success) {
|
|
||||||
if (success) {
|
|
||||||
listener.onItemClick("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl(), 0);
|
|
||||||
} else {
|
|
||||||
listener.onItemClick(null, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -8,15 +8,18 @@ import android.text.TextUtils;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.lzf.easyfloat.EasyFloat;
|
import com.lzf.easyfloat.EasyFloat;
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.lzy.okgo.model.Response;
|
||||||
|
import com.umeng.analytics.MobclickAgent;
|
||||||
import com.yunbao.common.CommonAppContext;
|
import com.yunbao.common.CommonAppContext;
|
||||||
import com.yunbao.common.bean.IMLoginModel;
|
import com.yunbao.common.bean.IMLoginModel;
|
||||||
import com.yunbao.common.event.DataUserInfoEvent;
|
import com.yunbao.common.event.DataUserInfoEvent;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
|
import com.yunbao.common.http.JsonBean;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||||
@@ -465,6 +468,11 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
//兼容老模块(之后要把用户维护的类更换掉)
|
//兼容老模块(之后要把用户维护的类更换掉)
|
||||||
SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo));
|
SpUtil.getInstance().setStringValue(SpUtil.USER_INFO, new Gson().toJson(userInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Response<JsonBean> response) {
|
||||||
|
super.onError(response);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.yunbao.common.pay.samsung;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.HelperDefine;
|
import com.samsung.android.sdk.iap.lib.constants.HelperDefine;
|
||||||
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
import com.samsung.android.sdk.iap.lib.helper.IapHelper;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
import com.samsung.android.sdk.iap.lib.listener.OnConsumePurchasedItemsListener;
|
||||||
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
import com.samsung.android.sdk.iap.lib.listener.OnGetOwnedListListener;
|
||||||
@@ -11,6 +11,8 @@ import com.samsung.android.sdk.iap.lib.listener.OnPaymentListener;
|
|||||||
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
import com.samsung.android.sdk.iap.lib.vo.ConsumeVo;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
import com.samsung.android.sdk.iap.lib.vo.ErrorVo;
|
||||||
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
import com.samsung.android.sdk.iap.lib.vo.OwnedProductVo;
|
||||||
|
import com.samsung.android.sdk.iap.lib.vo.PurchaseVo;
|
||||||
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -57,8 +59,26 @@ public class SamsungUtil {
|
|||||||
*/
|
*/
|
||||||
public void buy(String skuId, OnPaymentListener onPaymentListener) {
|
public void buy(String skuId, OnPaymentListener onPaymentListener) {
|
||||||
//购买
|
//购买
|
||||||
iapHelper.startPayment(skuId, "", onPaymentListener);
|
iapHelper.startPayment(skuId, "", (errorVo, purchaseVo) -> {
|
||||||
|
if (purchaseVo != null) {
|
||||||
|
onPaymentListener.onPaymentSuccess(purchaseVo.getPurchaseId());
|
||||||
|
} else {
|
||||||
|
if (errorVo.getErrorCode() == HelperDefine.IAP_PAYMENT_IS_CANCELED) {
|
||||||
|
onPaymentListener.onPaymentFailed(mContext.getString(R.string.pay_cancel));
|
||||||
|
} else {
|
||||||
|
onPaymentListener.onPaymentFailed(errorVo.getErrorString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnPaymentListener {
|
||||||
|
void onPaymentSuccess(String purchaseVo);
|
||||||
|
|
||||||
|
void onPaymentFailed(String errorVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消耗指定商品
|
* 消耗指定商品
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import android.view.View;
|
|||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
import com.yunbao.common.sud.decorator.SudFSMMGCache;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
import com.yunbao.common.sud.decorator.SudFSMMGDecorator;
|
||||||
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
import com.yunbao.common.sud.decorator.SudFSMMGListener;
|
||||||
@@ -17,10 +16,7 @@ import com.yunbao.common.sud.decorator.SudFSTAPPDecorator;
|
|||||||
import com.yunbao.common.sud.model.GameConfigModel;
|
import com.yunbao.common.sud.model.GameConfigModel;
|
||||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||||
import com.yunbao.common.sud.state.MGStateResponse;
|
import com.yunbao.common.sud.state.MGStateResponse;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
import com.yunbao.common.utils.SudJsonUtils;
|
import com.yunbao.common.utils.SudJsonUtils;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
import com.yunbao.common.utils.WordUtil;
|
|
||||||
|
|
||||||
import tech.sud.mgp.core.ISudFSMStateHandle;
|
import tech.sud.mgp.core.ISudFSMStateHandle;
|
||||||
import tech.sud.mgp.core.ISudFSTAPP;
|
import tech.sud.mgp.core.ISudFSTAPP;
|
||||||
@@ -146,10 +142,7 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
|
|
||||||
// 给装饰类设置回调
|
// 给装饰类设置回调
|
||||||
sudFSMMGDecorator.setSudFSMMGListener(this);
|
sudFSMMGDecorator.setSudFSMMGListener(this);
|
||||||
sudFSMMGDecorator.setGameId(gameId);
|
|
||||||
sudFSMMGDecorator.setRoomId(gameRoomId);
|
|
||||||
sudFSMMGDecorator.setUserId(getUserId());
|
|
||||||
Log.i("游戏回调", code + " " + gameId + " " + gameRoomId + " ");
|
|
||||||
// 调用游戏sdk加载游戏
|
// 调用游戏sdk加载游戏
|
||||||
ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator);
|
ISudFSTAPP iSudFSTAPP = SudMGP.loadMG(activity, getUserId(), gameRoomId, code, gameId, getLanguageCode(), sudFSMMGDecorator);
|
||||||
|
|
||||||
@@ -289,28 +282,6 @@ public abstract class BaseGameViewModel implements SudFSMMGListener {
|
|||||||
public void onGameLog(String str) {
|
public void onGameLog(String str) {
|
||||||
SudFSMMGListener.super.onGameLog(str);
|
SudFSMMGListener.super.onGameLog(str);
|
||||||
Log.e("onGameStarted", "游戏日志:" + str);
|
Log.e("onGameStarted", "游戏日志:" + str);
|
||||||
if (!StringUtil.isEmpty()) {
|
|
||||||
try {
|
|
||||||
JSONObject json = JSONObject.parseObject(str);
|
|
||||||
if ("error".equals(json.getString("level"))) {
|
|
||||||
String msg = json.getString("msg");
|
|
||||||
JSONObject error = JSONObject.parseObject(msg);
|
|
||||||
if (error.containsKey("msg")) {
|
|
||||||
int resultCode = error.getInteger("resultCode");
|
|
||||||
switch (resultCode) {
|
|
||||||
case 100503:
|
|
||||||
ToastUtil.show(WordUtil.isNewZh()?"有玩家未点击准备":":There are players who haven't clicked \"Ready\" yet.");
|
|
||||||
break;
|
|
||||||
case 100504:
|
|
||||||
ToastUtil.show(WordUtil.isNewZh()?"小于游戏最小开始人数":"The number of players is less than the minimum required to start the game.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception ignore) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
/**
|
/**
|
||||||
* 游戏的语言代码
|
* 游戏的语言代码
|
||||||
*/
|
*/
|
||||||
public String languageCode = "zh-TW";
|
public String languageCode = "zh-CN";
|
||||||
|
|
||||||
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
public final MutableLiveData<View> gameViewLiveData = new MutableLiveData<>(); // 游戏View回调
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public class QuickStartGameViewModel extends BaseGameViewModel {
|
|||||||
@Override
|
@Override
|
||||||
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
protected void getCode(Activity activity, String userId, String appId, GameGetCodeListener listener) {
|
||||||
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (IMLoginManager.get(activity).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
languageCode = "zh-TW";
|
languageCode = "zh-CN";
|
||||||
}else {
|
}else {
|
||||||
languageCode = "en-US";
|
languageCode = "en-US";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,6 @@ import tech.sud.mgp.core.ISudFSMStateHandle;
|
|||||||
*/
|
*/
|
||||||
public class SudFSMMGDecorator implements ISudFSMMG {
|
public class SudFSMMGDecorator implements ISudFSMMG {
|
||||||
|
|
||||||
private static final String TAG = "游戏回调";
|
|
||||||
private long gameId;
|
|
||||||
private String gameRoomId;
|
|
||||||
private String userId;
|
|
||||||
// 回调
|
// 回调
|
||||||
private SudFSMMGListener sudFSMMGListener;
|
private SudFSMMGListener sudFSMMGListener;
|
||||||
|
|
||||||
@@ -231,10 +227,10 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态
|
case SudMGPMGState.MG_COMMON_GAME_STATE: // 10. 游戏状态
|
||||||
Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::" + dataJson);
|
Log.e("onGameStateChange", "mg_common_game_state:::::" + "dataJson:::::"+dataJson);
|
||||||
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
|
SudMGPMGState.MGCommonGameState mgCommonGameState = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameState.class);
|
||||||
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
|
sudFSMMGCache.onGameMGCommonGameState(mgCommonGameState);
|
||||||
if (mgCommonGameState.gameState == 2) {
|
if (mgCommonGameState.gameState==2){
|
||||||
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
Bus.get().post(new CheckRemainingBalanceEvent().setSudMGPMGState(SudMGPMGState.MG_COMMON_GAME_STATE));
|
||||||
}
|
}
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
@@ -358,14 +354,6 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
break;
|
break;
|
||||||
case SudMGPMGState.MG_COMMON_GAME_CREATE_ORDER: // 25. 创建订单
|
case SudMGPMGState.MG_COMMON_GAME_CREATE_ORDER: // 25. 创建订单
|
||||||
SudMGPMGState.MGCommonGameCreateOrder mgCommonGameCreateOrder = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameCreateOrder.class);
|
SudMGPMGState.MGCommonGameCreateOrder mgCommonGameCreateOrder = SudJsonUtils.fromJson(dataJson, SudMGPMGState.MGCommonGameCreateOrder.class);
|
||||||
if (mgCommonGameCreateOrder != null) {
|
|
||||||
mgCommonGameCreateOrder.gameId = gameId;
|
|
||||||
mgCommonGameCreateOrder.gameRoomId = gameRoomId;
|
|
||||||
mgCommonGameCreateOrder.userId = userId;
|
|
||||||
mgCommonGameCreateOrder.dataJson = dataJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.i(TAG, "onGameStateChange: " + dataJson);
|
|
||||||
if (listener == null) {
|
if (listener == null) {
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
} else {
|
} else {
|
||||||
@@ -1033,15 +1021,4 @@ public class SudFSMMGDecorator implements ISudFSMMG {
|
|||||||
return sudFSMMGCache;
|
return sudFSMMGCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGameId(long gameId) {
|
|
||||||
this.gameId = gameId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoomId(String gameRoomId) {
|
|
||||||
this.gameRoomId = gameRoomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(String userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
package com.yunbao.common.sud.decorator;
|
package com.yunbao.common.sud.decorator;
|
||||||
|
|
||||||
import com.yunbao.common.sud.decorator.game.JumpEvent;
|
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||||
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
import com.yunbao.common.utils.ISudFSMStateHandleUtils;
|
||||||
|
|
||||||
@@ -272,14 +271,8 @@ public interface SudFSMMGListener {
|
|||||||
* mg_common_game_create_order
|
* mg_common_game_create_order
|
||||||
*/
|
*/
|
||||||
default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) {
|
default void onGameMGCommonGameCreateOrder(ISudFSMStateHandle handle, SudMGPMGState.MGCommonGameCreateOrder model) {
|
||||||
if ("addHeart".equals(model.cmd)) {
|
|
||||||
JumpEvent.addHeart(model);
|
|
||||||
} else if ("hit".equals(model.cmd)) {
|
|
||||||
JumpEvent.hit(model);
|
|
||||||
} else {
|
|
||||||
ISudFSMStateHandleUtils.handleSuccess(handle);
|
ISudFSMStateHandleUtils.handleSuccess(handle);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 26. 游戏通知app玩家角色(仅对狼人杀有效)
|
* 26. 游戏通知app玩家角色(仅对狼人杀有效)
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
package com.yunbao.common.sud.decorator.game;
|
|
||||||
|
|
||||||
import com.yunbao.common.bean.HttpCallbackModel;
|
|
||||||
import com.yunbao.common.event.SubGameEvent;
|
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
|
||||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
|
||||||
import com.yunbao.common.utils.AppManager;
|
|
||||||
import com.yunbao.common.utils.Bus;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
|
|
||||||
public class JumpEvent {
|
|
||||||
private static long clickTimer = 0;
|
|
||||||
|
|
||||||
public static void addHeart(SudMGPMGState.MGCommonGameCreateOrder order) {
|
|
||||||
createOrder(order);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void hit(SudMGPMGState.MGCommonGameCreateOrder order) {
|
|
||||||
createOrder(order);
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized static void createOrder(SudMGPMGState.MGCommonGameCreateOrder order) {
|
|
||||||
if (System.currentTimeMillis() - clickTimer < 500) {
|
|
||||||
//TODO 防止重复点击
|
|
||||||
HttpCallbackModel _data=new HttpCallbackModel(1001,"");
|
|
||||||
Bus.get().post(new SubGameEvent(0, _data,order.dataJson));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
clickTimer = System.currentTimeMillis();
|
|
||||||
LiveNetManager.get(AppManager.getInstance().getLastActivity())
|
|
||||||
.createGameOrder(order.gameRoomId,
|
|
||||||
order.cmd,
|
|
||||||
order.value + "",
|
|
||||||
order.gameId + "",
|
|
||||||
order.fromUid,
|
|
||||||
order.toUid,
|
|
||||||
order.gameRoomId,
|
|
||||||
order.payload,
|
|
||||||
new HttpCallback<HttpCallbackModel>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(HttpCallbackModel data) {
|
|
||||||
if (data.getCode() != 0) {
|
|
||||||
ToastUtil.show(data.getMsg());
|
|
||||||
Bus.get().post(new SubGameEvent(0, data,order.dataJson));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -496,11 +496,6 @@ public class SudMGPMGState implements Serializable {
|
|||||||
public String toUid; // 目标用户uid
|
public String toUid; // 目标用户uid
|
||||||
public long value; // 所属的游戏价值
|
public long value; // 所属的游戏价值
|
||||||
public String payload; // 扩展数据 json 字符串, 特殊可选
|
public String payload; // 扩展数据 json 字符串, 特殊可选
|
||||||
|
|
||||||
public long gameId;
|
|
||||||
public String gameRoomId;
|
|
||||||
public String userId;
|
|
||||||
public String dataJson;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,105 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UploadBean {
|
|
||||||
|
|
||||||
public static final int IMG = 0;
|
|
||||||
public static final int VIDEO = 1;
|
|
||||||
public static final int VOICE = 2;
|
|
||||||
private File mOriginFile;//要被上传的源文件
|
|
||||||
private File mCompressFile;//压缩后的图片文件
|
|
||||||
private String mRemoteFileName;//上传成功后在云存储上的文件名字
|
|
||||||
private String mRemoteAccessUrl;//上传成功后在云存储上的访问地址
|
|
||||||
private boolean mSuccess;//是否上传成功了
|
|
||||||
private int mType;
|
|
||||||
private Object mTag;
|
|
||||||
|
|
||||||
public UploadBean() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UploadBean(File originFile, int type) {
|
|
||||||
mOriginFile = originFile;
|
|
||||||
mType = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getOriginFile() {
|
|
||||||
return mOriginFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOriginFile(File originFile) {
|
|
||||||
mOriginFile = originFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemoteFileName() {
|
|
||||||
return mRemoteFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemoteFileName(String remoteFileName) {
|
|
||||||
mRemoteFileName = remoteFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemoteAccessUrl() {
|
|
||||||
return mRemoteAccessUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemoteAccessUrl(String remoteAccessUrl) {
|
|
||||||
mRemoteAccessUrl = remoteAccessUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getCompressFile() {
|
|
||||||
return mCompressFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompressFile(File compressFile) {
|
|
||||||
mCompressFile = compressFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSuccess() {
|
|
||||||
return mSuccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSuccess(boolean success) {
|
|
||||||
mSuccess = success;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setEmpty() {
|
|
||||||
mOriginFile = null;
|
|
||||||
mRemoteFileName = null;
|
|
||||||
mRemoteAccessUrl = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEmpty() {
|
|
||||||
return mOriginFile == null && mRemoteFileName == null && mRemoteAccessUrl == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType() {
|
|
||||||
return mType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getTag() {
|
|
||||||
return mTag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTag(Object tag) {
|
|
||||||
mTag = tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "UploadBean{" +
|
|
||||||
"mOriginFile=" + mOriginFile +
|
|
||||||
", mCompressFile=" + mCompressFile +
|
|
||||||
", mRemoteFileName='" + mRemoteFileName + '\'' +
|
|
||||||
", mRemoteAccessUrl='" + mRemoteAccessUrl + '\'' +
|
|
||||||
", mSuccess=" + mSuccess +
|
|
||||||
", mType=" + mType +
|
|
||||||
", mTag=" + mTag +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface UploadCallback {
|
|
||||||
void onFinish(List<UploadBean> list, boolean success);
|
|
||||||
}
|
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.qiniu.android.common.ServiceAddress;
|
|
||||||
import com.qiniu.android.common.Zone;
|
|
||||||
import com.qiniu.android.http.ResponseInfo;
|
|
||||||
import com.qiniu.android.storage.Configuration;
|
|
||||||
import com.qiniu.android.storage.UpCompletionHandler;
|
|
||||||
import com.qiniu.android.storage.UploadManager;
|
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
|
||||||
import com.yunbao.common.http.HttpCallback;
|
|
||||||
import com.yunbao.common.utils.L;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import top.zibin.luban.Luban;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
* 七牛上传文件
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UploadQnImpl implements UploadStrategy {
|
|
||||||
|
|
||||||
private static final String TAG = "UploadQnImpl";
|
|
||||||
private Context mContext;
|
|
||||||
private List<UploadBean> mList;
|
|
||||||
private int mIndex;
|
|
||||||
private boolean mNeedCompress;
|
|
||||||
private UploadCallback mUploadCallback;
|
|
||||||
private HttpCallback mGetUploadTokenCallback;
|
|
||||||
private String mToken;
|
|
||||||
private UploadManager mUploadManager;
|
|
||||||
private UpCompletionHandler mCompletionHandler;//上传回调
|
|
||||||
private Luban.Builder mLubanBuilder;
|
|
||||||
|
|
||||||
public UploadQnImpl(Context context) {
|
|
||||||
mContext = context;
|
|
||||||
mCompletionHandler = new UpCompletionHandler() {
|
|
||||||
@Override
|
|
||||||
public void complete(String key, ResponseInfo info, JSONObject response) {
|
|
||||||
System.out.println("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
|
||||||
//L.e("UploadQnImpl 上传-----ok----> " + info.isOK() + "--key---> " + "---response---> " + (response != null ? response.toString() : null));
|
|
||||||
try {
|
|
||||||
assert response != null;
|
|
||||||
mList.get(mIndex).setRemoteAccessUrl(response.getString("key"));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
if (mList == null || mList.size() == 0) {
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, false);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
UploadBean uploadBean = mList.get(mIndex);
|
|
||||||
if (info.isOK()) {
|
|
||||||
uploadBean.setSuccess(true);
|
|
||||||
if (uploadBean.getType() == UploadBean.IMG && mNeedCompress) {
|
|
||||||
//上传完成后把 压缩后的图片 删掉
|
|
||||||
File compressedFile = uploadBean.getCompressFile();
|
|
||||||
if (compressedFile != null && compressedFile.exists()) {
|
|
||||||
File originFile = uploadBean.getOriginFile();
|
|
||||||
if (originFile != null && !compressedFile.getAbsolutePath().equals(originFile.getAbsolutePath())) {
|
|
||||||
compressedFile.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mIndex++;
|
|
||||||
if (mIndex < mList.size()) {
|
|
||||||
uploadNext();
|
|
||||||
} else {
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
upload(mList.get(mIndex));//上传失败后 重新上传
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback, boolean isImg) {
|
|
||||||
System.err.println("-------upload------>" + list.size());
|
|
||||||
if (callback == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (list == null || list.size() == 0) {
|
|
||||||
callback.onFinish(list, false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean hasFile = false;
|
|
||||||
for (UploadBean bean : list) {
|
|
||||||
if (bean.getOriginFile() != null) {
|
|
||||||
hasFile = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!hasFile) {
|
|
||||||
callback.onFinish(list, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mList = list;
|
|
||||||
mNeedCompress = needCompress;
|
|
||||||
mUploadCallback = callback;
|
|
||||||
mIndex = 0;
|
|
||||||
|
|
||||||
if (mGetUploadTokenCallback == null) {
|
|
||||||
mGetUploadTokenCallback = new HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && info.length > 0) {
|
|
||||||
mToken = info[0];
|
|
||||||
System.err.println("-------上传的token------>" + mToken);
|
|
||||||
L.e(TAG, "-------上传的token------>" + mToken);
|
|
||||||
uploadNext();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
CommonHttpUtil.getUploadQiNiuToken(mGetUploadTokenCallback, isImg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cancelUpload() {
|
|
||||||
CommonHttpUtil.cancel(CommonHttpUtil.GET_UPLOAD_QI_NIU_TOKEN);
|
|
||||||
if (mList != null) {
|
|
||||||
mList.clear();
|
|
||||||
}
|
|
||||||
mUploadCallback = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void uploadNext() {
|
|
||||||
UploadBean bean = null;
|
|
||||||
while (mIndex < mList.size() && (bean = mList.get(mIndex)).getOriginFile() == null) {
|
|
||||||
mIndex++;
|
|
||||||
}
|
|
||||||
System.err.println("-------mIndex >= mList.size() mIndex------>" + mIndex);
|
|
||||||
if (mIndex >= mList.size()) {
|
|
||||||
System.err.println("-------mIndex >= mList.size()------>" + mList.size());
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, true);
|
|
||||||
}
|
|
||||||
System.err.println("-------mIndex >= mList.returnreturnreturnreturn------>" + mList.size());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bean.getType() == UploadBean.IMG) {
|
|
||||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".jpg"));
|
|
||||||
} else if (bean.getType() == UploadBean.VIDEO) {
|
|
||||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".mp4"));
|
|
||||||
} else if (bean.getType() == UploadBean.VOICE) {
|
|
||||||
bean.setRemoteFileName(StringUtil.contact(StringUtil.generateFileName(), ".m4a"));
|
|
||||||
}
|
|
||||||
System.err.println("-------mIndex >= bean.getType() == UploadBean.IMG------>" + bean);
|
|
||||||
upload(bean);
|
|
||||||
/*if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
|
||||||
System.err.println("-------UploadBean.IMG && mNeedCompress------>" + bean + "UploadBean.IMG:" + UploadBean.IMG + "__mNeedCompress" + mNeedCompress);
|
|
||||||
if (mLubanBuilder == null) {
|
|
||||||
mLubanBuilder = Luban.with(mContext).ignoreBy(8)//8k以下不压缩
|
|
||||||
.setTargetDir(CommonAppConfig.INNER_PATH).setRenameListener(new OnRenameListener() {
|
|
||||||
@Override
|
|
||||||
public String rename(String filePath) {
|
|
||||||
return mList.get(mIndex).getRemoteFileName();
|
|
||||||
}
|
|
||||||
}).setCompressListener(new OnCompressListener() {
|
|
||||||
@Override
|
|
||||||
public void onStart() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(File file) {
|
|
||||||
UploadBean uploadBean = mList.get(mIndex);
|
|
||||||
uploadBean.setCompressFile(file);
|
|
||||||
upload(uploadBean);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
upload(mList.get(mIndex));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
mLubanBuilder.load(bean.getOriginFile()).launch();
|
|
||||||
} else {
|
|
||||||
System.err.println("-------bean.getType() == UploadBean.IMG && mNeedCompress else");
|
|
||||||
upload(bean);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
private void upload(UploadBean bean) {
|
|
||||||
System.err.println("-------upload(UploadBean bean)------>" + bean);
|
|
||||||
if (bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null) {
|
|
||||||
System.err.println("bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
|
||||||
if (mUploadManager == null) {
|
|
||||||
Zone zone = new Zone(new ServiceAddress("http://upload-z0.qiniup.com"), new ServiceAddress("http://up-z0.qiniup.com"));
|
|
||||||
Configuration configuration = new Configuration.Builder().zone(zone).build();
|
|
||||||
mUploadManager = new UploadManager(configuration);
|
|
||||||
}
|
|
||||||
File uploadFile = bean.getOriginFile();
|
|
||||||
if (bean.getType() == UploadBean.IMG && mNeedCompress) {
|
|
||||||
File compressedFile = bean.getCompressFile();
|
|
||||||
if (compressedFile != null && compressedFile.exists()) {
|
|
||||||
uploadFile = compressedFile;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mUploadManager.put(uploadFile, bean.getRemoteFileName(), mToken, mCompletionHandler, null);
|
|
||||||
} else {
|
|
||||||
System.err.println("else bean != null && !TextUtils.isEmpty(mToken) && mCompletionHandler != null");
|
|
||||||
if (mUploadCallback != null) {
|
|
||||||
mUploadCallback.onFinish(mList, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.yunbao.common.upload;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by cxf on 2019/4/16.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface UploadStrategy {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行上传
|
|
||||||
*
|
|
||||||
* @param list 被上传的文件列表
|
|
||||||
* @param needCompress 是否需要压缩
|
|
||||||
* @param callback 上传回调
|
|
||||||
*/
|
|
||||||
void upload(List<UploadBean> list, boolean needCompress, UploadCallback callback,boolean isImg);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消上传
|
|
||||||
*/
|
|
||||||
void cancelUpload();
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,6 @@ public class AppManager {
|
|||||||
private static Stack<Activity> activityStack;
|
private static Stack<Activity> activityStack;
|
||||||
|
|
||||||
public AppManager() {
|
public AppManager() {
|
||||||
activityStack=new Stack<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,33 +20,6 @@ public class AppManager {
|
|||||||
return SingleApp.INSTANCE;
|
return SingleApp.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Activity getActivity(String activityName) {
|
|
||||||
for (Activity activity : activityStack) {
|
|
||||||
if (activity.getClass().getSimpleName().contains(activityName)) {
|
|
||||||
return activity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Activity getMainActivity() {
|
|
||||||
for (Activity activity : activityStack) {
|
|
||||||
if (activity.getClass().getSimpleName().contains("MainActivity")) {
|
|
||||||
return activity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Activity getLiveActivity() {
|
|
||||||
for (Activity activity : activityStack) {
|
|
||||||
if (activity.getClass().getSimpleName().contains("LiveAudienceActivity")) {
|
|
||||||
return activity;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SingleApp {
|
public static class SingleApp {
|
||||||
public static AppManager INSTANCE = new AppManager();
|
public static AppManager INSTANCE = new AppManager();
|
||||||
}
|
}
|
||||||
@@ -86,14 +58,7 @@ public class AppManager {
|
|||||||
* 获取当前显示Activity(堆栈中最后一个传入的activity)
|
* 获取当前显示Activity(堆栈中最后一个传入的activity)
|
||||||
*/
|
*/
|
||||||
public Activity getLastActivity() {
|
public Activity getLastActivity() {
|
||||||
if (activityStack.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Activity activity = activityStack.lastElement();
|
Activity activity = activityStack.lastElement();
|
||||||
if (activity == null || activity.isFinishing()) {
|
|
||||||
activityStack.remove(activity);
|
|
||||||
return getLastActivity();
|
|
||||||
}
|
|
||||||
return activity;
|
return activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +117,7 @@ public class AppManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仅在debug下运行的代码
|
*仅在debug下运行的代码
|
||||||
*/
|
*/
|
||||||
public static void runDebugCode(Runnable runnable) {
|
public static void runDebugCode(Runnable runnable) {
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
|
|||||||
@@ -358,8 +358,6 @@ public class DialogUitl {
|
|||||||
private boolean mCancelable;
|
private boolean mCancelable;
|
||||||
private boolean mBackgroundDimEnabled;//显示区域以外是否使用黑色半透明背景
|
private boolean mBackgroundDimEnabled;//显示区域以外是否使用黑色半透明背景
|
||||||
private boolean mInput;//是否是输入框的
|
private boolean mInput;//是否是输入框的
|
||||||
private boolean isShowCancelButton=true;
|
|
||||||
private boolean isSHowConfirmButton=true;
|
|
||||||
private String mHint;
|
private String mHint;
|
||||||
private int mInputType;
|
private int mInputType;
|
||||||
private int mLength;
|
private int mLength;
|
||||||
@@ -456,16 +454,6 @@ public class DialogUitl {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setShowCancelButton(boolean showCancelButton) {
|
|
||||||
isShowCancelButton = showCancelButton;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Builder setShowConfirmButton(boolean showConfirmButton) {
|
|
||||||
isSHowConfirmButton = showConfirmButton;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dialog build() {
|
public Dialog build() {
|
||||||
final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2);
|
final Dialog dialog = new Dialog(mContext, mBackgroundDimEnabled ? R.style.dialog : R.style.dialog2);
|
||||||
if (mView != 0) {
|
if (mView != 0) {
|
||||||
@@ -505,22 +493,10 @@ public class DialogUitl {
|
|||||||
TextView btnConfirm = (TextView) dialog.findViewById(R.id.btn_confirm);
|
TextView btnConfirm = (TextView) dialog.findViewById(R.id.btn_confirm);
|
||||||
if (!TextUtils.isEmpty(mConfirmString)) {
|
if (!TextUtils.isEmpty(mConfirmString)) {
|
||||||
btnConfirm.setText(mConfirmString);
|
btnConfirm.setText(mConfirmString);
|
||||||
btnConfirm.setVisibility(View.VISIBLE);
|
|
||||||
}else if(mConfirmString==null){
|
|
||||||
// btnConfirm.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
TextView btnCancel = (TextView) dialog.findViewById(R.id.btn_cancel);
|
TextView btnCancel = (TextView) dialog.findViewById(R.id.btn_cancel);
|
||||||
if (!TextUtils.isEmpty(mCancelString)) {
|
if (!TextUtils.isEmpty(mCancelString)) {
|
||||||
btnCancel.setText(mCancelString);
|
btnCancel.setText(mCancelString);
|
||||||
btnCancel.setVisibility(View.VISIBLE);
|
|
||||||
}else if(mCancelString==null){
|
|
||||||
//btnCancel.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if(!isSHowConfirmButton){
|
|
||||||
btnConfirm.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if(!isShowCancelButton){
|
|
||||||
btnCancel.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
View.OnClickListener listener = new View.OnClickListener() {
|
View.OnClickListener listener = new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
package com.yunbao.common.utils;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
|
|
||||||
public class MobclickAgent {
|
|
||||||
public static void onEvent(Context content, String key, Object value){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setCatchUncaughtExceptions(boolean b) {
|
|
||||||
}
|
|
||||||
public static void setPageCollectionMode(int type){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onPageStart(String mTag) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onPageEnd(String mTag) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onProfileSignOff() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void onProfileSignIn(String s) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,12 +6,10 @@ import android.content.Intent;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
import com.yalantis.ucrop.UCrop;
|
import com.yalantis.ucrop.UCrop;
|
||||||
import com.yalantis.ucrop.util.FileUtils;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.interfaces.ActivityResultCallback;
|
import com.yunbao.common.interfaces.ActivityResultCallback;
|
||||||
@@ -38,11 +36,6 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
private File mCorpResult;//裁剪后得到的图片
|
private File mCorpResult;//裁剪后得到的图片
|
||||||
private ImageResultCallback mResultCallback;
|
private ImageResultCallback mResultCallback;
|
||||||
private boolean mNeedCrop;//是否需要裁剪
|
private boolean mNeedCrop;//是否需要裁剪
|
||||||
private boolean mNeedGif;//允许gif图
|
|
||||||
|
|
||||||
public void setNeedGif(boolean mNeedGif) {
|
|
||||||
this.mNeedGif = mNeedGif;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProcessImageUtil(FragmentActivity activity) {
|
public ProcessImageUtil(FragmentActivity activity) {
|
||||||
super(activity);
|
super(activity);
|
||||||
@@ -100,41 +93,17 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
ToastUtil.show(mContext.getString(R.string.img_camera_cancel));
|
ToastUtil.show(mContext.getString(R.string.img_camera_cancel));
|
||||||
if (mResultCallback != null) {
|
|
||||||
mResultCallback.onFailure();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mAlumbResultCallback = new ActivityResultCallback() {
|
mAlumbResultCallback = new ActivityResultCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Intent intent) {
|
public void onSuccess(Intent intent) {
|
||||||
if (!mNeedCrop) {
|
|
||||||
if (mResultCallback != null) {
|
|
||||||
if (intent.getData() == null) {
|
|
||||||
if (mResultCallback != null) {
|
|
||||||
mResultCallback.onFailure();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String path = FileUtils.getPath(mContext, intent.getData());
|
|
||||||
File file = new File(path);
|
|
||||||
if (file.exists()) {
|
|
||||||
mResultCallback.onSuccess(file);
|
|
||||||
} else {
|
|
||||||
mResultCallback.onFailure();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
crop(intent.getData());
|
crop(intent.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
ToastUtil.show(mContext.getString(R.string.img_alumb_cancel));
|
ToastUtil.show(mContext.getString(R.string.img_alumb_cancel));
|
||||||
if (mResultCallback != null) {
|
|
||||||
mResultCallback.onFailure();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mCropResultCallback = new ActivityResultCallback() {
|
mCropResultCallback = new ActivityResultCallback() {
|
||||||
@@ -148,9 +117,6 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure() {
|
public void onFailure() {
|
||||||
ToastUtil.show(mContext.getString(R.string.img_crop_cancel));
|
ToastUtil.show(mContext.getString(R.string.img_crop_cancel));
|
||||||
if (mResultCallback != null) {
|
|
||||||
mResultCallback.onFailure();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -177,11 +143,6 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getImageByAlumb(boolean needCrop) {
|
|
||||||
this.mNeedCrop = needCrop;
|
|
||||||
requestPermissions(mAlumbPermissions, mAlumbPermissionCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启摄像头,执行照相
|
* 开启摄像头,执行照相
|
||||||
@@ -202,9 +163,7 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
}
|
}
|
||||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
|
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
|
||||||
startActivityForResult(intent, mCameraResultCallback);
|
startActivityForResult(intent, mCameraResultCallback);
|
||||||
} catch (Exception e) {
|
}catch (Exception e){e.printStackTrace();}
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private File getNewFile() {
|
private File getNewFile() {
|
||||||
@@ -221,14 +180,9 @@ public class ProcessImageUtil extends ProcessResultUtil {
|
|||||||
* 打开相册,选择文件
|
* 打开相册,选择文件
|
||||||
*/
|
*/
|
||||||
private void chooseFile() {
|
private void chooseFile() {
|
||||||
String[] mimeTypes = {"image/png", "image/jpg", "image/jpeg"};
|
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
intent.setType("*/*");
|
intent.setType("image/*");
|
||||||
if (mNeedGif) {
|
|
||||||
mimeTypes = new String[]{"image/png", "image/jpg", "image/jpeg", "image/gif"};
|
|
||||||
}
|
|
||||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
|
|
||||||
if (Build.VERSION.SDK_INT < 19) {
|
if (Build.VERSION.SDK_INT < 19) {
|
||||||
intent.setAction(Intent.ACTION_GET_CONTENT);
|
intent.setAction(Intent.ACTION_GET_CONTENT);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -50,9 +50,6 @@ public class RouteUtil {
|
|||||||
public static final String PATH_BattlePassActivity="/main/BattlePassActivity";
|
public static final String PATH_BattlePassActivity="/main/BattlePassActivity";
|
||||||
public static final String PATH_SudGameActivity="/live/SudGameActivity";
|
public static final String PATH_SudGameActivity="/live/SudGameActivity";
|
||||||
public static final String PATH_COMMUNITY_Activity="/main/MainHomeCommunityActivity";
|
public static final String PATH_COMMUNITY_Activity="/main/MainHomeCommunityActivity";
|
||||||
public static final String PATH_FEEDBACK_SUCCESS_ACTIVITY = "/main/FeedbackSuccessActivity";
|
|
||||||
public static final String PATH_FEEDBACK_ACTIVITY = "/main/FeedbackActivity";
|
|
||||||
public static final String PATH_FEEDBACK_EDIT_ACTIVITY = "/main/FeedbackEditActivity";
|
|
||||||
|
|
||||||
|
|
||||||
public static void forwardCommunityActivity() {
|
public static void forwardCommunityActivity() {
|
||||||
@@ -358,8 +355,4 @@ public class RouteUtil {
|
|||||||
ARouter.getInstance().build(PATH_BattlePassActivity)
|
ARouter.getInstance().build(PATH_BattlePassActivity)
|
||||||
.navigation();
|
.navigation();
|
||||||
}
|
}
|
||||||
public static void forwardActivity(String path){
|
|
||||||
ARouter.getInstance().build(path)
|
|
||||||
.navigation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import java.io.File;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -161,15 +160,4 @@ public class StringUtil {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取随机文件名
|
|
||||||
*/
|
|
||||||
public static String generateFileName() {
|
|
||||||
return contact("android_",
|
|
||||||
CommonAppConfig.getInstance().getUid(),
|
|
||||||
"_",
|
|
||||||
DateFormatUtil.getVideoCurTimeString(),
|
|
||||||
UUID.randomUUID().toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.yunbao.common.utils.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.adapter.FunGamesAdapter;
|
import com.yunbao.common.adapter.FunGamesAdapter;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.adapter.InteractionGamesAdapter;
|
||||||
import com.yunbao.common.adapter.LiveNewRoleInteractionGamesAdapter;
|
import com.yunbao.common.adapter.LiveNewRoleInteractionGamesAdapter;
|
||||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user