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
Show 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
import
com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import
com.bytedance.sdk.openadsdk.mediation.ad.MediationNativeToBannerListener
import
com.mints.helivideo.BuildConfig
import
com.mints.helivideo.MintsApplication
import
com.mints.helivideo.manager.UserManager
import
com.mints.helivideo.utils.LogUtil
import
com.mints.helivideo.utils.UIUtils
...
...
@@ -36,7 +37,10 @@ object BannerManager {
var
adSlot
:
AdSlot
=
AdSlot
.
Builder
()
.
setCodeId
(
BuildConfig
.
GROMORE_BANNER_CODE
)
// .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"
)
.
setMediationAdSlot
(
MediationAdSlot
.
Builder
()
...
...
@@ -45,7 +49,7 @@ object BannerManager {
* 如果未使用banner混出信息流功能,则无需设置MediationNativeToBannerListener。
* 如要使用混出功能,可参考AdUtils.kt类中getCSJMBannerViewFromNativeAd函数部分。
*/
.
setMediationNativeToBannerListener
(
object
:
MediationNativeToBannerListener
()
{
.
setMediationNativeToBannerListener
(
object
:
MediationNativeToBannerListener
()
{
override
fun
getMediationBannerViewFromNativeAd
(
adInfo
:
IMediationNativeAdInfo
):
View
?
{
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
import
android.view.KeyEvent
import
android.view.View
import
com.mints.helivideo.R
import
com.mints.helivideo.mvp.model.OrderRecordBean
import
com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.utils.SpanUtils
import
com.mints.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_nine_know.*
import
kotlinx.android.synthetic.main.fragment_main_my.*
/**
* 描述:9宫格手机
...
...
video/app/src/main/java/com/mints/helivideo/ui/widgets/NineContinueDialog.kt
View file @
62ffa5ee
...
...
@@ -38,7 +38,7 @@ class NineContinueDialog(
val
tv_nine_next
=
findViewById
<
TextView
>(
R
.
id
.
tv_nine_next
)
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
)
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 {
public
static
float
getAdWidth
(
Context
context
)
{
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"?>
<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_height=
"match_parent"
android:background=
"#90000000"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
>
<ImageView
android:layout_width=
"250dp"
android:layout_height=
"170dp"
android:scaleType=
"fitXY"
android:src=
"@mipmap/bg_vip_count"
/>
<LinearLayout
android:layout_width=
"250dp"
android:layout_height=
"170dp"
android:layout_centerInParent=
"true"
android:background=
"@mipmap/bg_vip_count"
android:orientation=
"vertical"
>
<TextView
...
...
@@ -22,7 +29,7 @@
android:layout_marginTop=
"34dp"
android:gravity=
"center"
android:textColor=
"@color/black"
android:textSize=
"16sp"
></TextView
>
android:textSize=
"18sp"
/
>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -31,8 +38,7 @@
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:text=
"每次解锁剧集,广告次数+1"
android:textColor=
"@color/gray"
android:textSize=
"11sp"
></TextView>
android:textColor=
"@color/gray"
/>
<TextView
...
...
@@ -48,5 +54,8 @@
android:textColor=
"#6C4D22"
android:textSize=
"14sp"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
video/app/src/main/res/layout/fragment_main.xml
View file @
62ffa5ee
...
...
@@ -98,30 +98,25 @@
android:overScrollMode=
"never"
/>
</LinearLayout>
<LinearLayout
<FrameLayout
android:id=
"@+id/fl_main_banner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:minHeight=
"45dp"
android:orientation=
"horizontal"
>
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"15dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"15dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_height=
"45dp"
android:layout_marginLeft=
"16dp"
android:gravity=
"center"
android:text=
"分类"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<FrameLayout
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>
</com.google.android.material.appbar.CollapsingToolbarLayout>
...
...
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