CourseActivity.java 1.63 KB
Newer Older
严久程 committed
1 2
package com.yidianling.course;

3
import android.os.Bundle;
YKai committed
4
import androidx.fragment.app.Fragment;
5

严久程 committed
6
import com.alibaba.android.arouter.facade.annotation.Route;
7
import com.ydl.media.view.PlayerFloatHelper;
严久程 committed
8
import com.ydl.ydlcommon.base.BaseActivity;
严久程 committed
9
import com.ydl.ydlcommon.bean.StatusBarOptions;
10
import com.ydl.ydlcommon.utils.StatusBarUtils;
11

严久程 committed
12
import org.jetbrains.annotations.NotNull;
13
import org.jetbrains.annotations.Nullable;
严久程 committed
14 15 16 17 18 19 20

/**
 * 课程首页Activity(心理课程)
 */
@Route(path = "/course/home")
public class CourseActivity extends BaseActivity {

21
    @Override
22 23 24 25
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        StatusBarUtils.Companion.setTransparentForImageView(this, null);
        StatusBarUtils.Companion.statusBarLightMode(this);
        super.onCreate(savedInstanceState);
26 27
    }

严久程 committed
28 29 30 31 32 33 34 35 36 37 38
    @Override
    protected int layoutResId() {
        return R.layout.activity_course;
    }


    @Override
    protected void initDataAndEvent() {
        initTags();
    }

严久程 committed
39

严久程 committed
40 41 42 43 44 45 46
    @NotNull
    @Override
    public StatusBarOptions getStatusViewOptions() {
        return new StatusBarOptions(false, true);
    }


严久程 committed
47 48 49 50
    /**
     * 初始化tab
     */
    private void initTags() {
严久程 committed
51 52 53 54 55 56
        Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.content);
        if (fragment == null) {
            fragment = new FlutterCourseHomeFragment();
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.content, fragment)
                    .commit();
严久程 committed
57 58
        }
    }
59 60 61 62 63 64

    @Override
    protected void onDestroy() {
        super.onDestroy();
        PlayerFloatHelper.Companion.onDestroy();
    }
严久程 committed
65
}