当前位置: 首页>>代码示例>>Java>>正文


Java Property.set方法代码示例

本文整理汇总了Java中android.util.Property.set方法的典型用法代码示例。如果您正苦于以下问题:Java Property.set方法的具体用法?Java Property.set怎么用?Java Property.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.util.Property的用法示例。


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

示例1: setWorkspaceTranslationAndAlpha

import android.util.Property; //导入方法依赖的package包/类
/**
 * Moves the workspace UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the workspace page
 */
private void setWorkspaceTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    mPageAlpha[direction.ordinal()] = alpha;
    float finalAlpha = mPageAlpha[0] * mPageAlpha[1];

    View currentChild = getChildAt(getCurrentPage());
    if (currentChild != null) {
        property.set(currentChild, translation);
        currentChild.setAlpha(finalAlpha);
    }

    // When the animation finishes, reset all pages, just in case we missed a page.
    if (Float.compare(translation, 0) == 0) {
        for (int i = getChildCount() - 1; i >= 0; i--) {
            View child = getChildAt(i);
            property.set(child, translation);
            child.setAlpha(finalAlpha);
        }
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:27,代码来源:Workspace.java

示例2: cursor2Entity

import android.util.Property; //导入方法依赖的package包/类
/**
 * 将游标转换为业务实体
 * @param cursor
 * @param table
 * @return
 */
public static  <T> T cursor2Entity(Cursor cursor, String table){
    try {
        if(cursor!=null ){
            Class<?> clazz = ReflectBeanUtil.getClazzByBeanName(geneClassName(table));
            T  entity = (T) clazz.newInstance();
            Map<String, Field> fields = ReflectBeanUtil.getFields(geneClassName(table));
            int columnCount = cursor.getColumnCount();
            if(columnCount>0){
                for(int i=0;i<columnCount;i++){
                    String column = cursor.getColumnName(i);
                    String value = cursor.getString(i);
                    Field field = fields.get(column);
                    Property property = Property.of(clazz, field.getType(), column);
                    property.set(entity, value);
                }
                return entity;
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:ccliu2015,项目名称:love,代码行数:30,代码来源:SqlBuilder.java

示例3: apply

import android.util.Property; //导入方法依赖的package包/类
/**
 * Apply the specified {@code value} across the {@code list} of views using the {@code property}.
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull List<T> list,
    @NonNull Property<? super T, V> setter, V value) {
  //noinspection ForLoopReplaceableByForEach
  for (int i = 0, count = list.size(); i < count; i++) {
    setter.set(list.get(i), value);
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:ButterKnife.java

示例4: setHotseatTranslationAndAlpha

import android.util.Property; //导入方法依赖的package包/类
/**
 * Moves the Hotseat UI in the provided direction.
 * @param direction the direction to move the workspace
 * @param translation the amount of shift.
 * @param alpha the alpha for the hotseat page
 */
public void setHotseatTranslationAndAlpha(Direction direction, float translation, float alpha) {
    Property<View, Float> property = direction.viewProperty;
    // Skip the page indicator movement in the vertical bar layout
    if (direction != Direction.Y || !mLauncher.getDeviceProfile().isVerticalBarLayout()) {
        property.set(mPageIndicator, translation);
    }
    property.set(mLauncher.getHotseat(), translation);
    setHotseatAlphaAtIndex(alpha, direction.ordinal());
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:16,代码来源:Workspace.java

示例5: apply

import android.util.Property; //导入方法依赖的package包/类
@TargetApi(14)
public static <T extends View, V> void apply(List<T> list, Property<? super T, V> setter, V value) {
    int count = list.size();
    for (int i = 0; i < count; i++) {
        setter.set(list.get(i), value);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:ButterKnife.java

示例6: apply

import android.util.Property; //导入方法依赖的package包/类
/**
 * Apply the specified {@code value} across the {@code list} of views using the {@code
 * property}.
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) // http://b.android.com/213630
@RequiresApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@UiThread
public static <T extends View, V> void apply(@NonNull List<T> list,
                                             @NonNull Property<? super T, V> setter, V value) {
    //noinspection ForLoopReplaceableByForEach
    for (int i = 0, count = list.size(); i < count; i++) {
        setter.set(list.get(i), value);
    }
}
 
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:15,代码来源:ButterKnife.java

示例7: apply

import android.util.Property; //导入方法依赖的package包/类
/**
 * Apply the specified {@code value} across the {@code list} of views using the {@code property}.
 */
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public static <T extends View, V> void apply(List<T> list, Property<? super T, V> setter,
    V value) {
  //noinspection ForLoopReplaceableByForEach
  for (int i = 0, count = list.size(); i < count; i++) {
    setter.set(list.get(i), value);
  }
}
 
开发者ID:ThirdProject,项目名称:android_external_JakeWharton_butterknife,代码行数:12,代码来源:ButterKnife.java

示例8: ofFloat

import android.util.Property; //导入方法依赖的package包/类
@Override
public ObjectAnimator ofFloat(View view, Property<View, Float> property,
                              float startFraction, float endFraction) {
    float start = property.get(view) * startFraction;
    float end = property.get(view) * endFraction;
    if (start == end) {
        return null;
    }
    property.set(view, start);
    return ObjectAnimator.ofFloat(view, property, end);
}
 
开发者ID:andkulikov,项目名称:Transitions-Everywhere,代码行数:12,代码来源:AnimatorUtils.java

示例9: ofInt

import android.util.Property; //导入方法依赖的package包/类
@Override
public ObjectAnimator ofInt(View view, Property<View, Integer> property,
                            float startFraction, float endFraction) {
    int start = (int) (property.get(view) * startFraction);
    int end = (int) (property.get(view) * endFraction);
    if (start == end) {
        return null;
    }
    property.set(view, start);
    return ObjectAnimator.ofInt(view, property, end);
}
 
开发者ID:andkulikov,项目名称:Transitions-Everywhere,代码行数:12,代码来源:AnimatorUtils.java


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