Commit c16b8ecb authored by jyx's avatar jyx

代码位错误修复及部分UI优化

parent d08e8440
......@@ -174,7 +174,11 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
vo["ecpm"] = ttNativeAd.preEcpm
vo["adSource"] = ttNativeAd.adNetworkPlatformId
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["adid"] = CsjGroMoreManager.APP_OUT_AD_UNIT_LOCK_EXPRESS_ID
if (isScreen) {
vo["adid"] = CsjGroMoreManager.APP_OUT_AD_UNIT_LOCK_EXPRESS_ID
} else {
vo["adid"] = CsjGroMoreManager.APP_OUT_AD_UNIT_EXPRESS_ID
}
TrackManager.getInstance().cmtGroMoreInfo(vo)
}
}
......
......@@ -91,8 +91,8 @@ object CsjGroMoreManager {
}
if (it.gromoreAdcodes_outer_ordinary != null) { // 应用外普通
if (!TextUtils.isEmpty(it.gromoreAdcodes_main.groExpress)) {
APP_OUT_AD_UNIT_EXPRESS_ID = it.gromoreAdcodes_main.groExpress
if (!TextUtils.isEmpty(it.gromoreAdcodes_outer_ordinary.groExpress)) {
APP_OUT_AD_UNIT_EXPRESS_ID = it.gromoreAdcodes_outer_ordinary.groExpress
}
if (!TextUtils.isEmpty(it.gromoreAdcodes_outer_ordinary.groNewInterstitial)) {
APP_OUT_AD_UNIT_FULL_NEW_INTERSTITIAL_ID = it.gromoreAdcodes_outer_ordinary.groNewInterstitial
......
......@@ -108,6 +108,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
runOnUiThread {
step++
if (step == mTimerMax - 2) {
mTimer?.cancel()
WifiAdManager.instance.showInterstitial(this@Increasespeed2Activity)
}
}
......
......@@ -52,6 +52,7 @@ class BoostFastActivity : BaseActivity() {
initView()
startAnim()
initExpress()
}
private fun startAnim() {
......@@ -128,11 +129,6 @@ class BoostFastActivity : BaseActivity() {
}
}
override fun onResume() {
super.onResume()
initExpress()
}
/**
* 初始化信息iyc
*/
......@@ -142,6 +138,7 @@ class BoostFastActivity : BaseActivity() {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getAppOutExpressFrameLayout())
} else {
fl_ad.removeAllViews()
ExpressManager.loadNoAppOutExpress(fl_ad)
}
} catch (e: Exception) {
......
......@@ -10,7 +10,6 @@ import com.mints.flowbox.common.Constant
import com.mints.flowbox.ui.activitys.CleanActivity
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.base.OutAppActivity
import com.mints.flowbox.utils.LogUtil
import com.mints.flowbox.utils.TimeRender
import com.mints.flowbox.utils.ToolUtil
import com.mints.library.utils.nodoubleclick.AntiShake
......@@ -92,13 +91,8 @@ class ScreenActivity : OutAppActivity(), View.OnClickListener {
*/
private fun initExpress() {
try {
if (fl_ad != null && ExpressManager.getAppOutExpressFrameLayout() != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getAppOutExpressFrameLayout())
} else {
fl_ad.removeAllViews()
ExpressManager.loadNoAppOutExpress(fl_ad)
}
fl_ad.removeAllViews()
ExpressManager.loadNoAppOutExpress(fl_ad, true)
} catch (e: Exception) {
e.printStackTrace()
}
......
package com.mints.flowbox.ui.adapter
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.provider.Settings
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
......@@ -24,12 +26,18 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe
private var mOnItemClickListener: OnItemClickListener? = null
private var mIsWifiConnected: Boolean = false
fun setOnItemClickListener(onItemClickListener: OnItemClickListener) {
mOnItemClickListener = onItemClickListener
}
fun setmIsWifiConnected(isWifiConnected: Boolean) {
this.mIsWifiConnected = isWifiConnected
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == FriendsInvitedAdapter.HOLDER_TYPE_EMPTY) {
if (viewType == HOLDER_TYPE_EMPTY) {
val emptyView =
LayoutInflater.from(parent.context).inflate(R.layout.item_wifi_empty, parent, false)
return EmptyHolder(emptyView)
......@@ -49,17 +57,27 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe
override fun getItemViewType(position: Int): Int {
if (taskData.isEmpty()) {
return FriendsInvitedAdapter.HOLDER_TYPE_EMPTY
return HOLDER_TYPE_EMPTY
}
return FriendsInvitedAdapter.HOLDER_TYPE_INVITED
return HOLDER_TYPE_WIFI
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (holder is EmptyHolder) {
holder.itemView.findViewById<Button>(R.id.btn)
.setOnClickListener {
mOnItemClickListener?.onItemClick(it, position)
if (mIsWifiConnected) {
holder.itemView.findViewById<TextView>(R.id.tvTitle).text = "已打开WIFI开关"
holder.itemView.findViewById<TextView>(R.id.tvTitle).text = "附近未发现WIFI,去系统扫描"
val btn = holder.itemView.findViewById<Button>(R.id.btn)
btn.setOnClickListener {
context.startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
}
} else {
holder.itemView.findViewById<Button>(R.id.btn)
.setOnClickListener {
mOnItemClickListener?.onItemClick(it, position)
}
}
return
}
......
......@@ -72,7 +72,6 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
private var rope: YoYo.YoYoString? = null
private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.fragment_main_friends
......
......@@ -141,7 +141,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
insertScreenAdManager?.onDestroy()
if (AppPreferencesManager.get()
.getBoolean(Constant.TURNTABLE_SWITCH_BUTTON, false)
.getBoolean(Constant.TURNTABLE_SWITCH_BUTTON, false)
) {
clickTurn()
}
......@@ -354,7 +354,7 @@ class TurnTableFragment : BaseFragment(), TurnTableView, AdapterView.OnItemClick
MobclickAgent.onEvent(activity!!, Constant.CARRIER_CHALLENGE_TURN, map)
if (insertScreenAdManager == null) insertScreenAdManager = InsertScreenAdManager()
insertScreenAdManager?.loadInterstitial(requireActivity(), true)
insertScreenAdManager?.loadInterstitial(requireActivity(), false)
turnTableView.startRotate(1)
awardVedio()
......
......@@ -115,11 +115,11 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
if (!AntiAuditManager.instance.isBlack()) {
ivImg.visibility=View.VISIBLE
ivImgHint.visibility=View.VISIBLE
}else{
ivImg.visibility=View.GONE
ivImgHint.visibility=View.GONE
ivImg.visibility = View.VISIBLE
ivImgHint.visibility = View.VISIBLE
} else {
ivImg.visibility = View.GONE
ivImgHint.visibility = View.GONE
}
// gromore激励视频预加载
......@@ -215,6 +215,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
Handler(Looper.getMainLooper()).postDelayed({
swipeRefreshLayout.isRefreshing = false
}, 1000)
mMainWifiAdapter?.setmIsWifiConnected(false)
mMainWifiAdapter?.notifyDataSetChanged()
return
}
......@@ -251,7 +252,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
connectIndex = i
}
}
if (!isHasConnectWifi) {
if (!isHasConnectWifi && wifiUtils.isWifiConnected(mContext)) {
// 插入数组头
mWifiList.add(
0,
......@@ -271,6 +272,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
swipeRefreshLayout.isRefreshing = false
}, 1000)
mMainWifiAdapter?.setmIsWifiConnected(true)
mMainWifiAdapter?.notifyDataSetChanged()
}
......
......@@ -90,7 +90,8 @@ public class WifiUtils {
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
return activeNetInfo != null && activeNetInfo.isConnected();
NetworkInfo wifi = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
return activeNetInfo != null && activeNetInfo.isConnected() && wifi.isConnected();
}
/**
......
......@@ -138,10 +138,10 @@
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="360dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:layout_margin="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:gravity="center" />
......
......@@ -63,7 +63,11 @@
<View
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_marginStart="50dp"
android:layout_marginTop="150dp"
android:layout_marginEnd="50dp"
android:layout_marginBottom="150dp" />
<com.mints.flowbox.ui.widgets.CircleCleanAnimationView
android:id="@+id/ccav_speed"
......
......@@ -121,7 +121,7 @@
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="15dp"
......
......@@ -9,11 +9,11 @@
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="450dp"
android:layout_marginBottom="30dp"
android:layout_height="480dp"
android:layout_marginBottom="20dp"
android:clipToPadding="false"
android:paddingStart="60dp"
android:paddingEnd="60dp"
android:paddingStart="50dp"
android:paddingEnd="50dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -13,6 +13,7 @@
android:src="@mipmap/ic_main_wifi_error" />
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
......@@ -21,6 +22,7 @@
android:textSize="18sp" />
<TextView
android:id="@+id/tvInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
......
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