当前位置: 首页>>代码示例>>Java>>正文


Java NetUtils.NetType方法代码示例

本文整理汇总了Java中com.github.obsessive.library.netstatus.NetUtils.NetType方法的典型用法代码示例。如果您正苦于以下问题:Java NetUtils.NetType方法的具体用法?Java NetUtils.NetType怎么用?Java NetUtils.NetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.obsessive.library.netstatus.NetUtils的用法示例。

在下文中一共展示了NetUtils.NetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.github.obsessive.library.netstatus.NetUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    if (toggleOverridePendingTransition()) {
        switch (getOverridePendingTransitionMode()) {
            case LEFT:
                overridePendingTransition(R.anim.left_in,R.anim.left_out);
                break;
            case RIGHT:
                overridePendingTransition(R.anim.right_in,R.anim.right_out);
                break;
            case TOP:
                overridePendingTransition(R.anim.top_in,R.anim.top_out);
                break;
            case BOTTOM:
                overridePendingTransition(R.anim.bottom_in,R.anim.bottom_out);
                break;
            case SCALE:
                overridePendingTransition(R.anim.scale_in,R.anim.scale_out);
                break;
            case FADE:
                overridePendingTransition(R.anim.fade_in,R.anim.fade_out);
                break;
        }
    }
    super.onCreate(savedInstanceState);
    // base setup
    Bundle extras = getIntent().getExtras();
    if (null != extras) {
        getBundleExtras(extras);
    }

    if (isBindEventBusHere()) {
        EventBus.getDefault().register(this);
    }
    SmartBarUtils.hide(getWindow().getDecorView());
    setTranslucentStatus(isApplyStatusBarTranslucency());

    mContext = this;
    TAG_LOG = this.getClass().getSimpleName();
    BaseAppManager.getInstance().addActivity(this);

    DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);

    mScreenDensity = displayMetrics.density;
    mScreenHeight = displayMetrics.heightPixels;
    mScreenWidth = displayMetrics.widthPixels;

    if (getContentViewLayoutID() != 0) {
        setContentView(getContentViewLayoutID());
    } else {
        throw new IllegalArgumentException("You must return a right contentView layout resource Id");
    }

    mNetChangeObserver = new NetChangeObserver() {
        @Override
        public void onNetConnected(NetUtils.NetType type) {
            super.onNetConnected(type);
            onNetworkConnected(type);
        }

        @Override
        public void onNetDisConnect() {
            super.onNetDisConnect();
            onNetworkDisConnected();
        }
    };

    NetStateReceiver.registerObserver(mNetChangeObserver);

    initViewsAndEvents();
}
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:73,代码来源:BaseAppCompatActivity.java


示例2: onCreate

import com.github.obsessive.library.netstatus.NetUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    if (toggleOverridePendingTransition()) {
        switch (getOverridePendingTransitionMode()) {
            case LEFT:
                overridePendingTransition(R.anim.left_in, R.anim.left_out);
                break;
            case RIGHT:
                overridePendingTransition(R.anim.right_in, R.anim.right_out);
                break;
            case TOP:
                overridePendingTransition(R.anim.top_in, R.anim.top_out);
                break;
            case BOTTOM:
                overridePendingTransition(R.anim.bottom_in, R.anim.bottom_out);
                break;
            case SCALE:
                overridePendingTransition(R.anim.scale_in, R.anim.scale_out);
                break;
            case FADE:
                overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
                break;
        }
    }
    super.onCreate(savedInstanceState);
    // base setup
    Bundle extras = getIntent().getExtras();
    if (null != extras) {
        getBundleExtras(extras);
    }

    if (isBindEventBusHere()) {
        EventBus.getDefault().register(this);
    }
    SmartBarUtils.hide(getWindow().getDecorView());
    setTranslucentStatus(isApplyStatusBarTranslucency());

    mContext = this;
    TAG_LOG = this.getClass().getSimpleName();
    BaseAppManager.getInstance().addActivity(this);

    DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);

    mScreenDensity = displayMetrics.density;
    mScreenHeight = displayMetrics.heightPixels;
    mScreenWidth = displayMetrics.widthPixels;

    if (getContentViewLayoutID() != 0) {
        setContentView(getContentViewLayoutID());
    } else {
        throw new IllegalArgumentException("You must return a right contentView layout resource Id");
    }

    mNetChangeObserver = new NetChangeObserver() {
        @Override
        public void onNetConnected(NetUtils.NetType type) {
            super.onNetConnected(type);
            onNetworkConnected(type);
        }

        @Override
        public void onNetDisConnect() {
            super.onNetDisConnect();
            onNetworkDisConnected();
        }
    };

    NetStateReceiver.registerObserver(mNetChangeObserver);

    initViewsAndEvents();
}
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:73,代码来源:BaseFragmentActivity.java


示例3: onCreate

import com.github.obsessive.library.netstatus.NetUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // base setup
    mHelper = new SwipeBackActivityHelper(this);
    mHelper.onActivityCreate();

    Bundle extras = getIntent().getExtras();
    if (null != extras) {
        getBundleExtras(extras);
    }

    if (isBindEventBusHere()) {
        EventBus.getDefault().register(this);
    }
    SmartBarUtils.hide(getWindow().getDecorView());
    setTranslucentStatus(isApplyStatusBarTranslucency());

    mContext = this;
    TAG_LOG = this.getClass().getSimpleName();
    BaseAppManager.getInstance().addActivity(this);

    DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);

    mScreenDensity = displayMetrics.density;
    mScreenHeight = displayMetrics.heightPixels;
    mScreenWidth = displayMetrics.widthPixels;

    if (getContentViewLayoutID() != 0) {
        setContentView(getContentViewLayoutID());
    } else {
        throw new IllegalArgumentException("You must return a right contentView layout resource Id");
    }

    mNetChangeObserver = new NetChangeObserver() {
        @Override
        public void onNetConnected(NetUtils.NetType type) {
            super.onNetConnected(type);
            onNetworkConnected(type);
        }

        @Override
        public void onNetDisConnect() {
            super.onNetDisConnect();
            onNetworkDisConnected();
        }
    };

    NetStateReceiver.registerObserver(mNetChangeObserver);

    initViewsAndEvents();
}
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:54,代码来源:BasePlayerActivity.java


示例4: onNetworkConnected

import com.github.obsessive.library.netstatus.NetUtils; //导入方法依赖的package包/类
@Override
protected void onNetworkConnected(NetUtils.NetType type) {

}
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:5,代码来源:AboutUsActivity.java


示例5: onNetworkConnected

import com.github.obsessive.library.netstatus.NetUtils; //导入方法依赖的package包/类
/**
 * network connected
 */
protected abstract void onNetworkConnected(NetUtils.NetType type);
 
开发者ID:Dreamer206602,项目名称:SimplifyReader2,代码行数:5,代码来源:BaseAppCompatActivity.java



注:本文中的com.github.obsessive.library.netstatus.NetUtils.NetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。