Commit 53cf96d8 authored by mengcuiguang2's avatar mengcuiguang2

添加开屏启动页

parent 7aa07a47
......@@ -109,6 +109,16 @@ android {
flavor -> flavor.manifestPlaceholders = [CHANNEL_NAME_VALUE: name]
}
// 自定义输出配置
applicationVariants.all { variant ->
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
outputFileName = "${variant.productFlavors[0].name}_${defaultConfig.versionName}.apk"
}
}
}
repositories {
flatDir {
dirs 'libs'
......
......@@ -7,6 +7,13 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
android:name="com.mints.street.AppApplication"
......@@ -19,7 +26,36 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name="com.mints.street.main.MainActivity">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" /> <!-- 适配小米(xiaomi)刘海屏 -->
<meta-data
android:name="android.max_aspect"
android:value="2.4"
tools:replace="android:value" />
<meta-data
android:name="android.notch_support"
android:value="true" />
<meta-data
android:name="notch.config"
android:value="portrait|landscape" /> <!-- 渠道名称 -->
<meta-data
android:name="CHANNEL_NAME"
android:value="${CHANNEL_NAME_VALUE}" /> <!-- 友盟 -->
<meta-data
android:name="UMENG_KEY"
android:value="${UMENG_KEY}" /> <!-- ShareSDK -->
<meta-data
android:name="Mob-AppKey"
android:value="${SHARE_KEY}" />
<meta-data
android:name="Mob-AppSecret"
android:value="${SHARE_SECRET}" />
<activity android:name="com.mints.street.splash.SplashActivity"
android:excludeFromRecents="true"
android:theme="@style/NormalSplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -29,7 +65,11 @@
<activity android:name="com.mints.street.login.LoginActivity">
</activity>
<activity android:name="com.mints.street.splash.SplashActivity">
<activity android:name="com.mints.street.main.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:theme="@style/AppTheme.NoneTranslucent">
</activity>
......
......@@ -10,6 +10,7 @@ import com.bytedance.msdk.api.TTMediationAdSdk;
import com.bytedance.msdk.api.UserInfoForSegment;
import com.mints.street.common.Constant;
import com.mints.street.BuildConfig;
import com.mints.street.manager.CsjGroMoreManager;
import java.util.HashMap;
import java.util.Map;
......@@ -19,9 +20,6 @@ import java.util.Map;
*/
public class TTGroMoreAdManagerHolder {
public static final String TT_AD_APPID = "12345";
public static final String TT_AD_NAME = Constant.MINTS_APP_NAME;
private static boolean sInit;
public static void init(Context context) {
......@@ -48,8 +46,8 @@ public class TTGroMoreAdManagerHolder {
// customInfos.put("bbbb", "test222");
userInfo.setCustomInfos(customInfos);
return new TTAdConfig.Builder()
.appId(TT_AD_APPID) //必填 ,不能为空
.appName(TT_AD_NAME) //必填,不能为空
.appId(CsjGroMoreManager.TT_AD_APPID) //必填 ,不能为空
.appName(Constant.MINTS_APP_NAME) //必填,不能为空
.openAdnTest(false)//开启第三方ADN测试时需要设置为true,会每次重新拉去最新配置,release 包情况下必须关闭.默认false
.isPanglePaid(false)//是否为费用户
.setPublisherDid(getAndroidId(context)) //用户自定义device_id
......
This diff is collapsed.
......@@ -9,8 +9,13 @@ import com.mints.street.ad.TTGroMoreAdManagerHolder
*/
object CsjGroMoreManager {
const val TT_AD_APPID = "12345"
var AD_UNIT_SPLASH_ID = "" // 开屏
// 穿山甲id
var AD_CSJ_SPLASH_ID = "" // 开屏
fun init(application: AppApplication) {
TTGroMoreAdManagerHolder.init(application)
}
......
package com.mints.street.splash
import android.os.Bundle
import android.widget.FrameLayout
import com.bytedance.msdk.adapter.pangle.PangleNetworkRequestInfo
import com.bytedance.msdk.api.AdError
import com.bytedance.msdk.api.AdSlot
import com.bytedance.msdk.api.TTNetworkRequestInfo
import com.bytedance.msdk.api.splash.TTSplashAd
import com.bytedance.msdk.api.splash.TTSplashAdListener
import com.bytedance.msdk.api.splash.TTSplashAdLoadCallback
import com.fry.base.base.BaseActivity
import com.mints.street.BR
import com.mints.street.R
import com.mints.street.common.DeviceInfo
import com.mints.street.databinding.ActivitySplashBinding
import com.mints.street.main.MainActivity
import com.mints.street.manager.CsjGroMoreManager
/**
* Created by 冯瑞雨 on 2021/7/5.
* 优量汇开屏页
* 描述:gromore开屏页
* 作者:孟崔广
* 时间:2021/7/9 13:39
*/
class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
private var mSplashContainer: FrameLayout? = null
private var mTTSplashAd: TTSplashAd? = null
private val AD_TIME_OUT = 3000
private var onPaused = false
//是否强制跳转到主页面
private var mForceGoMain = false
override fun initContentView(savedInstanceState: Bundle?) = R.layout.activity_splash
override fun initVariableId() = BR.viewModel
......@@ -27,10 +47,123 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
checkAppSign()
}
override fun onResume() {
//判断是否该跳转到主页面
if (mForceGoMain) {
goToMainActivity()
}
if (onPaused ) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要自己在onResume中跳转主页。
goToMainActivity()
}
super.onResume()
}
override fun onPause() {
super.onPause()
onPaused = true
}
override fun onStop() {
super.onStop()
mForceGoMain = true
}
override fun onDestroy() {
super.onDestroy()
mTTSplashAd?.destroy()
mTTSplashAd=null
mSplashContainer?.removeAllViews()
mSplashContainer=null
}
/**
* 校验App签名
*/
private fun checkAppSign() {
val deviceInfo: DeviceInfo = DeviceInfo.instance
if (!deviceInfo.signInfo) {
finish()
} else {
try {
mSplashContainer = findViewById(R.id.splash_container)
//加载开屏广告
loadSplashAd()
} catch (e: Exception) {
goToMainActivity()
}
}
}
/**
* 加载开屏广告
*/
private fun loadSplashAd() {
/**
* 注:每次加载开屏广告的时候需要新建一个TTSplashAd,否则可能会出现广告填充问题
* ( 例如:mTTSplashAd = new TTSplashAd(this, mAdUnitId);)
*/
mTTSplashAd = TTSplashAd(this, CsjGroMoreManager.AD_UNIT_SPLASH_ID)
mTTSplashAd?.setTTAdSplashListener(mSplashAdListener)
//step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档
val adSlot = AdSlot.Builder()
.setImageAdSize(1080, 1920) // 既适用于原生类型,也适用于模版类型。
.build()
//自定义兜底方案 选择使用
val ttNetworkRequestInfo: TTNetworkRequestInfo
//穿山甲兜底
ttNetworkRequestInfo = PangleNetworkRequestInfo(CsjGroMoreManager.TT_AD_APPID,CsjGroMoreManager.AD_CSJ_SPLASH_ID)
//step4:请求广告,调用开屏广告异步请求接口,对请求回调的广告作渲染处理
mTTSplashAd?.loadAd(adSlot, ttNetworkRequestInfo, object : TTSplashAdLoadCallback {
// mTTSplashAd.loadAd(adSlot, new TTSplashAdLoadCallback() {
override fun onSplashAdLoadFail(adError: AdError) {
goToMainActivity()
}
override fun onSplashAdLoadSuccess() {
if (mTTSplashAd != null) {
mTTSplashAd!!.showAd(mSplashContainer)
}
}
override fun onAdLoadTimeout() {
goToMainActivity()
}
}, AD_TIME_OUT)
}
var mSplashAdListener: TTSplashAdListener = object : TTSplashAdListener {
override fun onAdClicked() {
}
override fun onAdShow() {
}
override fun onAdSkip() {
goToMainActivity()
}
override fun onAdDismiss() {
if (onPaused) {
// 这种情况下,百度开屏广告不能在onAdDismiss中跳转,需要在onResume中跳转主页。
return
}
goToMainActivity()
}
}
/**
* 跳转到主页面
*/
private fun goToMainActivity() {
startActivityThenKill(MainActivity::class.java)
}
}
\ No newline at end of file
package com.mints.street.utils;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.core.app.ActivityCompat;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* Desction:授权工具类
* Author:孟崔广
*/
public class PermissionUtils {
public static final int CODE_PERMISSIONS = 123;
public interface PermissionGrant {
/**
* 处理结果
*
* @param requestCode 请求码
* @param permissions 本次授权权限列表
* @param grantResults 本次授权结果,0:授权成功 -1:拒绝授权
* @param requestPermissions 请求所有权限
*/
void onPermissionGranted(final int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults, String[] requestPermissions);
}
private static void showMessageOKCancel(final Activity context, String message, DialogInterface.OnClickListener okListener, DialogInterface.OnClickListener cancelListener) {
new AlertDialog.Builder(context)
.setMessage(message)
.setPositiveButton("是", okListener)
.setNegativeButton("否", cancelListener)
.create()
.show();
}
/**
* 跳转到系统设置界面去开启权限
*
* @param activity
* @param message
*/
private static void openSettingActivity(final Activity activity, String message) {
showMessageOKCancel(activity, message, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
intent.setData(uri);
activity.startActivity(intent);
}
}, null);
}
/////////////////////////////////执行授权/////////////////////////////////////
/**
* 一次申请多个权限
*
* @param activity
* @param grant
*/
public static void requestMultiPermissions(final Activity activity, final String[] requestPermissions, final PermissionGrant grant) {
//获取没有授权的权限
final List<String> permissionsList = getNoGrantedPermission(activity, requestPermissions, false);
//获取上次被拒权限列表
final List<String> shouldRationalePermissionsList = getNoGrantedPermission(activity, requestPermissions, true);
if (permissionsList == null || shouldRationalePermissionsList == null) {
return;
}
final int[] grantResults = new int[requestPermissions.length];
if (permissionsList.size() > 0) {//去授权
ActivityCompat.requestPermissions(activity, permissionsList.toArray(new String[permissionsList.size()]), CODE_PERMISSIONS);
} else if (shouldRationalePermissionsList.size() > 0) {
showMessageOKCancel(activity, "应用缺少权限,是否重新去授权?",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ActivityCompat.requestPermissions(activity, shouldRationalePermissionsList.toArray(new String[shouldRationalePermissionsList.size()]),
CODE_PERMISSIONS);
}
}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
grant.onPermissionGranted(CODE_PERMISSIONS, requestPermissions, grantResults, requestPermissions);
}
});
} else {
grant.onPermissionGranted(CODE_PERMISSIONS, requestPermissions, grantResults, requestPermissions);
}
}
private static ArrayList<String> getNoGrantedPermission(Activity activity, String[] requestPermissions, boolean isShouldRationale) {
ArrayList<String> permissions = new ArrayList<>();
for (int i = 0; i < requestPermissions.length; i++) {
String requestPermission = requestPermissions[i];
int checkSelfPermission = -1;
try {
checkSelfPermission = ActivityCompat.checkSelfPermission(activity, requestPermission);
} catch (RuntimeException e) {
return null;
}
if (checkSelfPermission != PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(activity, requestPermission)) {
if (isShouldRationale) {
permissions.add(requestPermission);
}
} else {
if (!isShouldRationale) {
permissions.add(requestPermission);
}
}
}
}
return permissions;
}
/////////////////////////////////处理授权结果/////////////////////////////////////
/**
* 处理授权
*
* @param requestCode Need consistent with requestPermission
* @param permissions
* @param grantResults
*/
public static void requestPermissionsResult(final int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults, String[] requestPermissions, PermissionGrant permissionGrant) {
if (requestCode == CODE_PERMISSIONS) {
permissionGrant.onPermissionGranted(requestCode, permissions, grantResults, requestPermissions);
return;
}
}
/////////////////////////////////处理授权结果/////////////////////////////////////
public static boolean checkPermission(Context paramContext, String paramString) {
boolean bool = false;
if (paramContext == null) {
return false;
} else {
if (Build.VERSION.SDK_INT >= 23) {
try {
Class localClass = Class.forName("android.content.Context");
Method localMethod = localClass.getMethod("checkSelfPermission", String.class);
int i = (Integer)localMethod.invoke(paramContext, paramString);
bool = i == 0;
} catch (Throwable var6) {
bool = false;
}
} else {
PackageManager localPackageManager = paramContext.getPackageManager();
if (localPackageManager.checkPermission(paramString, paramContext.getPackageName()) == 0) {
bool = true;
}
}
return bool;
}
}
}
This diff is collapsed.
This diff is collapsed.
package com.mints.street.utils
import android.app.ActivityManager
import android.content.Context
import android.os.Environment
import android.os.StatFs
import java.io.BufferedReader
import java.io.File
import java.io.FileReader
import java.io.IOException
import kotlin.math.ceil
object SystemUtils {
/**
* 该方法必须在Activity或Service类内调用,一般情况下,可以在Activity的onCreate()方法中调用。
* 由于应用每启动一个新的进程,就会调用一次Application的onCreate()方法,而个推SDK是一个独立的进程
* ,因此如果在Application的onCreate()中调用intialize接口,会导致SDK初始化在一个应用中多次调用,
* 所以不建议在Application继承类中调用个推SDK初始化接口。
* 解释一下,每个[Android](http://lib.csdn.net/base/android "Android知识库")应用都要运行在一个虚拟机上,
* ”个推“采用Service和后台服务器通信进行通信,于是和原本的Activity就形成了多进程。
* 一个前台的应用进程,一个service后台进程,每个进程对应一个application对象,所以当应用配置了多个进程的时候,
* application对象的onCreate方法就会执行多次,所以为了保证只初始化一次,
* 就必须做出区分的处理的(“个推”中提到的在Activity或Service中初始,这种做法个人认为也是存在多次初始化的风险的);
* 进程名是通过Manifest.xml中的"android:process"属性设置的,因此可以在application的onCreate方法中通过pid获取processName,
* 再做进一步的判断(跟android:process的值进行判断)使得相关初始化代码仅执行一次。
*/
fun getProcessName(cxt: Context, pid: Int): String? {
val am: ActivityManager = cxt.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val runningApps: List<ActivityManager.RunningAppProcessInfo> =
am.runningAppProcesses
?: return null
for (procInfo in runningApps) {
if (procInfo.pid == pid) {
return procInfo.processName
}
}
return null
}
/**
* ram
*/
fun getTotalMemory(): String {
// 系统内存信息文件
val file = "/proc/meminfo"
val memInfo: String
val strs: Array<String>
var memory: Long = 0
try {
val fileReader = FileReader(file)
val bufferedReader = BufferedReader(
fileReader,
8192
)
// 读取meminfo第一行,系统内存大小
memInfo = bufferedReader.readLine()
strs = memInfo.split("\\s+".toRegex()).toTypedArray()
// 获得系统总内存,单位KB
memory = Integer.valueOf(strs[1]).toLong()
bufferedReader.close()
} catch (e: Exception) {
e.printStackTrace()
}
return "" + ceil((memory.toFloat() / (1024 * 1024).toDouble())).toInt() + "GB"
}
/**
* 获取手机内部空间总大小
*
* @return 大小,字节为单位
*/
fun getTotalInternalMemorySize(): String {
//获取内部存储根目录
val path: File = Environment.getExternalStorageDirectory()
//系统的空间描述类
val stat = StatFs(path.absolutePath)
//每个区块占字节数
val totalSize = stat.totalBytes
return "" + ceil((totalSize.toFloat() / (1024 * 1024 * 1024).toDouble())).toInt() + "GB"
}
/**
* 描述:获取内存占用率.
*/
fun getUsedPercentValue(context: Context?): Int {
val dir = "/proc/meminfo"
try {
val fr = FileReader(dir)
val br = BufferedReader(fr, 8192)
val memoryTotalLine = br.readLine()
val subMemoryLine = memoryTotalLine.substring(memoryTotalLine.indexOf("MemTotal:"))
/** KB 计量单位 */
br.close()
val totalMemorySize = subMemoryLine.replace("\\D+".toRegex(), "").toLong() * 1024
val availableSize: Long = getAvailMemory(context)
return (((totalMemorySize - availableSize) / totalMemorySize.toFloat()) * 100).toInt()
} catch (e: IOException) {
e.printStackTrace()
}
return -1
}
/**
* 描述:获取可用内存.
*/
fun getAvailMemory(context: Context?): Long {
// 获取android当前可用内存大小
val activityManager = context?.getSystemService(
Context.ACTIVITY_SERVICE
) as ActivityManager
val memoryInfo =
ActivityManager.MemoryInfo()
activityManager.getMemoryInfo(memoryInfo)
// 当前系统可用内存 ,将获得的内存大小规格化
return memoryInfo.availMem
}
}
\ No newline at end of file
package com.mints.street.utils.json;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* 描述:FooAnnotation
* 作者:孟崔广
* 时间:2018/1/10 17:51
* 邮箱:mengcga@163.com
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface FooAnnotation {
}
package com.mints.street.utils.json;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
/**
* 描述:FooAnnotationExclusionStrategy
* 作者:孟崔广
*/
public class FooAnnotationExclusionStrategy implements ExclusionStrategy {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return f.getAnnotation(FooAnnotation.class) != null;
}
@Override
public boolean shouldSkipClass(Class<?> clazz) {
return false;
// return clazz.getAnnotation(FooAnnotation.class) != null;
}
}
package com.mints.street.utils.json;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.lang.reflect.Type;
public class JsonUtil {
private static Gson gson = new GsonBuilder()
.addSerializationExclusionStrategy(new FooAnnotationExclusionStrategy())
.create();
@SuppressWarnings("hiding")
public static <T> T parseJson(String response, Class<T> clazz) {
try {
return gson.fromJson(response, clazz);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static <T> T parseJson(JsonObject response, Class<T> clazz) {
try {
return gson.fromJson(response, clazz);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 把json字符串转换为JavaBean。如果json的根节点就是一个集合,则使用此方法<p>
* type参数的获取方式为:Type type = new TypeToken<集合泛型>(){}.getType();
*
* @param json json字符串
* @return type 指定要解析成的数据类型
*/
public static <T> T json2Bean(String json, Type type) {
T bean = null;
try {
bean = gson.fromJson(json, type);
} catch (Exception e) {
Log.i("JsonUtil", "解析json数据时出现异常\njson = " + json, e);
}
return bean;
}
/**
* 把JsonElement转换为JavaBean。如果json的根节点就是一个集合,则使用此方法<p>
* type参数的获取方式为:Type type = new TypeToken<集合泛型>(){}.getType();
*
* @param json json字符串
* @return type 指定要解析成的数据类型
*/
public static <T> T json2Bean(JsonElement json, Type type) {
T bean = null;
try {
bean = gson.fromJson(json, type);
} catch (Exception e) {
Log.i("JsonUtil", "解析json数据时出现异常\njson = " + json, e);
}
return bean;
}
public static String toJson(Object object) {
try {
return gson.toJson(object);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
</shape>
</item>
<item >
<bitmap
android:src="@drawable/bg_splash" />
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout
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_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="400px" />
<RelativeLayout
android:id="@+id/splash_main"
<FrameLayout
android:id="@+id/splash_container"
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 -->
<FrameLayout
android:id="@+id/splash_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/app_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区域是一个高度很小的图片。 -->
<ImageView
android:id="@+id/app_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
/>
<!-- 4.自定义跳过按钮区域:开发者可以根据需要自己实现不同样式的跳过按钮 -->
<!-- 注意1:根据广告法规定,跳过按钮必须在屏幕当中出现。因此广告展示的时候,必须让将SkipView显示出来,即visible,否则将SDK将不展示广告,返回错误码608。。 -->
<!-- 注意2:SDK除了会检查跳过按钮的可见性,还将检测它的尺寸,其尺寸不得小于3dp*3dp,否则将SDK将不展示广告,返回错误码608。 -->
<TextView
android:id="@+id/skip_view"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/shape_bg_circle"
android:gravity="center"
android:text="点击跳过"
android:textColor="@android:color/white"
android:textSize="14sp"
android:visibility="gone" />
<!-- 本示例省略了自定义的倒计时,和跳过按钮放在一起实现了。开发者也可以实现自己的倒计时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/shape_bg_circle"
android:gravity="center"
android:text="已Wi-Fi预加载"
android:textColor="@android:color/white"
android:textSize="14sp"
android:visibility="gone" />
</RelativeLayout>
</FrameLayout>
android:background="@color/white"
android:src="@drawable/bg_splash"
/>
<data>
......
......@@ -10,7 +10,7 @@
<string name="bottom_name_task">任务中心</string>
<string name="bottom_name_my">个人中心</string>
<string name="app_sign">5932d26a</string>
<string name="app_sign">61117d7a</string>
<string name="dot">--</string>
......
......@@ -61,4 +61,24 @@
<style name="TabLayoutFavoriteTextStyle">
<item name="android:textSize">15sp</item>
</style>
<style name="NormalSplash" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_bg</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="AppTheme.NoneTranslucent" parent="AppTheme.Base">
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowAnimationStyle">@null</item>
</style>
<style name="CustomerTransparentTheme" parent="AppTheme.Base">
<!-- 为窗体的Enter和Exit设置动画 -->
<item name="android:windowAnimationStyle">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>
</style>
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>
\ No newline at end of file
#Fri Jul 09 10:43:39 CST 2021
VERSION_BUILD=2632
#Fri Jul 09 14:18:23 CST 2021
VERSION_BUILD=2650
......@@ -9,7 +9,7 @@
public *;
}
# for DexGuard only
-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
#glide-transformations
-keep class jp.wasabeef.glide.transformations.** {*;}
......
......@@ -247,6 +247,17 @@ public abstract class HabitBaseActivity<V extends ViewDataBinding, VM extends Ba
startContainerActivity(canonicalName, null);
}
/**
* startActivity then finish
*
* @param clazz
*/
protected void startActivityThenKill(Class<?> clazz) {
Intent intent = new Intent(this, clazz);
startActivity(intent);
finish();
}
/**
* 跳转容器页面
*
......
#Thu Jul 08 18:55:14 CST 2021
#Fri Jul 09 11:54:15 CST 2021
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_auth_title_back.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_auth_title_back.png
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_oks_classic_yixin.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_oks_classic_yixin.png
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\ssdk_oks_classic_wechatfavorite.png=D\:\\android_space\\MyStreet\\shareSdkLib\\build\\intermediates\\packaged_res\\debug\\drawable-xhdpi-v4\\ssdk_oks_classic_wechatfavorite.png
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment