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


Java MerlinsBeard类代码示例

本文整理汇总了Java中com.novoda.merlin.MerlinsBeard的典型用法代码示例。如果您正苦于以下问题:Java MerlinsBeard类的具体用法?Java MerlinsBeard怎么用?Java MerlinsBeard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MerlinsBeard类属于com.novoda.merlin包,在下文中一共展示了MerlinsBeard类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onServiceConnected

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder binder) {
    Logger.d("onServiceConnected");
    MerlinService.LocalBinder merlinServiceBinder = ((MerlinService.LocalBinder) binder);
    ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    ConnectivityChangeEventExtractor connectivityChangeEventExtractor = new ConnectivityChangeEventExtractor(connectivityManager);
    ConnectivityChangesRegister connectivityChangesRegister = new ConnectivityChangesRegister(
            context,
            connectivityManager,
            new AndroidVersion(),
            connectivityChangeEventExtractor
    );
    NetworkStatusRetriever networkStatusRetriever = new NetworkStatusRetriever(MerlinsBeard.from(context));
    EndpointPinger endpointPinger = EndpointPinger.withCustomEndpointAndValidation(endpoint, validator);
    ConnectivityChangesForwarder connectivityChangesForwarder = new ConnectivityChangesForwarder(
            networkStatusRetriever,
            listenerHolder.disconnectCallbackManager,
            listenerHolder.connectCallbackManager,
            listenerHolder.bindCallbackManager,
            endpointPinger
    );

    merlinServiceBinder.setConnectivityChangesRegister(connectivityChangesRegister);
    merlinServiceBinder.setConnectivityChangesForwarder(connectivityChangesForwarder);
    merlinServiceBinder.onBindComplete();
}
 
开发者ID:novoda,项目名称:merlin,代码行数:27,代码来源:MerlinServiceBinder.java

示例2: onCreate

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    viewToAttachDisplayerTo = findViewById(R.id.displayerAttachableView);
    merlinsBeard = MerlinsBeard.from(this);
    networkStatusDisplayer = new NetworkStatusDisplayer(getResources(), merlinsBeard);

    findViewById(R.id.current_status).setOnClickListener(networkStatusOnClick);
    findViewById(R.id.wifi_connected).setOnClickListener(wifiConnectedOnClick);
    findViewById(R.id.mobile_connected).setOnClickListener(mobileConnectedOnClick);
    findViewById(R.id.network_subtype).setOnClickListener(networkSubtypeOnClick);
}
 
开发者ID:novoda,项目名称:merlin,代码行数:15,代码来源:DemoActivity.java

示例3: onCreate

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    viewToAttachDisplayerTo = findViewById(R.id.displayerAttachableView);
    merlinsBeard = MerlinsBeard.from(this);
    networkStatusDisplayer = new NetworkStatusDisplayer(getResources(), merlinsBeard);
    subscriptions = new CompositeSubscription();

    findViewById(R.id.current_status).setOnClickListener(networkStatusOnClick);
    findViewById(R.id.wifi_connected).setOnClickListener(wifiConnectedOnClick);
    findViewById(R.id.mobile_connected).setOnClickListener(mobileConnectedOnClick);
    findViewById(R.id.network_subtype).setOnClickListener(networkSubtypeOnClick);
}
 
开发者ID:novoda,项目名称:merlin,代码行数:15,代码来源:RxJavaDemoActivity.java

示例4: onCreate

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    viewToAttachDisplayerTo = findViewById(R.id.displayerAttachableView);
    merlinsBeard = MerlinsBeard.from(this);
    networkStatusDisplayer = new NetworkStatusDisplayer(getResources(), merlinsBeard);
    disposables = new CompositeDisposable();

    findViewById(R.id.current_status).setOnClickListener(networkStatusOnClick);
    findViewById(R.id.wifi_connected).setOnClickListener(wifiConnectedOnClick);
    findViewById(R.id.mobile_connected).setOnClickListener(mobileConnectedOnClick);
    findViewById(R.id.network_subtype).setOnClickListener(networkSubtypeOnClick);
}
 
开发者ID:novoda,项目名称:merlin,代码行数:15,代码来源:RxJava2DemoActivity.java

示例5: extractIsConnectedFrom

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
private boolean extractIsConnectedFrom(Intent intent, MerlinsBeard merlinsBeard) {
    if (intent.hasExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY)) {
        return !intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
    } else {
        return merlinsBeard.isConnected();
    }
}
 
开发者ID:novoda,项目名称:merlin,代码行数:8,代码来源:ConnectivityChangeEventCreator.java

示例6: notify

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
void notify(Context context, Intent intent) {
    if (intent != null && connectivityActionMatchesActionFor(intent)) {
        MerlinsBeard merlinsBeard = merlinsBeardCreator.createMerlinsBeard(context);
        ConnectivityChangeEvent connectivityChangeEvent = creator.createFrom(intent, merlinsBeard);
        notifyMerlinService(context, connectivityChangeEvent);
    }
}
 
开发者ID:novoda,项目名称:merlin,代码行数:8,代码来源:ConnectivityReceiverConnectivityChangeNotifier.java

示例7: provideMerlinsBeard

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
@Provides
@Singleton
public MerlinsBeard provideMerlinsBeard(@NonNull final Context poContext) {
    return MerlinsBeard.from(poContext);
}
 
开发者ID:RoRoche,项目名称:AndroidStarter,代码行数:6,代码来源:ModuleRest.java

示例8: NetworkStatusDisplayer

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
public NetworkStatusDisplayer(Resources resources, MerlinsBeard merlinsBeard) {
    this.resources = resources;
    this.merlinsBeard = merlinsBeard;
}
 
开发者ID:novoda,项目名称:merlin,代码行数:5,代码来源:NetworkStatusDisplayer.java

示例9: createFrom

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
ConnectivityChangeEvent createFrom(Intent intent, MerlinsBeard merlinsBeard) {
    boolean isConnected = extractIsConnectedFrom(intent, merlinsBeard);
    String info = intent.getStringExtra(ConnectivityManager.EXTRA_EXTRA_INFO);
    String reason = intent.getStringExtra(ConnectivityManager.EXTRA_REASON);
    return ConnectivityChangeEvent.createWithNetworkInfoChangeEvent(isConnected, info, reason);
}
 
开发者ID:novoda,项目名称:merlin,代码行数:7,代码来源:ConnectivityChangeEventCreator.java

示例10: NetworkStatusRetriever

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
NetworkStatusRetriever(MerlinsBeard merlinsBeard) {
    this.merlinsBeard = merlinsBeard;
}
 
开发者ID:novoda,项目名称:merlin,代码行数:4,代码来源:NetworkStatusRetriever.java

示例11: createMerlinsBeard

import com.novoda.merlin.MerlinsBeard; //导入依赖的package包/类
MerlinsBeard createMerlinsBeard(Context context); 
开发者ID:novoda,项目名称:merlin,代码行数:2,代码来源:ConnectivityReceiver.java


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