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

3
import android.os.Bundle;
严久程 committed
4
import android.support.v4.app.Fragment;
5

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

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

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

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

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


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

严久程 committed
38

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


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