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,7 +37,7 @@ | ||
| 37 | <ConfirmationsSetting value="0" id="Add" /> | 37 | <ConfirmationsSetting value="0" id="Add" /> |
| 38 | <ConfirmationsSetting value="0" id="Remove" /> | 38 | <ConfirmationsSetting value="0" id="Remove" /> |
| 39 | </component> | 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 | <output url="file://$PROJECT_DIR$/build/classes" /> | 41 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 42 | </component> | 42 | </component> |
| 43 | <component name="ProjectType"> | 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,7 +27,7 @@ | ||
| 27 | </intent-filter> | 27 | </intent-filter> |
| 28 | </activity> | 28 | </activity> |
| 29 | 29 | ||
| 30 | - <receiver android:name="cn.vlion.ad.utils.apkdownload.DownloadCompleteReceiver"> | 30 | + <receiver android:name="cn.vlion.ad.core.VLionReceiver"> |
| 31 | <intent-filter> | 31 | <intent-filter> |
| 32 | <action android:name="android.intent.action.DOWNLOAD_COMPLETE" /> | 32 | <action android:name="android.intent.action.DOWNLOAD_COMPLETE" /> |
| 33 | </intent-filter> | 33 | </intent-filter> |
| @@ -37,6 +37,16 @@ | @@ -37,6 +37,16 @@ | ||
| 37 | </intent-filter> | 37 | </intent-filter> |
| 38 | </receiver> | 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 | <activity | 50 | <activity |
| 41 | android:name="cn.vlion.simple.BannerActivity" | 51 | android:name="cn.vlion.simple.BannerActivity" |
| 42 | android:configChanges="keyboardHidden|screenSize|orientation" | 52 | android:configChanges="keyboardHidden|screenSize|orientation" |
app/src/main/java/cn/vlion/simple/BannerActivity.java
| @@ -2,12 +2,15 @@ package cn.vlion.simple; | @@ -2,12 +2,15 @@ package cn.vlion.simple; | ||
| 2 | 2 | ||
| 3 | import android.os.Bundle; | 3 | import android.os.Bundle; |
| 4 | import android.support.v7.app.AppCompatActivity; | 4 | import android.support.v7.app.AppCompatActivity; |
| 5 | +import android.util.Log; | ||
| 6 | +import android.view.ViewGroup; | ||
| 5 | import android.widget.RelativeLayout; | 7 | import android.widget.RelativeLayout; |
| 6 | 8 | ||
| 7 | import cn.vlion.ad.core.Config; | 9 | import cn.vlion.ad.core.Config; |
| 8 | import cn.vlion.ad.moudle.banner.BannerManager; | 10 | import cn.vlion.ad.moudle.banner.BannerManager; |
| 9 | import cn.vlion.ad.moudle.banner.BannerView; | 11 | import cn.vlion.ad.moudle.banner.BannerView; |
| 10 | import cn.vlion.ad.moudle.banner.BannerViewListener; | 12 | import cn.vlion.ad.moudle.banner.BannerViewListener; |
| 13 | +import cn.vlion.simple.util.ScreenUtil; | ||
| 11 | 14 | ||
| 12 | public class BannerActivity extends AppCompatActivity { | 15 | public class BannerActivity extends AppCompatActivity { |
| 13 | 16 | ||
| @@ -23,44 +26,46 @@ public class BannerActivity extends AppCompatActivity { | @@ -23,44 +26,46 @@ public class BannerActivity extends AppCompatActivity { | ||
| 23 | bannerContainer = (RelativeLayout) findViewById(R.id.bannerContainer); | 26 | bannerContainer = (RelativeLayout) findViewById(R.id.bannerContainer); |
| 24 | 27 | ||
| 25 | BannerManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); | 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 | @Override | 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 | @Override | 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 | @Override | 44 | @Override |
| 40 | public void onShowSuccess() { | 45 | public void onShowSuccess() { |
| 41 | - | 46 | + Log.e(TAG, "onShowSuccess"); |
| 42 | } | 47 | } |
| 43 | 48 | ||
| 44 | @Override | 49 | @Override |
| 45 | public void onSwitchBanner() { | 50 | public void onSwitchBanner() { |
| 46 | - | 51 | + Log.e(TAG, "onSwitchBanner"); |
| 47 | } | 52 | } |
| 48 | 53 | ||
| 49 | @Override | 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 | @Override | 59 | @Override |
| 55 | public void onBannerClicked() { | 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 | bannerContainer.addView(bannerView); | 65 | bannerContainer.addView(bannerView); |
| 62 | } | 66 | } |
| 63 | 67 | ||
| 68 | + | ||
| 64 | @Override | 69 | @Override |
| 65 | protected void onPause() { | 70 | protected void onPause() { |
| 66 | super.onPause(); | 71 | super.onPause(); |
app/src/main/java/cn/vlion/simple/SplashActivity.java
| @@ -72,7 +72,9 @@ public class SplashActivity extends AppCompatActivity { | @@ -72,7 +72,9 @@ public class SplashActivity extends AppCompatActivity { | ||
| 72 | SplashManager.getInstance().setAutoJumpToTargetWhenShowFailed(true); | 72 | SplashManager.getInstance().setAutoJumpToTargetWhenShowFailed(true); |
| 73 | SplashManager.getInstance().setSplashViewContainer(splashAdContainer); | 73 | SplashManager.getInstance().setSplashViewContainer(splashAdContainer); |
| 74 | SplashManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); | 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 | @Override | 79 | @Override |
| 78 | public void onRequestSuccess(int viewWidth, int viewHeight) { | 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,15 +36,16 @@ public class SpotActivity extends AppCompatActivity { | ||
| 36 | adLayout = (RelativeLayout) findViewById(R.id.adLayout); | 36 | adLayout = (RelativeLayout) findViewById(R.id.adLayout); |
| 37 | 37 | ||
| 38 | SpotManager.getInstance().setSpotViewContainer(spotAdContainer); | 38 | SpotManager.getInstance().setSpotViewContainer(spotAdContainer); |
| 39 | -// SpotManager.getInstance().setSplashViewContainerAndLayoutParams(splashContainer, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 600)); | ||
| 40 | SpotManager.getInstance().setAdScalingModel(Config.AD_SCALING_MODE_SCALE_TO_FIT); | 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 | @Override | 44 | @Override |
| 44 | public void onRequestSuccess(int viewWidth, int viewHeight, int closeViewHeight) { | 45 | public void onRequestSuccess(int viewWidth, int viewHeight, int closeViewHeight) { |
| 45 | Log.e(TAG, "onRequestSuccess: " + viewWidth + "," + viewHeight); | 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 | @Override | 51 | @Override |
app/src/main/res/drawable/vlion_bg_jump.xml
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | android:shape="rectangle" | 3 | android:shape="rectangle" |
| 4 | android:useLevel="false"> | 4 | android:useLevel="false"> |
| 5 | - <solid android:color="#66000000" /> | 5 | + <solid android:color="#2f000000" /> |
| 6 | <corners | 6 | <corners |
| 7 | android:bottomLeftRadius="10dp" | 7 | android:bottomLeftRadius="10dp" |
| 8 | android:bottomRightRadius="10dp" | 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 | \ No newline at end of file | 17 | \ No newline at end of file |