Commit 37a8ffe75fcf3c4831bf0b7722d191eb2980448e
1 parent
24cc7626
更新jar包及demo
Showing
8 changed files
with
55 additions
and
21 deletions
.idea/misc.xml
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | <ConfirmationsSetting value="0" id="Add" /> |
| 38 | 38 | <ConfirmationsSetting value="0" id="Remove" /> |
| 39 | 39 | </component> |
| 40 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
| 40 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
| 41 | 41 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 42 | 42 | </component> |
| 43 | 43 | <component name="ProjectType"> | ... | ... |
app/libs/vlionSdk1.0.jar
No preview for this file type
app/src/main/AndroidManifest.xml
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | </intent-filter> |
| 28 | 28 | </activity> |
| 29 | 29 | |
| 30 | - <receiver android:name="cn.vlion.ad.utils.apkdownload.DownloadCompleteReceiver"> | |
| 30 | + <receiver android:name="cn.vlion.ad.core.VLionReceiver"> | |
| 31 | 31 | <intent-filter> |
| 32 | 32 | <action android:name="android.intent.action.DOWNLOAD_COMPLETE" /> |
| 33 | 33 | </intent-filter> |
| ... | ... | @@ -37,6 +37,16 @@ |
| 37 | 37 | </intent-filter> |
| 38 | 38 | </receiver> |
| 39 | 39 | |
| 40 | + <provider | |
| 41 | + android:name="android.support.v4.content.FileProvider" | |
| 42 | + android:authorities="cn.vlion.ad.fileprovider" | |
| 43 | + android:exported="false" | |
| 44 | + android:grantUriPermissions="true"> | |
| 45 | + <meta-data | |
| 46 | + android:name="android.support.FILE_PROVIDER_PATHS" | |
| 47 | + android:resource="@xml/file_provider" /> | |
| 48 | + </provider> | |
| 49 | + | |
| 40 | 50 | <activity |
| 41 | 51 | android:name="cn.vlion.simple.BannerActivity" |
| 42 | 52 | android:configChanges="keyboardHidden|screenSize|orientation" | ... | ... |
app/src/main/java/cn/vlion/simple/BannerActivity.java
| ... | ... | @@ -2,12 +2,15 @@ package cn.vlion.simple; |
| 2 | 2 | |
| 3 | 3 | import android.os.Bundle; |
| 4 | 4 | import android.support.v7.app.AppCompatActivity; |
| 5 | +import android.util.Log; | |
| 6 | +import android.view.ViewGroup; | |
| 5 | 7 | import android.widget.RelativeLayout; |
| 6 | 8 | |
| 7 | 9 | import cn.vlion.ad.core.Config; |
| 8 | 10 | import cn.vlion.ad.moudle.banner.BannerManager; |
| 9 | 11 | import cn.vlion.ad.moudle.banner.BannerView; |
| 10 | 12 | import cn.vlion.ad.moudle.banner.BannerViewListener; |
| 13 | +import cn.vlion.simple.util.ScreenUtil; | |
| 11 | 14 | |
| 12 | 15 | public class BannerActivity extends AppCompatActivity { |
| 13 | 16 | |
| ... | ... | @@ -23,44 +26,46 @@ public class BannerActivity extends AppCompatActivity { |
| 23 | 26 | bannerContainer = (RelativeLayout) findViewById(R.id.bannerContainer); |
| 24 | 27 | |
| 25 | 28 | BannerManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); |
| 26 | - | |
| 27 | - bannerView = BannerManager.getInstance().getBannerView(this, "350", new BannerViewListener() { | |
| 28 | - | |
| 29 | + //430 h5 | |
| 30 | + //431 image | |
| 31 | + bannerView = BannerManager.getInstance().getBannerView(this, "430", new BannerViewListener() { | |
| 29 | 32 | @Override |
| 30 | - public void onRequestFailed(int i, String s) { | |
| 31 | - | |
| 33 | + public void onRequestSuccess(int viewWidth, int viewHeight) { | |
| 34 | + Log.e(TAG, "onRequestSuccess: " + viewWidth + "," + viewHeight); | |
| 35 | + bannerContainer.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT; | |
| 36 | + bannerContainer.getLayoutParams().height = ScreenUtil.getScreenWidth(BannerActivity.this) * viewHeight / viewWidth; | |
| 32 | 37 | } |
| 33 | 38 | |
| 34 | 39 | @Override |
| 35 | - public void onRequestSuccess(int i, int i1) { | |
| 36 | - | |
| 40 | + public void onRequestFailed(int code, String errorMsg) { | |
| 41 | + Log.e(TAG, "onRequestFailed" + code + " : " + errorMsg); | |
| 37 | 42 | } |
| 38 | 43 | |
| 39 | 44 | @Override |
| 40 | 45 | public void onShowSuccess() { |
| 41 | - | |
| 46 | + Log.e(TAG, "onShowSuccess"); | |
| 42 | 47 | } |
| 43 | 48 | |
| 44 | 49 | @Override |
| 45 | 50 | public void onSwitchBanner() { |
| 46 | - | |
| 51 | + Log.e(TAG, "onSwitchBanner"); | |
| 47 | 52 | } |
| 48 | 53 | |
| 49 | 54 | @Override |
| 50 | - public void onShowFailed(int i, String s) { | |
| 51 | - | |
| 55 | + public void onShowFailed(int code, String msg) { | |
| 56 | + Log.e(TAG, "onShowFailed: " + code + "," + msg); | |
| 52 | 57 | } |
| 53 | 58 | |
| 54 | 59 | @Override |
| 55 | 60 | public void onBannerClicked() { |
| 56 | - | |
| 61 | + Log.e(TAG, "onBannerClicked"); | |
| 57 | 62 | } |
| 58 | 63 | }); |
| 59 | 64 | |
| 60 | -// bannerView.setLayoutParams(new RelativeLayout.LayoutParams(300, 300)); | |
| 61 | 65 | bannerContainer.addView(bannerView); |
| 62 | 66 | } |
| 63 | 67 | |
| 68 | + | |
| 64 | 69 | @Override |
| 65 | 70 | protected void onPause() { |
| 66 | 71 | super.onPause(); | ... | ... |
app/src/main/java/cn/vlion/simple/SplashActivity.java
| ... | ... | @@ -72,7 +72,9 @@ public class SplashActivity extends AppCompatActivity { |
| 72 | 72 | SplashManager.getInstance().setAutoJumpToTargetWhenShowFailed(true); |
| 73 | 73 | SplashManager.getInstance().setSplashViewContainer(splashAdContainer); |
| 74 | 74 | SplashManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); |
| 75 | - SplashManager.getInstance().showSplash(this, "353", new SplashViewListener() { | |
| 75 | + //432 h5 | |
| 76 | + //433 image | |
| 77 | + SplashManager.getInstance().showSplash(this, "432", new SplashViewListener() { | |
| 76 | 78 | |
| 77 | 79 | @Override |
| 78 | 80 | public void onRequestSuccess(int viewWidth, int viewHeight) { | ... | ... |
app/src/main/java/cn/vlion/simple/SpotActivity.java
| ... | ... | @@ -36,15 +36,16 @@ public class SpotActivity extends AppCompatActivity { |
| 36 | 36 | adLayout = (RelativeLayout) findViewById(R.id.adLayout); |
| 37 | 37 | |
| 38 | 38 | SpotManager.getInstance().setSpotViewContainer(spotAdContainer); |
| 39 | -// SpotManager.getInstance().setSplashViewContainerAndLayoutParams(splashContainer, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 600)); | |
| 40 | 39 | SpotManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); |
| 41 | - SpotManager.getInstance().showSpot(this, "355",new SpotViewListener() { | |
| 40 | + //434 h5 | |
| 41 | + //438 image | |
| 42 | + SpotManager.getInstance().showSpot(this, "438", new SpotViewListener() { | |
| 42 | 43 | |
| 43 | 44 | @Override |
| 44 | 45 | public void onRequestSuccess(int viewWidth, int viewHeight, int closeViewHeight) { |
| 45 | 46 | Log.e(TAG, "onRequestSuccess: " + viewWidth + "," + viewHeight); |
| 46 | - spotAdContainer.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT; | |
| 47 | - spotAdContainer.getLayoutParams().height = ScreenUtil.getScreenWidth(SpotActivity.this) * viewHeight / viewWidth + closeViewHeight; | |
| 47 | + spotAdContainer.getLayoutParams().width = 300; | |
| 48 | + spotAdContainer.getLayoutParams().height = 300 * viewHeight / viewWidth + closeViewHeight; | |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | 51 | @Override | ... | ... |
app/src/main/res/drawable/vlion_bg_jump.xml
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | 3 | android:shape="rectangle" |
| 4 | 4 | android:useLevel="false"> |
| 5 | - <solid android:color="#66000000" /> | |
| 5 | + <solid android:color="#2f000000" /> | |
| 6 | 6 | <corners |
| 7 | 7 | android:bottomLeftRadius="10dp" |
| 8 | 8 | android:bottomRightRadius="10dp" | ... | ... |
app/src/main/res/xml/file_provider.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<paths> | |
| 3 | + | |
| 4 | + <!-- | |
| 5 | + ## 说明 | |
| 6 | + | |
| 7 | + 这个文件为开发者适配Android 7.0系统以上才需要配置瑞狮的相关内容,如果没有兼容到的话,可以不管 | |
| 8 | + --> | |
| 9 | + | |
| 10 | + <cache-path | |
| 11 | + name="apk1" | |
| 12 | + path="." /> | |
| 13 | + <external-path | |
| 14 | + name="apk2" | |
| 15 | + path="." /> | |
| 16 | +</paths> | |
| 0 | 17 | \ No newline at end of file | ... | ... |