Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
Easy Cleaner Junk
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Easy Cleaner Junk
Commits
542ae49d
Commit
542ae49d
authored
Jul 09, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...ad
parent
b44f982c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
4 deletions
+116
-4
NativeView.kt
...ava/com/test/easy/easycleanerjunk/helps/ads/NativeView.kt
+1
-1
layout_native.xml
app/src/main/res/layout/layout_native.xml
+6
-3
layout_native_small.xml
app/src/main/res/layout/layout_native_small.xml
+106
-0
themes.xml
app/src/main/res/values/themes.xml
+3
-0
No files found.
app/src/main/java/com/test/easy/easycleanerjunk/helps/ads/NativeView.kt
View file @
542ae49d
...
@@ -28,7 +28,7 @@ class NativeView @JvmOverloads constructor(
...
@@ -28,7 +28,7 @@ class NativeView @JvmOverloads constructor(
nativeAd
?:
return
nativeAd
?:
return
val
adView
=
LayoutInflater
.
from
(
context
)
val
adView
=
LayoutInflater
.
from
(
context
)
.
inflate
(
R
.
layout
.
layout_native
,
this
,
false
)
as
NativeAdView
.
inflate
(
R
.
layout
.
layout_native
_small
,
this
,
false
)
as
NativeAdView
adView
.
mediaView
=
adView
.
findViewById
(
R
.
id
.
ad_media
)
adView
.
mediaView
=
adView
.
findViewById
(
R
.
id
.
ad_media
)
adView
.
headlineView
=
adView
.
findViewById
(
R
.
id
.
ad_headline
)
adView
.
headlineView
=
adView
.
findViewById
(
R
.
id
.
ad_headline
)
...
...
app/src/main/res/layout/layout_native.xml
View file @
542ae49d
<com.google.android.gms.ads.nativead.NativeAdView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<com.google.android.gms.ads.nativead.NativeAdView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"10dp"
>
android:layout_margin=
"10dp"
>
...
@@ -8,6 +9,7 @@
...
@@ -8,6 +9,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:background=
"#D9D9D9"
android:background=
"#D9D9D9"
android:baselineAligned=
"false"
android:minHeight=
"50dp"
android:minHeight=
"50dp"
android:paddingHorizontal=
"15dp"
android:paddingHorizontal=
"15dp"
android:paddingVertical=
"10dp"
>
android:paddingVertical=
"10dp"
>
...
@@ -34,7 +36,6 @@
...
@@ -34,7 +36,6 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"10dp"
android:layout_marginEnd=
"10dp"
android:layout_marginRight=
"10dp"
android:ellipsize=
"end"
android:ellipsize=
"end"
android:lines=
"2"
android:lines=
"2"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
...
@@ -48,7 +49,8 @@
...
@@ -48,7 +49,8 @@
android:id=
"@+id/ad_app_icon"
android:id=
"@+id/ad_app_icon"
android:layout_width=
"40dp"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_height=
"40dp"
android:layout_gravity=
"center_vertical"
/>
android:layout_gravity=
"center_vertical"
tools:ignore=
"ContentDescription"
/>
<Button
<Button
android:id=
"@+id/ad_call_to_action"
android:id=
"@+id/ad_call_to_action"
...
@@ -84,7 +86,8 @@
...
@@ -84,7 +86,8 @@
android:paddingBottom=
"2dp"
android:paddingBottom=
"2dp"
android:text=
"Ad"
android:text=
"Ad"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"12sp"
/>
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
</FrameLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
</com.google.android.gms.ads.nativead.NativeAdView>
</com.google.android.gms.ads.nativead.NativeAdView>
\ No newline at end of file
app/src/main/res/layout/layout_native_small.xml
0 → 100644
View file @
542ae49d
<com.google.android.gms.ads.nativead.NativeAdView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"2dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"#D9D9D9"
android:baselineAligned=
"false"
android:minHeight=
"40dp"
android:orientation=
"horizontal"
android:paddingHorizontal=
"5dp"
android:paddingVertical=
"2dp"
>
<FrameLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
>
<com.google.android.gms.ads.nativead.MediaView
android:id=
"@+id/ad_media"
android:layout_width=
"80dp"
android:layout_height=
"60dp"
android:layout_gravity=
"center"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end"
android:background=
"@color/black"
android:padding=
"2dp"
android:text=
"Ad"
android:textColor=
"@color/white"
android:textSize=
"8sp"
tools:ignore=
"HardcodedText,SmallSp"
/>
</FrameLayout>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"5dp"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/ad_headline"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:includeFontPadding=
"false"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/ad_body"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:maxLines=
"2"
android:textColor=
"@color/black"
android:textSize=
"14sp"
tools:ignore=
"SmallSp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/ad_app_icon"
android:layout_width=
"30dp"
android:layout_height=
"30dp"
android:layout_gravity=
"center_horizontal"
tools:ignore=
"ContentDescription"
/>
<androidx.appcompat.widget.AppCompatButton
android:id=
"@+id/ad_call_to_action"
android:layout_width=
"wrap_content"
android:layout_height=
"30dp"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"8dp"
android:layout_marginVertical=
"5dp"
android:background=
"@drawable/bg_corners_4772ff"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
</com.google.android.gms.ads.nativead.NativeAdView>
\ No newline at end of file
app/src/main/res/values/themes.xml
View file @
542ae49d
...
@@ -74,5 +74,8 @@
...
@@ -74,5 +74,8 @@
<item
name=
"android:statusBarColor"
>
?attr/colorPrimaryVariant
</item>
<item
name=
"android:statusBarColor"
>
?attr/colorPrimaryVariant
</item>
</style>
</style>
<style
name=
"MyButton"
>
</style>
</resources>
</resources>
\ No newline at end of file
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