本文整理汇总了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);
}
}
}
示例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;
}
示例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);
}
}
示例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());
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}