Compare commits
195 Commits
pandorapan
...
gong_dev_p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af6398354c | ||
| 403b4c2aa3 | |||
| 4513d8495f | |||
| cc355b0177 | |||
| b2da6e4ea1 | |||
| dc652050ac | |||
| 4298ff2dae | |||
| 4695e040a1 | |||
| 0a87f300b4 | |||
|
|
c3aa0d5c12 | ||
| d9d5cf7046 | |||
|
|
66849632e0 | ||
|
|
06fa241af6 | ||
|
|
b31ec9cddf | ||
| 80d89c8c0b | |||
| 99d92b8137 | |||
| dbebb942e3 | |||
| ed20df63eb | |||
| 67cca1b4fb | |||
|
|
1e91f4c716 | ||
| 7072aadcb6 | |||
| 269ad6e808 | |||
|
|
954a14662b | ||
| 35e0d3dc3e | |||
| 26af3fbbdd | |||
| 75da607022 | |||
| 98c17b91fc | |||
| 0cb2918561 | |||
|
|
538fcc4331 | ||
| 088868201d | |||
| fb81ca8c54 | |||
| 703e3c16d1 | |||
| d06f4599fa | |||
| b285512914 | |||
| 44fc3c651a | |||
| 7eb9aafd87 | |||
| ceaec086ad | |||
|
|
7ab38b12d9 | ||
| 47a3ba6b78 | |||
| 260a6b91f3 | |||
|
|
04bc9af501 | ||
| 0f9f53a080 | |||
| 9652bcaf9a | |||
| 5c10820e98 | |||
| dc65e2bdd3 | |||
| 4685b7979b | |||
| d44df09e5c | |||
|
|
4c760e60b1 | ||
| 4de32ec4e0 | |||
|
|
c35832487d | ||
| b52e1cea66 | |||
| 41874a5073 | |||
| 1f21d447e7 | |||
|
|
ddaed22630 | ||
|
|
97c692d41d | ||
| 79f0237849 | |||
| 6945414be3 | |||
| 5ed273f99b | |||
| f80e8016b5 | |||
| 1dcd0c7882 | |||
| 962a07d6d1 | |||
| 51ab918327 | |||
|
|
10ea7d9735 | ||
| 91217e6bda | |||
| 081a2ee350 | |||
| 6172b5ea9a | |||
| 3b7f273a6e | |||
| bc412a0fb5 | |||
|
|
326e376323 | ||
| 3f717131cc | |||
|
|
7f40b899a9 | ||
| 2a4ce7740b | |||
| 4725e67c75 | |||
|
|
f31c20f49a | ||
|
|
b975e5864f | ||
| df996435ec | |||
| c4117b80ee | |||
|
|
1d9930ed26 | ||
| ab4a5cb077 | |||
| 8a480b51dd | |||
| 01e4afe9c0 | |||
| 462d7177c2 | |||
| 2ab97cb0f6 | |||
| d8e002a8bd | |||
| dcf7cfa889 | |||
| 6a5272d39f | |||
| 6e6acd8871 | |||
|
|
4f590a78a8 | ||
|
|
ff57432814 | ||
|
|
2e9d1cb3dd | ||
|
|
54c97251b8 | ||
|
|
0481db2570 | ||
|
|
415a532351 | ||
| 72a18a0500 | |||
|
|
6b616a4ff8 | ||
| 79c691f5b2 | |||
| 2c41e9418d | |||
| e256b61238 | |||
| be214df23b | |||
| 4451403f46 | |||
|
|
b0a9ebe0f3 | ||
| b3aed71dd6 | |||
|
|
d2f4bb3d4f | ||
| 863aef9a20 | |||
| 25fbf11fbc | |||
|
|
9bb4ed1393 | ||
|
|
e69be60d43 | ||
|
|
e352e5692c | ||
|
|
c7a4c9f501 | ||
| f2d7617ebe | |||
| 210d3a5184 | |||
|
|
fe2af299cb | ||
| 698b875a93 | |||
| b3fe537b2c | |||
|
|
453de855b9 | ||
|
|
e386fbfdbb | ||
| 1d0500128b | |||
| 99bbffed21 | |||
| 7c669b338f | |||
| 7e6a296722 | |||
|
|
80fd2a1bbc | ||
| 9d528524be | |||
| bb4621ee13 | |||
| 631be1bd89 | |||
| 218b223320 | |||
| 8c0398190e | |||
| 460dfa87b3 | |||
|
|
b90d86d90f | ||
| 4337f0bdd6 | |||
| f391d1bee7 | |||
| 33b1f6101f | |||
|
|
0324b638fa | ||
| 7cffce8760 | |||
| be4d05da79 | |||
| f8c5b072af | |||
| a497d70599 | |||
| 84520a4f2f | |||
| 9a7054ce76 | |||
| 57333cdae8 | |||
| e50b00152d | |||
| 253fe38067 | |||
|
|
28f00f1c8a | ||
| 511a354155 | |||
| 463e7b9040 | |||
| dd582c10c7 | |||
| bd6ddf7153 | |||
| c20708d633 | |||
| d08861a082 | |||
| 12989e12ce | |||
| 77530340d0 | |||
| a387b30893 | |||
| 889f8dcfe8 | |||
| 88e822004f | |||
| b954e9d451 | |||
| 578de1f101 | |||
| 62419c86cf | |||
| 434486387d | |||
| 7cf7c1e993 | |||
|
|
9427fb8aaa | ||
|
|
4d4d3d1bae | ||
| 2cc58b920f | |||
| 3b4ffe8c51 | |||
| cd3a86c6b7 | |||
| 82c4edf7e4 | |||
| bd598176c1 | |||
|
|
02bc604685 | ||
|
|
5ebb97cd3c | ||
|
|
e9a3e8aa2f | ||
| 61dcf0916d | |||
| 7167ad8e97 | |||
| 9992dec28e | |||
| 04980cbb2f | |||
|
|
f2b2c39168 | ||
| d39facbcc7 | |||
|
|
c3ca76df07 | ||
| 34dae7d981 | |||
| ce568c6d87 | |||
| c7ba98acb4 | |||
|
|
f8cb1d0a4b | ||
|
|
94d05a3929 | ||
| 1c74689e90 | |||
| a5acbb0146 | |||
| 457e47e885 | |||
| 1442d05262 | |||
| 9e80e77297 | |||
| ab6d871b38 | |||
|
|
0e83f4fbaf | ||
|
|
434474bd98 | ||
| f3d19e37bb | |||
| bfa4a52dd4 | |||
| d17f89b5c1 | |||
| 938bee4fdb | |||
| 3127a5faaf | |||
| d130c1565c | |||
| b3b46ccff3 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,3 +14,4 @@ local.properties
|
|||||||
/live/build/
|
/live/build/
|
||||||
/main/build/
|
/main/build/
|
||||||
/video/build/
|
/video/build/
|
||||||
|
/tmp/full-r8-config.txt
|
||||||
@@ -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.InstrumentationRegistry;
|
import androidx.test.platform.app.Instrimport com.yunbao.common.utils.MobclickAgent;ntationRegistry;
|
||||||
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,10 +1,10 @@
|
|||||||
<?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.pandoralive.shayu"/>
|
<package android:name="com.pandora.sy"/>
|
||||||
<package android:name="com.facebook.orca"/>
|
<package android:name="com.facebook.orca"/>
|
||||||
|
|
||||||
<package
|
<package
|
||||||
@@ -19,17 +19,17 @@
|
|||||||
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"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<provider
|
<!-- <provider-->
|
||||||
android:name="com.facebook.FacebookContentProvider"
|
<!-- android:name="com.facebook.FacebookContentProvider"-->
|
||||||
android:authorities="com.facebook.app.FacebookContentProvider5476953575716796"
|
<!-- android:authorities="com.facebook.app.FacebookContentProvider5476953575716796"-->
|
||||||
android:exported="true" />
|
<!-- android:exported="true" />-->
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.yunbao.share.receiver.TwitterResultReceiver"
|
android:name="com.yunbao.share.receiver.TwitterResultReceiver"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import android.net.Uri;
|
|||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
import com.twitter.sdk.android.tweetcomposer.TweetUploadService;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.receiver.TwitterResultReceiver;
|
import com.yunbao.share.receiver.TwitterResultReceiver;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -23,7 +23,7 @@ public abstract class AbsShareInterface {
|
|||||||
context.registerReceiver(new TwitterResultReceiver(), filter);
|
context.registerReceiver(new TwitterResultReceiver(), filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void share(ShareBuilder builder, ICallback callback);
|
public abstract void share(ShareBean builder, ICallback callback);
|
||||||
|
|
||||||
public Uri fileToUri(File file){
|
public Uri fileToUri(File file){
|
||||||
return FileProvider.getUriForFile(mContext,
|
return FileProvider.getUriForFile(mContext,
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.yunbao.share.adapters;
|
package com.yunbao.share.adapters;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -11,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.utils.ViewUtils;
|
||||||
import com.yunbao.common.views.weight.ClipPathCircleImage;
|
import com.yunbao.common.views.weight.ClipPathCircleImage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -22,18 +26,36 @@ import io.rong.imlib.model.Conversation;
|
|||||||
public class InternalShareAdapter extends RecyclerView.Adapter<InternalShareAdapter.ViewHolder> {
|
public class InternalShareAdapter extends RecyclerView.Adapter<InternalShareAdapter.ViewHolder> {
|
||||||
List<SingleConversation> listData = new ArrayList<>();
|
List<SingleConversation> listData = new ArrayList<>();
|
||||||
int selectPosition = -1;
|
int selectPosition = -1;
|
||||||
|
private int isEmpty = -233;
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public InternalShareAdapter(Context mContext) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
if (viewType == isEmpty) {
|
||||||
|
return new EmptyViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.view_layout_msg, parent, false));
|
||||||
|
}
|
||||||
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_internal_user, parent, false));
|
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_internal_user, parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
if (getItemViewType(position) == isEmpty) return;
|
||||||
holder.bind(listData.get(position), position);
|
holder.bind(listData.get(position), position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
if (listData.get(position).mCore.getTargetId().equals("isEmpty_-233-pdl-5YK76YC8")) {
|
||||||
|
return isEmpty;
|
||||||
|
}
|
||||||
|
return super.getItemViewType(position);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return listData.size();
|
return listData.size();
|
||||||
@@ -43,6 +65,11 @@ public class InternalShareAdapter extends RecyclerView.Adapter<InternalShareAdap
|
|||||||
if (listData == null) {
|
if (listData == null) {
|
||||||
listData = new ArrayList<>();
|
listData = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
if (listData.isEmpty()) {
|
||||||
|
Conversation conversation = new Conversation();
|
||||||
|
conversation.setTargetId("isEmpty_-233-pdl-5YK76YC8");
|
||||||
|
listData.add(new SingleConversation(mContext, conversation));
|
||||||
|
}
|
||||||
this.listData = listData;
|
this.listData = listData;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
|
||||||
@@ -52,6 +79,19 @@ public class InternalShareAdapter extends RecyclerView.Adapter<InternalShareAdap
|
|||||||
return selectPosition;
|
return selectPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SingleConversation> getListData() {
|
||||||
|
return listData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EmptyViewHolder extends ViewHolder {
|
||||||
|
|
||||||
|
public EmptyViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
ViewUtils.findViewById(itemView, R.id.imageView, ImageView.class).setImageResource(R.mipmap.ic_addressbook_not_search);
|
||||||
|
ViewUtils.findViewById(itemView, R.id.textView, TextView.class).setText(R.string.not_data_message_address_book_list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ClipPathCircleImage mAvatar;
|
ClipPathCircleImage mAvatar;
|
||||||
TextView userName;
|
TextView userName;
|
||||||
@@ -75,6 +115,10 @@ public class InternalShareAdapter extends RecyclerView.Adapter<InternalShareAdap
|
|||||||
} else {
|
} else {
|
||||||
radioButton.setChecked(false);
|
radioButton.setChecked(false);
|
||||||
}
|
}
|
||||||
|
radioButton.setOnClickListener(view -> {
|
||||||
|
selectPosition = position;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
});
|
||||||
itemView.setOnClickListener(view -> {
|
itemView.setOnClickListener(view -> {
|
||||||
selectPosition = position;
|
selectPosition = position;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.yunbao.share.adapters;
|
package com.yunbao.share.adapters;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Environment;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -15,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.platform.FacebookShare;
|
import com.yunbao.share.platform.FacebookShare;
|
||||||
import com.yunbao.share.platform.Instagram;
|
import com.yunbao.share.platform.Instagram;
|
||||||
import com.yunbao.share.platform.Internal;
|
import com.yunbao.share.platform.Internal;
|
||||||
@@ -24,21 +23,30 @@ import com.yunbao.share.platform.MessengerShare;
|
|||||||
import com.yunbao.share.platform.TwitterShare;
|
import com.yunbao.share.platform.TwitterShare;
|
||||||
import com.yunbao.share.platform.WhatsApp;
|
import com.yunbao.share.platform.WhatsApp;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
|
public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppViewHolder> {
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private List<ShareBuilder> list;
|
private List<ShareBean> list;
|
||||||
ShareCallback shareCallback;
|
ShareCallback shareCallback;
|
||||||
|
|
||||||
|
private onShareListener onShareListener;
|
||||||
|
|
||||||
|
public ShareAppAdapter.onShareListener getOnShareListener() {
|
||||||
|
return onShareListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnShareListener(ShareAppAdapter.onShareListener onShareListener) {
|
||||||
|
this.onShareListener = onShareListener;
|
||||||
|
}
|
||||||
|
|
||||||
public ShareAppAdapter(Context mContext) {
|
public ShareAppAdapter(Context mContext) {
|
||||||
list = new ArrayList<>();
|
list = new ArrayList<>();
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setList(List<ShareBuilder> list) {
|
public void setList(List<ShareBean> list) {
|
||||||
this.list = list;
|
this.list = list;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
@@ -51,27 +59,28 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull AppViewHolder holder, int position) {
|
||||||
ShareBuilder builder = list.get(position);
|
ShareBean builder = list.get(position);
|
||||||
|
System.out.println("------type------>" + builder.getType());
|
||||||
switch (builder.getType()) {
|
switch (builder.getType()) {
|
||||||
case ShareBuilder.APP_FACEBOOK:
|
case ShareBean.APP_FACEBOOK:
|
||||||
holder.setData(builder, R.mipmap.icon_share_facebook, R.string.dialog_share_app_facebook);
|
holder.setData(builder, R.mipmap.icon_share_facebook, R.string.dialog_share_app_facebook);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_LINE:
|
case ShareBean.APP_LINE:
|
||||||
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
|
holder.setData(builder, R.mipmap.icon_share_line, R.string.dialog_share_app_line);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_TWITTER:
|
case ShareBean.APP_TWITTER:
|
||||||
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
|
holder.setData(builder, R.mipmap.icon_share_twitter, R.string.dialog_share_app_twitter);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_WHATSAPP:
|
case ShareBean.APP_WHATSAPP:
|
||||||
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
|
holder.setData(builder, R.mipmap.icon_share_whatsapp, R.string.dialog_share_app_whatsapp);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_MESSENGER:
|
case ShareBean.APP_MESSENGER:
|
||||||
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
|
holder.setData(builder, R.mipmap.icon_share_messenger, R.string.dialog_share_app_messenger);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INSTAGRAM:
|
case ShareBean.APP_INSTAGRAM:
|
||||||
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
|
holder.setData(builder, R.mipmap.icon_share_instagram, R.string.dialog_share_app_instagram);
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INTERNAL:
|
case ShareBean.APP_INTERNAL:
|
||||||
holder.setData(builder, R.mipmap.ic_share_friend, R.string.dialog_share_app_internal);
|
holder.setData(builder, R.mipmap.ic_share_friend, R.string.dialog_share_app_internal);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -99,38 +108,44 @@ public class ShareAppAdapter extends RecyclerView.Adapter<ShareAppAdapter.AppVie
|
|||||||
title = itemView.findViewById(R.id.share_app_name);
|
title = itemView.findViewById(R.id.share_app_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(ShareBuilder bean, @DrawableRes int iconId, @StringRes int appName) {
|
public void setData(ShareBean bean, @DrawableRes int iconId, @StringRes int appName) {
|
||||||
icon.setImageResource(iconId);
|
icon.setImageResource(iconId);
|
||||||
title.setText(appName);
|
title.setText(appName);
|
||||||
itemView.setOnClickListener(v -> {
|
itemView.setOnClickListener(v -> {
|
||||||
switch (bean.getType()) {
|
switch (bean.getType()) {
|
||||||
case ShareBuilder.APP_FACEBOOK:
|
case ShareBean.APP_FACEBOOK:
|
||||||
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
|
new FacebookShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_LINE:
|
case ShareBean.APP_LINE:
|
||||||
new Line(itemView.getContext()).share(bean, new ShareCallback());
|
new Line(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_TWITTER:
|
case ShareBean.APP_TWITTER:
|
||||||
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
|
new TwitterShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_WHATSAPP:
|
case ShareBean.APP_WHATSAPP:
|
||||||
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
|
new WhatsApp(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_MESSENGER:
|
case ShareBean.APP_MESSENGER:
|
||||||
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
|
new MessengerShare(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INSTAGRAM:
|
case ShareBean.APP_INSTAGRAM:
|
||||||
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
|
new Instagram(itemView.getContext()).share(bean, new ShareCallback());
|
||||||
break;
|
break;
|
||||||
case ShareBuilder.APP_INTERNAL:
|
case ShareBean.APP_INTERNAL:
|
||||||
new Internal(itemView.getContext()).share(bean, shareCallback);
|
new Internal(itemView.getContext()).share(bean, shareCallback);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (onShareListener != null) {
|
||||||
|
onShareListener.onAddShareCount();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface onShareListener {
|
||||||
|
void onAddShareCount();
|
||||||
|
}
|
||||||
|
|
||||||
public static class ShareCallback implements ICallback {
|
public static class ShareCallback implements ICallback {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
276
Share/src/main/java/com/yunbao/share/bean/ShareBean.java
Normal file
276
Share/src/main/java/com/yunbao/share/bean/ShareBean.java
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
package com.yunbao.share.bean;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.yunbao.common.CommonAppConfig;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
import com.yunbao.share.ui.SharePopDialog;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class ShareBean {
|
||||||
|
public static final int APP_FACEBOOK = 0;
|
||||||
|
public static final int APP_LINE = 1;
|
||||||
|
public static final int APP_TWITTER = 2;
|
||||||
|
public static final int APP_WHATSAPP = 3;
|
||||||
|
public static final int APP_MESSENGER = 4;
|
||||||
|
public static final int APP_INSTAGRAM = 5;
|
||||||
|
public static final int APP_INTERNAL = 6;
|
||||||
|
|
||||||
|
private String text;
|
||||||
|
private String link;
|
||||||
|
private File file;
|
||||||
|
private int type;
|
||||||
|
private String uid;
|
||||||
|
private String anchorId;
|
||||||
|
private String anchorName;
|
||||||
|
private String anchorAvatar;
|
||||||
|
private int shareType;
|
||||||
|
private String cover;
|
||||||
|
private String title;
|
||||||
|
private String extraData;
|
||||||
|
|
||||||
|
|
||||||
|
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
|
||||||
|
return String.format(CommonAppConfig.HOST +
|
||||||
|
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
||||||
|
anchorId,
|
||||||
|
shareUid,
|
||||||
|
CommonAppConfig.IS_GOOGLE_PLAY
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String createInviteLink(String shareUid) {
|
||||||
|
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
|
||||||
|
shareUid,
|
||||||
|
CommonAppConfig.IS_GOOGLE_PLAY
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ShareBean builder(int type) {
|
||||||
|
return new ShareBean(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ShareBean(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getShareType() {
|
||||||
|
return shareType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShareType(int shareType) {
|
||||||
|
this.shareType = shareType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCover() {
|
||||||
|
return cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCover(String cover) {
|
||||||
|
this.cover = cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(String uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchorId() {
|
||||||
|
return anchorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchorId(String anchorId) {
|
||||||
|
this.anchorId = anchorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchorName() {
|
||||||
|
return anchorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchorName(String anchorName) {
|
||||||
|
this.anchorName = anchorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnchorAvatar() {
|
||||||
|
return anchorAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnchorAvatar(String anchorAvatar) {
|
||||||
|
this.anchorAvatar = anchorAvatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExtraData() {
|
||||||
|
return extraData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtraData(String extraData) {
|
||||||
|
this.extraData = extraData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBean setText(String text) {
|
||||||
|
this.text = text;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBean setLink(String link) {
|
||||||
|
this.link = link;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBean setFile(File file) {
|
||||||
|
this.file = file;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
if (StringUtil.isEmpty(text)) {
|
||||||
|
return getLink();
|
||||||
|
}
|
||||||
|
return text + "\n" + getLink();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLink() {
|
||||||
|
if (StringUtil.isEmpty(link)) {
|
||||||
|
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
||||||
|
}
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getFile() {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ShareBuilder{" +
|
||||||
|
"text='" + text + '\'' +
|
||||||
|
", link='" + link + '\'' +
|
||||||
|
", file=" + file +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* private String text;
|
||||||
|
* private String link;
|
||||||
|
* private File file;
|
||||||
|
* private int type;
|
||||||
|
* private String uid;
|
||||||
|
* private String anchorId;
|
||||||
|
* private String anchorName;
|
||||||
|
* private String anchorAvatar;
|
||||||
|
* private int shareType;
|
||||||
|
* private String cover;
|
||||||
|
* private String title;
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ShareBean clone() {
|
||||||
|
ShareBean bean = new ShareBean(type);
|
||||||
|
bean.anchorId = anchorId;
|
||||||
|
bean.anchorName = anchorName;
|
||||||
|
bean.anchorAvatar = anchorAvatar;
|
||||||
|
bean.text = text;
|
||||||
|
bean.link = link;
|
||||||
|
bean.file = file;
|
||||||
|
bean.uid = uid;
|
||||||
|
bean.shareType = shareType;
|
||||||
|
bean.cover = cover;
|
||||||
|
bean.title = title;
|
||||||
|
bean.extraData = extraData;
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ShareBuilder {
|
||||||
|
ShareBean bean;
|
||||||
|
|
||||||
|
public ShareBuilder() {
|
||||||
|
bean = new ShareBean(APP_FACEBOOK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setShareType(int shareType) {
|
||||||
|
bean.setShareType(shareType);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setCover(String cover) {
|
||||||
|
bean.setCover(cover);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setTitle(String title) {
|
||||||
|
bean.setTitle(title);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setUid(String uid) {
|
||||||
|
bean.setUid(uid);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setAnchorId(String anchorId) {
|
||||||
|
bean.setAnchorId(anchorId);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setAnchorName(String anchorName) {
|
||||||
|
bean.setAnchorName(anchorName);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setAnchorAvatar(String anchorAvatar) {
|
||||||
|
bean.setAnchorAvatar(anchorAvatar);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setText(String text) {
|
||||||
|
bean.setText(text);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setLink(String link) {
|
||||||
|
bean.setLink(link);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setFile(File file) {
|
||||||
|
bean.setFile(file);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBuilder setExtraData(String extraData) {
|
||||||
|
bean.setExtraData(extraData);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShareBean build() {
|
||||||
|
return bean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ShareBuilder create() {
|
||||||
|
return new ShareBuilder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
package com.yunbao.share.bean;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.CommonAppContext;
|
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class ShareBuilder {
|
|
||||||
public static final int APP_FACEBOOK = 0;
|
|
||||||
public static final int APP_LINE = 1;
|
|
||||||
public static final int APP_TWITTER = 2;
|
|
||||||
public static final int APP_WHATSAPP = 3;
|
|
||||||
public static final int APP_MESSENGER = 4;
|
|
||||||
public static final int APP_INSTAGRAM = 5;
|
|
||||||
public static final int APP_INTERNAL = 6;
|
|
||||||
|
|
||||||
private String text;
|
|
||||||
private String link;
|
|
||||||
private File file;
|
|
||||||
private int type;
|
|
||||||
private String uid;
|
|
||||||
private String anchorId;
|
|
||||||
private String anchorName;
|
|
||||||
private String anchorAvatar;
|
|
||||||
|
|
||||||
public static String createLiveShareLink(String shareUid, String anchorId, String anchorName, String anchorAvatar) {
|
|
||||||
return String.format(CommonAppConfig.HOST +
|
|
||||||
"/index.php?g=Appapi&m=home&a=share&uid=%s&user_id=%s&isGoogle=%s",
|
|
||||||
anchorId,
|
|
||||||
shareUid,
|
|
||||||
CommonAppConfig.IS_GOOGLE_PLAY
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String createInviteLink(String shareUid) {
|
|
||||||
return String.format("https://www.pdlive.com/public/app/download/index.html?user_id=%s&isGoogle=%s",
|
|
||||||
shareUid,
|
|
||||||
CommonAppConfig.IS_GOOGLE_PLAY
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ShareBuilder builder(int type) {
|
|
||||||
return new ShareBuilder(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ShareBuilder(int type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUid() {
|
|
||||||
return uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUid(String uid) {
|
|
||||||
this.uid = uid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAnchorId() {
|
|
||||||
return anchorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnchorId(String anchorId) {
|
|
||||||
this.anchorId = anchorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAnchorName() {
|
|
||||||
return anchorName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnchorName(String anchorName) {
|
|
||||||
this.anchorName = anchorName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAnchorAvatar() {
|
|
||||||
return anchorAvatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnchorAvatar(String anchorAvatar) {
|
|
||||||
this.anchorAvatar = anchorAvatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShareBuilder setText(String text) {
|
|
||||||
this.text = text;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShareBuilder setLink(String link) {
|
|
||||||
this.link = link;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShareBuilder setFile(File file) {
|
|
||||||
this.file = file;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getText() {
|
|
||||||
if (StringUtil.isEmpty(text)) {
|
|
||||||
return getLink();
|
|
||||||
}
|
|
||||||
return text + "\n" + getLink();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLink() {
|
|
||||||
if (StringUtil.isEmpty(link)) {
|
|
||||||
link = createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
|
||||||
}
|
|
||||||
return link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getFile() {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ShareBuilder{" +
|
|
||||||
"text='" + text + '\'' +
|
|
||||||
", link='" + link + '\'' +
|
|
||||||
", file=" + file +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,10 +12,9 @@ import com.facebook.FacebookException;
|
|||||||
import com.facebook.share.Sharer;
|
import com.facebook.share.Sharer;
|
||||||
import com.facebook.share.model.ShareLinkContent;
|
import com.facebook.share.model.ShareLinkContent;
|
||||||
import com.facebook.share.widget.ShareDialog;
|
import com.facebook.share.widget.ShareDialog;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class FacebookShare extends AbsShareInterface {
|
public class FacebookShare extends AbsShareInterface {
|
||||||
public static CallbackManager callbackManager;
|
public static CallbackManager callbackManager;
|
||||||
@@ -24,7 +23,7 @@ public class FacebookShare extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
callbackManager= CallbackManager.Factory.create();
|
callbackManager= CallbackManager.Factory.create();
|
||||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||||
.setContentUrl(Uri.parse(builder.getLink()))
|
.setContentUrl(Uri.parse(builder.getLink()))
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import android.net.Uri;
|
|||||||
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class Instagram extends AbsShareInterface {
|
public class Instagram extends AbsShareInterface {
|
||||||
public Instagram(Context context) {
|
public Instagram(Context context) {
|
||||||
@@ -14,7 +14,7 @@ public class Instagram extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
String type = "image/*";
|
String type = "image/*";
|
||||||
Intent share = new Intent(Intent.ACTION_SEND);
|
Intent share = new Intent(Intent.ACTION_SEND);
|
||||||
Uri uri = fileToUri(builder.getFile());
|
Uri uri = fileToUri(builder.getFile());
|
||||||
|
|||||||
@@ -3,20 +3,24 @@ package com.yunbao.share.platform;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.interfaces.OnSendMessageListener;
|
||||||
|
import com.yunbao.common.message.content.MessageChatCardContent;
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.ui.AppInternalShareDialog;
|
import com.yunbao.share.ui.AppInternalShareDialog;
|
||||||
|
import com.yunbao.share.ui.SharePopDialog;
|
||||||
import com.yunbao.share.ui.ShareSuccessNotifyDialog;
|
import com.yunbao.share.ui.ShareSuccessNotifyDialog;
|
||||||
|
|
||||||
|
import io.rong.imlib.model.Conversation;
|
||||||
|
|
||||||
public class Internal extends AbsShareInterface {
|
public class Internal extends AbsShareInterface {
|
||||||
public Internal(Context context) {
|
public Internal(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
new AppInternalShareDialog(mContext)
|
new AppInternalShareDialog(mContext)
|
||||||
.setOnItemClickListener(new OnItemClickListener<String>() {
|
.setOnItemClickListener(new OnItemClickListener<String>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -26,10 +30,36 @@ public class Internal extends AbsShareInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
builder.setUid(toUid);
|
builder.setUid(toUid);
|
||||||
|
sendMessage(builder);
|
||||||
new ShareSuccessNotifyDialog(mContext, builder)
|
new ShareSuccessNotifyDialog(mContext, builder)
|
||||||
.showDialog();
|
.showDialog();
|
||||||
callback.onSuccess();
|
callback.onSuccess();
|
||||||
}
|
}
|
||||||
}).showDialog();
|
}).showDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sendMessage(ShareBean builder) {
|
||||||
|
MessageChatCardContent.sendMessage(Conversation.ConversationType.PRIVATE, builder.getUid(),
|
||||||
|
MessageChatCardContent.obtain(
|
||||||
|
builder.getCover(),
|
||||||
|
builder.getTitle(),
|
||||||
|
builder.getAnchorAvatar(),
|
||||||
|
builder.getAnchorName(),
|
||||||
|
builder.getAnchorId(),
|
||||||
|
builder.getShareType() + "",
|
||||||
|
builder.getExtraData()
|
||||||
|
),
|
||||||
|
new OnSendMessageListener<Object>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String token, Object bean) {
|
||||||
|
super.onSuccess(token, bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int status, String msg) {
|
||||||
|
super.onError(status, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import android.net.Uri;
|
|||||||
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ public class Line extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
try {
|
try {
|
||||||
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
|
Intent share = new Intent(Intent.ACTION_VIEW, Uri.parse("https://line.me/R/share?text=" + URLEncoder.encode(builder.getText(), "UTF-8")));
|
||||||
mContext.startActivity(share);
|
mContext.startActivity(share);
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ import com.facebook.FacebookSdk;
|
|||||||
import com.facebook.share.Sharer;
|
import com.facebook.share.Sharer;
|
||||||
import com.facebook.share.model.ShareLinkContent;
|
import com.facebook.share.model.ShareLinkContent;
|
||||||
import com.facebook.share.widget.MessageDialog;
|
import com.facebook.share.widget.MessageDialog;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class MessengerShare extends AbsShareInterface {
|
public class MessengerShare extends AbsShareInterface {
|
||||||
public static CallbackManager callbackManager;
|
public static CallbackManager callbackManager;
|
||||||
@@ -27,7 +26,7 @@ public class MessengerShare extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
callbackManager = CallbackManager.Factory.create();
|
callbackManager = CallbackManager.Factory.create();
|
||||||
ShareLinkContent content = new ShareLinkContent.Builder()
|
ShareLinkContent content = new ShareLinkContent.Builder()
|
||||||
.setContentUrl(Uri.parse(builder.getLink()))
|
.setContentUrl(Uri.parse(builder.getLink()))
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import android.net.Uri;
|
|||||||
import com.twitter.sdk.android.core.Twitter;
|
import com.twitter.sdk.android.core.Twitter;
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ public class TwitterShare extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder date, ICallback callback) {
|
public void share(ShareBean date, ICallback callback) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
new TwitterAuthClient().authorize((Activity) mContext, new Callback<TwitterSession>() {
|
new TwitterAuthClient().authorize((Activity) mContext, new Callback<TwitterSession>() {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import android.content.Intent;
|
|||||||
|
|
||||||
import com.yunbao.share.AbsShareInterface;
|
import com.yunbao.share.AbsShareInterface;
|
||||||
import com.yunbao.share.ICallback;
|
import com.yunbao.share.ICallback;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
public class WhatsApp extends AbsShareInterface {
|
public class WhatsApp extends AbsShareInterface {
|
||||||
public WhatsApp(Context context) {
|
public WhatsApp(Context context) {
|
||||||
@@ -13,7 +13,7 @@ public class WhatsApp extends AbsShareInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void share(ShareBuilder builder, ICallback callback) {
|
public void share(ShareBean builder, ICallback callback) {
|
||||||
try {
|
try {
|
||||||
Intent sendIntent = new Intent();
|
Intent sendIntent = new Intent();
|
||||||
sendIntent.setAction(Intent.ACTION_SEND);
|
sendIntent.setAction(Intent.ACTION_SEND);
|
||||||
|
|||||||
@@ -1,24 +1,34 @@
|
|||||||
package com.yunbao.share.ui;
|
package com.yunbao.share.ui;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.text.TextWatcher;
|
||||||
|
import android.util.Log;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.common.bean.MessageChatUserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.dialog.AbsDialogFullScreenPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogFullScreenPopupWindow;
|
||||||
|
import com.yunbao.common.dialog.DebugDialog;
|
||||||
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
import com.yunbao.common.manager.InstructorRemarkManager;
|
||||||
|
import com.yunbao.common.utils.AppManager;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.ViewUtils;
|
|
||||||
import com.yunbao.share.adapters.InternalShareAdapter;
|
import com.yunbao.share.adapters.InternalShareAdapter;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import io.rong.imkit.conversationlist.model.SingleConversation;
|
import io.rong.imkit.conversationlist.model.SingleConversation;
|
||||||
@@ -31,8 +41,8 @@ import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
|||||||
import io.rong.imlib.IRongCoreCallback;
|
import io.rong.imlib.IRongCoreCallback;
|
||||||
import io.rong.imlib.IRongCoreEnum;
|
import io.rong.imlib.IRongCoreEnum;
|
||||||
import io.rong.imlib.RongCoreClient;
|
import io.rong.imlib.RongCoreClient;
|
||||||
import io.rong.imlib.RongIMClient;
|
|
||||||
import io.rong.imlib.model.Conversation;
|
import io.rong.imlib.model.Conversation;
|
||||||
|
import io.rong.imlib.model.UserInfo;
|
||||||
|
|
||||||
public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
||||||
EditText search;
|
EditText search;
|
||||||
@@ -72,19 +82,54 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
|||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
findViewById(R.id.btn_share).setOnClickListener(view -> {
|
findViewById(R.id.btn_share).setOnClickListener(view -> {
|
||||||
|
if (adapter.getSelectPosition() == -1) {
|
||||||
|
ToastUtil.show(R.string.dialog_share_failure_not_select);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (onItemClickListener != null) {
|
if (onItemClickListener != null) {
|
||||||
onItemClickListener.onItemClick(listData.get(adapter.getSelectPosition()).mCore.getTargetId(), adapter.getSelectPosition());
|
onItemClickListener.onItemClick(adapter.getListData().get(adapter.getSelectPosition()).mCore.getTargetId(), adapter.getSelectPosition());
|
||||||
}
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
search = findViewById(R.id.search);
|
search = findViewById(R.id.search);
|
||||||
mList = findViewById(R.id.recyclerView);
|
mList = findViewById(R.id.recyclerView);
|
||||||
mRefreshLayout = findViewById(R.id.rc_refresh);
|
mRefreshLayout = findViewById(R.id.rc_refresh);
|
||||||
adapter = new InternalShareAdapter();
|
adapter = new InternalShareAdapter(mContext);
|
||||||
mList.setAdapter(adapter);
|
mList.setAdapter(adapter);
|
||||||
initRefreshView();
|
initRefreshView();
|
||||||
|
|
||||||
refreshData();
|
refreshData();
|
||||||
|
search.addTextChangedListener(new TextWatcher() {
|
||||||
|
List<SingleConversation> searchList = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable editable) {
|
||||||
|
String key = editable.toString();
|
||||||
|
searchList.clear();
|
||||||
|
if (StringUtil.isEmpty(key)) {
|
||||||
|
adapter.setList(listData);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (SingleConversation datum : listData) {
|
||||||
|
if (datum.mCore.getConversationTitle().contains(key)) {
|
||||||
|
searchList.add(datum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adapter.setList(searchList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -109,6 +154,7 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onConversationListRefresh(RefreshLayout refreshLayout) {
|
private void onConversationListRefresh(RefreshLayout refreshLayout) {
|
||||||
|
search.setText("");
|
||||||
listData.clear();
|
listData.clear();
|
||||||
startTime = 0;
|
startTime = 0;
|
||||||
refreshData();
|
refreshData();
|
||||||
@@ -116,22 +162,72 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow {
|
|||||||
|
|
||||||
private void refreshData() {
|
private void refreshData() {
|
||||||
RongCoreClient.getInstance().getConversationListByPage(new IRongCoreCallback.ResultCallback<List<Conversation>>() {
|
RongCoreClient.getInstance().getConversationListByPage(new IRongCoreCallback.ResultCallback<List<Conversation>>() {
|
||||||
|
boolean isNeedData = false;
|
||||||
|
List<String> needUidList = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<Conversation> conversations) {
|
public void onSuccess(List<Conversation> conversations) {
|
||||||
|
isNeedData = false;
|
||||||
|
needUidList.clear();
|
||||||
if (conversations.isEmpty()) {
|
if (conversations.isEmpty()) {
|
||||||
mRefreshLayout.finishLoadMoreWithNoMoreData();
|
mRefreshLayout.finishLoadMoreWithNoMoreData();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<SingleConversation> tmp = new ArrayList<>();
|
List<SingleConversation> tmp = new ArrayList<>();
|
||||||
for (Conversation conversation : conversations) {
|
for (Conversation conversation : conversations) {
|
||||||
|
if(conversation.getTargetId().contains("__system__")){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StringUtil.isEmpty(conversation.getPortraitUrl())) {
|
||||||
|
isNeedData = true;
|
||||||
|
needUidList.add(conversation.getTargetId());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
tmp.add(new SingleConversation(getContext(), conversation));
|
tmp.add(new SingleConversation(getContext(), conversation));
|
||||||
}
|
}
|
||||||
|
if (isNeedData) {
|
||||||
|
checkUserData();
|
||||||
|
return;
|
||||||
|
}
|
||||||
startTime = conversations.get(conversations.size() - 1).getSentTime();
|
startTime = conversations.get(conversations.size() - 1).getSentTime();
|
||||||
listData.addAll(tmp);
|
listData.addAll(tmp);
|
||||||
adapter.setList(listData);
|
adapter.setList(listData);
|
||||||
mRefreshLayout.finishRefresh(true);
|
mRefreshLayout.finishRefresh(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkUserData() {
|
||||||
|
Iterator<String> iterator = needUidList.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
String userId = iterator.next();
|
||||||
|
CommonHttpUtil.getUserBaseinfo(userId, new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0 && info.length > 0 && !TextUtils.equals("__system__", userId)) {
|
||||||
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
|
UserBean userBean = JSON.toJavaObject(obj, UserBean.class);
|
||||||
|
needUidList.remove(userBean.getId());
|
||||||
|
UserInfo userInfo = new UserInfo(userBean.getId(), userBean.getUserNiceName(), Uri.parse(userBean.getAvatar()));
|
||||||
|
userInfo.setExtra(obj.toString());
|
||||||
|
RongUserInfoManager.getInstance().refreshUserInfoCache(userInfo);
|
||||||
|
Conversation conversation=new Conversation();
|
||||||
|
conversation.setTargetId(userBean.getId());
|
||||||
|
conversation.setConversationTitle(userBean.getUserNiceName());
|
||||||
|
conversation.setPortraitUrl(userBean.getAvatar());
|
||||||
|
SingleConversation singleConversation = new SingleConversation(getContext(), conversation);
|
||||||
|
listData.add(singleConversation);
|
||||||
|
if (needUidList.isEmpty()) {
|
||||||
|
adapter.setList(listData);
|
||||||
|
mRefreshLayout.finishRefresh(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.i("刷新用户", "3>" + code + "|" + msg + "|" + info.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(IRongCoreEnum.CoreErrorCode e) {
|
public void onError(IRongCoreEnum.CoreErrorCode e) {
|
||||||
ToastUtil.show("出错了:" + e.getMessage());
|
ToastUtil.show("出错了:" + e.getMessage());
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ package com.yunbao.share.ui;
|
|||||||
|
|
||||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.LinearGradient;
|
import android.graphics.LinearGradient;
|
||||||
import android.graphics.Shader;
|
import android.graphics.Shader;
|
||||||
import android.view.ViewTreeObserver;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -22,10 +20,8 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
|||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
|
||||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -38,7 +34,7 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
|||||||
private TextView info;
|
private TextView info;
|
||||||
private TextView link;
|
private TextView link;
|
||||||
private TextView title;
|
private TextView title;
|
||||||
private List<ShareBuilder> data;
|
private List<ShareBean> data;
|
||||||
|
|
||||||
private String uid;
|
private String uid;
|
||||||
private String anchorId;
|
private String anchorId;
|
||||||
@@ -123,18 +119,18 @@ public class InvitePopDialog extends AbsDialogPopupWindow {
|
|||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
data = new ArrayList<>();
|
data = new ArrayList<>();
|
||||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
data.add(builder(ShareBean.APP_FACEBOOK));
|
||||||
data.add(builder(ShareBuilder.APP_LINE));
|
data.add(builder(ShareBean.APP_LINE));
|
||||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
data.add(builder(ShareBean.APP_TWITTER));
|
||||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
data.add(builder(ShareBean.APP_WHATSAPP));
|
||||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
data.add(builder(ShareBean.APP_MESSENGER));
|
||||||
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
// data.add(builder(ShareBuilder.APP_INSTAGRAM));
|
||||||
adapter.setList(data);
|
adapter.setList(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ShareBuilder builder(int type) {
|
private ShareBean builder(int type) {
|
||||||
ShareBuilder builder = ShareBuilder.builder(type);
|
ShareBean builder = ShareBean.builder(type);
|
||||||
builder.setText(getContext().getString(R.string.dialog_invite_info));
|
builder.setText(getContext().getString(R.string.dialog_invite_info));
|
||||||
builder.setLink(url);
|
builder.setLink(url);
|
||||||
builder.setUid(uid);
|
builder.setUid(uid);
|
||||||
|
|||||||
@@ -12,55 +12,51 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.lxj.xpopup.util.XPopupUtils;
|
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
|
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.share.adapters.ShareAppAdapter;
|
import com.yunbao.share.adapters.ShareAppAdapter;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SharePopDialog extends AbsDialogPopupWindow {
|
public class SharePopDialog extends AbsDialogPopupWindow {
|
||||||
|
public static final int TYPE_LIVE = 1;
|
||||||
|
public static final int TYPE_DYNAMIC = 0;
|
||||||
|
public static final int TYPE_VIDEO = 2;
|
||||||
private ShareAppAdapter adapter;
|
private ShareAppAdapter adapter;
|
||||||
private RecyclerView list;
|
private RecyclerView list;
|
||||||
private RoundedImageView avatar;
|
private RoundedImageView avatar;
|
||||||
private TextView info;
|
private TextView info;
|
||||||
private TextView link;
|
private TextView link;
|
||||||
private List<ShareBuilder> data;
|
private List<ShareBean> data;
|
||||||
|
|
||||||
private String uid;
|
|
||||||
private String anchorId;
|
|
||||||
private String anchorName;
|
|
||||||
private String anchorAvatar;
|
|
||||||
private String shareLink;
|
private String shareLink;
|
||||||
|
private int type;
|
||||||
|
private ShareBean bean;
|
||||||
|
public onShareListener onShareListener;
|
||||||
|
|
||||||
|
public void setOnShareListener(SharePopDialog.onShareListener onShareListener) {
|
||||||
|
this.onShareListener = onShareListener;
|
||||||
|
}
|
||||||
|
|
||||||
public SharePopDialog(@NonNull Context context) {
|
public SharePopDialog(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharePopDialog setUid(String uid) {
|
public SharePopDialog setShareType(int type) {
|
||||||
this.uid = uid;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharePopDialog setAnchorId(String anchorId) {
|
public SharePopDialog setShareData(ShareBean build) {
|
||||||
this.anchorId = anchorId;
|
this.bean = build;
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SharePopDialog setAnchorName(String anchorName) {
|
|
||||||
this.anchorName = anchorName;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SharePopDialog setAnchorAvatar(String anchorAvatar) {
|
|
||||||
this.anchorAvatar = anchorAvatar;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,13 +85,21 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
info = findViewById(R.id.share_info);
|
info = findViewById(R.id.share_info);
|
||||||
link = findViewById(R.id.share_link);
|
link = findViewById(R.id.share_link);
|
||||||
adapter = new ShareAppAdapter(getContext());
|
adapter = new ShareAppAdapter(getContext());
|
||||||
adapter.setOnShareStatusListener(new ShareAppAdapter.ShareCallback(){
|
adapter.setOnShareStatusListener(new ShareAppAdapter.ShareCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
super.onSuccess();
|
super.onSuccess();
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
adapter.setOnShareListener(new ShareAppAdapter.onShareListener() {
|
||||||
|
@Override
|
||||||
|
public void onAddShareCount() {
|
||||||
|
if (onShareListener != null) {
|
||||||
|
onShareListener.onShareAddCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||||
list.setAdapter(adapter);
|
list.setAdapter(adapter);
|
||||||
initData();
|
initData();
|
||||||
@@ -103,16 +107,16 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
data = new ArrayList<>();
|
data = new ArrayList<>();
|
||||||
data.add(builder(ShareBuilder.APP_FACEBOOK));
|
data.add(builder(ShareBean.APP_FACEBOOK));
|
||||||
data.add(builder(ShareBuilder.APP_LINE));
|
data.add(builder(ShareBean.APP_LINE));
|
||||||
data.add(builder(ShareBuilder.APP_TWITTER));
|
data.add(builder(ShareBean.APP_TWITTER));
|
||||||
data.add(builder(ShareBuilder.APP_WHATSAPP));
|
data.add(builder(ShareBean.APP_WHATSAPP));
|
||||||
data.add(builder(ShareBuilder.APP_MESSENGER));
|
data.add(builder(ShareBean.APP_MESSENGER));
|
||||||
data.add(builder(ShareBuilder.APP_INTERNAL));
|
data.add(builder(ShareBean.APP_INTERNAL));
|
||||||
adapter.setList(data);
|
adapter.setList(data);
|
||||||
String url;
|
String url;
|
||||||
if (shareLink == null) {
|
if (shareLink == null) {
|
||||||
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar).substring(0, 40) + "...";
|
url = ShareBean.createLiveShareLink(bean.getUid(), bean.getAnchorId(), bean.getAnchorName(), bean.getAnchorAvatar()).substring(0, 40) + "...";
|
||||||
} else {
|
} else {
|
||||||
if (shareLink.length() > 40) {
|
if (shareLink.length() > 40) {
|
||||||
url = shareLink.substring(0, 40) + "...";
|
url = shareLink.substring(0, 40) + "...";
|
||||||
@@ -122,20 +126,14 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
}
|
}
|
||||||
url = url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
url = url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
|
||||||
link.setText(url);
|
link.setText(url);
|
||||||
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
info.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(bean.getAnchorName()) ? "" : bean.getAnchorName()));
|
||||||
ImgLoader.display(getContext(), anchorAvatar, avatar);
|
ImgLoader.display(getContext(), bean.getAnchorAvatar(), avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ShareBuilder builder(int type) {
|
private ShareBean builder(int type) {
|
||||||
ShareBuilder builder = ShareBuilder.builder(type);
|
ShareBean builder = bean.clone();
|
||||||
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(anchorName) ? "" : anchorName));
|
builder.setType(type);
|
||||||
builder.setUid(uid);
|
builder.setText(String.format(getContext().getString(R.string.dialog_share_info), StringUtil.isEmpty(bean.getAnchorName()) ? "" : bean.getAnchorName()));
|
||||||
builder.setAnchorId(anchorId);
|
|
||||||
builder.setAnchorName(anchorName);
|
|
||||||
builder.setAnchorAvatar(anchorAvatar);
|
|
||||||
if (shareLink != null) {
|
|
||||||
builder.setLink(shareLink);
|
|
||||||
}
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,11 +142,16 @@ public class SharePopDialog extends AbsDialogPopupWindow {
|
|||||||
if (shareLink != null) {
|
if (shareLink != null) {
|
||||||
url = shareLink;
|
url = shareLink;
|
||||||
} else {
|
} else {
|
||||||
url = ShareBuilder.createLiveShareLink(uid, anchorId, anchorName, anchorAvatar);
|
url = ShareBean.createLiveShareLink(bean.getUid(), bean.getAnchorId(), bean.getAnchorName(), bean.getAnchorAvatar());
|
||||||
}
|
}
|
||||||
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(CLIPBOARD_SERVICE);
|
||||||
ClipData clipData = ClipData.newPlainText("text", info.getText().toString() + "\n" + url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
|
ClipData clipData = ClipData.newPlainText("text", info.getText().toString() + "\n" + url + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0));
|
||||||
cm.setPrimaryClip(clipData);
|
cm.setPrimaryClip(clipData);
|
||||||
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
ToastUtil.show(getContext().getString(com.yunbao.common.R.string.copy_success));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface onShareListener {
|
||||||
|
void onShareAddCount();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,19 +11,17 @@ import androidx.annotation.NonNull;
|
|||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.lxj.xpopup.enums.PopupAnimation;
|
import com.lxj.xpopup.enums.PopupAnimation;
|
||||||
import com.pdlive.shayu.R;
|
import com.pdlive.shayu.R;
|
||||||
import com.yunbao.common.bean.MessageUserInfoBean;
|
|
||||||
import com.yunbao.common.custom.RatioRoundImageView;
|
import com.yunbao.common.custom.RatioRoundImageView;
|
||||||
|
import com.yunbao.common.dialog.AbsDialogCenterPopupWindow;
|
||||||
import com.yunbao.common.dialog.AbsDialogPositionPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogPositionPopupWindow;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.share.bean.ShareBean;
|
||||||
import com.yunbao.share.bean.ShareBuilder;
|
|
||||||
|
|
||||||
import io.rong.imkit.utils.RouteUtils;
|
import io.rong.imkit.utils.RouteUtils;
|
||||||
import io.rong.imlib.model.Conversation;
|
import io.rong.imlib.model.Conversation;
|
||||||
|
|
||||||
public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
|
public class ShareSuccessNotifyDialog extends AbsDialogCenterPopupWindow {
|
||||||
private ShareBuilder bean;
|
private ShareBean bean;
|
||||||
private DialogInterface.OnDismissListener onDismissListener;
|
private DialogInterface.OnDismissListener onDismissListener;
|
||||||
|
|
||||||
private TextView anchorName;
|
private TextView anchorName;
|
||||||
@@ -34,7 +32,7 @@ public class ShareSuccessNotifyDialog extends AbsDialogPositionPopupWindow {
|
|||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShareSuccessNotifyDialog(@NonNull Context context, ShareBuilder bean) {
|
public ShareSuccessNotifyDialog(@NonNull Context context, ShareBean bean) {
|
||||||
super(context);
|
super(context);
|
||||||
this.bean = bean;
|
this.bean = bean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
android:layout_width="168dp"
|
android:layout_width="168dp"
|
||||||
android:layout_height="54dp"
|
android:layout_height="54dp"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:background="@drawable/bg_msg_address_book_user_btn_fan"
|
android:background="@drawable/bg_msg_address_book_user_btn_fan_cuia"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|||||||
@@ -5,11 +5,12 @@
|
|||||||
<string name="dialog_invite_title">Invite Friends</string>
|
<string name="dialog_invite_title">Invite Friends</string>
|
||||||
<string name="dialog_invite_info">Come to PDLIVE to discover more and better live streams.</string>
|
<string name="dialog_invite_info">Come to PDLIVE to discover more and better live streams.</string>
|
||||||
<string name="dialog_share_copy">Copy</string>
|
<string name="dialog_share_copy">Copy</string>
|
||||||
<string name="dialog_share_app_internal">Friend</string>
|
<string name="dialog_share_app_internal">Site friends</string>
|
||||||
<string name="dialog_share_internal_title">Share To</string>
|
<string name="dialog_share_internal_title">Share To</string>
|
||||||
<string name="dialog_share_internal_cancel">cancel</string>
|
<string name="dialog_share_internal_cancel">cancel</string>
|
||||||
<string name="dialog_share_internal_search">Search</string>
|
<string name="dialog_share_internal_search">Search nickname</string>
|
||||||
<string name="dialog_share_internal_list_btn">Share</string>
|
<string name="dialog_share_internal_list_btn">Send</string>
|
||||||
<string name="dialog_share_success">Success</string>
|
<string name="dialog_share_success">Share success</string>
|
||||||
<string name="dialog_share_success_btn">Chat</string>
|
<string name="dialog_share_success_btn">Go chat</string>
|
||||||
|
<string name="dialog_share_failure_not_select">Please select friends</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -21,4 +21,5 @@
|
|||||||
<string name="dialog_share_internal_list_btn">發送</string>
|
<string name="dialog_share_internal_list_btn">發送</string>
|
||||||
<string name="dialog_share_success">分享成功</string>
|
<string name="dialog_share_success">分享成功</string>
|
||||||
<string name="dialog_share_success_btn">去聊聊</string>
|
<string name="dialog_share_success_btn">去聊聊</string>
|
||||||
|
<string name="dialog_share_failure_not_select">请选择好友</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.yunbao.share;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 {
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
{
|
|
||||||
"agcgw":{
|
|
||||||
"backurl":"connect-drcn.hispace.hicloud.com",
|
|
||||||
"url":"connect-drcn.dbankcloud.cn",
|
|
||||||
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
|
||||||
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
|
||||||
},
|
|
||||||
"agcgw_all":{
|
|
||||||
"CN":"connect-drcn.dbankcloud.cn",
|
|
||||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
|
||||||
"DE":"connect-dre.dbankcloud.cn",
|
|
||||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
|
||||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
|
||||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
|
||||||
"SG":"connect-dra.dbankcloud.cn",
|
|
||||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
|
||||||
},
|
|
||||||
"websocketgw_all":{
|
|
||||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
|
||||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
|
||||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
|
||||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
|
||||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
|
||||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
|
||||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
|
||||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
|
||||||
},
|
|
||||||
"client":{
|
|
||||||
"cp_id":"30852000032486141",
|
|
||||||
"product_id":"388421841221767494",
|
|
||||||
"client_id":"1283893262452580800",
|
|
||||||
"client_secret":"17BC070420691D35650C694230D6348075CB549F7BBA94EDD49FA9E61A9E5434",
|
|
||||||
"project_id":"388421841221767494",
|
|
||||||
"app_id":"109612651",
|
|
||||||
"api_key":"DAEDAAlBbTFuTuyQWQsyYBZLuyjALH9Y9BNFkVZl1GhI0tRaa6HF1LgzXWy2MZiSFrmpbn1aAvcvzP6aKZtR6MVikS8V4SbBlYUPfQ==",
|
|
||||||
"package_name":"com.pandoralive.shayu"
|
|
||||||
},
|
|
||||||
"oauth_client":{
|
|
||||||
"client_id":"109612651",
|
|
||||||
"client_type":1
|
|
||||||
},
|
|
||||||
"app_info":{
|
|
||||||
"app_id":"109612651",
|
|
||||||
"package_name":"com.pandoralive.shayu"
|
|
||||||
},
|
|
||||||
"service":{
|
|
||||||
"analytics":{
|
|
||||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
|
||||||
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
|
||||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
|
||||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
|
||||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
|
||||||
"resource_id":"p1",
|
|
||||||
"channel_id":""
|
|
||||||
},
|
|
||||||
"edukit":{
|
|
||||||
"edu_url":"edukit.cloud.huawei.com.cn",
|
|
||||||
"dh_url":"edukit.cloud.huawei.com.cn"
|
|
||||||
},
|
|
||||||
"search":{
|
|
||||||
"url":"https://search-drcn.cloud.huawei.com"
|
|
||||||
},
|
|
||||||
"cloudstorage":{
|
|
||||||
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
|
|
||||||
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
|
|
||||||
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
|
|
||||||
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
|
|
||||||
"storage_url_de":"https://ops-dre.agcstorage.link",
|
|
||||||
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
|
|
||||||
"storage_url_sg":"https://ops-dra.agcstorage.link",
|
|
||||||
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
|
|
||||||
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
|
||||||
},
|
|
||||||
"ml":{
|
|
||||||
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"region":"CN",
|
|
||||||
"configuration_version":"3.0",
|
|
||||||
"appInfos":[
|
|
||||||
{
|
|
||||||
"package_name":"com.pandoralive.shayu",
|
|
||||||
"client":{
|
|
||||||
"app_id":"109612651"
|
|
||||||
},
|
|
||||||
"app_info":{
|
|
||||||
"package_name":"com.pandoralive.shayu",
|
|
||||||
"app_id":"109612651"
|
|
||||||
},
|
|
||||||
"oauth_client":{
|
|
||||||
"client_type":1,
|
|
||||||
"client_id":"109612651"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -4,11 +4,9 @@ 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 {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* applicationVariants.all { variant ->
|
/* applicationVariants.all { variant ->
|
||||||
variant.mergeAssetsProvider.configure {
|
variant.mergeAssetsProvider.configure {
|
||||||
@@ -33,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"
|
||||||
@@ -105,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文件夹";
|
||||||
@@ -117,11 +116,15 @@ android {
|
|||||||
String variantName = variant.name.capitalize()
|
String variantName = variant.name.capitalize()
|
||||||
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
def processManifestTask = project.tasks.getByName("process${variantName}Manifest")
|
||||||
processManifestTask.doLast { pm ->
|
processManifestTask.doLast { pm ->
|
||||||
String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml"
|
String manifestPath = "build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml"
|
||||||
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay
|
||||||
if (file(manifestPath).exists() && isGooglePlay) {
|
println "谷歌版本:" + isGooglePlay
|
||||||
|
println "文件存在" + file(manifestPath).exists()
|
||||||
|
println "" + (isGooglePlay ==1)
|
||||||
|
println "" + (file(manifestPath).exists() && isGooglePlay == 1)
|
||||||
|
if (file(manifestPath).exists() && isGooglePlay == 1) {
|
||||||
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" />', '')
|
||||||
file(manifestPath).write(manifestContent)
|
file(manifestPath).write(manifestContent)
|
||||||
} else {
|
} else {
|
||||||
@@ -171,7 +174,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 = "完整"
|
||||||
@@ -215,7 +218,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// applicationId "myname.pdlive.shayu"
|
// applicationId "myname.pdlive.shayu"
|
||||||
applicationId "com.pandoralive.shayu"
|
applicationId "com.pandora.sy"
|
||||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||||
//版本在这里修改
|
//版本在这里修改
|
||||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||||
@@ -265,7 +268,6 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
|
|
||||||
//implementation platform('com.google.firebase:firebase-bom:30.5.0')
|
//implementation platform('com.google.firebase:firebase-bom:30.5.0')
|
||||||
//implementation 'com.google.firebase:firebase-crashlytics'
|
//implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
|
|
||||||
|
|||||||
@@ -1,65 +1,58 @@
|
|||||||
{
|
{
|
||||||
"project_info": {
|
"project_info": {
|
||||||
"project_number": "292494634914",
|
"project_number": "867032862719",
|
||||||
"project_id": "pdlive-1631521064967",
|
"project_id": "pdlnew",
|
||||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
"storage_bucket": "pdlnew.appspot.com"
|
||||||
},
|
},
|
||||||
"client": [
|
"client": [
|
||||||
{
|
{
|
||||||
"client_info": {
|
"client_info": {
|
||||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
"mobilesdk_app_id": "1:867032862719:android:841a73fdfb6c37453ae1ca",
|
||||||
"android_client_info": {
|
"android_client_info": {
|
||||||
"package_name": "com.pandoralive.shayu"
|
"package_name": "com.pandora.sy"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth_client": [
|
"oauth_client": [
|
||||||
{
|
{
|
||||||
"client_id": "292494634914-8nuhhoeo061ki1jevbcsrl7dfdl6dlm0.apps.googleusercontent.com",
|
"client_id": "867032862719-af2dnojobjd8s6ekdr1is1vev8nk36sv.apps.googleusercontent.com",
|
||||||
"client_type": 1,
|
"client_type": 1,
|
||||||
"android_info": {
|
"android_info": {
|
||||||
"package_name": "com.pandoralive.shayu",
|
"package_name": "com.pandora.sy",
|
||||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
"client_id": "867032862719-ohaa1f18e186qpasvgt7qkk1i1pivniq.apps.googleusercontent.com",
|
||||||
"client_type": 1,
|
"client_type": 1,
|
||||||
"android_info": {
|
"android_info": {
|
||||||
"package_name": "com.pandoralive.shayu",
|
"package_name": "com.pandora.sy",
|
||||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
|
||||||
"client_type": 1,
|
|
||||||
"android_info": {
|
|
||||||
"package_name": "com.pandoralive.shayu",
|
|
||||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
"client_id": "867032862719-snpbqruvqcc9fsifjnmm1h3dcgtr8am4.apps.googleusercontent.com",
|
||||||
|
"client_type": 1,
|
||||||
|
"android_info": {
|
||||||
|
"package_name": "com.pandora.sy",
|
||||||
|
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||||
"client_type": 3
|
"client_type": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"api_key": [
|
"api_key": [
|
||||||
{
|
{
|
||||||
"current_key": "AIzaSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
"current_key": "AIzaSyAnlY2aBEGyg7QpghHo7EaMRkM89dVNgq8"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"services": {
|
"services": {
|
||||||
"appinvite_service": {
|
"appinvite_service": {
|
||||||
"other_platform_oauth_client": [
|
"other_platform_oauth_client": [
|
||||||
{
|
{
|
||||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
"client_id": "867032862719-ep4r92lpjmn7gs9tg0r7q0l75a4gm9mt.apps.googleusercontent.com",
|
||||||
"client_type": 3
|
"client_type": 3
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
|
||||||
"client_type": 2,
|
|
||||||
"ios_info": {
|
|
||||||
"bundle_id": "com.live.pd"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
21
app/proguard-rules.pro
vendored
21
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,6 +278,18 @@ 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.** {*;}
|
||||||
|
|
||||||
@@ -292,3 +307,7 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode;
|
|||||||
|
|
||||||
-keep class com.shayu.lib_google.**{*;}
|
-keep class com.shayu.lib_google.**{*;}
|
||||||
-keep class com.shayu.lib_huawei.**{*;}
|
-keep class com.shayu.lib_huawei.**{*;}
|
||||||
|
|
||||||
|
-keep class com.qiniu.**{*;}
|
||||||
|
-keep class com.qiniu.**{public <init>();}
|
||||||
|
-ignorewarnings
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?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 android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.CALL_PHONE"
|
android:name="android.permission.CALL_PHONE"
|
||||||
tools:node="remove" />
|
tools:node="remove" />
|
||||||
@@ -154,6 +154,9 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="IS_PLUGIN_MODEL"
|
android:name="IS_PLUGIN_MODEL"
|
||||||
android:value="${isPluginModel}" />
|
android:value="${isPluginModel}" />
|
||||||
|
<meta-data
|
||||||
|
android:name="BUILD_TIME"
|
||||||
|
android:value="${buildTime}" />
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="firebase_crashlytics_collection_enabled"
|
android:name="firebase_crashlytics_collection_enabled"
|
||||||
android:value="${isUploadLog}" />
|
android:value="${isUploadLog}" />
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import static com.yunbao.live.socket.SocketClient.mSocketHandler;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
import android.app.LauncherActivity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.http.HttpResponseCache;
|
import android.net.http.HttpResponseCache;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -25,13 +26,14 @@ import com.blankj.utilcode.util.Utils;
|
|||||||
import com.facebook.appevents.AppEventsLogger;
|
import com.facebook.appevents.AppEventsLogger;
|
||||||
import com.fm.openinstall.OpenInstall;
|
import com.fm.openinstall.OpenInstall;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.pandoralive.shayu.R;
|
||||||
import com.shayu.phonelive.utils.LogUtils;
|
import com.shayu.phonelive.utils.LogUtils;
|
||||||
import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
|
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.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.utils.MobclickAgent;
|
||||||
import com.umeng.commonsdk.UMConfigure;
|
import com.yalantis.ucrop.UCropActivity;
|
||||||
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;
|
||||||
@@ -44,7 +46,9 @@ import com.yunbao.common.manager.imrongcloud.InstructorSendRewardProvider;
|
|||||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
import com.yunbao.common.manager.imrongcloud.RecommendLiveRoom;
|
||||||
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
|
||||||
|
import com.yunbao.common.message.content.MessageChatCardContent;
|
||||||
import com.yunbao.common.message.content.MessageChatTipsContent;
|
import com.yunbao.common.message.content.MessageChatTipsContent;
|
||||||
|
import com.yunbao.common.provider.MessageChatCardItemProvider;
|
||||||
import com.yunbao.common.provider.MessageChatTipsItemProvider;
|
import com.yunbao.common.provider.MessageChatTipsItemProvider;
|
||||||
import com.yunbao.common.utils.AppManager;
|
import com.yunbao.common.utils.AppManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
@@ -53,6 +57,7 @@ import com.yunbao.common.utils.L;
|
|||||||
import com.yunbao.common.utils.MessageChatNotifyManager;
|
import com.yunbao.common.utils.MessageChatNotifyManager;
|
||||||
import com.yunbao.common.utils.MessageSayHiNotifyManager;
|
import com.yunbao.common.utils.MessageSayHiNotifyManager;
|
||||||
import com.yunbao.common.utils.SpUtil;
|
import com.yunbao.common.utils.SpUtil;
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.activity.LiveActivity;
|
import com.yunbao.live.activity.LiveActivity;
|
||||||
import com.yunbao.live.activity.SudGameActivity;
|
import com.yunbao.live.activity.SudGameActivity;
|
||||||
import com.yunbao.live.socket.SocketReceiveBean;
|
import com.yunbao.live.socket.SocketReceiveBean;
|
||||||
@@ -60,10 +65,15 @@ import com.yunbao.live.socket.SocketRyClient;
|
|||||||
import com.yunbao.live.utils.LiveImDeletUtil;
|
import com.yunbao.live.utils.LiveImDeletUtil;
|
||||||
import com.yunbao.live.views.PortraitLiveManager;
|
import com.yunbao.live.views.PortraitLiveManager;
|
||||||
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
import com.yunbao.live.views.RecommendLiveRoomProvider;
|
||||||
|
import com.yunbao.main.activity.CompleteUserInfoActivity;
|
||||||
|
import com.yunbao.main.activity.EntryActivity;
|
||||||
|
import com.yunbao.main.activity.LoginActivity;
|
||||||
import com.yunbao.main.activity.MainActivity;
|
import com.yunbao.main.activity.MainActivity;
|
||||||
import com.yunbao.main.activity.MainHomeCommunityActivity;
|
import com.yunbao.main.activity.MainHomeCommunityActivity;
|
||||||
import com.yunbao.main.activity.MsgSettActivity;
|
import com.yunbao.main.activity.MsgSettActivity;
|
||||||
import com.yunbao.main.activity.PDLiveConversationActivity;
|
import com.yunbao.main.activity.PDLiveConversationActivity;
|
||||||
|
import com.yunbao.main.activity.RegisterActivity;
|
||||||
|
import com.yunbao.video.activity.VideoPlayActivity;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@@ -78,6 +88,9 @@ import io.rong.imkit.config.RongConfigCenter;
|
|||||||
import io.rong.imlib.RongIMClient;
|
import io.rong.imlib.RongIMClient;
|
||||||
import io.rong.imlib.model.Conversation;
|
import io.rong.imlib.model.Conversation;
|
||||||
import io.rong.imlib.model.MessageContent;
|
import io.rong.imlib.model.MessageContent;
|
||||||
|
import io.rong.message.HQVoiceMessage;
|
||||||
|
import io.rong.message.ImageMessage;
|
||||||
|
import io.rong.message.SightMessage;
|
||||||
import io.rong.message.TextMessage;
|
import io.rong.message.TextMessage;
|
||||||
|
|
||||||
//import cn.tillusory.sdk.TiSDK;
|
//import cn.tillusory.sdk.TiSDK;
|
||||||
@@ -100,6 +113,7 @@ public class AppContext extends CommonAppContext {
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityResumed(Activity activity) {
|
public void onActivityResumed(Activity activity) {
|
||||||
Log.e("打招呼定时器", "onActivityResumed: " + activity);
|
Log.e("打招呼定时器", "onActivityResumed: " + activity);
|
||||||
|
MessageChatNotifyManager.getInstance().restart(activity);
|
||||||
if (activity instanceof LiveActivity) {
|
if (activity instanceof LiveActivity) {
|
||||||
MessageSayHiNotifyManager.getInstance().stop();
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
return;
|
return;
|
||||||
@@ -108,17 +122,37 @@ public class AppContext extends CommonAppContext {
|
|||||||
MessageSayHiNotifyManager.getInstance().stop();
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(activity instanceof MainHomeCommunityActivity){
|
if (activity instanceof MainHomeCommunityActivity) {
|
||||||
MessageSayHiNotifyManager.getInstance().stop();
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(activity instanceof SudGameActivity){
|
if (activity instanceof SudGameActivity) {
|
||||||
MessageSayHiNotifyManager.getInstance().stop();
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (activity instanceof MainActivity && !MessageSayHiNotifyManager.getInstance().isInit()) {
|
if (activity instanceof MainActivity && !MessageSayHiNotifyManager.getInstance().isInit()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (activity instanceof CompleteUserInfoActivity) {
|
||||||
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (activity instanceof VideoPlayActivity) {
|
||||||
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (activity instanceof LoginActivity) {
|
||||||
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (activity instanceof EntryActivity) {
|
||||||
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (activity instanceof UCropActivity) {
|
||||||
|
MessageSayHiNotifyManager.getInstance().stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
MessageSayHiNotifyManager.getInstance().reload();
|
MessageSayHiNotifyManager.getInstance().reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +184,9 @@ public class AppContext extends CommonAppContext {
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
|
||||||
activities.add(new WeakReference<>(activity));
|
activities.add(new WeakReference<>(activity));
|
||||||
|
if(activity instanceof LoginActivity){
|
||||||
|
AppManager.getInstance().clear();
|
||||||
|
}
|
||||||
CrashSaveBean.getInstance().setActivitySize(activities);
|
CrashSaveBean.getInstance().setActivitySize(activities);
|
||||||
AppManager.getInstance().addActivity(activity);
|
AppManager.getInstance().addActivity(activity);
|
||||||
}
|
}
|
||||||
@@ -194,20 +231,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
|
||||||
@@ -220,12 +257,24 @@ public class AppContext extends CommonAppContext {
|
|||||||
myMessages.add(RecommendLiveRoom.class);
|
myMessages.add(RecommendLiveRoom.class);
|
||||||
myMessages.add(InstructorSendReward.class);
|
myMessages.add(InstructorSendReward.class);
|
||||||
myMessages.add(MessageChatTipsContent.class);
|
myMessages.add(MessageChatTipsContent.class);
|
||||||
|
myMessages.add(MessageChatCardContent.class);
|
||||||
|
|
||||||
RongIMClient.registerMessageType(myMessages);
|
RongIMClient.registerMessageType(myMessages);
|
||||||
// 注册自定义消息模板
|
// 注册自定义消息模板
|
||||||
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
RongConfigCenter.conversationConfig().addMessageProvider(new InstructorSendRewardProvider(getApplicationContext()));
|
||||||
RongConfigCenter.conversationConfig().addMessageProvider(new RecommendLiveRoomProvider(getApplicationContext()));
|
RongConfigCenter.conversationConfig().addMessageProvider(new RecommendLiveRoomProvider(getApplicationContext()));
|
||||||
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
|
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext()));
|
||||||
|
RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatCardItemProvider(getApplicationContext()));
|
||||||
|
|
||||||
|
//注册屏蔽push弹窗的类
|
||||||
|
MessageChatNotifyManager.getInstance().addShieldClass(CompleteUserInfoActivity.class);
|
||||||
|
MessageChatNotifyManager.getInstance().addShieldClass(PDLiveConversationActivity.class);
|
||||||
|
MessageChatNotifyManager.getInstance().addShieldClass(LauncherActivity.class);
|
||||||
|
MessageChatNotifyManager.getInstance().addShieldClass(EntryActivity.class);
|
||||||
|
MessageChatNotifyManager.getInstance().addShieldClass(LoginActivity.class);
|
||||||
|
MessageChatNotifyManager.getInstance().addShieldClass(RegisterActivity.class);
|
||||||
|
MessageChatNotifyManager.getInstance().addShieldClass(UCropActivity.class);
|
||||||
|
|
||||||
|
|
||||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -237,7 +286,21 @@ public class AppContext extends CommonAppContext {
|
|||||||
msg.what = Constants.SOCKET_WHAT_BROADCAST;
|
msg.what = Constants.SOCKET_WHAT_BROADCAST;
|
||||||
try {
|
try {
|
||||||
if (!"".equals(message.getContent()) && message.getContent() != null) {
|
if (!"".equals(message.getContent()) && message.getContent() != null) {
|
||||||
TextMessage content = (TextMessage) message.getContent();
|
TextMessage content;
|
||||||
|
if (message.getContent() instanceof MessageChatCardContent) {
|
||||||
|
content = new TextMessage(WordUtil.getNewString(R.string.activity_msg_chat_list_card));
|
||||||
|
} else if (message.getContent() instanceof TextMessage) {
|
||||||
|
content = (TextMessage) message.getContent();
|
||||||
|
}else if(message.getContent() instanceof ImageMessage){
|
||||||
|
content = new TextMessage(WordUtil.getNewString(R.string.rc_conversation_summary_content_image));
|
||||||
|
}else if(message.getContent() instanceof SightMessage){
|
||||||
|
content = new TextMessage(WordUtil.getNewString(R.string.rc_conversation_summary_content_sight));
|
||||||
|
}else if(message.getContent() instanceof HQVoiceMessage){
|
||||||
|
content = new TextMessage(WordUtil.getNewString(R.string.rc_conversation_summary_content_voice));
|
||||||
|
}else {
|
||||||
|
System.out.println("未知消息类型:"+message.getContent().getClass().getSimpleName()+"|"+message.getContent());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (content.getContent().contains("_method_")) {
|
if (content.getContent().contains("_method_")) {
|
||||||
msg.obj = content.getContent();
|
msg.obj = content.getContent();
|
||||||
//观众页面
|
//观众页面
|
||||||
@@ -260,10 +323,33 @@ public class AppContext extends CommonAppContext {
|
|||||||
|
|
||||||
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
} else if (message.getConversationType() == Conversation.ConversationType.PRIVATE) {//私聊信息
|
||||||
EventBus.getDefault().post(message);
|
EventBus.getDefault().post(message);
|
||||||
MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity()
|
MessageIMManager.get(sInstance).resetImUnReadMessageCount(sInstance);
|
||||||
, message.getTargetId(),
|
if (AppManager.getInstance().getLastActivity() instanceof CompleteUserInfoActivity) {
|
||||||
content.getContent()
|
return false;
|
||||||
);
|
}
|
||||||
|
Log.i("聊天推送", message.getTargetId() + "是否已读:" + message.getReceivedStatus().isRead());
|
||||||
|
if (message.getReceivedStatus().isRead()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
RongIMClient.getInstance().getUnreadCount(Conversation.ConversationType.PRIVATE, message.getTargetId(), new RongIMClient.ResultCallback<Integer>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Integer integer) {
|
||||||
|
if (integer > 0) {
|
||||||
|
Log.i("聊天推送", message.getTargetId() + "是否已读:" + message.getReceivedStatus().isRead() + "|未读数" + integer);
|
||||||
|
MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity()
|
||||||
|
, message.getTargetId(),
|
||||||
|
content.getContent()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(RongIMClient.ErrorCode e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -358,9 +444,9 @@ public class AppContext extends CommonAppContext {
|
|||||||
activity.get().finish();
|
activity.get().finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setFirebaseCrashData();
|
||||||
Process.killProcess(Process.myPid());
|
Process.killProcess(Process.myPid());
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
setFirebaseCrashData();
|
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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:$kotlin_version"
|
||||||
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
|
||||||
|
|||||||
@@ -1,92 +0,0 @@
|
|||||||
{
|
|
||||||
"agcgw":{
|
|
||||||
"backurl":"connect-drcn.hispace.hicloud.com",
|
|
||||||
"url":"connect-drcn.dbankcloud.cn",
|
|
||||||
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
|
||||||
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
|
||||||
},
|
|
||||||
"agcgw_all":{
|
|
||||||
"CN":"connect-drcn.dbankcloud.cn",
|
|
||||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
|
||||||
"DE":"connect-dre.dbankcloud.cn",
|
|
||||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
|
||||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
|
||||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
|
||||||
"SG":"connect-dra.dbankcloud.cn",
|
|
||||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
|
||||||
},
|
|
||||||
"websocketgw_all":{
|
|
||||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
|
||||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
|
||||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
|
||||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
|
||||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
|
||||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
|
||||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
|
||||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
|
||||||
},
|
|
||||||
"client":{
|
|
||||||
"cp_id":"30086000612391734",
|
|
||||||
"product_id":"99536292102564216",
|
|
||||||
"client_id":"964994320723627840",
|
|
||||||
"client_secret":"6D5FE29D85B967D3A66BDCD473641E4C7B5524F7F4935CA0EF4A842730C3402D",
|
|
||||||
"project_id":"99536292102564216",
|
|
||||||
"app_id":"106936673",
|
|
||||||
"api_key":"DAEDADYGta/0O4ZSdrnug52NgC67/w/RIyTq9A8LyAY0+mp6g6XeJDbxugpluFPLAhaqjaMs5c0PLnRx14UzWbPPADgi1EqihbWLoA==",
|
|
||||||
"package_name":"com.pandoralive.shayu"
|
|
||||||
},
|
|
||||||
"oauth_client":{
|
|
||||||
"client_id":"106936673",
|
|
||||||
"client_type":1
|
|
||||||
},
|
|
||||||
"app_info":{
|
|
||||||
"app_id":"106936673",
|
|
||||||
"package_name":"com.pandoralive.shayu"
|
|
||||||
},
|
|
||||||
"service":{
|
|
||||||
"analytics":{
|
|
||||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
|
||||||
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
|
||||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
|
||||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
|
||||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
|
||||||
"resource_id":"p1",
|
|
||||||
"channel_id":""
|
|
||||||
},
|
|
||||||
"search":{
|
|
||||||
"url":"https://search-drcn.cloud.huawei.com"
|
|
||||||
},
|
|
||||||
"cloudstorage":{
|
|
||||||
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
|
|
||||||
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
|
|
||||||
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
|
|
||||||
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
|
|
||||||
"storage_url_de":"https://ops-dre.agcstorage.link",
|
|
||||||
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
|
|
||||||
"storage_url_sg":"https://ops-dra.agcstorage.link",
|
|
||||||
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
|
|
||||||
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
|
||||||
},
|
|
||||||
"ml":{
|
|
||||||
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"region":"CN",
|
|
||||||
"configuration_version":"3.0",
|
|
||||||
"appInfos":[
|
|
||||||
{
|
|
||||||
"package_name":"com.pandoralive.shayu",
|
|
||||||
"client":{
|
|
||||||
"app_id":"106936673"
|
|
||||||
},
|
|
||||||
"app_info":{
|
|
||||||
"package_name":"com.pandoralive.shayu",
|
|
||||||
"app_id":"106936673"
|
|
||||||
},
|
|
||||||
"oauth_client":{
|
|
||||||
"client_type":1,
|
|
||||||
"client_id":"106936673"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -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
|
||||||
@@ -59,8 +59,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 {
|
||||||
@@ -70,6 +73,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
@@ -165,14 +169,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'
|
||||||
|
|
||||||
@@ -207,9 +211,7 @@ dependencies {
|
|||||||
//自定义圆角图片
|
//自定义圆角图片
|
||||||
api 'com.makeramen:roundedimageview:2.3.0'
|
api 'com.makeramen:roundedimageview:2.3.0'
|
||||||
// 友盟统计SDK
|
// 友盟统计SDK
|
||||||
api 'com.umeng.umsdk:common:9.6.3'// 必选
|
// api(name: 'umeng-common-9.6.8+000', ext: 'aar')
|
||||||
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'
|
||||||
@@ -226,7 +228,7 @@ dependencies {
|
|||||||
api project(':lib_google')
|
api project(':lib_google')
|
||||||
|
|
||||||
//samsung插件包
|
//samsung插件包
|
||||||
api project(':IAP6Helper')
|
//api project(':IAP6Helper')
|
||||||
|
|
||||||
//時間選擇器
|
//時間選擇器
|
||||||
api 'com.contrarywind:Android-PickerView:4.1.9'
|
api 'com.contrarywind:Android-PickerView:4.1.9'
|
||||||
@@ -239,4 +241,13 @@ dependencies {
|
|||||||
api 'com.github.xuexiangjys:XUI:1.1.6'
|
api 'com.github.xuexiangjys:XUI:1.1.6'
|
||||||
api 'com.github.xuexiangjys.XUtil:xutil-core:2.0.0'
|
api 'com.github.xuexiangjys.XUtil:xutil-core:2.0.0'
|
||||||
|
|
||||||
|
//ExoPlayer,腾讯的播放器不支持无缝切换
|
||||||
|
api 'com.google.android.exoplayer:exoplayer:2.18.2'
|
||||||
|
api 'com.google.android.exoplayer:exoplayer-core:2.18.2@aar'
|
||||||
|
//文字渐变色
|
||||||
|
api 'com.github.FlyJingFish:GradientTextView:1.2.4'
|
||||||
|
//轮播 一屏显示多个
|
||||||
|
api 'com.github.xiaohaibin:XBanner:androidx_v1.2.6'
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
"project_info": {
|
|
||||||
"project_number": "292494634914",
|
|
||||||
"project_id": "pdlive-1631521064967",
|
|
||||||
"storage_bucket": "pdlive-1631521064967.appspot.com"
|
|
||||||
},
|
|
||||||
"client": [
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:292494634914:android:d8db197d7e7a6c3a3a4cfb",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "com.pandoralive.shayu"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-8nuhhoeo061ki1jevbcsrl7dfdl6dlm0.apps.googleusercontent.com",
|
|
||||||
"client_type": 1,
|
|
||||||
"android_info": {
|
|
||||||
"package_name": "com.pandoralive.shayu",
|
|
||||||
"certificate_hash": "38cc19306c9facee36a9224e9a4070bc0be15c7d"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-ctr3fptp5mkv2qqr4gkgjo9uluq2joqb.apps.googleusercontent.com",
|
|
||||||
"client_type": 1,
|
|
||||||
"android_info": {
|
|
||||||
"package_name": "com.pandoralive.shayu",
|
|
||||||
"certificate_hash": "15fc5e70cf238323bf7111c8c627803985478e87"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-ejtqvaj86a2lldv0di2pr3d5gngprahd.apps.googleusercontent.com",
|
|
||||||
"client_type": 1,
|
|
||||||
"android_info": {
|
|
||||||
"package_name": "com.pandoralive.shayu",
|
|
||||||
"certificate_hash": "b66dc8d21cfcf6c729577ddcf0c312b2a31ed872"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyDVnuGnQzjI_vDrxh20Hv_S1OMUD7Vp3zU"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-ha2kbgtclkv20hl3a1l8r7861a1a0m5i.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_id": "292494634914-v9j4rei86q2pfh9as4seotb23vr2744a.apps.googleusercontent.com",
|
|
||||||
"client_type": 2,
|
|
||||||
"ios_info": {
|
|
||||||
"bundle_id": "com.live.pd"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configuration_version": "1"
|
|
||||||
}
|
|
||||||
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.
3
common/proguard-rules.pro
vendored
3
common/proguard-rules.pro
vendored
@@ -23,3 +23,6 @@
|
|||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
-keep class com.qiniu.**{*;}
|
||||||
|
-keep class com.qiniu.**{public <init>();}
|
||||||
|
-ignorewarnings
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
<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"-->
|
||||||
@@ -23,7 +25,7 @@
|
|||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.pandoralive.shayu.fileprovider"
|
android:authorities="com.pandora.sy.fileprovider"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:grantUriPermissions="true">
|
android:grantUriPermissions="true">
|
||||||
<meta-data
|
<meta-data
|
||||||
@@ -66,16 +68,7 @@
|
|||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.CommunitySendActivity"
|
android:name="com.yunbao.common.activity.VideoPlayActivity"
|
||||||
android:screenOrientation="portrait" />
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".activity.CommunityDetailsActivity"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:windowSoftInputMode="adjustResize" />
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".activity.UserHomeActivity"
|
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.yunbao.common;
|
package com.yunbao.common;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -12,6 +13,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yunbao.common.bean.ConfigBean;
|
import com.yunbao.common.bean.ConfigBean;
|
||||||
import com.yunbao.common.bean.FansMedalBean;
|
import com.yunbao.common.bean.FansMedalBean;
|
||||||
|
import com.yunbao.common.bean.NewCommunityType;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.common.bean.UserItemBean;
|
import com.yunbao.common.bean.UserItemBean;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
@@ -37,6 +39,7 @@ public class CommonAppConfig {
|
|||||||
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
public static final boolean IS_UPLOAD_ERROR_LOG = getMetaDataBoolean("IS_UPLOAD_ERROR_LOG");
|
||||||
//是否为插件包模式
|
//是否为插件包模式
|
||||||
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
public static final boolean IS_PLUGIN_MODEL = getMetaDataBoolean("IS_PLUGIN_MODEL");
|
||||||
|
public static final String BUILD_TIME = getMetaDataString("BUILD_TIME");
|
||||||
|
|
||||||
//外部sd卡
|
//外部sd卡
|
||||||
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
public static final String DCMI_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath();
|
||||||
@@ -117,10 +120,46 @@ public class CommonAppConfig {
|
|||||||
private String mAppName;
|
private String mAppName;
|
||||||
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜
|
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜
|
||||||
|
|
||||||
|
public static List<NewCommunityType> getCommunityTypeList(boolean isHome, Context mContext) {
|
||||||
|
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
|
||||||
|
if (isHome) {
|
||||||
|
NewCommunityType type0 = new NewCommunityType();
|
||||||
|
type0.setId(0);
|
||||||
|
type0.setTalk_name(mContext.getString(R.string.recomment));
|
||||||
|
newCommunityTypeList.add(type0);
|
||||||
|
}
|
||||||
|
NewCommunityType type17 = new NewCommunityType();
|
||||||
|
type17.setId(5);
|
||||||
|
type17.setTalk_name(mContext.getResources().getString(R.string.main_active_type_01));
|
||||||
|
|
||||||
|
NewCommunityType type16 = new NewCommunityType();
|
||||||
|
type16.setId(4);
|
||||||
|
type16.setTalk_name(mContext.getResources().getString(R.string.main_active_type_02));
|
||||||
|
|
||||||
|
NewCommunityType type15 = new NewCommunityType();
|
||||||
|
type15.setId(3);
|
||||||
|
type15.setTalk_name(mContext.getResources().getString(R.string.main_active_type_03));
|
||||||
|
|
||||||
|
NewCommunityType type14 = new NewCommunityType();
|
||||||
|
type14.setId(2);
|
||||||
|
type14.setTalk_name(mContext.getResources().getString(R.string.main_active_type_04));
|
||||||
|
|
||||||
|
NewCommunityType type13 = new NewCommunityType();
|
||||||
|
type13.setId(1);
|
||||||
|
type13.setTalk_name(mContext.getResources().getString(R.string.main_active_type_05));
|
||||||
|
|
||||||
|
newCommunityTypeList.add(type17);
|
||||||
|
newCommunityTypeList.add(type16);
|
||||||
|
newCommunityTypeList.add(type15);
|
||||||
|
newCommunityTypeList.add(type14);
|
||||||
|
newCommunityTypeList.add(type13);
|
||||||
|
return newCommunityTypeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getUid() {
|
public String getUid() {
|
||||||
if (TextUtils.isEmpty(mUid)) {
|
if (TextUtils.isEmpty(mUid)) {
|
||||||
String[] uidAndToken = SpUtil.getInstance()
|
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
||||||
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
|
|
||||||
if (uidAndToken != null) {
|
if (uidAndToken != null) {
|
||||||
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
|
||||||
mUid = uidAndToken[0];
|
mUid = uidAndToken[0];
|
||||||
@@ -311,9 +350,7 @@ public class CommonAppConfig {
|
|||||||
mUid = null;
|
mUid = null;
|
||||||
mToken = null;
|
mToken = null;
|
||||||
mLoginIM = false;
|
mLoginIM = false;
|
||||||
SpUtil.getInstance().removeValue(
|
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
|
||||||
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -349,12 +386,7 @@ public class CommonAppConfig {
|
|||||||
mProvince = null;
|
mProvince = null;
|
||||||
mCity = null;
|
mCity = null;
|
||||||
mDistrict = null;
|
mDistrict = null;
|
||||||
SpUtil.getInstance().removeValue(
|
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
|
||||||
SpUtil.LOCATION_LNG,
|
|
||||||
SpUtil.LOCATION_LAT,
|
|
||||||
SpUtil.LOCATION_PROVINCE,
|
|
||||||
SpUtil.LOCATION_CITY,
|
|
||||||
SpUtil.LOCATION_DISTRICT);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -274,6 +274,8 @@ 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/shoppingMall.html";
|
public static final String SHOP = CommonAppConfig.HOST + "/h5/shop/index.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,6 +6,7 @@ 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;
|
||||||
@@ -24,13 +25,12 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.yunbao.common.utils.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,7 +92,8 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
protected void main() {
|
protected void main() {
|
||||||
|
|
||||||
}
|
}
|
||||||
protected void create(){
|
|
||||||
|
protected void create() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +108,17 @@ 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();
|
||||||
@@ -181,14 +193,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();
|
||||||
@@ -382,11 +394,12 @@ public abstract class AbsActivity extends AppCompatActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public boolean isKefu(String url){
|
|
||||||
if(url.contains("kefu")){
|
public boolean isKefu(String url) {
|
||||||
|
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");
|
||||||
|
|||||||
@@ -1,759 +0,0 @@
|
|||||||
package com.yunbao.common.activity;
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.Outline;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.provider.MediaStore;
|
|
||||||
import android.util.SparseArray;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewOutlineProvider;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.ScrollView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import androidx.viewpager.widget.ViewPager;
|
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
|
||||||
import com.ms.banner.Banner;
|
|
||||||
import com.xuexiang.xui.widget.flowlayout.FlowTagLayout;
|
|
||||||
import com.yunbao.common.CommonAppConfig;
|
|
||||||
import com.yunbao.common.Constants;
|
|
||||||
import com.yunbao.common.R;
|
|
||||||
import com.yunbao.common.adapter.LabelTagAdapter;
|
|
||||||
import com.yunbao.common.adapter.UserCommunityAdapter;
|
|
||||||
import com.yunbao.common.adapter.UserHomeImgAdapter;
|
|
||||||
import com.yunbao.common.bean.ActiveBean;
|
|
||||||
import com.yunbao.common.bean.ActiveOtherBean;
|
|
||||||
import com.yunbao.common.bean.HomeUserExhibitInfoBean;
|
|
||||||
import com.yunbao.common.bean.HomeUserInfoBean;
|
|
||||||
import com.yunbao.common.bean.LabelBean;
|
|
||||||
import com.yunbao.common.bean.UserHomeImgBean;
|
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
|
||||||
import com.yunbao.common.interfaces.CommonCallback;
|
|
||||||
import com.yunbao.common.upload.UploadBean;
|
|
||||||
import com.yunbao.common.upload.UploadCallback;
|
|
||||||
import com.yunbao.common.upload.UploadQnImpl;
|
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
|
||||||
import com.yunbao.common.utils.FilesUtils;
|
|
||||||
import com.yunbao.common.utils.L;
|
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
|
||||||
import com.yunbao.common.views.UserHomeImgsViewHolder;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import pl.droidsonroids.gif.GifImageView;
|
|
||||||
|
|
||||||
@Route(path = RouteUtil.PATH_USER_HOME)
|
|
||||||
public class UserHomeActivity extends AbsActivity {
|
|
||||||
private final int CHOOSE_IMG = 100;//Android 5.0以下的
|
|
||||||
public static final int PERMISSION_REQUEST_CODE_IMG = 0;
|
|
||||||
private String uid;
|
|
||||||
private Banner mBanner;
|
|
||||||
private RecyclerView imgsRecyclerView;
|
|
||||||
private UserHomeImgAdapter userHomeImgAdapter;
|
|
||||||
private List<String> bannerImgList = new ArrayList<>();
|
|
||||||
private List<UserHomeImgBean> tempList;
|
|
||||||
private RoundedImageView avatar;
|
|
||||||
private TextView userName;
|
|
||||||
private TextView fansCount;
|
|
||||||
private TextView likeCount;
|
|
||||||
private LinearLayout followLayout;
|
|
||||||
private ImageView followIcon;
|
|
||||||
private TextView followName;
|
|
||||||
private TextView userId;
|
|
||||||
private TextView userStatus;
|
|
||||||
private ImageView userStatusIcon;
|
|
||||||
private ImageView user_sex;
|
|
||||||
private ImageView authorIcon;
|
|
||||||
private ImageView levelIcon;
|
|
||||||
private LinearLayout authenticationLayout;
|
|
||||||
private TextView signature;
|
|
||||||
private LinearLayout moreLayout;
|
|
||||||
private TextView moreText;
|
|
||||||
private ImageView moreIcon;
|
|
||||||
private HomeUserInfoBean userInfo;
|
|
||||||
private RecyclerView communityRecyclerView;
|
|
||||||
private LinearLayout itemLayout01;
|
|
||||||
private LinearLayout itemLayout02;
|
|
||||||
private LinearLayout itemLayout03;
|
|
||||||
private LinearLayout itemLayout04;
|
|
||||||
private FlowTagLayout myFlowTag; //我的标签
|
|
||||||
private LabelTagAdapter myAdapter;
|
|
||||||
private boolean isShowcase;
|
|
||||||
private boolean isAnchor;
|
|
||||||
private boolean isMe;
|
|
||||||
private RelativeLayout userPresidentLayout;
|
|
||||||
private TextView userPresidentName;
|
|
||||||
private RoundedImageView fansImg1;
|
|
||||||
private RoundedImageView fansImg2;
|
|
||||||
private RoundedImageView fansImg3;
|
|
||||||
private List<RoundedImageView> fansImgViewList = new ArrayList<>();
|
|
||||||
private RoundedImageView guardImg1;
|
|
||||||
private RoundedImageView guardImg2;
|
|
||||||
private RoundedImageView guardImg3;
|
|
||||||
private List<RoundedImageView> guardImgViewList = new ArrayList<>();
|
|
||||||
private RoundedImageView giftImg1;
|
|
||||||
private RoundedImageView giftImg2;
|
|
||||||
private RoundedImageView giftImg3;
|
|
||||||
private List<RoundedImageView> giftImgViewList = new ArrayList<>();
|
|
||||||
private RoundedImageView honorImg1;
|
|
||||||
private RoundedImageView honorImg2;
|
|
||||||
private RoundedImageView honorImg3;
|
|
||||||
private List<RoundedImageView> honorImgViewList = new ArrayList<>();
|
|
||||||
private TextView giftCount;
|
|
||||||
private List<String> tagList;
|
|
||||||
private GifImageView liveStatus;
|
|
||||||
private TextView topName;
|
|
||||||
private LinearLayout topLayout;
|
|
||||||
private ScrollView scrollView;
|
|
||||||
private RelativeLayout topImgLayout;
|
|
||||||
private ImageView imgUp;
|
|
||||||
private ImageView imgLabel;
|
|
||||||
private LinearLayout bottomEditLayout;
|
|
||||||
private UploadQnImpl mUploadStrategy;
|
|
||||||
private List<ActiveBean> videoList = new ArrayList<>();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutId() {
|
|
||||||
return R.layout.activity_user_home;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void create() {
|
|
||||||
super.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void main() {
|
|
||||||
uid = getIntent().getStringExtra(Constants.TO_UID);
|
|
||||||
if (StringUtil.isEmpty(uid)) {
|
|
||||||
ToastUtil.show("用户不存在");
|
|
||||||
finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
initView();
|
|
||||||
getUseData();
|
|
||||||
getCommunityList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getCommunityList() {
|
|
||||||
CommonHttpUtil.getOtherDynamicList(uid, new com.yunbao.common.http.HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
List<ActiveOtherBean> beanList = JSONArray.parseArray(Arrays.toString(info), ActiveOtherBean.class);
|
|
||||||
UserCommunityAdapter userCommunityAdapter = new UserCommunityAdapter(mContext, beanList);
|
|
||||||
userCommunityAdapter.setOnItemClickListener(new UserCommunityAdapter.onItemClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onImgItem(ActiveOtherBean bean, int position) {
|
|
||||||
if (bean.getImg_or_video().equals("1")) {
|
|
||||||
RouteUtil.forwardCommunity(bean.getId());
|
|
||||||
} else {
|
|
||||||
int playPosition = 0;
|
|
||||||
for (int i = 0; i < videoList.size(); i++) {
|
|
||||||
if (videoList.get(i).getId().equals(bean.getId())) {
|
|
||||||
playPosition = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RouteUtil.forwardVideoActivity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onVideoItem(String activeBean, int position) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
communityRecyclerView.setAdapter(userCommunityAdapter);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint({"SetTextI18n", "UseCompatLoadingForDrawables"})
|
|
||||||
private void initData(HomeUserInfoBean userInfoBean) {
|
|
||||||
userInfo = userInfoBean;
|
|
||||||
if (!userInfo.getCheckBlack().get(0).getU2t().equals("0")) {
|
|
||||||
ToastUtil.show("已拉黑,无法查看");
|
|
||||||
finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_president_name())) {
|
|
||||||
userPresidentLayout.setVisibility(View.VISIBLE);
|
|
||||||
userPresidentName.setText(userInfo.getUserHomeTopInfo().getUser_president_name());
|
|
||||||
}
|
|
||||||
isAnchor = userInfo.getUserHomeTopInfo().getIs_anchor() == 1;
|
|
||||||
isMe = CommonAppConfig.getInstance().getUserBean().getId().equals(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
|
||||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_avatar(), avatar);
|
|
||||||
topName.setText(userInfo.getUserHomeTopInfo().getUser_name()); //用户名称-顶部
|
|
||||||
userName.setText(userInfo.getUserHomeTopInfo().getUser_name());//用户名称
|
|
||||||
fansCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_fans_num()));//粉丝数量
|
|
||||||
likeCount.setText(String.valueOf(userInfo.getUserHomeTopInfo().getUser_love_num()));//关注数量
|
|
||||||
|
|
||||||
if (isMe) {
|
|
||||||
bottomEditLayout.setVisibility(View.VISIBLE);
|
|
||||||
imgUp.setVisibility(View.VISIBLE);
|
|
||||||
imgLabel.setVisibility(View.VISIBLE);
|
|
||||||
followLayout.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_goodnum())) {
|
|
||||||
userId.setText("靓号:" + userInfo.getUserHomeTopInfo().getUser_goodnum());//用户靓号
|
|
||||||
} else {
|
|
||||||
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
|
|
||||||
}
|
|
||||||
|
|
||||||
if (userInfo.getUserHomeTopInfo().getRong_online().equals("0")) {
|
|
||||||
userStatus.setText("在线");
|
|
||||||
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_green));
|
|
||||||
} else {
|
|
||||||
userStatus.setText("离线");
|
|
||||||
userStatusIcon.setImageDrawable(getResources().getDrawable(R.mipmap.icon_gray));
|
|
||||||
}
|
|
||||||
if (userInfo.getUserHomeTopInfo().getIs_live() == 1) {
|
|
||||||
liveStatus.setVisibility(View.VISIBLE);
|
|
||||||
avatar.setBackground(getResources().getDrawable(R.drawable.bg_live_1));
|
|
||||||
}
|
|
||||||
ImgLoader.display(UserHomeActivity.this, Integer.parseInt(String.valueOf(userInfo.getUserHomeTopInfo().getUser_sex())) == 0 ? R.mipmap.icon_man_new : R.mipmap.icon_wumen, user_sex);
|
|
||||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_anchor_img(), authorIcon);
|
|
||||||
ImgLoader.display(UserHomeActivity.this, userInfo.getUserHomeTopInfo().getUser_level_img(), levelIcon);
|
|
||||||
|
|
||||||
if (isAnchor) {//是否是主播
|
|
||||||
authorIcon.setVisibility(View.VISIBLE);
|
|
||||||
authenticationLayout.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
authorIcon.setVisibility(View.GONE);
|
|
||||||
authenticationLayout.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
signature.setText(userInfo.getUserHomeTopInfo().getUser_signature());//个性签名
|
|
||||||
//标签
|
|
||||||
myAdapter = new LabelTagAdapter(mContext, new LabelTagAdapter.OnSureOnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void sure(LabelBean.Children labelBean) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tagList = new ArrayList<>();
|
|
||||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getAge())) {
|
|
||||||
tagList.add(userInfo.getUserHomeTopInfo().getAge() + "岁");
|
|
||||||
}
|
|
||||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getHeight())) {
|
|
||||||
tagList.add(userInfo.getUserHomeTopInfo().getHeight());
|
|
||||||
}
|
|
||||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCareer())) {
|
|
||||||
tagList.add(userInfo.getUserHomeTopInfo().getCareer());
|
|
||||||
}
|
|
||||||
if (userInfo.getUserHomeTopInfo().getCn_label() != null) {
|
|
||||||
if (userInfo.getUserHomeTopInfo().getCn_label().size() > 0) {
|
|
||||||
for (int i = 0; i < userInfo.getUserHomeTopInfo().getCn_label().size(); i++) {
|
|
||||||
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getCn_label().get(i))) {
|
|
||||||
tagList.add(userInfo.getUserHomeTopInfo().getCn_label().get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myFlowTag.setAdapter(myAdapter);
|
|
||||||
myFlowTag.setTagCheckedMode(FlowTagLayout.FLOW_TAG_CHECKED_NONE);
|
|
||||||
myAdapter.setData(tagList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mBanner.setOutlineProvider(new ViewOutlineProvider() {
|
|
||||||
@Override
|
|
||||||
public void getOutline(View view, Outline outline) {
|
|
||||||
outline.setRoundRect(0, 0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageSelected(int position) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageScrollStateChanged(int state) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
bannerImgList = userInfo.getUserHomeTopInfo().getUser_home_banner();
|
|
||||||
tempList = new ArrayList<>();
|
|
||||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
|
||||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
|
||||||
}
|
|
||||||
if (tempList.size() > 0) {
|
|
||||||
tempList.get(0).setShow(true);
|
|
||||||
}
|
|
||||||
userHomeImgAdapter = new UserHomeImgAdapter(UserHomeActivity.this, tempList, isMe);
|
|
||||||
imgsRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
|
||||||
imgsRecyclerView.setAdapter(userHomeImgAdapter);
|
|
||||||
|
|
||||||
userHomeImgAdapter.setOnItemClickListener(new UserHomeImgAdapter.onItemClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onImgItem(UserHomeImgBean activeBean, int position) {
|
|
||||||
L.e("onImgItem:" + position);
|
|
||||||
mBanner.setCurrentPage(position).start();
|
|
||||||
for (int i = 0; i < tempList.size(); i++) {
|
|
||||||
if (i == position) {
|
|
||||||
tempList.get(i).setShow(true);
|
|
||||||
} else {
|
|
||||||
tempList.get(i).setShow(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImgDel(UserHomeImgBean activeBean, int position) {
|
|
||||||
bannerImgList.remove(position);
|
|
||||||
uploadImg(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mBanner.setAutoPlay(false).setPages(bannerImgList, new UserHomeImgsViewHolder()).setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageSelected(int position) {
|
|
||||||
L.e("onPageSelected:" + position);
|
|
||||||
for (int i = 0; i < tempList.size(); i++) {
|
|
||||||
if (i == position) {
|
|
||||||
tempList.get(i).setShow(true);
|
|
||||||
} else {
|
|
||||||
tempList.get(i).setShow(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageScrollStateChanged(int state) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mBanner.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initView() {
|
|
||||||
bottomEditLayout = findViewById(R.id.bottomEditLayout);
|
|
||||||
imgUp = findViewById(R.id.imgUp);
|
|
||||||
imgLabel = findViewById(R.id.imgLabel);
|
|
||||||
topImgLayout = findViewById(R.id.topImgLayout);
|
|
||||||
|
|
||||||
topLayout = findViewById(R.id.topLayout);
|
|
||||||
scrollView = findViewById(R.id.scrollView);
|
|
||||||
|
|
||||||
topName = findViewById(R.id.topName);
|
|
||||||
liveStatus = findViewById(R.id.liveStatus);
|
|
||||||
giftCount = findViewById(R.id.giftCount);
|
|
||||||
|
|
||||||
fansImg1 = findViewById(R.id.fansImg1);
|
|
||||||
fansImg2 = findViewById(R.id.fansImg2);
|
|
||||||
fansImg3 = findViewById(R.id.fansImg3);
|
|
||||||
fansImgViewList = new ArrayList<>();
|
|
||||||
fansImgViewList.add(fansImg1);
|
|
||||||
fansImgViewList.add(fansImg2);
|
|
||||||
fansImgViewList.add(fansImg3);
|
|
||||||
|
|
||||||
guardImg1 = findViewById(R.id.guardImg1);
|
|
||||||
guardImg2 = findViewById(R.id.guardImg2);
|
|
||||||
guardImg3 = findViewById(R.id.guardImg3);
|
|
||||||
guardImgViewList = new ArrayList<>();
|
|
||||||
guardImgViewList.add(guardImg1);
|
|
||||||
guardImgViewList.add(guardImg2);
|
|
||||||
guardImgViewList.add(guardImg3);
|
|
||||||
|
|
||||||
giftImg1 = findViewById(R.id.giftImg1);
|
|
||||||
giftImg2 = findViewById(R.id.giftImg2);
|
|
||||||
giftImg3 = findViewById(R.id.giftImg3);
|
|
||||||
giftImgViewList = new ArrayList<>();
|
|
||||||
giftImgViewList.add(giftImg1);
|
|
||||||
giftImgViewList.add(giftImg2);
|
|
||||||
giftImgViewList.add(giftImg3);
|
|
||||||
|
|
||||||
honorImg1 = findViewById(R.id.honorImg1);
|
|
||||||
honorImg2 = findViewById(R.id.honorImg2);
|
|
||||||
honorImg3 = findViewById(R.id.honorImg3);
|
|
||||||
honorImgViewList = new ArrayList<>();
|
|
||||||
honorImgViewList.add(honorImg1);
|
|
||||||
honorImgViewList.add(honorImg2);
|
|
||||||
honorImgViewList.add(honorImg3);
|
|
||||||
|
|
||||||
userPresidentLayout = findViewById(R.id.userPresidentLayout);
|
|
||||||
userPresidentName = findViewById(R.id.userPresidentName);
|
|
||||||
itemLayout01 = findViewById(R.id.itemLayout01);
|
|
||||||
itemLayout02 = findViewById(R.id.itemLayout02);
|
|
||||||
itemLayout03 = findViewById(R.id.itemLayout03);
|
|
||||||
itemLayout04 = findViewById(R.id.itemLayout04);
|
|
||||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
|
||||||
myFlowTag = findViewById(R.id.myFlowTag);
|
|
||||||
avatar = findViewById(R.id.avatar);
|
|
||||||
userName = findViewById(R.id.name);
|
|
||||||
fansCount = findViewById(R.id.fansCount);
|
|
||||||
likeCount = findViewById(R.id.likeCount);
|
|
||||||
followLayout = findViewById(R.id.followLayout);
|
|
||||||
followName = findViewById(R.id.followName);
|
|
||||||
followIcon = findViewById(R.id.followIcon);
|
|
||||||
userId = findViewById(R.id.userId);
|
|
||||||
userStatus = findViewById(R.id.userStatus);
|
|
||||||
userStatusIcon = findViewById(R.id.userStatusIcon);
|
|
||||||
user_sex = findViewById(R.id.user_sex);
|
|
||||||
|
|
||||||
levelIcon = findViewById(R.id.levelIcon);
|
|
||||||
authorIcon = findViewById(R.id.authorlIcon);
|
|
||||||
|
|
||||||
authenticationLayout = findViewById(R.id.authenticationLayout);
|
|
||||||
signature = findViewById(R.id.signature);
|
|
||||||
moreLayout = findViewById(R.id.moreLayout);
|
|
||||||
moreText = findViewById(R.id.moreText);
|
|
||||||
moreIcon = findViewById(R.id.moreIcon);
|
|
||||||
|
|
||||||
mBanner = findViewById(R.id.banner);
|
|
||||||
imgsRecyclerView = findViewById(R.id.imgsRecyclerView);
|
|
||||||
|
|
||||||
communityRecyclerView = findViewById(R.id.communityRecyclerView);
|
|
||||||
communityRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
|
||||||
communityRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
|
|
||||||
|
|
||||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
followLayout.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
CommonHttpUtil.setAttention(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new CommonCallback<Integer>() {
|
|
||||||
@Override
|
|
||||||
public void callback(Integer isAttention) {
|
|
||||||
if (isAttention == 1) {
|
|
||||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_followed, followIcon);
|
|
||||||
followName.setText("已关注");
|
|
||||||
followName.setTextColor(Color.parseColor("#777777"));
|
|
||||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type_1));
|
|
||||||
} else {
|
|
||||||
ImgLoader.display(UserHomeActivity.this, R.mipmap.icon_like_follow, followIcon);
|
|
||||||
followName.setText("关注");
|
|
||||||
followName.setTextColor(getResources().getColor(R.color.white));
|
|
||||||
followLayout.setBackground(getResources().getDrawable(R.drawable.bg_main_com_type));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
moreLayout.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (isShowcase) {
|
|
||||||
if (isAnchor) {
|
|
||||||
itemLayout01.setVisibility(View.GONE);
|
|
||||||
itemLayout02.setVisibility(View.GONE);
|
|
||||||
itemLayout03.setVisibility(View.GONE);
|
|
||||||
itemLayout04.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
itemLayout03.setVisibility(View.GONE);
|
|
||||||
itemLayout04.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
moreText.setText("查看更多");
|
|
||||||
ImgLoader.display(mContext, R.mipmap.icon_down, moreIcon);
|
|
||||||
} else {
|
|
||||||
if (isAnchor) {
|
|
||||||
itemLayout01.setVisibility(View.VISIBLE);
|
|
||||||
itemLayout02.setVisibility(View.VISIBLE);
|
|
||||||
itemLayout03.setVisibility(View.VISIBLE);
|
|
||||||
itemLayout04.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
itemLayout01.setVisibility(View.GONE);
|
|
||||||
itemLayout02.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
moreText.setText("收起");
|
|
||||||
ImgLoader.display(mContext, R.mipmap.icon_up, moreIcon);
|
|
||||||
}
|
|
||||||
isShowcase = !isShowcase;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
|
||||||
int height = (int) (topImgLayout.getMeasuredHeight() * 1.2);
|
|
||||||
if (scrollY <= 0) {
|
|
||||||
//滑动之前,标题栏布局背景颜色为完全透明,标题文字完全透明
|
|
||||||
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
|
||||||
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
|
||||||
//让mScrollView滑动的距离在0~height之间时颜色发生渐变
|
|
||||||
} else if (scrollY > 0 && scrollY <= height) {
|
|
||||||
//获取渐变率
|
|
||||||
float scale = (float) scrollY / height;
|
|
||||||
//获取渐变数值
|
|
||||||
float alpha = (255 * scale);
|
|
||||||
//布局文本颜色逐渐发生变化
|
|
||||||
topLayout.setBackgroundColor(Color.argb((int) alpha, 0, 0, 0));
|
|
||||||
topName.setTextColor(Color.argb((int) alpha, 255, 255, 255));
|
|
||||||
} else {
|
|
||||||
//当滑动距离超过height,布局文本颜色完全不透明
|
|
||||||
topLayout.setBackgroundColor(Color.argb(255, 0, 0, 0));
|
|
||||||
topName.setTextColor(Color.argb(255, 255, 255, 255));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
topLayout.setBackgroundColor(Color.argb(0, 0, 0, 0));
|
|
||||||
topName.setTextColor(Color.argb(0, 255, 255, 255));
|
|
||||||
}
|
|
||||||
imgUp.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (bannerImgList.size() < 9) {
|
|
||||||
selectImg();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
bottomEditLayout.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
RouteUtil.forwardEditProfileActivity();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
findViewById(R.id.setting).setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
SparseArray<String> array = new SparseArray<>();
|
|
||||||
array.append(1, "不感兴趣");
|
|
||||||
array.append(0, "举报");
|
|
||||||
array.append(2, "加入黑名单");
|
|
||||||
DialogUitl.showStringArrayDialog(UserHomeActivity.this, array, new DialogUitl.StringArrayDialogCallback() {
|
|
||||||
@Override
|
|
||||||
public void onItemClick(String text, int tag) {
|
|
||||||
if (tag == 0) {
|
|
||||||
CommonHttpUtil.noInterest(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()), new com.yunbao.common.http.HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
ToastUtil.show(msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (tag == 1) {
|
|
||||||
RouteUtil.forwardLiveReportActivity(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
|
||||||
} else {
|
|
||||||
RouteUtil.forwardLiveReportActivity(String.valueOf(userInfo.getUserHomeTopInfo().getUser_id()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void selectImg() {
|
|
||||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
|
||||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
permission1 = Manifest.permission.READ_MEDIA_IMAGES;
|
|
||||||
permission2 = Manifest.permission.READ_MEDIA_VIDEO;
|
|
||||||
}
|
|
||||||
int isPermission1 = ContextCompat.checkSelfPermission(mContext, permission1);
|
|
||||||
int isPermission2 = ContextCompat.checkSelfPermission(mContext, permission2);
|
|
||||||
if (isPermission1 == PackageManager.PERMISSION_GRANTED && isPermission2 == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
openImageChooserActivity();
|
|
||||||
} else {
|
|
||||||
//申请权限
|
|
||||||
ActivityCompat.requestPermissions(UserHomeActivity.this, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE_IMG);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void openImageChooserActivity() {
|
|
||||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
|
||||||
intent.setType("image/*");
|
|
||||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false);
|
|
||||||
startActivityForResult(intent, CHOOSE_IMG);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
||||||
if (requestCode == PERMISSION_REQUEST_CODE_IMG) {
|
|
||||||
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
openImageChooserActivity();
|
|
||||||
} else {
|
|
||||||
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE_IMG);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getUseData() {
|
|
||||||
LiveNetManager.get(mContext).getUserHomeInfo(uid, new HttpCallback<HomeUserInfoBean>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(HomeUserInfoBean data) {
|
|
||||||
initData(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
LiveNetManager.get(mContext).getUserExhibitInfoInfo(uid, new HttpCallback<HomeUserExhibitInfoBean>() {
|
|
||||||
@SuppressLint("SetTextI18n")
|
|
||||||
@Override
|
|
||||||
public void onSuccess(HomeUserExhibitInfoBean data) {
|
|
||||||
//主播粉丝团
|
|
||||||
if (data.getUserHomeTopInfo().getFans().getList() != null) {
|
|
||||||
if (data.getUserHomeTopInfo().getFans().getList().size() >= 3) {
|
|
||||||
for (int i = 0; i < 3; i++) {
|
|
||||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < data.getUserHomeTopInfo().getFans().getList().size(); i++) {
|
|
||||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getFans().getList().get(i).getAvatar(), fansImgViewList.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//主播守护团
|
|
||||||
if (data.getUserHomeTopInfo().getGuard() != null) {
|
|
||||||
if (data.getUserHomeTopInfo().getGuard().size() >= 3) {
|
|
||||||
for (int i = 0; i < 3; i++) {
|
|
||||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < data.getUserHomeTopInfo().getGuard().size(); i++) {
|
|
||||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getGuard().get(i).getAvatar(), guardImgViewList.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//礼物墙
|
|
||||||
if (data.getGiftAlreadyWall().getGift_wall() != null) {
|
|
||||||
if (data.getGiftAlreadyWall().getGift_wall().size() >= 3) {
|
|
||||||
for (int i = 0; i < 3; i++) {
|
|
||||||
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < data.getGiftAlreadyWall().getGift_wall().size(); i++) {
|
|
||||||
ImgLoader.display(mContext, data.getGiftAlreadyWall().getGift_wall().get(i).getGifticon(), giftImgViewList.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
giftCount.setText(data.getGiftAlreadyWall().getGift_wall().size() + "/36");
|
|
||||||
}
|
|
||||||
//荣誉墙
|
|
||||||
if (data.getUserHomeTopInfo().getDress() != null) {
|
|
||||||
if (data.getUserHomeTopInfo().getDress().size() >= 3) {
|
|
||||||
for (int i = 0; i < 3; i++) {
|
|
||||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (int i = 0; i < data.getUserHomeTopInfo().getDress().size(); i++) {
|
|
||||||
ImgLoader.display(mContext, data.getUserHomeTopInfo().getDress().get(i).getDisplay_src(), honorImgViewList.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(String error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
if (resultCode == RESULT_OK && requestCode == CHOOSE_IMG) {
|
|
||||||
// 获取用户选择的图片 URI
|
|
||||||
Uri[] imageUris = null;
|
|
||||||
if (data != null) {
|
|
||||||
imageUris = new Uri[]{data.getData()};
|
|
||||||
File file = new File(Objects.requireNonNull(FilesUtils.getPath(mContext, imageUris[0])));
|
|
||||||
uploadFile(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void uploadFile(File file) {
|
|
||||||
if (mUploadStrategy == null) {
|
|
||||||
mUploadStrategy = new UploadQnImpl(mContext);
|
|
||||||
}
|
|
||||||
List<UploadBean> uploadBeans = new ArrayList<>();
|
|
||||||
UploadBean upVideoBean = new UploadBean(file, UploadBean.IMG);
|
|
||||||
uploadBeans.add(upVideoBean);
|
|
||||||
mUploadStrategy.upload(uploadBeans, true, new UploadCallback() {
|
|
||||||
@Override
|
|
||||||
public void onFinish(List<UploadBean> list, boolean success) {
|
|
||||||
if (!success) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bannerImgList.add("https://downs.yaoulive.com/" + list.get(0).getRemoteAccessUrl());
|
|
||||||
uploadImg(true);
|
|
||||||
L.e(new Gson().toJson(list));
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void uploadImg(boolean isUp) {
|
|
||||||
CommonHttpUtil.uploadUserInfoImg(new Gson().toJson(bannerImgList), new com.yunbao.common.http.HttpCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
|
||||||
if (code == 0 && info != null) {
|
|
||||||
if (isUp) {
|
|
||||||
ToastUtil.show("上传成功");
|
|
||||||
} else {
|
|
||||||
ToastUtil.show("删除成功");
|
|
||||||
}
|
|
||||||
mBanner.setPages(bannerImgList, new UserHomeImgsViewHolder()).start();
|
|
||||||
tempList = new ArrayList<>();
|
|
||||||
for (int i = 0; i < bannerImgList.size(); i++) {
|
|
||||||
tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
|
|
||||||
}
|
|
||||||
if (tempList.size() > 0) {
|
|
||||||
tempList.get(0).setShow(true);
|
|
||||||
}
|
|
||||||
userHomeImgAdapter.setCommentBeanList(tempList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private File uri2File(Uri uri) {
|
|
||||||
String img_path;
|
|
||||||
String[] proj = {MediaStore.Images.Media.DATA};
|
|
||||||
Cursor actualimagecursor = this.managedQuery(uri, proj, null, null, null);
|
|
||||||
if (actualimagecursor == null) {
|
|
||||||
img_path = uri.getPath();
|
|
||||||
} else {
|
|
||||||
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
|
||||||
actualimagecursor.moveToFirst();
|
|
||||||
img_path = actualimagecursor.getString(actual_image_column_index);
|
|
||||||
}
|
|
||||||
File file = new File(img_path);
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.yunbao.common.activity;
|
||||||
|
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.VideoView;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
|
||||||
|
public class VideoPlayActivity extends AbsActivity {
|
||||||
|
private VideoView videoPlay;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_google_play;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
Uri url = getIntent().getParcelableExtra("videoUri");
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
videoPlay = findViewById(R.id.videoPlay);
|
||||||
|
videoPlay.setVideoURI(url);
|
||||||
|
videoPlay.start();
|
||||||
|
|
||||||
|
findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,6 +29,7 @@ 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;
|
||||||
@@ -100,7 +101,6 @@ 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,11 +136,17 @@ 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)");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -194,6 +200,8 @@ 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);
|
||||||
@@ -213,6 +221,9 @@ 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,15 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
report1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||||
|
onItemClickListener.onReport(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
replyTextView.setOnClickListener(new View.OnClickListener() {
|
replyTextView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -135,6 +144,7 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void setData(CommentBean bean) {
|
public void setData(CommentBean bean) {
|
||||||
del.setTag(bean);
|
del.setTag(bean);
|
||||||
|
del1.setTag(bean);
|
||||||
report.setTag(bean);
|
report.setTag(bean);
|
||||||
replyTextView.setTag(bean);
|
replyTextView.setTag(bean);
|
||||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||||
@@ -151,8 +161,9 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
del.setVisibility(View.GONE);
|
del.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if (bean.getReplyCommentList() != null) {
|
if (bean.getReplyCommentList() != null) {
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
replyCount.setText(String.format(mContext.getResources().getString(R.string.active_count), String.valueOf(bean.getReplyCommentList().size())));
|
||||||
if (bean.getReplyCommentList().size() > 0) {
|
if (bean.getReplyCommentList().size() > 0) {
|
||||||
|
report1.setTag(bean.getReplyCommentList().get(0));
|
||||||
del1.setTag(bean.getReplyCommentList().get(0));
|
del1.setTag(bean.getReplyCommentList().get(0));
|
||||||
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||||
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
ImgLoader.display(itemView.getContext(), bean.getReplyCommentList().get(0).getUser_avatar(), mAvatar01);
|
||||||
@@ -203,10 +214,11 @@ public class CommentAdapter extends RecyclerView.Adapter {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (!bean.isShow()) {
|
if (!bean.isShow()) {
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
recyclerView.setVisibility(View.VISIBLE);
|
||||||
replyCount.setText("收起");
|
replyCount.setText(mContext.getResources().getString(R.string.close));
|
||||||
} else {
|
} else {
|
||||||
recyclerView.setVisibility(View.GONE);
|
recyclerView.setVisibility(View.GONE);
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
replyCount.setText(String.format(mContext.getResources().getString(R.string.active_count), String.valueOf(bean.getReplyCommentList().size())))
|
||||||
|
;
|
||||||
}
|
}
|
||||||
bean.setShow(!bean.isShow());
|
bean.setShow(!bean.isShow());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
|||||||
this.onItemClickListener = onItemClickListener;
|
this.onItemClickListener = onItemClickListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CommentVideoAdapter(Context content, String authorId,CommentVideoAdapter.onItemClickListener onItemClickListener ) {
|
public CommentVideoAdapter(Context content, String authorId, CommentVideoAdapter.onItemClickListener onItemClickListener) {
|
||||||
super(content);
|
super(content);
|
||||||
this.onItemClickListener = onItemClickListener;
|
this.onItemClickListener = onItemClickListener;
|
||||||
this.mContext = content;
|
this.mContext = content;
|
||||||
@@ -94,6 +94,15 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
|||||||
author = itemView.findViewById(R.id.author);
|
author = itemView.findViewById(R.id.author);
|
||||||
del1 = itemView.findViewById(R.id.del1);
|
del1 = itemView.findViewById(R.id.del1);
|
||||||
report1 = itemView.findViewById(R.id.report1);
|
report1 = itemView.findViewById(R.id.report1);
|
||||||
|
report1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
CommentBean.ReplyComment bean = (CommentBean.ReplyComment) v.getTag();
|
||||||
|
onItemClickListener.onReport(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
report.setOnClickListener(new View.OnClickListener() {
|
report.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -135,9 +144,11 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
|||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void setData(CommentBean bean) {
|
public void setData(CommentBean bean) {
|
||||||
del.setTag(bean);
|
del.setTag(bean);
|
||||||
|
report1.setTag(bean);
|
||||||
report.setTag(bean);
|
report.setTag(bean);
|
||||||
replyTextView.setTag(bean);
|
replyTextView.setTag(bean);
|
||||||
ImgLoader.display(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
del1.setTag(bean);
|
||||||
|
ImgLoader.displayAvatar(itemView.getContext(), bean.getUser_avatar(), mAvatar);
|
||||||
name.setText(bean.getUser_name());
|
name.setText(bean.getUser_name());
|
||||||
content.setText(bean.getContent());
|
content.setText(bean.getContent());
|
||||||
if (bean.getUser_id().equals(authorId)) {
|
if (bean.getUser_id().equals(authorId)) {
|
||||||
@@ -151,7 +162,7 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
|||||||
del.setVisibility(View.GONE);
|
del.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if (bean.getReplyCommentList() != null) {
|
if (bean.getReplyCommentList() != null) {
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
replyCount.setText( String.format(mContext.getResources().getString(R.string.active_count), String.valueOf(bean.getReplyCommentList().size())));
|
||||||
if (bean.getReplyCommentList().size() > 0) {
|
if (bean.getReplyCommentList().size() > 0) {
|
||||||
del1.setTag(bean.getReplyCommentList().get(0));
|
del1.setTag(bean.getReplyCommentList().get(0));
|
||||||
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
replyContent.setText(bean.getReplyCommentList().get(0).getContent());
|
||||||
@@ -203,10 +214,10 @@ public class CommentVideoAdapter extends RefreshAdapter<CommentBean> {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (!bean.isShow()) {
|
if (!bean.isShow()) {
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
recyclerView.setVisibility(View.VISIBLE);
|
||||||
replyCount.setText("收起");
|
replyCount.setText(mContext.getResources().getString(R.string.close));
|
||||||
} else {
|
} else {
|
||||||
recyclerView.setVisibility(View.GONE);
|
recyclerView.setVisibility(View.GONE);
|
||||||
replyCount.setText("共" + bean.getReplyCommentList().size() + "条回复>");
|
replyCount.setText( String.format(mContext.getResources().getString(R.string.active_count), String.valueOf(bean.getReplyCommentList().size())));
|
||||||
}
|
}
|
||||||
bean.setShow(!bean.isShow());
|
bean.setShow(!bean.isShow());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
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.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
public class DebugDialogAdapter extends RecyclerView.Adapter<DebugDialogAdapter.DebugViewHolder> {
|
||||||
|
HashMap<String, View> paramMap = new HashMap<>();
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public DebugDialogAdapter(Context mContext) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParamMap(HashMap<String, View> paramMap) {
|
||||||
|
Log.i("debug弹窗", "setParamMap: 添加值到view " + paramMap.size());
|
||||||
|
this.paramMap = paramMap;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public DebugViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
Log.i("debug弹窗", "onCreateViewHolder: 创建适配器");
|
||||||
|
return new DebugViewHolder(new LinearLayout(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 msg, View view) {
|
||||||
|
Log.i("debug弹窗", "setData: 添加值到view " + view + "|" + msg + "|" + ((LinearLayout) itemView).indexOfChild(view));
|
||||||
|
if (view instanceof TextView && StringUtil.isEmpty(((TextView) view).getText().toString())) {
|
||||||
|
((TextView) view).setText(msg);
|
||||||
|
}
|
||||||
|
int indexOfChild = ((LinearLayout) itemView).indexOfChild(view);
|
||||||
|
if (indexOfChild != -1) {
|
||||||
|
if (((LinearLayout) itemView).getChildAt(indexOfChild) instanceof TextView) {
|
||||||
|
((TextView) ((LinearLayout) itemView).getChildAt(indexOfChild)).setText(msg);
|
||||||
|
} else {
|
||||||
|
((LinearLayout) itemView).removeViewAt(indexOfChild);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (view.getParent() != null) {
|
||||||
|
((ViewGroup) view.getParent()).removeView(view);
|
||||||
|
}
|
||||||
|
((LinearLayout) itemView).addView(view);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.util.SparseArray;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.sendMoneyLongListModel;
|
||||||
|
import com.yunbao.common.views.DragonSendMoneyListViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DragonSendMoneyListAdapter extends RecyclerView.Adapter {
|
||||||
|
RecyclerView send_money_list;
|
||||||
|
boolean isAnchor;
|
||||||
|
SparseArray<CountDownTimer> countDownMap;
|
||||||
|
boolean isAttention;
|
||||||
|
|
||||||
|
public DragonSendMoneyListAdapter setAnchor(boolean anchor) {
|
||||||
|
isAnchor = anchor;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragonSendMoneyListAdapter setAttention(boolean attention) {
|
||||||
|
isAttention = attention;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<sendMoneyLongListModel> getMoneyLongListModels() {
|
||||||
|
return moneyLongListModels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DragonSendMoneyListAdapter(RecyclerView send_money_list) {
|
||||||
|
this.send_money_list = send_money_list;
|
||||||
|
countDownMap = new SparseArray<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<sendMoneyLongListModel> moneyLongListModels = new ArrayList<>();
|
||||||
|
DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack;
|
||||||
|
|
||||||
|
public void setCallBack(DragonSendMoneyListViewHolder.DragonSendMoneyListClicksCallBack callBack) {
|
||||||
|
this.callBack = callBack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoneyLongListModels(List<sendMoneyLongListModel> models) {
|
||||||
|
|
||||||
|
moneyLongListModels.clear();
|
||||||
|
moneyLongListModels.addAll(models);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
|
||||||
|
View goodGiftsView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_dragon_send_money_list, parent, false);
|
||||||
|
|
||||||
|
return new DragonSendMoneyListViewHolder(goodGiftsView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
DragonSendMoneyListViewHolder sendMoneyListViewHolder = (DragonSendMoneyListViewHolder) holder;
|
||||||
|
// sendMoneyLongListModel model = moneyLongListModels.get(position);
|
||||||
|
// long mPkTimeCount2 = Long.parseLong(model.getCountdown());
|
||||||
|
// long time = mPkTimeCount2 * 1000;
|
||||||
|
// if (sendMoneyListViewHolder.countDownTimer != null) {
|
||||||
|
// sendMoneyListViewHolder.countDownTimer.cancel();
|
||||||
|
// }
|
||||||
|
// if (time > 0) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
sendMoneyListViewHolder.setData(moneyLongListModels.get(position), callBack, isAnchor,isAttention);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return moneyLongListModels.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
return super.getItemViewType(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,10 +18,14 @@ 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;
|
||||||
@@ -46,7 +50,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(child));
|
.setDisMiss(true).setInteractionID(activityID).setInteraction(true).setChild(srcChild));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -61,6 +65,7 @@ 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));
|
||||||
@@ -68,6 +73,7 @@ public class InteractionGamesAdapter extends RecyclerView.Adapter {
|
|||||||
} else {
|
} else {
|
||||||
child.addAll(mChild);
|
child.addAll(mChild);
|
||||||
}
|
}
|
||||||
|
srcChild.addAll(mChild);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class LabelTagAdapter extends BaseTagAdapter<String, TextView> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void convert(TextView textView, String item, int position) {
|
protected void convert(TextView textView, String item, int position) {
|
||||||
textView.setText(item);
|
textView.setText("#"+item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnSureOnClickListener {
|
public interface OnSureOnClickListener {
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.views.LiveBuyGuardPrivilegeViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveBuyGuardPrivilegeAdapter extends RecyclerView.Adapter {
|
||||||
|
List<String> guardPrivilege = new ArrayList<>();
|
||||||
|
|
||||||
|
public void setGuardPrivilege(List<String> privilege) {
|
||||||
|
guardPrivilege.clear();
|
||||||
|
guardPrivilege.addAll(privilege);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveBuyGuardPrivilegeAdapter(List<String> guardPrivilege) {
|
||||||
|
this.guardPrivilege = guardPrivilege;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_buy_guard_privilege_item, parent, false);
|
||||||
|
return new LiveBuyGuardPrivilegeViewHolder(herdView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
LiveBuyGuardPrivilegeViewHolder buyGuardSelectViewHolder = (LiveBuyGuardPrivilegeViewHolder) holder;
|
||||||
|
buyGuardSelectViewHolder.setData(guardPrivilege.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return guardPrivilege.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.yunbao.common.adapter;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.yunbao.common.R;
|
||||||
|
import com.yunbao.common.bean.GuardPriceModel;
|
||||||
|
import com.yunbao.common.views.LiveBuyGuardSelectViewHolder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LiveBuyGuardSelectAdapter extends RecyclerView.Adapter {
|
||||||
|
List<GuardPriceModel> price = new ArrayList<>();
|
||||||
|
GuardPriceModel model;
|
||||||
|
|
||||||
|
public LiveBuyGuardSelectAdapter(List<GuardPriceModel> price, GuardPriceModel mModel) {
|
||||||
|
this.price = price;
|
||||||
|
model = mModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_buy_guard_slelect_item, parent, false);
|
||||||
|
return new LiveBuyGuardSelectViewHolder(herdView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
|
LiveBuyGuardSelectViewHolder buyGuardSelectViewHolder = (LiveBuyGuardSelectViewHolder) holder;
|
||||||
|
buyGuardSelectViewHolder.setData(price.get(position), liveBuyGuardSelectClickListener,model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return price.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener;
|
||||||
|
|
||||||
|
public LiveBuyGuardSelectAdapter setLiveBuyGuardSelectClickListener(LiveBuyGuardSelectViewHolder.LiveBuyGuardSelectClickListener liveBuyGuardSelectClickListener) {
|
||||||
|
this.liveBuyGuardSelectClickListener = liveBuyGuardSelectClickListener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -67,13 +67,14 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public class SudTitleSelectAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.makeramen.roundedimageview.RoundedImageView;
|
import com.makeramen.roundedimageview.RoundedImageView;
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.bean.ActiveBean;
|
||||||
import com.yunbao.common.bean.ActiveOtherBean;
|
import com.yunbao.common.bean.ActiveOtherBean;
|
||||||
import com.yunbao.common.dialog.ImagePreviewDialog;
|
import com.yunbao.common.dialog.ImagePreviewDialog;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
@@ -27,17 +28,19 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class UserCommunityAdapter extends RecyclerView.Adapter {
|
public class UserCommunityAdapter extends RecyclerView.Adapter {
|
||||||
private List<ActiveOtherBean> commentBeanList;
|
private List<ActiveBean> commentBeanList;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private onItemClickListener onItemClickListener;
|
private onItemClickListener onItemClickListener;
|
||||||
|
private boolean isMe;
|
||||||
|
|
||||||
public void setOnItemClickListener(UserCommunityAdapter.onItemClickListener onItemClickListener) {
|
public void setOnItemClickListener(UserCommunityAdapter.onItemClickListener onItemClickListener) {
|
||||||
this.onItemClickListener = onItemClickListener;
|
this.onItemClickListener = onItemClickListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserCommunityAdapter(Context content, List<ActiveOtherBean> commentBeanList) {
|
public UserCommunityAdapter(Context content, List<ActiveBean> commentBeanList, boolean isMe) {
|
||||||
this.mContext = content;
|
this.mContext = content;
|
||||||
this.commentBeanList = commentBeanList;
|
this.commentBeanList = commentBeanList;
|
||||||
|
this.isMe = isMe;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -69,6 +72,7 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
private TextView likeCount;
|
private TextView likeCount;
|
||||||
private TextView comCount;
|
private TextView comCount;
|
||||||
private TextView shareCount;
|
private TextView shareCount;
|
||||||
|
private ImageView more_del;
|
||||||
|
|
||||||
public CommentViewHolder(@NonNull View itemView) {
|
public CommentViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
@@ -82,19 +86,40 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
likeCount = itemView.findViewById(R.id.likeCount);
|
likeCount = itemView.findViewById(R.id.likeCount);
|
||||||
comCount = itemView.findViewById(R.id.comCount);
|
comCount = itemView.findViewById(R.id.comCount);
|
||||||
shareCount = itemView.findViewById(R.id.shareCount);
|
shareCount = itemView.findViewById(R.id.shareCount);
|
||||||
|
more_del = itemView.findViewById(R.id.more_del);
|
||||||
|
more_del.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemMore((ActiveBean) v.getTag(), getPosition());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
itemView.setOnClickListener(new View.OnClickListener() {
|
itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
onItemClickListener.onImgItem((ActiveOtherBean) v.getTag(), getPosition());
|
if (onItemClickListener != null) {
|
||||||
|
ActiveBean activeOtherBean = (ActiveBean) v.getTag();
|
||||||
|
if (activeOtherBean.getImg_or_video().equals("1")) {
|
||||||
|
onItemClickListener.onImgItem(activeOtherBean, getPosition());
|
||||||
|
} else {
|
||||||
|
onItemClickListener.onItemVideo(activeOtherBean, getPosition());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public void setData(ActiveOtherBean bean) {
|
public void setData(ActiveBean bean) {
|
||||||
itemView.setTag(bean);
|
itemView.setTag(bean);
|
||||||
mAvatar.setTag(bean);
|
mAvatar.setTag(bean);
|
||||||
|
more_del.setTag(bean);
|
||||||
|
if (isMe) {
|
||||||
|
more_del.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
more_del.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
ImgLoader.display(mContext, bean.getUser_avatar(), mAvatar);
|
||||||
userName.setText(bean.getUser_name());
|
userName.setText(bean.getUser_name());
|
||||||
time.setText(bean.getCreate_time());
|
time.setText(bean.getCreate_time());
|
||||||
@@ -144,8 +169,10 @@ public class UserCommunityAdapter extends RecyclerView.Adapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface onItemClickListener {
|
public interface onItemClickListener {
|
||||||
void onImgItem(ActiveOtherBean activeBean, int position);
|
void onImgItem(ActiveBean activeBean, int position);
|
||||||
|
|
||||||
void onVideoItem(String activeBean, int position);
|
void onItemMore(ActiveBean activeBean, int position);
|
||||||
|
|
||||||
|
void onItemVideo(ActiveBean activeBean, int position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
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消息
|
||||||
@@ -21,6 +24,9 @@ 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;
|
||||||
@@ -35,7 +41,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) {
|
||||||
@@ -43,6 +49,15 @@ 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;
|
||||||
}
|
}
|
||||||
@@ -62,6 +77,9 @@ public class AiAutomaticSpeechModel extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIcon() {
|
public String getIcon() {
|
||||||
|
if (!WordUtil.isNewZh() && !StringUtil.isEmpty(iconEn)) {
|
||||||
|
return iconEn;
|
||||||
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user