Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_vedio
Commits
62ffa5ee
Commit
62ffa5ee
authored
Jul 31, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
9c52849b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
69 deletions
+79
-69
BannerManager.kt
.../main/java/com/mints/helivideo/ad/banner/BannerManager.kt
+6
-2
NineKnowActivity.kt
...java/com/mints/helivideo/ui/activitys/NineKnowActivity.kt
+0
-2
NineContinueDialog.kt
...java/com/mints/helivideo/ui/widgets/NineContinueDialog.kt
+1
-1
UIUtils.java
.../app/src/main/java/com/mints/helivideo/utils/UIUtils.java
+4
-0
activity_nine_know.xml
video/app/src/main/res/layout/activity_nine_know.xml
+52
-43
fragment_main.xml
video/app/src/main/res/layout/fragment_main.xml
+16
-21
No files found.
video/app/src/main/java/com/mints/helivideo/ad/banner/BannerManager.kt
View file @
62ffa5ee
...
@@ -8,6 +8,7 @@ import com.bytedance.sdk.openadsdk.mediation.ad.IMediationNativeAdInfo
...
@@ -8,6 +8,7 @@ import com.bytedance.sdk.openadsdk.mediation.ad.IMediationNativeAdInfo
import
com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import
com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import
com.bytedance.sdk.openadsdk.mediation.ad.MediationNativeToBannerListener
import
com.bytedance.sdk.openadsdk.mediation.ad.MediationNativeToBannerListener
import
com.mints.helivideo.BuildConfig
import
com.mints.helivideo.BuildConfig
import
com.mints.helivideo.MintsApplication
import
com.mints.helivideo.manager.UserManager
import
com.mints.helivideo.manager.UserManager
import
com.mints.helivideo.utils.LogUtil
import
com.mints.helivideo.utils.LogUtil
import
com.mints.helivideo.utils.UIUtils
import
com.mints.helivideo.utils.UIUtils
...
@@ -36,7 +37,10 @@ object BannerManager {
...
@@ -36,7 +37,10 @@ object BannerManager {
var
adSlot
:
AdSlot
=
AdSlot
.
Builder
()
var
adSlot
:
AdSlot
=
AdSlot
.
Builder
()
.
setCodeId
(
BuildConfig
.
GROMORE_BANNER_CODE
)
.
setCodeId
(
BuildConfig
.
GROMORE_BANNER_CODE
)
// .setImageAcceptedSize(UIUtils.dp2px(weakActivity?.get(), 300f), UIUtils.dp2px(weakActivity?.get(), 45f)) // 单位px
// .setImageAcceptedSize(UIUtils.dp2px(weakActivity?.get(), 300f), UIUtils.dp2px(weakActivity?.get(), 45f)) // 单位px
.
setImageAcceptedSize
(
UIUtils
.
dp2px
(
weakActivity
?.
get
(),
300f
),
0
)
// 单位px
.
setImageAcceptedSize
(
UIUtils
.
getAdWidth2
(
MintsApplication
.
getContext
()).
toInt
(),
0
)
// 单位px
.
setUserID
(
"1234"
)
.
setUserID
(
"1234"
)
.
setMediationAdSlot
(
.
setMediationAdSlot
(
MediationAdSlot
.
Builder
()
MediationAdSlot
.
Builder
()
...
@@ -45,7 +49,7 @@ object BannerManager {
...
@@ -45,7 +49,7 @@ object BannerManager {
* 如果未使用banner混出信息流功能,则无需设置MediationNativeToBannerListener。
* 如果未使用banner混出信息流功能,则无需设置MediationNativeToBannerListener。
* 如要使用混出功能,可参考AdUtils.kt类中getCSJMBannerViewFromNativeAd函数部分。
* 如要使用混出功能,可参考AdUtils.kt类中getCSJMBannerViewFromNativeAd函数部分。
*/
*/
.
setMediationNativeToBannerListener
(
object
:
MediationNativeToBannerListener
()
{
.
setMediationNativeToBannerListener
(
object
:
MediationNativeToBannerListener
()
{
override
fun
getMediationBannerViewFromNativeAd
(
adInfo
:
IMediationNativeAdInfo
):
View
?
{
override
fun
getMediationBannerViewFromNativeAd
(
adInfo
:
IMediationNativeAdInfo
):
View
?
{
return
null
return
null
}
}
...
...
video/app/src/main/java/com/mints/helivideo/ui/activitys/NineKnowActivity.kt
View file @
62ffa5ee
...
@@ -4,12 +4,10 @@ import android.os.Bundle
...
@@ -4,12 +4,10 @@ import android.os.Bundle
import
android.view.KeyEvent
import
android.view.KeyEvent
import
android.view.View
import
android.view.View
import
com.mints.helivideo.R
import
com.mints.helivideo.R
import
com.mints.helivideo.mvp.model.OrderRecordBean
import
com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.utils.SpanUtils
import
com.mints.helivideo.utils.SpanUtils
import
com.mints.library.utils.nodoubleclick.AntiShake
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_nine_know.*
import
kotlinx.android.synthetic.main.activity_nine_know.*
import
kotlinx.android.synthetic.main.fragment_main_my.*
/**
/**
* 描述:9宫格手机
* 描述:9宫格手机
...
...
video/app/src/main/java/com/mints/helivideo/ui/widgets/NineContinueDialog.kt
View file @
62ffa5ee
...
@@ -38,7 +38,7 @@ class NineContinueDialog(
...
@@ -38,7 +38,7 @@ class NineContinueDialog(
val
tv_nine_next
=
findViewById
<
TextView
>(
R
.
id
.
tv_nine_next
)
val
tv_nine_next
=
findViewById
<
TextView
>(
R
.
id
.
tv_nine_next
)
val
tv_nine_close
=
findViewById
<
ImageView
>(
R
.
id
.
tv_nine_close
)
val
tv_nine_close
=
findViewById
<
ImageView
>(
R
.
id
.
tv_nine_close
)
tv_nine_text
.
text
=
String
.
format
(
"再看%d
集
即可抽奖"
,
watchCount
)
tv_nine_text
.
text
=
String
.
format
(
"再看%d
次
即可抽奖"
,
watchCount
)
listener
.
setDialog
(
this
)
listener
.
setDialog
(
this
)
tv_nine_next
.
setOnClickListener
(
listener
)
tv_nine_next
.
setOnClickListener
(
listener
)
...
...
video/app/src/main/java/com/mints/helivideo/utils/UIUtils.java
View file @
62ffa5ee
...
@@ -290,4 +290,8 @@ public class UIUtils {
...
@@ -290,4 +290,8 @@ public class UIUtils {
public
static
float
getAdWidth
(
Context
context
)
{
public
static
float
getAdWidth
(
Context
context
)
{
return
getScreenWidth
(
context
)
-
dp2px
(
60
);
return
getScreenWidth
(
context
)
-
dp2px
(
60
);
}
}
public
static
float
getAdWidth2
(
Context
context
)
{
return
getScreenWidth
(
context
)
-
dp2px
(
30
);
}
}
}
video/app/src/main/res/layout/activity_nine_know.xml
View file @
62ffa5ee
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#90000000"
android:background=
"#90000000"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<LinearLayout
<RelativeLayout
android:layout_width=
"250dp"
android:layout_width=
"wrap_content"
android:layout_height=
"170dp"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_centerInParent=
"true"
>
android:background=
"@mipmap/bg_vip_count"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"250dp"
<TextView
android:layout_height=
"170dp"
android:id=
"@+id/tv_nine_know_text"
android:scaleType=
"fitXY"
android:layout_width=
"wrap_content"
android:src=
"@mipmap/bg_vip_count"
/>
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
<LinearLayout
android:layout_marginTop=
"34dp"
android:layout_width=
"250dp"
android:gravity=
"center"
android:layout_height=
"170dp"
android:textColor=
"@color/black"
android:orientation=
"vertical"
>
android:textSize=
"16sp"
></TextView>
<TextView
<TextView
android:id=
"@+id/tv_nine_know_text"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"34dp"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"每次解锁剧集,广告次数+1"
android:textColor=
"@color/black"
android:textColor=
"@color/gray"
android:textSize=
"18sp"
/>
android:textSize=
"11sp"
></TextView>
<TextView
android:layout_width=
"wrap_content"
<TextView
android:layout_height=
"wrap_content"
android:id=
"@+id/tv_nine_know_next"
android:layout_gravity=
"center_horizontal"
android:layout_width=
"200dp"
android:layout_marginTop=
"10dp"
android:layout_height=
"44dp"
android:gravity=
"center"
android:layout_gravity=
"center_horizontal"
android:text=
"每次解锁剧集,广告次数+1"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/gray"
/>
android:layout_marginBottom=
"18dp"
android:background=
"@mipmap/bg_vip_count_btn"
android:gravity=
"center"
<TextView
android:text=
"知道了"
android:id=
"@+id/tv_nine_know_next"
android:textColor=
"#6C4D22"
android:layout_width=
"200dp"
android:textSize=
"14sp"
/>
android:layout_height=
"44dp"
</LinearLayout>
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"24dp"
android:layout_marginBottom=
"18dp"
android:background=
"@mipmap/bg_vip_count_btn"
android:gravity=
"center"
android:text=
"知道了"
android:textColor=
"#6C4D22"
android:textSize=
"14sp"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
video/app/src/main/res/layout/fragment_main.xml
View file @
62ffa5ee
...
@@ -98,29 +98,24 @@
...
@@ -98,29 +98,24 @@
android:overScrollMode=
"never"
/>
android:overScrollMode=
"never"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<FrameLayout
android:id=
"@+id/fl_main_banner"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:minHeight=
"45dp"
android:layout_gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:layout_marginStart=
"15dp"
android:layout_marginTop=
"10dp"
<TextView
android:layout_marginEnd=
"15dp"
/>
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
<TextView
android:layout_gravity=
"center_vertical"
android:layout_width=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:layout_height=
"45dp"
android:text=
"分类"
android:layout_marginLeft=
"16dp"
android:textColor=
"@color/black"
android:gravity=
"center"
android:textSize=
"16sp"
android:text=
"分类"
android:textStyle=
"bold"
/>
android:textColor=
"@color/black"
android:textSize=
"16sp"
<FrameLayout
android:textStyle=
"bold"
/>
android:id=
"@+id/fl_main_banner"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"4dp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment