Commit 4065410c authored by jyx's avatar jyx

删除无用代码

parent 59c8427b
......@@ -58,6 +58,7 @@
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:screenOrientation="portrait"
android:supportsRtl="true"
android:theme="@style/CustomAppTheme"
android:usesCleartextTraffic="true"
......@@ -111,22 +112,8 @@
android:name="JPUSH_CHANNEL"
android:value="${JPUSH_CHANNEL}" />
<!-- <activity-->
<!-- android:configChanges="keyboard|orientation|screenSize"-->
<!-- android:windowSoftInputMode="adjustPan|stateHidden"-->
<!-- android:theme="@style/Theme.ActivitySplash"-->
<!-- android:name=".ui.activitys.SplashYlhActivity"-->
<!-- android:screenOrientation="portrait">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
<activity
android:name="com.wenshu.youyou.ui.activitys.SplashYlhActivity"
android:screenOrientation="portrait"
android:theme="@style/NormalSplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -138,99 +125,45 @@
android:name="com.wenshu.youyou.ui.activitys.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoneTranslucent" />
<activity
android:name=".ui.activitys.SplashCsjADActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.activitys.SplashCsjADActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.WebActivity" />
<activity
android:name="com.wenshu.library.base.BaseWebActivity"
android:theme="@style/AppTheme.NoneTranslucent" />
<activity
android:name="com.wenshu.youyou.ui.activitys.BindMobileActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.MobileLoginActivity"
android:screenOrientation="portrait" />
<activity android:name="com.wenshu.youyou.ui.activitys.BindMobileActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.MobileLoginActivity" />
<activity
android:name="com.wenshu.youyou.ui.activitys.WxLoginActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:launchMode="singleTop" />
<activity
android:name="com.wenshu.youyou.ui.activitys.AwardActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.SettingsActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.AboutusActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.GuideActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.DrawcashActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.WaterActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.WalkActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.FoodSubsidyActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.EraseActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.DrawcashRecordActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.CoinRecordActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.SplashADActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.MorningClockActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.FriendsActivity"
android:screenOrientation="portrait" />
<activity android:name="com.wenshu.youyou.ui.activitys.AwardActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.SettingsActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.AboutusActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.GuideActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.DrawcashActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.WaterActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.WalkActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.FoodSubsidyActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.EraseActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.DrawcashRecordActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.CoinRecordActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.SplashADActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.MorningClockActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.FriendsActivity" />
<activity
android:name="com.wenshu.youyou.ui.activitys.FeedbackActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible" />
<activity
android:name="com.wenshu.youyou.ui.activitys.AccountMergeActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.WrapperActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.DhGameActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.XmlyAwardActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.XmlyPlayActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.ui.activitys.TaskCpdActivity"
android:screenOrientation="portrait" />
<activity android:name="com.wenshu.youyou.ui.activitys.AccountMergeActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.WrapperActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.XmlyAwardActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.XmlyPlayActivity" />
<activity android:name="com.wenshu.youyou.ui.activitys.TaskCpdActivity" />
<activity
android:name="com.wenshu.youyou.ui.activitys.KylVideoActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.call.permission.PermissionActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.wenshu.youyou.call.detail.DetailApplyActivity"
android:screenOrientation="portrait" />
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity android:name="com.wenshu.youyou.call.permission.PermissionActivity" />
<activity android:name="com.wenshu.youyou.call.detail.DetailApplyActivity" />
<service
android:name="com.wenshu.youyou.service.UpdateService"
......@@ -301,17 +234,6 @@
tools:replace="android:resource" />
</provider>
<!-- 鱼丸盒子广告 -->
<!-- <provider-->
<!-- android:name="com.component.dly.xzzq_ywsdk.YwFileProvider"-->
<!-- android:authorities="${applicationId}.YwFileProvider"-->
<!-- android:exported="false"-->
<!-- android:grantUriPermissions="true">-->
<!-- <meta-data-->
<!-- android:name="android.support.FILE_PROVIDER_PATHS"-->
<!-- android:resource="@xml/ywsdk_file_paths" />-->
<!-- </provider>-->
<!-- 穿山甲广告 -->
<provider
android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
......@@ -329,7 +251,6 @@
tools:replace="android:resource" />
</provider>
<!-- 广点通广告 -->
<uses-library
android:name="org.apache.http.legacy"
......@@ -362,7 +283,6 @@
android:resource="@xml/wn_file_paths" />
</provider>
<!-- 来电秀 -->
<service
android:name="com.wenshu.youyou.call.service.PhoneListenService"
......
......@@ -16,6 +16,7 @@ import com.wenshu.youyou.manager.MhManager;
import com.wenshu.youyou.manager.MiitHelper;
import com.wenshu.youyou.manager.RsNewsManager;
import com.wenshu.youyou.manager.TtCsjAdManager;
import com.wenshu.youyou.manager.TzManager;
import com.wenshu.youyou.manager.WnManager;
import com.wenshu.youyou.manager.YlVideoManager;
import com.wenshu.youyou.manager.YlhAdManager;
......@@ -125,7 +126,7 @@ public class WenshuApplication extends MultiDexApplication {
MhManager.INSTANCE.initWn(this);
// 天卓珊瑚
// TzManager.INSTANCE.initTz(this);
TzManager.INSTANCE.initTz(this);
// 一览视频
YlVideoManager.INSTANCE.init(this);
......@@ -181,7 +182,7 @@ public class WenshuApplication extends MultiDexApplication {
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
}
private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
private final MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
/**
* 移动安装联盟 获取OAID等设备标识符
......
......@@ -104,7 +104,7 @@ public class TTPreLoadCarrierExpressManager {
* 预加载 信息流
*/
public void loadTtFrameLayout(String codeId) {
// init();
init();
// ToastUtil.showLong(WenshuApplication.getContext(), "通用信息流:" + codeId);
......
......@@ -74,12 +74,12 @@ public class VideoAdingManager {
*/
private void init(Activity activity) {
this.activity = activity;
// csjVideoAdManager = CsjVideoAdManager.getInstance(activity);
// ylhVideoAdManager = YlhVideoAdManager.getInstance();
// wnVideoAdManager = WnVideoAdManager.Companion.getInstance();
// shVideoAdManager = ShVideoAdManager.Companion.getInstance(activity);
// csjFullVideoAdManager = CsjFullVideoAdManager.getInstance(activity);
// ksVideoAdManager = KsVideoAdManager.Companion.getInstance();
csjVideoAdManager = CsjVideoAdManager.getInstance(activity);
ylhVideoAdManager = YlhVideoAdManager.getInstance();
wnVideoAdManager = WnVideoAdManager.Companion.getInstance();
shVideoAdManager = ShVideoAdManager.Companion.getInstance(activity);
csjFullVideoAdManager = CsjFullVideoAdManager.getInstance(activity);
ksVideoAdManager = KsVideoAdManager.Companion.getInstance();
weightList = new ArrayList<>();
}
......
......@@ -2,7 +2,6 @@ package com.wenshu.youyou.manager;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.library.net.neterror.HttpResponseFunc;
import com.wenshu.youyou.mvp.model.BaseResponse;
import rx.Observable;
import rx.Scheduler;
......@@ -64,17 +63,12 @@ public class AppHttpManager {
* @param <T>
* @return
*/
public <T> Observable.Transformer<BaseResponse<T>, T> handleErrTransformer() {
public <T> Observable.Transformer handleErrTransformer() {
if (exceptTransformer != null) {
return exceptTransformer;
} else {
return exceptTransformer = new Observable.Transformer() {
@Override
public Object call(Object observable) {
return ((Observable) observable)/*.map(new HandleFuc<T>())*/.onErrorResumeNext(new HttpResponseFunc<T>());
}
};
return exceptTransformer = observable -> ((Observable) observable)/*.map(new HandleFuc<T>())*/.onErrorResumeNext(new HttpResponseFunc<T>());
}
}
......
......@@ -23,10 +23,11 @@ object AppTryPlayManager {
fun getTryPlayIsOK(pkg: String, useTime: Int): Boolean {
val timePkgUsed = AppUtil.getTimePkgUsed(WenshuApplication.getContext(), pkg)
LogUtil.d("AppTryPlayManager -> " + timePkgUsed)
LogUtil.d("AppTryPlayManager -> $timePkgUsed")
return timePkgUsed >= useTime
}
// TODO 待优化
private var cdaa: CustomDialogAsApple? = null
/**
......
//package com.wenshu.youyou.manager
//
//import android.app.Activity
//import android.app.Application
//import android.view.ViewGroup
//import com.dhcw.sdk.BDAdvanceButtonAd
//import com.dhcw.sdk.BDAdvanceButtonListener
//import com.dhcw.sdk.BDAppNativeOnClickListener
//import com.dhcw.sdk.manager.BDAdvanceConfig
//import com.dhcw.sdk.manager.BDManager
//import com.wenshu.youyou.BuildConfig
//import com.wenshu.youyou.WenshuApplication
//import com.wenshu.youyou.common.Constant
//
///**
// * 描述:变现猫
// * 作者:孟崔广
// */
//object BxmManager {
//
// private const val APP_ID = ""
// private const val BUTTON_AD_SPOT_ID = ""
//
// private var bdAdvanceButtonAd: BDAdvanceButtonAd? = null
//
// /**
// * 初始化
// */
// fun initBxm(application: Application) {
// BDAdvanceConfig.getInstance()
// .setAppName(Constant.wenshu_APP_NAME)
// .setDebug(BuildConfig.DEBUG)
// .enableAudit(false)
//
// BDManager.getStance()
// .init(application, APP_ID)
// }
//
// /**
// * 获取Button广告
// */
// fun loadButtonAd(activity: Activity?, viewGroup: ViewGroup) {
// if (activity == null) return
//
// try {
// if (bdAdvanceButtonAd != null) {
// bdAdvanceButtonAd!!.setBdAdvanceButtonListener(null)
// bdAdvanceButtonAd!!.setBdAppNativeOnClickListener(null)
// bdAdvanceButtonAd = null
// }
// bdAdvanceButtonAd = BDAdvanceButtonAd(activity, viewGroup, BUTTON_AD_SPOT_ID)
// bdAdvanceButtonAd?.setBdAdvanceButtonListener(object : BDAdvanceButtonListener {
// override fun onActivityClosed() {
//// Toast.makeText(activity, "活动页关闭 ", Toast.LENGTH_LONG).show()
// }
//
// override fun onAdShow() {
//// Toast.makeText(activity, "广告展示 ", Toast.LENGTH_LONG).show()
// }
//
// override fun onAdFailed() {
//// Toast.makeText(activity, "广告加载失败 ", Toast.LENGTH_LONG).show()
// }
//
// override fun onAdClicked() {
//// Toast.makeText(activity, "广告点击 ", Toast.LENGTH_LONG).show()
// }
// })
// bdAdvanceButtonAd?.setBdAppNativeOnClickListener(object : BDAppNativeOnClickListener {
// override fun onActivityClosed() {
//// Toast.makeText(activity, "float onActivityClosed ", Toast.LENGTH_SHORT).show()
// }
//
// override fun onClick(type: Int, adid: String) {
//// Toast.makeText(activity, "float onClick:$type", Toast.LENGTH_SHORT).show()
// //type=1 加载视频 type=2 播放视频
// if (type == 1) {
// //bdAdvanceFloatIconAd 绑定激励视频回调
// BxmPlayVideo.getInstance().load(bdAdvanceButtonAd)
// } else if (type == 2) {
// BxmPlayVideo.getInstance().play(activity)
// }
// }
// })
// bdAdvanceButtonAd?.loadAd()
// } catch (e: Exception) {
// e.printStackTrace()
// }
// }
//
// /**
// * 登录后绑定用户信息
// */
// fun bindUserData() {
// try {
// BDManager.getStance().bindUserData(WenshuApplication.getContext(), APP_ID, "cuid=${UserManager.getInstance().userID}")
// } catch (e: Exception) {
// e.printStackTrace()
// }
// }
//
// fun onDestory() {
// bdAdvanceButtonAd = null
// }
//}
\ No newline at end of file
//package com.wenshu.youyou.manager;
//
//import android.app.Activity;
//
//import com.bytedance.sdk.openadsdk.AdSlot;
//import com.bytedance.sdk.openadsdk.TTAdConstant;
//import com.bytedance.sdk.openadsdk.TTAdNative;
//import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
//import com.dhcw.sdk.BDAdvanceBaseAppNative;
//
//public class BxmPlayVideo {
// static BxmPlayVideo instance = new BxmPlayVideo();
//
// public static BxmPlayVideo getInstance() {
// return instance;
// }
//
// //一、加载穿山甲激励视频
// //BDAdvanceBaseAppNative 绑定激励视频回调
// public void load(final BDAdvanceBaseAppNative appNative) {
// try {
// TTNativeExpressManager ttNativeExpressManager = null;
// TTAdNative adNative = null;
// if (ttNativeExpressManager == null) {
// ttNativeExpressManager = new TTNativeExpressManager();
// adNative = ttNativeExpressManager.initTTAd(false);
// }
//
// //模版渲染请求AdSlot
// AdSlot adSlot = new AdSlot.Builder()
// .setCodeId(TtCsjAdManager.TT_AD_VEDIO_BIANXIANMAO)
// .setSupportDeepLink(true)
// .setAdCount(1)
// .setExpressViewAcceptedSize(500, 500)//个性化模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可。仅模板广告需要设置此参数
// .setImageAcceptedSize(1080, 1920)
// .setOrientation(TTAdConstant.VERTICAL)
// .setMediaExtra("media_extra")
// .setUserID(UserManager.getInstance().getUserID())
// .build();
//
// //加载激励视频广告
// adNative.loadRewardVideoAd(adSlot, new TTAdNative.RewardVideoAdListener() {
// @Override
// public void onError(int i, String s) {
// appNative.onError(i);
// }
//
// @Override
// public void onRewardVideoAdLoad(TTRewardVideoAd ttRewardVideoAd) {
// if (ttRewardVideoAd == null) {
// appNative.onError(0);
// } else {
// bindRewardListener(ttRewardVideoAd, appNative);
// appNative.onADLoad();
// }
// }
//
// @Override
// public void onRewardVideoCached() {
//
// }
// });
// } catch (Throwable e) {
// appNative.onError(0);
// }
// }
//
//
// //二、绑定穿山甲激励视频回调
// //BDAdvanceBaseAppNative 绑定激励视频回调
// TTRewardVideoAd mttRewardVideoAd;
//
// private void bindRewardListener(TTRewardVideoAd ttRewardVideoAd, final BDAdvanceBaseAppNative appNative) {
// mttRewardVideoAd = ttRewardVideoAd;
// mttRewardVideoAd.setRewardAdInteractionListener(new TTRewardVideoAd.RewardAdInteractionListener() {
// @Override
// public void onAdShow() {
// appNative.onADShow();
// }
//
// @Override
// public void onAdVideoBarClick() {
// appNative.onADClick();
// }
//
// @Override
// public void onAdClose() {
// appNative.onADClose();
// }
//
// @Override
// public void onVideoComplete() {
// appNative.onVideoComplete();
// }
//
// @Override
// public void onVideoError() {
// appNative.onError(0);
// }
//
// @Override
// public void onRewardVerify(boolean b, int i, String s, int i1, String s1) {
// appNative.onReward();
// }
//
// @Override
// public void onSkippedVideo() {
// appNative.onSkipped();
// }
// });
//
// }
//
// //三、播放穿山甲激励视频
// public void play(Activity activity) {
// if (mttRewardVideoAd != null) {
// mttRewardVideoAd.showRewardVideoAd(activity);
// }
// }
//}
//package com.wenshu.youyou.manager
//
//import android.app.Activity
//import android.text.TextUtils
//import com.fly.scenemodule.SceneUtil
//import com.fly.scenemodule.model.GDTInfo
//import com.fly.scenemodule.model.TTInfo
//import com.wenshu.youyou.WenshuApplication
//import com.wenshu.youyou.common.AppConfig
//
///**
// * 描述:聚乐云SDK
// */
//object SceneManager {
//
// const val SCENE_CHANNEL_Id = ""
//
// /**
// * 初始化
// */
// fun initScene() {
// val userId = UserManager.getInstance().userID
//
// // 初始化聚乐云
// SceneUtil.initSdk(SCENE_CHANNEL_Id, userId, WenshuApplication.OAID)
//
// //穿山甲-------
// val ttInfo = TTInfo()
// ttInfo.csJ_Appid = TtCsjAdManager.TT_AD_APPID
// ttInfo.csJ_VideoId = TtCsjAdManager.TT_AD_VEDIO_JULEYUN
// ttInfo.csJ_BannerId = TtCsjAdManager.TT_AD_BANNER_JULEYUN
// ttInfo.csJ_InteractionId = TtCsjAdManager.TT_AD_INSERT_LOADING_ID_JULEYUN
// SceneUtil.initCSJConfig(ttInfo)
//
// //广点通-------
// val gdtInfo = GDTInfo()
// gdtInfo.gdT_Appid = YlhAdManager.YLH_AD_APPID
//// gdtInfo.gdT_VideoId = YlhAdManager.YLH_AD_VEDIO_JULEYUN_POSTID
// gdtInfo.gdT_ExpressId = YlhAdManager.YLH_AD_NATIVEEXPRESS_JULEYUN
// gdtInfo.GDT_InteractionId = YlhAdManager.YLH_AD_INTERSTITIALAD_JULEYUN
// SceneUtil.initGDTConfig(gdtInfo)
// }
//
// /**
// * 账号同步
// */
// fun signIn(activity: Activity) {
// if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
// SceneUtil.signIn(activity, SCENE_CHANNEL_Id, UserManager.getInstance().userID, WenshuApplication.OAID)
// AppConfig.scene_flag = true
// }
// }
//}
\ No newline at end of file
......@@ -69,7 +69,6 @@ public class TTNativeExpressManager {
private void getTtNativeExpress(String codeId, FrameLayout view, float viewWidth, float viewHeight) {
// ToastUtil.showLong(WenshuApplication.getContext(), "奖励信息流:" + codeId);
// Context context= WenshuApplication.getContext();
//step4:创建广告请求参数AdSlot,具体参数含义参考文档
AdSlot adSlot = new AdSlot.Builder()
.setCodeId(codeId) //广告位id
......@@ -154,7 +153,7 @@ public class TTNativeExpressManager {
});
//dislike设置
if (ad.getInteractionType() != TTAdConstant.INTERACTION_TYPE_DOWNLOAD) {
return;
// TODO 暂时不加
}
}
}
......@@ -20,12 +20,12 @@ public class TtCsjAdManager {
public static final String TT_AD_APPID = "5155496";
public static final String TT_AD_NAME = Constant.Wenshu_APP_NAME;
/*banner*/
public static String TT_AD_BANNER_MY = "945968536";// 个人中心
/*开屏*/
public static String TT_AD_SPLASH_POSTID = "887454728";// 开屏
/*banner*/
public static String TT_AD_BANNER_MY = "945968536";// 个人中心
/*激励视频*/
public static String TT_AD_VEDIO_MAIN_DEV = "945974847";// 开发使用
public static String TT_AD_VEDIO_DRINK = "945968497";//喝水打卡
......
......@@ -6,32 +6,42 @@ import com.wenshu.library.utils.CommonUtils
import com.tz.sdk.core.engine.ADEngine
import com.tz.sdk.core.engine.ADEngineConfig
import com.tz.sdk.core.engine.IADEngineState
import com.wenshu.youyou.utils.LogUtil
/**
* 描述:天卓珊瑚激励视频
*/
object TzManager {
const val APP_KEY = ""
const val APP_SECRET = ""
const val APP_KEY = "8aac19578f57b6d96f05eeedce75b99f"
const val APP_SECRET = "d54da9aa7a4de6b2688c58eac85b5761"
/**
* 初始化
*/
fun initTz(application: Application) {
ADEngine.getInstance(application)
.start(ADEngineConfig.Builder(application)
.appKey(APP_KEY)
.appSecret(APP_SECRET)
.appChannel(CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME"))
.forTest(false)
.build(),
object : IADEngineState {
override fun onIdle() {}
override fun onStarting() {}
override fun onStarted() {}
override fun onFailed(p0: Int, p1: String?) {}
})
.start(ADEngineConfig.Builder(application)
.appKey(APP_KEY)
.appSecret(APP_SECRET)
.appChannel(
CommonUtils.getAppMetaData(
WenshuApplication.getContext(),
"CHANNEL_NAME"
)
)
.forTest(false)
.log(true)
.verbose(true)
.build(),
object : IADEngineState {
override fun onIdle() {}
override fun onStarting() {}
override fun onStarted() {}
override fun onFailed(p0: Int, p1: String?) {
LogUtil.d(p1)
}
})
}
}
\ No newline at end of file
//package com.wenshu.youyou.manager
//
//import android.app.Application
//import com.ireader.ireadersdk.IreaderApi
//import java.lang.Exception
//
///**
// * 描述:掌阅书城
// * 作者:孟崔广
// */
//object ZhangyueManager {
//
// private const val APPID = ""
//
// fun onCreateIreader(application: Application) {
// try {
// IreaderApi.attachBaseContext(application)
// IreaderApi.onCreate(application, APPID)
// } catch (e: Exception) {
// e.printStackTrace()
// }
// }
//}
\ No newline at end of file
......@@ -66,7 +66,7 @@ class BindMobileActivity : BaseActivity(), LoginView, View.OnClickListener {
return
}
var code = etLoginCode.getText().toString().trim()
val code = etLoginCode.getText().toString().trim()
if (code.length < 4) {
showToast("请输入验证码")
return
......@@ -130,17 +130,17 @@ class BindMobileActivity : BaseActivity(), LoginView, View.OnClickListener {
fun sendCodeThread() {
num = 60
tvLoginSendcode?.let {
it.setEnabled(false)
it.setText("($num)重新获取")
it.isEnabled = false
it.text = "($num)重新获取"
run = object : Runnable {
override fun run() {
num--
if (num == 0) {
it.setText("重新获取")
it.setEnabled(true)
it.text = "重新获取"
it.isEnabled = true
} else {
it.setText("($num)重新获取")
it.text = "($num)重新获取"
it.postDelayed(this, 1000)
}
}
......
package com.wenshu.youyou.ui.activitys
import android.annotation.SuppressLint
import android.content.Intent
import android.content.pm.ApplicationInfo
import android.net.Uri
import android.os.Build
import android.view.View
import android.view.ViewGroup
import android.webkit.WebSettings
import android.webkit.WebViewClient
import com.wenshu.youyou.R
import com.wenshu.youyou.manager.UserManager
import com.wenshu.youyou.ui.activitys.base.BaseActivity
import com.wenshu.youyou.utils.MD5
import com.wenshu.youyou.utils.URIEncoder
import kotlinx.android.synthetic.main.fragment_main_dh.*
import kotlinx.android.synthetic.main.header_layout.*
class DhGameActivity : BaseActivity(), View.OnClickListener {
companion object {
const val CHANNEL = "14533"
const val KEY = "4932d9037fd94f6ba24fa09605203cd6"
const val AUTH_URL = "http://www.shandw.com/auth/"
}
override fun getContentViewLayoutID() = R.layout.fragment_main_dh
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
tv_title.text = "游戏大厅"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
loadH5Game()
initListener()
}
override fun onPause() {
super.onPause()
loadH5Game()
}
override fun onDestroy() {
super.onDestroy()
dh_webview?.let {
it.destroyDrawingCache()
val parent = it.getParent() as ViewGroup
parent.removeView(it)
it.removeAllViews()
it.destroy()
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
}
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
}
/**
* 加载H5Game
*/
@SuppressLint("SetJavaScriptEnabled")
private fun loadH5Game() {
dh_webview?.let {
val loadUrl = getLoadUrl()
val settings = it.settings
// 本地 DOM 存储(解决加载某些网页出现白板现象)
settings.domStorageEnabled = true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// 解决 Android 5.0 上 WebView 默认不允许加载 Http 与 Https 混合内容
settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
}
settings.javaScriptEnabled = true
settings.javaScriptCanOpenWindowsAutomatically = true
it.setWebViewClient(object : WebViewClient() {
override fun shouldOverrideUrlLoading(
view: android.webkit.WebView,
url: String
): Boolean {
if (url.startsWith("weixin://wap/pay?") || url.startsWith("alipay")) {
val hasApp: Boolean
hasApp = if (url.startsWith("weixin://wap/pay?")) {
isAppExist("com.tencent.mm")
} else {
(isAppExist("com.eg.android.AlipayGphone") || isAppExist("com.alipay.android.app"))
}
if (hasApp) {
val intent = Intent()
intent.action = Intent.ACTION_VIEW
intent.data = Uri.parse(url)
startActivity(intent)
} else {
showToast("客官,请先安装支付App哦~")
}
return true
}
if (url.startsWith("https")) {
val map = HashMap<String, String>()
map["Referer"] = "http://www.shandw.com"
it.loadUrl(url, map)
}
return super.shouldOverrideUrlLoading(view, url)
}
})
it.loadUrl(loadUrl)
}
}
/**
* 获取拼接url
*/
fun getLoadUrl(): String {
val currentTimeMillis = System.currentTimeMillis() / 1000
val loadUrl = "${AUTH_URL}?" +
"channel=${CHANNEL}&" +
"openid=${URIEncoder.encodeURIComponent(UserManager.getInstance().userID)}&" +
"time=${currentTimeMillis}&" +
"nick=${URIEncoder.encodeURIComponent(UserManager.getInstance().userID)}&" +
"avatar=${URIEncoder.encodeURIComponent("https://wenshu-pkg.oss-cn-beijing.aliyuncs.com/pkg_goodmoney/img/ic_my.png")}&" +
"sex=${0}&" +
"phone=${UserManager.getInstance().mobile}&" +
"sdw_simple=${2}&" +
"sign=${getSignStr(currentTimeMillis)}"
return loadUrl
}
/**
* 获取签名
*/
fun getSignStr(currentTimeMillis: Long): String {
val signStr = "channel=${CHANNEL}&" +
"openid=${URIEncoder.encodeURIComponent(UserManager.getInstance().userID)}&" +
"time=${currentTimeMillis}&" +
"nick=${UserManager.getInstance().userID}&" +
"avatar=https://wenshu-pkg.oss-cn-beijing.aliyuncs.com/pkg_goodmoney/img/ic_my.png&" +
"sex=${0}&" +
"phone=${UserManager.getInstance().mobile}${KEY}"
return MD5.GetMD5Code(signStr).toLowerCase()
}
fun isAppExist(pkgName: String): Boolean {
var info: ApplicationInfo? = null
try {
info = context?.getPackageManager()!!.getApplicationInfo(pkgName, 0)
context!!.startActivity(context!!.packageManager.getLaunchIntentForPackage(pkgName))
} catch (e: Exception) {
}
return if (info != null) true else false
}
}
\ No newline at end of file
......@@ -230,7 +230,7 @@ class DrawcashActivity : BaseActivity(),
val allcoinBig = BigDecimal(data.coin.toString())
val rateBig = BigDecimal("10000")
val cashStr: String = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
tvDrawcashGoldabout.setText("约" + cashStr + "元")
tvDrawcashGoldabout.text = "约" + cashStr + "元"
}
override fun editUserMsgSuc() {
......
......@@ -61,7 +61,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
}
if (AppConfig.isMainShowWz) {
tab_iv_four.setImageResource(R.drawable.tab_wz_share_btn)
tab_iv_four.setImageResource(R.drawable.tab_friends_btn)
tab_tv_four.text = "新闻分享"
isMainShowWz = true
} else {
......
......@@ -59,7 +59,7 @@ class SplashActivity : BaseActivity() {
* 校验App签名
*/
private fun checkAppSign() {
val deviceInfo: DeviceInfo = DeviceInfo.instance!!
val deviceInfo: DeviceInfo = DeviceInfo.instance
if (!deviceInfo.signInfo) {
finish()
} else {
......
......@@ -166,7 +166,7 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
val alreadyDelayMills = System.currentTimeMillis() - fetchSplashADTime //从拉广告开始到onNoAD已经消耗了多少时间
val shouldDelayMills = if (alreadyDelayMills > minSplashTimeWhenNoAD) 0 else minSplashTimeWhenNoAD - alreadyDelayMills //为防止加载广告失败后立刻跳离开屏可能造成的视觉上类似于"闪退"的情况,根据设置的minSplashTimeWhenNoAD
// 计算出还需要延时多久
handler.postDelayed({ readyGoOtherActivity() }, shouldDelayMills.toLong())
handler.postDelayed({ readyGoOtherActivity() }, shouldDelayMills)
}
/**
......
......@@ -60,7 +60,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
url: String
): Boolean {
if (url.contains(".apk")) {
DownloadApkManager.downloadApk(this@WebActivity,url!!)
DownloadApkManager.downloadApk(this@WebActivity, url)
return true
}
......
//package com.wenshu.goodmoney.ui.fragment
//
//import android.annotation.SuppressLint
//import android.content.Intent
//import android.content.pm.ApplicationInfo
//import android.net.Uri
//import android.os.Build
//import android.view.View
//import android.view.ViewGroup
//import android.webkit.WebSettings
//import android.webkit.WebViewClient
//import com.wenshu.goodmoney.R
//import com.wenshu.goodmoney.manager.UserManager
//import com.wenshu.goodmoney.ui.fragment.base.LazyLoadBaseFragment
//import com.wenshu.goodmoney.utils.LogUtil
//import com.wenshu.goodmoney.utils.MD5
//import com.wenshu.goodmoney.utils.URIEncoder
//import kotlinx.android.synthetic.main.fragment_main_dh.*
//
///**
// * 描述:电魂游戏
// * 作者:孟崔广
// * 时间:2020/11/17 13:48
// */
//class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
//
// companion object {
// const val CHANNEL = "14533"
// const val KEY = "4932d9037fd94f6ba24fa09605203cd6"
// const val AUTH_URL = "http://www.shandw.com/auth/"
// }
//
// private val TAG = DhGameFragment::class.java.simpleName
//
// override fun getContentViewLayoutID() = R.layout.fragment_main_dh
//
// override fun initViewsAndEvents() {
// }
//
// override fun onFragmentFirstVisible() {
// loadH5Game()
// initListener()
// }
//
// override fun onFragmentResume() {
// super.onFragmentResume()
//// LogUtil.d(TAG, "onFragmentResume")
// }
//
// override fun onFragmentPause() {
//// LogUtil.d(TAG, "onFragmentPause")
// if (UserManager.getInstance().userIsLogin()) {
// loadH5Game()
// }
// }
//
// override fun onDestroy() {
// super.onDestroy()
//
// dh_webview?.let {
// it.destroyDrawingCache()
// val parent = it.getParent() as ViewGroup
// parent.removeView(it)
// it.removeAllViews()
// it.destroy()
// }
//
// }
//
// override fun onClick(v: View) {
// when (v.id) {
// R.id.ivDhBack -> {
// dh_webview.goBack()
// }
// R.id.tvDhRefresh -> {
// loadH5Game()
// }
// }
// }
//
// /**
// * 加载H5Game
// */
// @SuppressLint("SetJavaScriptEnabled")
// private fun loadH5Game() {
// dh_webview?.let {
// val loadUrl = getLoadUrl()
// LogUtil.d(TAG, "url-->${loadUrl}")
// val settings = it.settings
// // 本地 DOM 存储(解决加载某些网页出现白板现象)
// settings.domStorageEnabled = true
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// // 解决 Android 5.0 上 WebView 默认不允许加载 Http 与 Https 混合内容
// settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
// }
// settings.javaScriptEnabled = true
// settings.javaScriptCanOpenWindowsAutomatically = true
// it.setWebViewClient(object : WebViewClient() {
// override fun shouldOverrideUrlLoading(
// view: android.webkit.WebView,
// url: String
// ): Boolean {
// if (url.startsWith("weixin://wap/pay?") || url.startsWith("alipay")) {
// val hasApp: Boolean
// hasApp = if (url.startsWith("weixin://wap/pay?")) {
// isAppExist("com.tencent.mm")
// } else {
// (isAppExist("com.eg.android.AlipayGphone") || isAppExist("com.alipay.android.app"))
// }
// if (hasApp) {
// val intent = Intent()
// intent.action = Intent.ACTION_VIEW
// intent.data = Uri.parse(url)
// activity?.startActivity(intent)
// } else {
// showToast("客官,请先安装支付App哦~")
// }
// return true
// }
//
// if (url.startsWith("https")) {
// val map = HashMap<String, String>()
// map["Referer"] = "http://www.shandw.com"
// it.loadUrl(url, map)
// }
// return super.shouldOverrideUrlLoading(view, url)
// }
// })
// it.loadUrl(loadUrl)
// }
// }
//
// /**
// * 获取拼接url
// */
// fun getLoadUrl(): String {
// val currentTimeMillis = System.currentTimeMillis() / 1000
// val loadUrl = "${AUTH_URL}?" +
// "channel=${CHANNEL}&" +
// "openid=${URIEncoder.encodeURIComponent(UserManager.getInstance().userID)}&" +
// "time=${currentTimeMillis}&" +
// "nick=${URIEncoder.encodeURIComponent(UserManager.getInstance().userID)}&" +
// "avatar=${URIEncoder.encodeURIComponent("https://wenshu-pkg.oss-cn-beijing.aliyuncs.com/pkg_goodmoney/img/ic_my.png")}&" +
// "sex=${0}&" +
// "phone=${UserManager.getInstance().mobile}&" +
// "sdw_simple=${2}&" +
// "sign=${getSignStr(currentTimeMillis)}"
// return loadUrl
// }
//
// /**
// * 获取签名
// */
// fun getSignStr(currentTimeMillis: Long): String {
// val signStr = "channel=${CHANNEL}&" +
// "openid=${URIEncoder.encodeURIComponent(UserManager.getInstance().userID)}&" +
// "time=${currentTimeMillis}&" +
// "nick=${UserManager.getInstance().userID}&" +
// "avatar=https://wenshu-pkg.oss-cn-beijing.aliyuncs.com/pkg_goodmoney/img/ic_my.png&" +
// "sex=${0}&" +
// "phone=${UserManager.getInstance().mobile}${KEY}"
// return MD5.GetMD5Code(signStr).toLowerCase()
// }
//
// fun isAppExist(pkgName: String): Boolean {
// var info: ApplicationInfo? = null
// try {
// info = context?.getPackageManager()!!.getApplicationInfo(pkgName, 0)
// context!!.startActivity(context!!.packageManager.getLaunchIntentForPackage(pkgName))
// } catch (e: Exception) {
// }
// return if (info != null) true else false
// }
//
// private fun initListener() {
// ivDhBack.setOnClickListener(this)
// tvDhRefresh.setOnClickListener(this)
// }
//}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.text.TextUtils
import android.view.View
import android.view.animation.AccelerateDecelerateInterpolator
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.ViewPager
......@@ -94,7 +95,7 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
private fun initView() {
tv_right_subtitle.visibility = View.VISIBLE
tv_right_subtitle.text = "玩法规则"
tv_right_subtitle.setTextColor(resources.getColor(R.color.color_666))
tv_right_subtitle.setTextColor(ContextCompat.getColor(mContext,R.color.color_666))
tv_right_subtitle.setOnClickListener { }
tv_title.text = "瓜分百万现金福利"
......@@ -265,7 +266,7 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
if (data.button == "戳我分红") {
btn_get_bonus.isEnabled = true
btn_get_bonus.setTextColor(resources.getColor(R.color.white))
btn_get_bonus.setTextColor(ContextCompat.getColor(mContext,R.color.white))
btn_get_bonus.setBackgroundResource(R.drawable.shape_btn_friends_unenabled)
showRedbox(btn_get_bonus)
} else {
......@@ -275,32 +276,36 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
tv_bonus_date.text = data.periods
tv_bonus_sum.text = SpanUtils()
.append("今日奖池 ").setForegroundColor(resources.getColor(R.color.black))
.append("今日奖池 ").setForegroundColor(ContextCompat.getColor(mContext,R.color.black))
.append(data.titleMsg).setFontSize(BubbleUtils.dp2px(28))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append(" 元").setForegroundColor(resources.getColor(R.color.black))
.setForegroundColor(
ContextCompat.getColor(mContext, R.color.color_E72C2B)
)
.append(" 元").setForegroundColor(
ContextCompat.getColor(mContext, R.color.black)
)
.create()
tv_yesterday_bonus.text = SpanUtils()
.append(data.contribution_yesterday.toString())
.setForegroundColor(resources.getColor(R.color.color_FF7C00))
.setForegroundColor(ContextCompat.getColor(mContext,R.color.color_FF7C00))
.create()
tv_today_bonus.text = SpanUtils()
.append(data.contribution_today.toString())
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.setForegroundColor(ContextCompat.getColor(mContext,R.color.color_E72C2B))
.create()
tv_bonus_money.text = SpanUtils()
.append(data.cash.toString())
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.setForegroundColor(ContextCompat.getColor(mContext,R.color.color_E72C2B))
.append("元").setFontSize(BubbleUtils.dp2px(14))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.setForegroundColor(ContextCompat.getColor(mContext,R.color.color_E72C2B))
.create()
tv_bonus_rate.text = SpanUtils()
.append("昨日汇率:").setForegroundColor(resources.getColor(R.color.black))
.append(data.rate).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("昨日汇率:").setForegroundColor(ContextCompat.getColor(mContext,R.color.black))
.append(data.rate).setForegroundColor(ContextCompat.getColor(mContext,R.color.color_E72C2B))
.create()
tv_bonus_hint.text = data.remark
}
......@@ -324,13 +329,19 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
}
})
bonusDialog?.let {
if (status == -1) {
it.canClose(true)
} else {
it.canClose(false)
}
it.setTitle("提示")
it.setContent(content)
it.setBtnStr(btnStr)
it.show()
}
}
private fun inviteFriends(){
private fun inviteFriends() {
// 邀请好友
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
......@@ -481,7 +492,7 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
hintDialog(
-1, "您还需邀请" +
(cashoutChallengeBean!!.list[position].needCount - cashoutChallengeBean?.complete!!) +
"位好友才可领取奖励",
"位好友才可领取" + cashoutChallengeBean!!.list[position].cash + "元奖励",
"邀请好友"
)
}
......@@ -494,7 +505,7 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
}
2 -> {
hintDialog(
0,"您已经领取过本阶段奖励",
0, "您已经领取过本阶段奖励",
"知道了"
)
}
......@@ -556,10 +567,14 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
val content = SpanUtils()
.append("我已在尤友赚了")
.append(sumCoin).setFontSize(BubbleUtils.dp2px(10))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.setForegroundColor(
ContextCompat.getColor(mContext, R.color.color_E72C2B)
)
.append("元 ,快来跟我一起赚钱吧,满")
.append("0.3").setFontSize(BubbleUtils.dp2px(10))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.setForegroundColor(
ContextCompat.getColor(mContext, R.color.color_E72C2B)
)
.append("元就可以提现")
.create()
shareDialog.run {
......
......@@ -765,28 +765,6 @@ class MyFragment : BaseFragment(),
it.selectBook()
}
}
// 试玩平台
// MainMyAdapter.TO_YWHZ -> {
// if (!userManager.userIsLogin()) {
// readyGo(WxLoginActivity::class.java)
// return
// }
//
// try {
// activity?.let { open(it) }
// } catch (e: Exception) {
// e.printStackTrace()
// showToast("请重新退出账号登录")
// }
// }
MainMyAdapter.TO_DHGAME -> {
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
return
}
readyGo(DhGameActivity::class.java)
}
MainMyAdapter.TO_XMLY -> {
if (taskBean.otherConfig != null) {
when (taskBean.otherConfig.status) {
......@@ -1134,14 +1112,6 @@ class MyFragment : BaseFragment(),
private fun initManager() {
BannerManager.init()
vedioAdingManager = VideoAdingManager.getInstance(activity)
// if (!TextUtils.isEmpty(userManager.userID)) {
// // 登录成功的用户初始化鱼丸盒子
// if (userManager.userIsLogin()) {
// YwhzManager.init(baseApplication)
// }
// }
}
private fun initView() {
......@@ -1466,14 +1436,25 @@ class MyFragment : BaseFragment(),
* 坐标移动至每日任务
*/
fun turnDayTask() {
// 当从PanFragment中跳转到MyFragment中,由于MyFragment尚未初始化,则须先判定当前页面加载完成,使用signBean对象控制
if (signCardBean != null) {
scrollviewMy.scrollTo(0, llMyRoot.height - viewTitleDayTask.height)
scrollviewMy.scrollTo(
0, llMyRoot.height - (
viewTitleDayTask.height +
recy_my.height
)
)
return
}
Timer().schedule(800) {
activity?.runOnUiThread {
scrollviewMy.scrollTo(0, llMyRoot.height - viewTitleDayTask.height)
scrollviewMy.scrollTo(
0, llMyRoot.height - (
viewTitleDayTask.height +
recy_my.height
)
)
}
}
}
......
......@@ -34,13 +34,6 @@ class PanFragment : BaseFragment(), PanView {
override fun initViewsAndEvents() {
panPresenter.attachView(this)
// if (!TextUtils.isEmpty(userManager.userID)) {
// // 登录成功的用户初始化鱼丸盒子
// if (userManager.userIsLogin()) {
// YwhzManager.init(baseApplication)
// }
// }
}
override fun onHiddenChanged(hidden: Boolean) {
......
......@@ -31,7 +31,6 @@ import com.wenshu.youyou.utils.LogUtil
import com.wenshu.youyou.utils.SpanUtils
import kotlinx.android.synthetic.main.fragment_main_turntable.*
import kotlinx.android.synthetic.main.layout_turn_btn.*
import net.grandcentrix.tray.AppPreferences
import java.util.*
import kotlin.collections.ArrayList
import kotlin.concurrent.schedule
......@@ -45,7 +44,6 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
private val turnTablePresenter by lazy { TurnTablePresenter() }
private val userManager by lazy { UserManager.getInstance() }
private val ps by lazy { AppPreferences(context) }
private var rope: YoYo.YoYoString? = null
......@@ -72,9 +70,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
gvTurnTable.onItemClickListener = this
tvTurnMore.setOnClickListener {
val activity: MainActivity? = activity as MainActivity?
activity?.let {
it.turnDayTask()
}
activity?.turnDayTask()
}
}
......@@ -177,7 +173,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
colorsArray.clear()
desList.clear()
bitmapList.clear()
for (index in 0..data.configs.size - 1) {
for (index in 0 until data.configs.size) {
//颜色
if (index % 2 == 0) {
colorsArray.add(Color.parseColor(firstColor))
......@@ -244,7 +240,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
.append(data.surplus.toString()).setFontSize(BubbleUtils.dp2px(28)).setForegroundColor(ContextCompat.getColor(mContext, R.color.color_E72C2B))
.append("次机会").setForegroundColor(ContextCompat.getColor(mContext, R.color.black))
.create()
gvTurnTable.setAdapter(TurnTableAdapter(activity, data.bottoms))
gvTurnTable.adapter = TurnTableAdapter(activity, data.bottoms)
Timer().schedule(1000) {
activity?.runOnUiThread {
......
......@@ -97,9 +97,9 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
val sb = StringBuilder()
// sb.append("http://api.wenlv-kd.com/h5/init.html?appkey=taojinkongjian&appid=177")
sb.append(WZ_URL + "?appkey=" + APP_KEY + "&appid=" + APP_ID)
.append("&userid=" + userManager.userID)
.append("&reward=" + AppConfig.wzReadCoin)
.append("&unit=" + "金币")
.append("&userid=" + userManager.userID)
.append("&reward=" + AppConfig.wzReadCoin)
.append("&unit=" + "金币")
blTurntableWebview.loadUrl(sb.toString())
}
......@@ -109,7 +109,13 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
* 分享文章
*/
@JavascriptInterface
fun shareArticle(shareImageUrl: String, shareTarget: String, shareTitle: String, shareUrl: String, shareContent: String) {
fun shareArticle(
shareImageUrl: String,
shareTarget: String,
shareTitle: String,
shareUrl: String,
shareContent: String
) {
val wechatSp = Platform.ShareParams()
wechatSp.shareType = Platform.SHARE_WEBPAGE
wechatSp.imageUrl = shareImageUrl
......
......@@ -7,6 +7,7 @@ import android.view.KeyEvent
import android.view.View
import android.view.WindowManager
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import com.wenshu.youyou.R
......@@ -14,11 +15,12 @@ import com.wenshu.youyou.R
* 提示弹框
*/
class BonusDialog(context: Context, private val listener: DialogListener) :
Dialog(context, R.style.dialog) {
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val tv_dialogper_title: TextView
private val tv_dialogper_content: TextView
private val btn_dialogper_submit: Button
private val iv_dialoger_close: ImageView
fun setTitle(title: String) {
tv_dialogper_title.visibility = View.VISIBLE
......@@ -33,6 +35,14 @@ class BonusDialog(context: Context, private val listener: DialogListener) :
btn_dialogper_submit.text = btnStr
}
fun canClose(flag: Boolean) {
if (flag) {
iv_dialoger_close.visibility = View.VISIBLE
} else {
iv_dialoger_close.visibility = View.GONE
}
}
init {
setContentView(R.layout.dialog_friends)
// 设置window属性
......@@ -51,13 +61,17 @@ class BonusDialog(context: Context, private val listener: DialogListener) :
// 查找View
tv_dialogper_title =
findViewById<View>(R.id.tv_title) as TextView
findViewById<View>(R.id.tv_title) as TextView
tv_dialogper_content =
findViewById<View>(R.id.tv_content) as TextView
findViewById<View>(R.id.tv_content) as TextView
btn_dialogper_submit =
findViewById<View>(R.id.btn_submit) as Button
findViewById<View>(R.id.btn_submit) as Button
iv_dialoger_close =
findViewById<View>(R.id.iv_close) as ImageView
tv_dialogper_content.setOnClickListener(listener)
tv_dialogper_title.setOnClickListener(listener)
btn_dialogper_submit.setOnClickListener(listener)
iv_dialoger_close.setOnClickListener { this@BonusDialog.dismiss() }
}
}
\ No newline at end of file
......@@ -49,7 +49,7 @@ class TaskCpdDialog(context: Context, listener: DialogListener) :
textView.setOnClickListener(listener)
}
fun setData(title: String, description: String, icon: String, seconds: Int, coin: Int) {
fun setData(title: String?, description: String?, icon: String?, seconds: Int, coin: Int) {
if (seconds > 0) {
tvText1.text = "下载并试玩$seconds" + "秒"
} else {
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/icon_home_wz" android:state_selected="true" />
<item android:drawable="@mipmap/icon_home_wz_nor" />
</selector>
\ No newline at end of file
......@@ -5,13 +5,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:orientation="vertical">
android:orientation="vertical"
android:paddingStart="25dp"
android:paddingEnd="25dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="90dp"
android:layout_marginEnd="30dp">
android:layout_marginTop="90dp">
<TextView
android:id="@+id/tvAwardBack"
......@@ -36,15 +37,14 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="25dp"
android:layout_marginTop="26dp"
android:layout_marginRight="25dp"
android:background="@drawable/shape_bg_award"
android:orientation="vertical">
......@@ -173,10 +173,6 @@
android:id="@+id/flAwardAd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="10dp"
android:layout_marginRight="25dp"
android:background="@drawable/shape_bg_award"
android:gravity="center" />
android:background="@drawable/shape_bg_award" />
</LinearLayout>
\ No newline at end of file
......@@ -5,24 +5,39 @@
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:background="@drawable/shape_dialog_friends"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="20dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="gone" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_centerHorizontal="true"
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:src="@mipmap/ic_close" />
</RelativeLayout>
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:gravity="center"
android:textColor="@color/gray"
android:textSize="16sp" />
......@@ -30,6 +45,7 @@
android:id="@+id/btn_submit"
android:layout_width="200dp"
android:layout_height="42dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="@drawable/shape_btn_friends"
android:gravity="center"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<WebView
android:id="@+id/dh_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fadingEdge="none"
android:overScrollMode="never" />
</LinearLayout>
......@@ -263,7 +263,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="邀请好友 奖励现金"
android:text="邀请好友 奖励现金"
android:textColor="@color/black"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/line"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment