android.databinding.ObservableInt Java Examples

The following examples show how to use android.databinding.ObservableInt. 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: RepositoryViewModel.java    From archi with Apache License 2.0 6 votes vote down vote up
public RepositoryViewModel(Context context, final Repository repository) {
    this.repository = repository;
    this.context = context;
    this.ownerName = new ObservableField<>();
    this.ownerEmail = new ObservableField<>();
    this.ownerLocation = new ObservableField<>();
    this.ownerLayoutVisibility = new ObservableInt(View.INVISIBLE);
    this.ownerEmailVisibility = new ObservableInt(View.VISIBLE);
    this.ownerLocationVisibility = new ObservableInt(View.VISIBLE);
    // Trigger loading the rest of the user data as soon as the view model is created.
    // It's odd having to trigger this from here. Cases where accessing to the data model
    // needs to happen because of a change in the Activity/Fragment lifecycle
    // (i.e. an activity created) don't work very well with this MVVM pattern.
    // It also makes this class more difficult to test. Hopefully a better solution will be found
    loadFullUser(repository.owner.url);
}
 
Example #2
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 #3
Source File: MainViewModel.java    From archi with Apache License 2.0 5 votes vote down vote up
public MainViewModel(Context context, DataListener dataListener) {
    this.context = context;
    this.dataListener = dataListener;
    infoMessageVisibility = new ObservableInt(View.VISIBLE);
    progressVisibility = new ObservableInt(View.INVISIBLE);
    recyclerViewVisibility = new ObservableInt(View.INVISIBLE);
    searchButtonVisibility = new ObservableInt(View.GONE);
    infoMessage = new ObservableField<>(context.getString(R.string.default_info_message));
}
 
Example #4
Source File: NoteModel.java    From mv2m with Apache License 2.0 5 votes vote down vote up
protected NoteModel(Parcel in) {
    noteId = in.readString();
    title = in.readParcelable(ObservableString.class.getClassLoader());
    text = in.readParcelable(ObservableString.class.getClassLoader());
    titleError = in.readParcelable(ObservableInt.class.getClassLoader());
    textError = in.readParcelable(ObservableInt.class.getClassLoader());
}
 
Example #5
Source File: MainViewModel.java    From demo4Fish with MIT License 4 votes vote down vote up
private void initData() {
    mDrawerItems = new ObservableArrayList<>();
    mCurrentIndex = new ObservableInt(-1);

    setDrawer();
}
 
Example #6
Source File: SeekBarModel.java    From Flubber with Apache License 2.0 4 votes vote down vote up
public ObservableInt getName() {
    return name;
}
 
Example #7
Source File: SeekBarModel.java    From Flubber with Apache License 2.0 4 votes vote down vote up
public void setName(ObservableInt name) {
    this.name = name;
}
 
Example #8
Source File: PlaybackStatusBarModel.java    From PainlessMusicPlayer with Apache License 2.0 4 votes vote down vote up
@NonNull
public ObservableInt getBtnPlayRes() {
    return btnPlayRes;
}
 
Example #9
Source File: NowPlayingActivityModel.java    From PainlessMusicPlayer with Apache License 2.0 4 votes vote down vote up
public ObservableInt getProgress() {
    return mProgress;
}
 
Example #10
Source File: NowPlayingActivityModel.java    From PainlessMusicPlayer with Apache License 2.0 4 votes vote down vote up
@NonNull
public ObservableInt getBtnPlayRes() {
    return mBtnPlayRes;
}
 
Example #11
Source File: EffectsFragmentModel.java    From PainlessMusicPlayer with Apache License 2.0 4 votes vote down vote up
public ObservableInt getBassBoostStrength() {
    return bassBoostStrength;
}
 
Example #12
Source File: NoteViewModel.java    From mv2m with Apache License 2.0 4 votes vote down vote up
private boolean checkMandatory(ObservableString bindableString, ObservableInt error) {
    boolean empty = bindableString.isEmpty();
    error.set(empty ? R.string.mandatory_field : 0);
    return !empty;
}
 
Example #13
Source File: NoteModel.java    From mv2m with Apache License 2.0 4 votes vote down vote up
public ObservableInt getTitleError() {
    return titleError;
}
 
Example #14
Source File: NoteModel.java    From mv2m with Apache License 2.0 4 votes vote down vote up
public ObservableInt getTextError() {
    return textError;
}