Java Examples for android.databinding.Bindable

The following java examples will help you to understand the usage of android.databinding.Bindable. These source code samples are taken from different open source projects.

Example 1
Project: android-detect-webgl-master  File: BindableSupportLevel.java View source code
@SuppressWarnings("unused")
@Bindable
public String getSupportLevel() {
    if (supportLevel == null) {
        return "Checking...";
    } else {
        switch(supportLevel) {
            case NOT_SUPPORTED:
                return "Not supported :(";
            case SUPPORTED_DISABLED:
                return "Supported, but disabled :(";
            case SUPPORTED:
                return "Supported! :)";
            default:
            case UNKNOWN:
                return "Unknown";
        }
    }
}
Example 2
Project: Jockey-master  File: RuleViewModel.java View source code
@Bindable
public String getValueText() {
    if ((mEnumeratedRule.getInputType() & InputType.TYPE_CLASS_DATETIME) != 0) {
        long dateAsUnixTimestamp;
        try {
            dateAsUnixTimestamp = Long.parseLong(mFactory.getValue()) * 1000;
        } catch (NumberFormatException e) {
            dateAsUnixTimestamp = System.currentTimeMillis();
        }
        int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR;
        Formatter date = DateUtils.formatDateRange(mContext, new Formatter(), dateAsUnixTimestamp, dateAsUnixTimestamp, flags, "UTC");
        return date.toString();
    } else {
        return mFactory.getValue();
    }
}
Example 3
Project: android-sdk-sources-for-api-level-23-master  File: ProcessBindable.java View source code
@Override
public boolean onHandleStep(RoundEnvironment roundEnv, ProcessingEnvironment processingEnv, BindingBuildInfo buildInfo) {
    if (mProperties == null) {
        mProperties = new IntermediateV1(buildInfo.modulePackage());
        mergeLayoutVariables();
        mLayoutVariables.clear();
        TypeElement observableType = processingEnv.getElementUtils().getTypeElement("android.databinding.Observable");
        Types typeUtils = processingEnv.getTypeUtils();
        for (Element element : AnnotationUtil.getElementsAnnotatedWith(roundEnv, Bindable.class)) {
            Element enclosingElement = element.getEnclosingElement();
            ElementKind kind = enclosingElement.getKind();
            if (kind != ElementKind.CLASS && kind != ElementKind.INTERFACE) {
                L.e("Bindable must be on a member field or method. The enclosing type is %s", enclosingElement.getKind());
            }
            TypeElement enclosing = (TypeElement) enclosingElement;
            if (!typeUtils.isAssignable(enclosing.asType(), observableType.asType())) {
                L.e("Bindable must be on a member in an Observable class. %s is not Observable", enclosingElement.getSimpleName());
            }
            String name = getPropertyName(element);
            if (name != null) {
                Preconditions.checkNotNull(mProperties, "Must receive app / library info before " + "Bindable fields.");
                mProperties.addProperty(enclosing.getQualifiedName().toString(), name);
            }
        }
        GenerationalClassUtil.writeIntermediateFile(processingEnv, mProperties.getPackage(), createIntermediateFileName(mProperties.getPackage()), mProperties);
        generateBRClasses(!buildInfo.isLibrary(), mProperties.getPackage());
    }
    return false;
}
Example 4
Project: SyncthingAndroid-master  File: FolderCard.java View source code
@Bindable
public int getCompletion() {
    if (state == ModelState.SYNCING) {
        return globalBytes != 0 ? Math.min(100, Math.round(100f * inSyncBytes / globalBytes)) : 100;
    } else if (state == ModelState.SCANNING) {
        return scanProgress != null ? Math.min(100, Math.round(100f * scanProgress.current / scanProgress.total)) : 100;
    } else {
        return 0;
    }
}
Example 5
Project: all-base-adapter-master  File: FlowBean.java View source code
@Bindable
public String getTag() {
    return tag;
}
Example 6
Project: ErrorReport-TestWithAndroidDataBinding-master  File: ViewMode.java View source code
@Bindable
public String getHelloworld() {
    return helloworld;
}
Example 7
Project: GoogleIOTest-master  File: User.java View source code
@Bindable
public String getName() {
    return name;
}
Example 8
Project: ZhuanLan-master  File: Person.java View source code
@Bindable
public String getFirstName() {
    return firstName;
}
Example 9
Project: RxDownload-master  File: BaseModel.java View source code
@Bindable
public String getUrl() {
    return url;
}
Example 10
Project: demos-master  File: TestDoubleBindBean.java View source code
@Bindable
public boolean isSelect() {
    return select;
}
Example 11
Project: MasteringAndroidDataBinding-master  File: ObservableUser.java View source code
@Bindable
public String getFirstName() {
    return mFirstName;
}
Example 12
Project: AndroidAgeraTutorial-master  File: BaseObservableVehicleInfo.java View source code
@Bindable
public boolean getIsSelected() {
    return isSelected;
}
Example 13
Project: CloudReader-master  File: HotMovieBean.java View source code
@Bindable
public int getCount() {
    return count;
}
Example 14
Project: cw-omnibus-master  File: Question.java View source code
@Bindable
public String getTitle() {
    return (title);
}
Example 15
Project: playground-master  File: Book.java View source code
@Bindable
public String getTitle() {
    return title;
}
Example 16
Project: avatar-view-master  File: ExampleViewModel.java View source code
@Bindable
public User getRefreshableUser() {
    return refreshableUser;
}
Example 17
Project: firebase-jobdispatcher-android-master  File: JobForm.java View source code
@Bindable
public String getWinEndSecondsStr() {
    return String.valueOf(winEndSeconds);
}
Example 18
Project: S1-Next-master  File: PageJumpViewModel.java View source code
@Bindable
public int getSeekBarProgress() {
    return seekBarProgress;
}
Example 19
Project: Surviving-with-android-master  File: Data.java View source code
@Bindable
public String getTemp() {
    return temp;
}
Example 20
Project: android-money-manager-ex-master  File: BudgetViewModel.java View source code
@Bindable
public String getName() {
    return name;
}
Example 21
Project: AndroidMvc-master  File: CounterMasterController.java View source code
@Bindable
public String getCount() {
    return count;
}
Example 22
Project: artcodes-android-master  File: ListAdapter.java View source code
@Bindable
public RecyclerView.Adapter getAdapter() {
    return adapter;
}
Example 23
Project: countries-master  File: BaseCountryViewModel.java View source code
@Override
@Bindable
public Drawable getBookmarkDrawable() {
    return AppCompatDrawableManager.get().getDrawable(ctx, countryRepo.getByField("alpha2Code", country.alpha2Code, false) != null ? R.drawable.ic_bookmark_black : R.drawable.ic_bookmark_border_black);
}
Example 24
Project: Materialize-master  File: AdjustViewModel.java View source code
@Bindable
public ColorDrawable getWhite() {
    return white;
}