CourseActivity.java 1.24 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;
8
import com.ydl.ydlcommon.utils.StatusBarUtils;
9

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

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

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

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


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

严久程 committed
36

严久程 committed
37 38 39 40
    /**
     * 初始化tab
     */
    private void initTags() {
严久程 committed
41 42 43 44 45 46
        Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.content);
        if (fragment == null) {
            fragment = new FlutterCourseHomeFragment();
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.content, fragment)
                    .commit();
严久程 committed
47 48 49
        }
    }
}