启动页问题修改 1
This commit is contained in:
parent
54eb9ea099
commit
e447824ea1
@ -128,12 +128,32 @@
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- -->
|
||||
|
||||
<activity
|
||||
android:name="com.shayu.phonelive.activity.LauncherActivity"
|
||||
android:exported="true"
|
||||
>
|
||||
<!-- <intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>-->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
|
||||
<data android:scheme="um.64e40ee55488fe7b3afa2c96" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.shayu.phonelive.activity.TestActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/MySplashTheme"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="LockedOrientationActivity">
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@ -144,10 +144,12 @@ public class AppContext extends CommonAppContext {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
if (!isMainProcess()) {
|
||||
return;
|
||||
}
|
||||
super.onCreate();
|
||||
long startTime = System.currentTimeMillis();
|
||||
Log.d("AppStart AppContext", "App start time: " + startTime);
|
||||
CrashSaveBean.getInstance().setStartTime(System.currentTimeMillis());
|
||||
//注册全局异常捕获
|
||||
registerError();
|
||||
|
@ -119,9 +119,9 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
setStatusBar();
|
||||
setContentView(R.layout.activity_launcher);
|
||||
EventBus.getDefault().register(this);
|
||||
// setStatusBar();
|
||||
mContext = this;
|
||||
mRoot = findViewById(R.id.root);
|
||||
mCover = findViewById(R.id.cover);
|
||||
@ -131,7 +131,6 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
mBtnSkipVideo = findViewById(R.id.btn_skip_video);
|
||||
mBtnSkipImage.setOnClickListener(this);
|
||||
mBtnSkipVideo.setOnClickListener(this);
|
||||
// ImgLoader.display(mContext, R.drawable.screen, mCover);
|
||||
mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
@ -145,6 +144,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
mHandler.sendEmptyMessageDelayed(WHAT_GET_CONFIG, 1000);
|
||||
try {
|
||||
LogUtil.uploadErrorLog(AppContext.sInstance);
|
||||
@ -188,9 +188,11 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
* 获取Config信息
|
||||
*/
|
||||
private void getConfig() {
|
||||
// TODO 这里花了1.5s
|
||||
CommonHttpUtil.getConfig(mContext, new CommonCallback<ConfigBean>() {
|
||||
@Override
|
||||
public void callback(ConfigBean bean) {
|
||||
|
||||
if (bean != null) {
|
||||
L.e(TAG, "----------> getPaster360Url:" + bean.getBeautyKey() + " " + bean.getPaster360Url());
|
||||
CommonAppConfig.getInstance().setBeautySdkType(bean.getSproutType());
|
||||
@ -220,7 +222,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
final String uid = uidAndToken[0];
|
||||
final String token = uidAndToken[1];
|
||||
if (!TextUtils.isEmpty(uid) && !TextUtils.isEmpty(token)) {
|
||||
playAD(obj.getIntValue("type") == 0);
|
||||
// playAD(obj.getIntValue("type") == 0);
|
||||
} else {
|
||||
releaseVideo();
|
||||
LauncherActivity.this.startActivity(new Intent(LauncherActivity.this, EntryActivity.class));
|
||||
@ -235,6 +237,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
} else {
|
||||
checkUidAndToken();
|
||||
}
|
||||
|
||||
} else {
|
||||
ToastUtil.show(getString(R.string.net_error));
|
||||
}
|
||||
@ -423,6 +426,7 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL
|
||||
ImageView imageView = new ImageView(mContext);
|
||||
imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
// imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
imageView.setBackgroundColor(0xffffffff);
|
||||
imageView.setTransitionName("ad_img_" + i);
|
||||
mImageViewList.add(imageView);
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.shayu.phonelive.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import myname.pdlive.shayu.R;
|
||||
|
||||
|
||||
public class TestActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_test);
|
||||
ConstraintLayout constraintLayout = findViewById(R.id.root_view);
|
||||
|
||||
View decorView = getWindow().getDecorView();
|
||||
decorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
);
|
||||
|
||||
ViewTreeObserver vto = constraintLayout.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
// 移除监听器,避免重复调用
|
||||
constraintLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
|
||||
int width = constraintLayout.getWidth();
|
||||
int height = constraintLayout.getHeight();
|
||||
Log.d("TestActivity", "Width: " + width + ", Height: " + height);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/icon_new_splash.9.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/icon_new_splash.9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 535 KiB |
BIN
app/src/main/res/drawable-xxhdpi/screen.9.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/screen.9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 228 KiB |
14
app/src/main/res/drawable/test.xml
Normal file
14
app/src/main/res/drawable/test.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@android:color/white"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:gravity="center"> <!-- 使用gravity属性来居中图像 -->
|
||||
<bitmap
|
||||
android:src="@mipmap/logo_middle"
|
||||
android:gravity="center"/> <!-- 尽管在<bitmap>中通常不需要这个,但在某些情况下可能有助于明确意图 -->
|
||||
</item>
|
||||
</layer-list>
|
@ -2,6 +2,8 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/root"
|
||||
android:background="@color/red"
|
||||
android:padding="1dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@ -52,13 +54,13 @@
|
||||
android:text="@string/recommend_skip"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp"
|
||||
android:visibility="invisible" />
|
||||
android:visibility="invisible"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/screen"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
|
20
app/src/main/res/layout/activity_test.xml
Normal file
20
app/src/main/res/layout/activity_test.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/white"
|
||||
android:id="@+id/root_view"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/logo_middle"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
BIN
app/src/main/res/mipmap-xxxhdpi/logo_middle.webp
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/logo_middle.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 207 KiB |
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 228 KiB |
@ -1,12 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="MySplashTheme" parent="AppTheme">
|
||||
<style name="MySplashTheme" parent="Theme.AppCompat.Light.NoActionBar">">
|
||||
<!--正常-->
|
||||
<item name="android:windowBackground">@drawable/screen</item>
|
||||
<!-- <item name="android:windowBackground">@drawable/bg_splash</item>-->
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
|
||||
<item name="android:windowBackground">@drawable/test</item>
|
||||
<item name="android:windowFullscreen">true</item>全屏
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="Base.Theme.NoActionBar">
|
||||
<!--Base.Theme.NoActionBar Theme.AppCompat.Light.NoActionBar-->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
@ -228,6 +228,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
|
||||
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
Log.d("AppStart MainActivity", "App start time: " + startTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -312,7 +314,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
}
|
||||
});
|
||||
} else if (getIntent().getStringExtra("type") != null && getIntent().getStringExtra("type").equals("2")) {
|
||||
//跳转消息列表
|
||||
//TODO 跳转消息列表
|
||||
if (mViewPager != null) {
|
||||
mViewPager.setCurrentItem(2);
|
||||
mTabButtonGroup.setCurPosition(2);
|
||||
@ -1044,6 +1046,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
Log.d("AppStart MainActivity onResume", "App start time: " + startTime);
|
||||
|
||||
|
||||
if (binder != null) {
|
||||
if (binder.isDownloadOK()) {
|
||||
binder.install();
|
||||
@ -1126,7 +1133,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
if (code == 0 && info.length > 0) {
|
||||
ArrayList<String> list = new ArrayList<String>(Arrays.asList(info));
|
||||
String url1;
|
||||
|
||||
// TODO 优化这个循环
|
||||
for (int j = 0; j < list.size(); j++) {
|
||||
String[] arr = list.get(j).split("/");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user