• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RxLocation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: startLocationScan

import com.patloew.rxlocation.RxLocation; //导入依赖的package包/类
private void startLocationScan() {

        RxLocation rxLocation = new RxLocation(this);

        LocationRequest locationRequest = LocationRequest.create()
                .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
                .setInterval(TimeUnit.SECONDS.toMillis(5));

        rxLocationObserver = rxLocation.location()
                .updates(locationRequest)
                .subscribeOn(Schedulers.io())
                .flatMap(location -> rxLocation.geocoding().fromLocation(location).toObservable())
                .observeOn(Schedulers.io())
                .subscribeWith(new DisposableObserver<Address>() {
                    @Override public void onNext(Address address) {

                        boolean isLocationsEnabled = App.INSTANCE.getSharedPreferences().isLocationsEnabled();
                        if (isLocationsEnabled) {
                            mOWDevice.setGpsLocation(address);
                        } else if (rxLocationObserver != null) {
                            rxLocationObserver.dispose();
                        }
                    }

                    @Override public void onError(Throwable e) {
                        Log.e(TAG, "onError: error retreiving location", e);
                    }

                    @Override public void onComplete() {
                        Log.d(TAG, "onComplete: ");
                    }
                });
    }
 
开发者ID:ponewheel,项目名称:android-ponewheel,代码行数:34,代码来源:MainActivity.java


示例2: onCreate

import com.patloew.rxlocation.RxLocation; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_home);

    ButterKnife.bind(this);
    rxPermissions = new RxPermissions(this);
    rxLocation = new RxLocation(this);

    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
    rvNearbyRestaurant.setLayoutManager(linearLayoutManager);

    // get users last known location
    getLastKnownLocation(searchTerm);

    endlessRecyclerViewScrollListener = new EndlessRecyclerViewScrollListener(linearLayoutManager) {
        @Override
        public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {
            offset = totalItemsCount;
            loadData(searchTerm, lastKnownLocation, offset);
        }
    };

    rvNearbyRestaurant.addOnScrollListener(endlessRecyclerViewScrollListener);
}
 
开发者ID:pranayairan,项目名称:YelpQL,代码行数:26,代码来源:SearchActivity.java


示例3: onCreate

import com.patloew.rxlocation.RxLocation; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    }

    RealmContract.configureRealm(this);
    FirebaseApp.initializeApp(this);

    rxLocation = new RxLocation(this);
}
 
开发者ID:BANKEX,项目名称:smart-asset-iot-android-demo,代码行数:13,代码来源:DemoApplication.java


示例4: RxLocationManager

import com.patloew.rxlocation.RxLocation; //导入依赖的package包/类
public RxLocationManager(RxLocation rxLocation) {
    this.rxLocation = rxLocation;
    locationRequest = buildLocationRequest();
}
 
开发者ID:BANKEX,项目名称:smart-asset-iot-android-demo,代码行数:5,代码来源:RxLocationManager.java


示例5: getRxLocation

import com.patloew.rxlocation.RxLocation; //导入依赖的package包/类
public RxLocation getRxLocation() {
    return rxLocation;
}
 
开发者ID:BANKEX,项目名称:smart-asset-iot-android-demo,代码行数:4,代码来源:DemoApplication.java


示例6: RxGps

import com.patloew.rxlocation.RxLocation; //导入依赖的package包/类
public RxGps(RxLocation rxLocation, Activity activity) {
    this.rxLocation = rxLocation;
    this.rxPermissions = new RxPermissions(activity);
    this.activityReference = new WeakReference<Activity>(activity);
}
 
开发者ID:florent37,项目名称:RxGps,代码行数:6,代码来源:RxGps.java


示例7: onCreate

import com.patloew.rxlocation.RxLocation; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_bloop);

    mBootprintMapFragment = new BootprintMapFragment();
    mBootprintMapFragment.setArguments(savedInstanceState);
    getSupportFragmentManager()
            .beginTransaction()
            .add(R.id.map_container, mBootprintMapFragment)
            .commit();

    ButterKnife.bind(this);

    // init global references / api stuff
    mApplication = BloopApplication.getInstance();

    mGoogleApiClient = mApplication.getGoogleApiClient();

    // makes achievement dialogs visible
    Games.setViewForPopups(
            mGoogleApiClient,
            getWindow().getDecorView().findViewById(android.R.id.content)
    );

    mService = mApplication.getService();

    // hide flag by default
    mPlaceFlagButtonMarginBottom = getResources().getDimension(R.dimen.fab_margin);
    mPlaceFlagButton.setVisibility(View.INVISIBLE);
    // also hide text telling user to place flags
    mCannotCaptureTextView.setVisibility(View.INVISIBLE);

    checkHasPlacedFlag();

    mPlaceFlagButton.setOnClickListener(view -> placeFlag());

    mBigButtonView.setOnClickListener(view -> captureFlag());

    // init location
    mRxLocation = new RxLocation(this);

    startTrackingLocation();

    // init blooping
    mBloopHandler = new Handler();

    setSupportActionBar(mToolbar);

    // init sounds
    mBloopSoundPlayer = new BloopSoundPlayer(this);

    // mute logic
    mutePref = getSharedPreferences(PREF_SOUND, Context.MODE_PRIVATE);
    mute = mutePref.getBoolean(PREF_SOUND_VAL, false);
}
 
开发者ID:BloopApp,项目名称:Bloop,代码行数:57,代码来源:BloopActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Mode类代码示例发布时间:2022-05-23
下一篇:
Java S00PacketKeepAlive类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap