android.databinding.ObservableBoolean Java Examples

The following examples show how to use android.databinding.ObservableBoolean. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SignInActivityViewModel.java    From Anago with Apache License 2.0 6 votes vote down vote up
@Inject
public SignInActivityViewModel(BaseActivity activity, SignInUseCase signInUseCase,
                               CheckSessionUseCase checkSessionUseCase) {
    super(activity);

    this.signInUseCase = signInUseCase;
    this.checkSessionUseCase = checkSessionUseCase;

    name = new ObservableField<>();
    password = new ObservableField<>();
    buttonEnabled = new ObservableBoolean(false);

    checkSessionUseCase.run()
            .compose(bindToLifecycle().forSingle())
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(authToken -> {
                Timber.v("Check session: " + authToken.token);
                Toast.makeText(getContext(), "Already signed in", Toast.LENGTH_SHORT).show();
                goToNext();
            }, Timber::e);
}
 
Example #2
Source File: SettingsActivity.java    From PainlessMusicPlayer with Apache License 2.0 5 votes vote down vote up
@Override
protected void onPropertyChanged2(
        @NonNull final ObservableBoolean sender, final int propertyId) {
    if (sender.get()) {
        sender.set(false);
        new DaynightAccuracyDialog().show(
                getSupportFragmentManager(), TAG_DIALOG_DAYNIGHT_ACCURACY);
    }
}
 
Example #3
Source File: SettingsActivity.java    From PainlessMusicPlayer with Apache License 2.0 5 votes vote down vote up
@Override
protected void onPropertyChanged2(@NonNull ObservableBoolean sender, int propertyId) {
    if (sender.get()) {
        sender.set(false);
        restart(Henson.with(SettingsActivity.this).gotoSettingsActivity()
                .suppressDayNightWarnings(viewModel.suppressDayNightWarnings)
                .build());
    }
}
 
Example #4
Source File: StarredRepoListFragmentViewModel.java    From Anago with Apache License 2.0 5 votes vote down vote up
@Inject
public StarredRepoListFragmentViewModel(BaseFragment fragment, GetStarredReposUseCase getStarredReposUseCase,
                                        EventBus eventBus) {
    super(fragment);

    this.getStarredReposUseCase = getStarredReposUseCase;
    this.eventBus = eventBus;

    repos = new ObservableArrayList<>();
    isConnecting = new ObservableBoolean(true);
    isRefreshing = new ObservableBoolean(false);
}
 
Example #5
Source File: RepoListItemViewModel.java    From Anago with Apache License 2.0 5 votes vote down vote up
@Inject
public RepoListItemViewModel(BaseFragment fragment,
                             StarUseCase starUseCase,
                             UnstarUseCase unstarUseCase,
                             EventBus eventBus) {
    super(fragment);
    this.starUseCase = starUseCase;
    this.unstarUseCase = unstarUseCase;
    this.eventBus = eventBus;

    this.repo = new ObservableField<>();
    this.starred = new ObservableBoolean(false);
}
 
Example #6
Source File: RepoInfoFragmentViewModel.java    From Anago with Apache License 2.0 5 votes vote down vote up
@Inject
public RepoInfoFragmentViewModel(BaseFragment fragment, GetRepoUseCase getRepoUseCase,
                                 CheckStarUseCase checkStarUseCase, StarUseCase starUseCase,
                                 UnstarUseCase unstarUseCase, EventBus eventBus) {
    super(fragment);
    this.getRepoUseCase = getRepoUseCase;
    this.checkStarUseCase = checkStarUseCase;
    this.starUseCase = starUseCase;
    this.unstarUseCase = unstarUseCase;
    this.eventBus = eventBus;

    this.repo = new ObservableField<>();
    this.isConnecting = new ObservableBoolean(true);
    this.starred = new ObservableBoolean(false);
}
 
Example #7
Source File: UserActivityViewModel.java    From Anago with Apache License 2.0 5 votes vote down vote up
@Inject
public UserActivityViewModel(BaseActivity activity, GetUserUseCase getUserUseCase, EventBus eventBus) {
    super(activity);
    this.getUserUseCase = getUserUseCase;
    this.eventBus = eventBus;

    this.user = new ObservableField<>();
    this.isConnecting = new ObservableBoolean(true);
}
 
Example #8
Source File: MyRepoListFragmentViewModel.java    From Anago with Apache License 2.0 5 votes vote down vote up
@Inject
public MyRepoListFragmentViewModel(BaseFragment fragment, GetUserReposUseCase getUserReposUseCase, EventBus eventBus) {
    super(fragment);

    this.getUserReposUseCase = getUserReposUseCase;
    this.eventBus = eventBus;

    repos = new ObservableArrayList<>();
    isConnecting = new ObservableBoolean(true);
    isRefreshing = new ObservableBoolean(false);
}
 
