當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。