Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_xunmi
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_xunmi
Commits
9c5b2762
Commit
9c5b2762
authored
Aug 13, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加优量汇广告
parent
94fe3c8a
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
841 additions
and
3 deletions
+841
-3
build.gradle
position/app/build.gradle
+4
-2
GDTSDK.unionNormal.4.232.1102.aar
position/app/libs/GDTSDK.unionNormal.4.232.1102.aar
+0
-0
AndroidManifest.xml
position/app/src/main/AndroidManifest.xml
+29
-1
MintsApplication.java
...n/app/src/main/java/com/mints/xunmi/MintsApplication.java
+10
-0
SplashADActivity.java
...n/java/com/mints/xunmi/ui/activitys/SplashADActivity.java
+295
-0
SplashYlhActivity.java
.../java/com/mints/xunmi/ui/activitys/SplashYlhActivity.java
+371
-0
ForegroundOrBackground.java
...in/java/com/mints/xunmi/utils/ForegroundOrBackground.java
+17
-0
gdt_splash_logo.png
position/app/src/main/res/drawable-xhdpi/gdt_splash_logo.png
+0
-0
background_circle.xml
position/app/src/main/res/drawable/background_circle.xml
+19
-0
activity_splash_ylh.xml
position/app/src/main/res/layout/activity_splash_ylh.xml
+88
-0
provider_paths.xml
position/app/src/main/res/xml/provider_paths.xml
+8
-0
No files found.
position/app/build.gradle
View file @
9c5b2762
...
...
@@ -10,8 +10,8 @@ android {
applicationId
"com.mints.xunmi"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
1
versionName
"1.0.
0
"
versionCode
2
versionName
"1.0.
1
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
@@ -219,6 +219,8 @@ dependencies {
implementation
files
(
'libs/AMap3DMap_7.4.0_AMapSearch_7.3.0_AMapLocation_4.9.0_20200416.jar'
)
// 移动安全联盟
implementation
(
name:
'msa_mdid_1.0.13'
,
ext:
'aar'
)
// 优量汇
implementation
(
name:
'GDTSDK.unionNormal.4.232.1102'
,
ext:
'aar'
)
testImplementation
'junit:junit:4.12'
...
...
position/app/libs/GDTSDK.unionNormal.4.232.1102.aar
0 → 100644
View file @
9c5b2762
File added
position/app/src/main/AndroidManifest.xml
View file @
9c5b2762
...
...
@@ -76,7 +76,8 @@
android:value=
"${SHARE_SECRET}"
/>
<activity
android:name=
"com.mints.xunmi.ui.activitys.SplashActivity"
android:name=
".ui.activitys.SplashYlhActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:theme=
"@style/AppTheme.TranslucentSplish"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
@@ -84,6 +85,14 @@
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".ui.activitys.SplashADActivity"
android:configChanges=
"orientation|screenSize|keyboardHidden"
android:theme=
"@style/AppTheme.TranslucentSplish"
>
</activity>
<activity
android:name=
".ui.activitys.SplashActivity"
android:theme=
"@style/AppTheme.TranslucentSplish"
/>
<activity
android:name=
"com.mints.xunmi.ui.activitys.GuideActivity"
/>
<activity
android:name=
".ui.activitys.LoginActivity"
...
...
@@ -247,6 +256,25 @@
<meta-data
android:name=
"JPUSH_CHANNEL"
android:value=
"${JPUSH_CHANNEL}"
/>
<!-- 广点通广告 -->
<uses-library
android:name=
"org.apache.http.legacy"
android:required=
"false"
/>
<!-- 声明SDK所需要的组件 -->
<service
android:name=
"com.qq.e.comm.DownloadService"
android:exported=
"false"
/>
<activity
android:name=
"com.qq.e.ads.ADActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
/>
<activity
android:name=
"com.qq.e.ads.PortraitADActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
"com.qq.e.ads.LandscapeADActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation=
"landscape"
/>
</application>
</manifest>
\ No newline at end of file
position/app/src/main/java/com/mints/xunmi/MintsApplication.java
View file @
9c5b2762
...
...
@@ -32,6 +32,7 @@ import com.orhanobut.logger.AndroidLogAdapter;
import
com.orhanobut.logger.FormatStrategy
;
import
com.orhanobut.logger.Logger
;
import
com.orhanobut.logger.PrettyFormatStrategy
;
import
com.qq.e.comm.managers.GDTADManager
;
import
com.tendcloud.tenddata.TCAgent
;
import
com.umeng.commonsdk.UMConfigure
;
...
...
@@ -158,6 +159,9 @@ public class MintsApplication extends MultiDexApplication {
// 极光一键登录
initJLogin
();
// 优量汇
initYlh
();
}
/**
...
...
@@ -245,6 +249,12 @@ public class MintsApplication extends MultiDexApplication {
TCAgent
.
setReportUncaughtExceptions
(
true
);
}
/**
* 优量汇
*/
private
void
initYlh
()
{
GDTADManager
.
getInstance
().
initWith
(
this
,
"1110736621"
);
}
/**
* app退出
...
...
position/app/src/main/java/com/mints/xunmi/ui/activitys/SplashADActivity.java
0 → 100644
View file @
9c5b2762
This diff is collapsed.
Click to expand it.
position/app/src/main/java/com/mints/xunmi/ui/activitys/SplashYlhActivity.java
0 → 100644
View file @
9c5b2762
This diff is collapsed.
Click to expand it.
position/app/src/main/java/com/mints/xunmi/utils/ForegroundOrBackground.java
View file @
9c5b2762
...
...
@@ -2,6 +2,7 @@ package com.mints.xunmi.utils;
import
android.app.Activity
;
import
android.app.Application
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
...
...
@@ -9,6 +10,7 @@ import com.mints.xunmi.common.AppConfig;
import
com.mints.xunmi.manager.TrackManager
;
import
com.mints.xunmi.mvp.presenters.VersionUpdatePresenter
;
import
com.mints.xunmi.mvp.presenters.VersionUpdatePresenter
;
import
com.mints.xunmi.ui.activitys.SplashADActivity
;
import
java.lang.ref.WeakReference
;
...
...
@@ -89,6 +91,21 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
if
(
activity
==
null
)
return
;
String
simpleName
=
activity
.
getClass
().
getSimpleName
();
if
(
TextUtils
.
equals
(
simpleName
,
"SplashYlhActivity"
)
||
TextUtils
.
equals
(
simpleName
,
"GuideActivity"
)
||
TextUtils
.
equals
(
simpleName
,
"CarePeopleActivity"
)
||
TextUtils
.
equals
(
simpleName
,
"VipActivity"
)
||
TextUtils
.
equals
(
simpleName
,
"Vip3Activity"
)
||
TextUtils
.
equals
(
simpleName
,
"Vip2Activity"
))
{
count
++;
return
;
}
if
(
count
==
0
)
{
activity
.
startActivity
(
new
Intent
(
activity
,
SplashADActivity
.
class
));
}
count
++;
}
...
...
position/app/src/main/res/drawable-xhdpi/gdt_splash_logo.png
0 → 100644
View file @
9c5b2762
96.1 KB
position/app/src/main/res/drawable/background_circle.xml
0 → 100644
View file @
9c5b2762
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"#80000000"
/>
<padding
android:bottom=
"3dp"
android:left=
"8dp"
android:right=
"8dp"
android:top=
"3dp"
/>
<corners
android:bottomLeftRadius=
"45dp"
android:bottomRightRadius=
"45dp"
android:topLeftRadius=
"45dp"
android:topRightRadius=
"45dp"
/>
</shape>
\ No newline at end of file
position/app/src/main/res/layout/activity_splash_ylh.xml
0 → 100644
View file @
9c5b2762
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/fl_splash"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/white"
>
<!--这里模拟一张oneshot单的焦点图展示-->
<ImageView
android:id=
"@+id/oneshot_image"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"400px"
android:layout_marginLeft=
"10dp"
android:layout_marginRight=
"10dp"
/>
<RelativeLayout
android:id=
"@+id/splash_main"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/white"
>
<!-- 广点通开屏广告支持“半屏/全屏”展示,开发者可以把Logo区域放在屏幕底部,然后在Logo上方提供一个容器来放置半开屏广告,请注意此容器高度不得小于400dp -->
<!-- 1.Logo区域:展示半开屏广告时使用,如果想展示全开屏广告,可以不需要这个Logo区域 -->
<!-- 注意:如需要这个Logo区域,建议开发者使用自己的Logo资源,而不是联盟的Logo资源@drawable/gdt_splash_logo,资源规格可参照@drawable/gdt_splash_logo -->
<ImageView
android:id=
"@+id/app_logo"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:src=
"@drawable/gdt_splash_logo"
/>
<!-- 2.预设开屏图片区域: -->
<!-- 开发者可以把自家App设计开屏图片摆放在这里,本示例中放置了一张静态图片。!-->
<!-- 注意1:直接将此图放在广告容器的下面即可,始终不要将广告容器splash_container的设为invisible,否则将不会展示广告无法计费,返回错误码600。-->
<!-- 注意2:建议开发者使用自己的开屏图片资源,而不是联盟的@drawable/splash_holder,资源规格可参照@drawable/splash_holder -->
<ImageView
android:id=
"@+id/splash_holder"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@id/app_logo"
android:scaleType=
"fitXY"
/>
<!-- 3.开屏广告容器区域:-->
<!-- 注意:该区域高度不得小于400dp。在本示例中没有写死splash_container的高度值,是因为第1部分的app_logo区域是一个高度很小的图片。 -->
<FrameLayout
android:id=
"@+id/splash_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@id/app_logo"
/>
<!-- 4.自定义跳过按钮区域:开发者可以根据需要自己实现不同样式的跳过按钮 -->
<!-- 注意1:根据广告法规定,跳过按钮必须在屏幕当中出现。因此广告展示的时候,必须让将SkipView显示出来,即visible,否则将SDK将不展示广告,返回错误码608。。 -->
<!-- 注意2:SDK除了会检查跳过按钮的可见性,还将检测它的尺寸,其尺寸不得小于3dp*3dp,否则将SDK将不展示广告,返回错误码608。 -->
<TextView
android:id=
"@+id/skip_view"
android:layout_width=
"96dp"
android:visibility=
"gone"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentTop=
"true"
android:layout_margin=
"16dp"
android:background=
"@drawable/background_circle"
android:gravity=
"center"
android:text=
"点击跳过"
android:textColor=
"@android:color/white"
android:textSize=
"14sp"
/>
<!-- 本示例省略了自定义的倒计时,和跳过按钮放在一起实现了。开发者也可以实现自己的倒计时View,方法是在onADTick回调中获得广告剩余的展示时间,并自由决定倒计时View的样式,SDK对倒计时的View没有要求。 -->
<!-- 自定义wifi预加载按钮,需设置状态为不显示,当素材为视频且视频开始播放时,SDK内部会处理为显示状态-->
<TextView
android:id=
"@+id/preload_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_alignParentTop=
"true"
android:layout_margin=
"16dp"
android:background=
"@drawable/background_circle"
android:gravity=
"center"
android:text=
"已Wi-Fi预加载"
android:textColor=
"@android:color/white"
android:textSize=
"14sp"
android:visibility=
"gone"
/>
</RelativeLayout>
</FrameLayout>
\ No newline at end of file
position/app/src/main/res/xml/provider_paths.xml
View file @
9c5b2762
...
...
@@ -11,4 +11,12 @@
<cache-path
name=
"cache"
path=
"."
/>
<!-- 优量汇 这个下载路径也不可以修改,必须为GDTDOWNLOAD -->
<external-cache-path
name=
"gdt_sdk_download_path1"
path=
"com_qq_e_download"
/>
<cache-path
name=
"gdt_sdk_download_path2"
path=
"com_qq_e_download"
/>
</paths>
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