Example #9
Source File: ListServerViewModel.java    From SimpleFTP with MIT License 5 votes vote down vote up
/**
 * Default constructor.
 * @param context The context of the current activity.
 */
public ListServerViewModel(Activity context) {
    this.context = context;
    this.servers = new ObservableArrayList<FtpServerViewModel>();
    this.selectedServer = new ObservableField<FtpServerViewModel>();
    this.selectedServerVisible = new ObservableBoolean();
}
 
Example #10
Source File: ExplorerViewModel.java    From SimpleFTP with MIT License 5 votes vote down vote up
/**
 * Default constructor.
 * @param context The context of the current activity.
 */
public ExplorerViewModel(Context context) {
    this.context = context;
    this.isLoading = new ObservableBoolean(false);
    this.isRefreshing = new ObservableBoolean(false);
    this.files = new ObservableArrayList<FileViewModel>();
    this.isSelectionMode = new ObservableBoolean(false);
    this.numberSelectedItems = new ObservableInt(0);
    this.changeDirectory("/");
}
 
Example #11
Source File: AppModule.java    From vk_music_android with GNU General Public License v3.0 4 votes vote down vote up
@Provides
@Singleton
@Named("shuffle")
ObservableBoolean provideShuffleSetting() {
    return Paper.book().read("shuffle", new ObservableBoolean());
}
 
Example #12
Source File: AppModule.java    From vk_music_android with GNU General Public License v3.0 4 votes vote down vote up
@Provides
@Singleton
@Named("repeat")
ObservableBoolean provideRepeatSetting() {
    return Paper.book().read("repeat", new ObservableBoolean());
}
 
Example #13
Source File: NoteListModel.java    From mv2m with Apache License 2.0 4 votes vote down vote up
protected NoteListModel(Parcel in) {
    error = in.readParcelable(ObservableBoolean.class.getClassLoader());
    in.readList(items, getClass().getClassLoader());
    loaded = in.readByte() != 0;
}
 
Example #14
Source File: NoteListModel.java    From mv2m with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getError() {
    return error;
}
 
Example #15
Source File: NoteListViewModel.java    From mv2m with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getLoading() {
    return loading;
}
 
Example #16
Source File: EffectsFragmentModel.java    From PainlessMusicPlayer with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean isEqualizerEnabled() {
    return equalizerEnabled;
}
 
Example #17
Source File: EffectsFragmentModel.java    From PainlessMusicPlayer with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean isBassBoostEnabled() {
    return bassBoostEnabled;
}
 
Example #18
Source File: NoteModel.java    From mv2m with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getError() {
    return error;
}
 
Example #19
Source File: NowPlayingActivityModel.java    From PainlessMusicPlayer with Apache License 2.0 4 votes vote down vote up
@NonNull
public ObservableBoolean isShuffleEnabled() {
    return mShuffleEnabled;
}
 
Example #20
Source File: OnBoardingViewModel.java    From triviums with MIT License 4 votes vote down vote up
@Inject
public OnBoardingViewModel(MainAppStore store){
    isLastPage = new ObservableBoolean();
    this.store = store;
}
 
Example #21
Source File: BaseViewModel.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getRefreshing() {
    return refreshing;
}
 
Example #22
Source File: BaseViewModel.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getStatusNetworkError() {
    return statusNetworkError;
}
 
Example #23
Source File: BaseViewModel.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getStatusError() {
    return statusError;
}
 
Example #24
Source File: BaseViewModel.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getStatusLoading() {
    return statusLoading;
}
 
Example #25
Source File: BaseViewModel.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getStatusEmpty() {
    return statusEmpty;
}
 
Example #26
Source File: BaseListViewModel.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getLoadingMore() {
    return loadingMore;
}
 
Example #27
Source File: BaseListViewModel.java    From Android-MVVMFramework with Apache License 2.0 4 votes vote down vote up
public ObservableBoolean getHasMore() {
    return hasMore;
}
 
Example #28
Source File: BaseExpandableObservable.java    From ExpandableRecyclerview-Databinding with Apache License 2.0 4 votes vote down vote up
public BaseExpandableObservable() {
    mChildList = new ObservableArrayList<>();
    isExpand = new ObservableBoolean(false);
}
 
Example #29
Source File: FileViewModel.java    From SimpleFTP with MIT License 4 votes vote down vote up
/**
 * Default constructor.
 * @param mainViewModel The parent view model.
 */
public FileViewModel(ExplorerViewModel mainViewModel) {
    this.mainViewModel = mainViewModel;
    this.isSelected = new ObservableBoolean(false);
}
 
Example #30
Source File: VehicleInfo.java    From AndroidAgeraTutorial with Apache License 2.0 4 votes vote down vote up
public VehicleInfo(ObservableBoolean isSelected, String logoUrl, String brand, String description) {
    this.isSelected = isSelected;
    this.logoUrl = logoUrl;
    this.brand = brand;
    this.description = description;
}