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

Java ObservableFloat类代码示例

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

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



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

示例1: takeTakesCorrectTimes

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void takeTakesCorrectTimes() throws Exception {
    float float1 = 123;
    float float2 = 32;
    ObservableFloat observed = new ObservableFloat(float1);
    ObservableFloat observing = Cinder.computeFloat(()->
                    observed.get()
            , observed).take(2).immediate();
    assertTrue(observing.get() == float1);

    observed.set(float2);
    assertTrue(observing.get() == float2);

    observed.set(float1);
    assertTrue(observing.get() == float2);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:17,代码来源:CinderFloatUnitTest.java


示例2: skipSkipsCorrectTimes

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void skipSkipsCorrectTimes() throws Exception {
    float float1 = 123;
    float float2 = 32;
    ObservableFloat observed = new ObservableFloat();
    ObservableFloat observing = Cinder.computeFloat(()->
                    observed.get()
            , observed).skip(1);

    observed.set(float1);
    assertTrue(observing.get() == 0);

    observed.set(float2);
    assertTrue(observing.get() == float2);

    observed.set(float1);
    assertTrue(observing.get() == float1);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:19,代码来源:CinderFloatUnitTest.java


示例3: BaseLibraryActivityViewModel

import android.databinding.ObservableFloat; //导入依赖的package包/类
public BaseLibraryActivityViewModel(Context context, boolean fitSystemWindows) {
    super(context);

    mFitSystemWindows = fitSystemWindows;
    mExpandedHeight = getDimensionPixelSize(R.dimen.miniplayer_height);
    mAnimateSlideInOut = false;

    mMiniplayerHeight = new ObservableInt(0);
    mMiniplayerAlpha = new ObservableFloat(1.0f);
    mNowPlayingToolbarAlpha = new ObservableFloat(0.0f);

    int backgroundColor = getColor(R.color.background);
    mNowPlayingBackground = new ColorDrawable(backgroundColor);

    setPlaybackOngoing(false);
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:17,代码来源:BaseLibraryActivityViewModel.java


示例4: Listener

import android.databinding.ObservableFloat; //导入依赖的package包/类
Listener(final ObservableFloat observableFloat, final Observer<? super Float> observer) {
  this.observableFloat = observableFloat;
  this.onPropertyChangedCallback =
      new android.databinding.Observable.OnPropertyChangedCallback() {
        @Override
        public void onPropertyChanged(android.databinding.Observable observable,
            int ignoredPropertyId) {
          if (!isDisposed()) {
            ObservableFloat observableFloat = (ObservableFloat) observable;
            observer.onNext(observableFloat.get());
          }
        }
      };
}
 
开发者ID:oldergod,项目名称:RxDataBinding,代码行数:15,代码来源:ObservableFloatObservable.java


示例5: SSQuarterliesViewModel

import android.databinding.ObservableFloat; //导入依赖的package包/类
public SSQuarterliesViewModel(Context context, final DataListener dataListener, SsQuarterliesActivityBinding ssQuarterliesActivityBinding) {
    this.context = context;
    this.dataListener = dataListener;
    this.ssQuarterliesActivityBinding = ssQuarterliesActivityBinding;
    ssQuarterliesLoadingVisibility = new ObservableInt(View.INVISIBLE);
    ssQuarterliesListVisibility = new ObservableInt(View.INVISIBLE);
    ssQuarterliesLanguageFilterVisibility = new ObservableInt(View.GONE);
    ssQuarterliesErrorMessageVisibility = new ObservableInt(View.INVISIBLE);
    ssQuarterliesEmptyStateVisibility = new ObservableInt(View.INVISIBLE);
    ssQuarterliesErrorStateVisibility = new ObservableInt(View.INVISIBLE);
    ssQuarterliesListMarginTop = new ObservableFloat(0);
    ssFirebaseDatabase = FirebaseDatabase.getInstance().getReference();
    ssFirebaseDatabase.keepSynced(true);

    this.ssQuarterlyLanguages = new ArrayList<>();
    this.ssQuarterlies = new ArrayList<>();

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);


    String ssLastLanguageSelected = prefs.getString(SSConstants.SS_LAST_LANGUAGE_INDEX, "");
    ssDefaultLanguage = Locale.getDefault().getLanguage();

    if (!ssLastLanguageSelected.isEmpty()){
        ssDefaultLanguage = ssLastLanguageSelected;
    }

    ssQuarterlyLanguage = new SSQuarterlyLanguage(ssDefaultLanguage, getDisplayLanguageByCode(ssDefaultLanguage), 1);

    loadLanguages();
}
 
开发者ID:Adventech,项目名称:sabbath-school-android,代码行数:32,代码来源:SSQuarterliesViewModel.java


示例6: computesFloat

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void computesFloat() throws Exception {
    float float1 = 0.4321f;
    float float2 = 1234.4321f;
    ObservableFloat obsFloat = new ObservableFloat(float1);
    ObservableFloat computedFloat = Cinder.computeFloat(()->obsFloat.get(), obsFloat).immediate();
    assertEquals(computedFloat.get(), float1, 0.0001f);

    obsFloat.set(float2);
    assertEquals(computedFloat.get(), float2, 0.0001f);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:12,代码来源:CinderUnitTest.java


示例7: onceTakesOnce

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void onceTakesOnce() throws Exception {
    float float1 = 123;
    float float2 = 43;
    ObservableFloat observed = new ObservableFloat(float1);
    ObservableFloat observing = Cinder.computeFloat(()->
            observed.get(), observed).once().immediate();
    assertTrue(observing.get() == float1);

    observed.set(float2);
    assertTrue(observing.get() == float1);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:13,代码来源:CinderFloatUnitTest.java


示例8: filterFilters

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void filterFilters() throws Exception {
    float float1 = 123;
    float float2 = 32;
    ObservableFloat observed = new ObservableFloat();
    ObservableFloat observing = Cinder.computeFloat(()->
                    observed.get()
            , observed).filter(()->observed.get() == float1);

    observed.set(float2);
    assertTrue(observing.get() == 0);

    observed.set(float1);
    assertTrue(observing.get() == float1);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:16,代码来源:CinderFloatUnitTest.java


示例9: takeWhileTakesWhileTrue

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void takeWhileTakesWhileTrue() throws Exception {
    float float1 = 123;
    float float2 = 32;
    ObservableFloat observed = new ObservableFloat();
    ObservableFloat observing = Cinder.computeFloat(()->
                    observed.get()
            , observed).takeWhile(()->observed.get() == float1);

    observed.set(float1);
    assertTrue(observing.get() == float1);

    observed.set(float2);
    assertTrue(observing.get() == float1);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:16,代码来源:CinderFloatUnitTest.java


示例10: skipWhileSkipsWhileTrue

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void skipWhileSkipsWhileTrue() throws Exception {
    float float1 = 123;
    float float2 = 32;
    ObservableFloat observed = new ObservableFloat();
    ObservableFloat observing = Cinder.computeFloat(()->
                    observed.get()
            , observed).skipWhile(()->observed.get() == float1);

    observed.set(float1);
    assertTrue(observing.get() == 0);

    observed.set(float2);
    assertTrue(observing.get() == float2);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:16,代码来源:CinderFloatUnitTest.java


示例11: withDefaultAssignsDefault

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void withDefaultAssignsDefault() throws Exception {
    float float1 = 12;
    ObservableFloat observing = Cinder.computeFloat(()->0
    ).withDefault(float1);

    assertTrue(observing.get() == float1);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:9,代码来源:CinderFloatUnitTest.java


示例12: stopStops

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void stopStops() throws Exception {
    float float1 = 123;
    float float2 = 43;
    ObservableFloat observed = new ObservableFloat(float1);
    CinderFloat observing = Cinder.computeFloat(()->
            observed.get(), observed).immediate();
    assertTrue(observing.get() == float1);

    observing.stop();

    observed.set(float2);
    assertTrue(observing.get() == float1);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:15,代码来源:CinderFloatUnitTest.java


示例13: convertsObservableFloatToRx

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void convertsObservableFloatToRx() throws Exception {
    ObservableFloat observableFloat = new ObservableFloat();
    Observable<Float> rxFloat = RxCinder.convert(observableFloat);

    final String TEST_KEY = "TEST_KEY";
    final ArrayMap<String, Float> testMap = new ArrayMap<>();
    rxFloat.subscribe((c)->{
        testMap.put(TEST_KEY, c);});

    final float TEST_FLOAT = 23;
    observableFloat.set(TEST_FLOAT);
    assertTrue(testMap.get(TEST_KEY).equals(TEST_FLOAT));
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:15,代码来源:RxCinderUnitTest.java


示例14: convertsRxFloatToObservable

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Test
public void convertsRxFloatToObservable() throws Exception {
    float TEST_FLOAT = 234;
    Observable<Float> rxFloat = Observable.just(TEST_FLOAT);
    ObservableFloat observableFloat = RxCinder.convertFloat(rxFloat);
    assertTrue(observableFloat.get() == TEST_FLOAT);
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:8,代码来源:RxCinderUnitTest.java


示例15: getValue

import android.databinding.ObservableFloat; //导入依赖的package包/类
public ObservableFloat getValue() {
    return value;
}
 
开发者ID:Appolica,项目名称:Flubber,代码行数:4,代码来源:SeekBarModel.java


示例16: setValue

import android.databinding.ObservableFloat; //导入依赖的package包/类
public void setValue(ObservableFloat value) {
    this.value = value;
}
 
开发者ID:Appolica,项目名称:Flubber,代码行数:4,代码来源:SeekBarModel.java


示例17: ObservableFloatObservable

import android.databinding.ObservableFloat; //导入依赖的package包/类
ObservableFloatObservable(ObservableFloat observableFloat) {
  this.observableFloat = observableFloat;
}
 
开发者ID:oldergod,项目名称:RxDataBinding,代码行数:4,代码来源:ObservableFloatObservable.java


示例18: convert

import android.databinding.ObservableFloat; //导入依赖的package包/类
public static Observable<Float> convert(ObservableFloat observableFloat){
    return Observable.create((e)->
        Cinder.observe(()->e.onNext(observableFloat.get()), observableFloat)
    );
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:6,代码来源:RxCinder.java


示例19: convertFloat

import android.databinding.ObservableFloat; //导入依赖的package包/类
public static ObservableFloat convertFloat(Observable<Float> observable){
    ObservableFloat observableFloat = new ObservableFloat();
    observable.subscribe((b)->observableFloat.set(b));
    return observableFloat;
}
 
开发者ID:akiraspeirs,项目名称:Cinder,代码行数:6,代码来源:RxCinder.java


示例20: getMiniplayerAlpha

import android.databinding.ObservableFloat; //导入依赖的package包/类
@Bindable
public ObservableFloat getMiniplayerAlpha() {
    return mMiniplayerAlpha;
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:5,代码来源:BaseLibraryActivityViewModel.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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