本文整理汇总了Java中android.support.percent.PercentFrameLayout类的典型用法代码示例。如果您正苦于以下问题:Java PercentFrameLayout类的具体用法?Java PercentFrameLayout怎么用?Java PercentFrameLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PercentFrameLayout类属于android.support.percent包,在下文中一共展示了PercentFrameLayout类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: fixlayout
import android.support.percent.PercentFrameLayout; //导入依赖的package包/类
private void fixlayout(float width, float height) {
PercentFrameLayout.LayoutParams layoutParams =
(PercentFrameLayout.LayoutParams)image.getLayoutParams();
PercentLayoutInfo info = layoutParams.getPercentLayoutInfo();
float oldAspect = info.aspectRatio;
float newAspect = width / height;
Log.v("LAYOUT", String.format("recycled %d to %d: %dx%d, aspect %.3f -> %.3f",
previousPosition, getAdapterPosition(), image.getWidth(), image.getHeight(), oldAspect, newAspect));
info.aspectRatio = newAspect;
layoutParams.height = 0; // @see PercentLayoutHelper.PercentLayoutInfo.fillLayoutParams()
image.setLayoutParams(layoutParams);
}
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:15,代码来源:FeedEntryViewHolder.java
示例2: setupWallpaperActions
import android.support.percent.PercentFrameLayout; //导入依赖的package包/类
void setupWallpaperActions() {
int navBarHeight = UIUtils.getNavBarHeight(this);
if (navBarHeight > 0) {
View wallpaperActionsContainer = findById(this, R.id.group_lwq_settings_wallpaper_actions);
float navBarHeightPercentage = (float) navBarHeight / (float) UIUtils.getRealScreenSize().y;
final PercentFrameLayout.LayoutParams layoutParams =
(PercentFrameLayout.LayoutParams) wallpaperActionsContainer.getLayoutParams();
layoutParams.getPercentLayoutInfo().bottomMarginPercent += navBarHeightPercentage;
wallpaperActionsContainer.requestLayout();
}
shareButton.setTag(R.id.view_tag_flags, FLAG_ENABLE | FLAG_REVEAL);
skipButton.setTag(R.id.view_tag_flags, FLAG_ENABLE | FLAG_REVEAL | FLAG_NO_ROTATE);
skipButton.setTag(R.id.view_tag_animator_rotate, new Runnable() {
@Override
public void run() {
animateAction(skipButton);
}
});
skipButton.setTag(R.id.view_tag_animator_unrotate, new Runnable() {
@Override
public void run() {
endActionAnimation(skipButton);
}
});
saveButton.setTag(R.id.view_tag_flags, FLAG_ENABLE | FLAG_REVEAL | FLAG_NO_ROTATE);
saveButton.setTag(R.id.view_tag_animator_rotate, new Runnable() {
@Override
public void run() {
animateAction(saveButton);
}
});
saveButton.setTag(R.id.view_tag_animator_unrotate, new Runnable() {
@Override
public void run() {
endActionAnimation(saveButton);
}
});
}
开发者ID:stanidesis,项目名称:quotograph,代码行数:39,代码来源:LWQSettingsActivity.java
注:本文中的android.support.percent.PercentFrameLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论