use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.
the class AnimatedStateVectorDrawableTest method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ScrollView scrollView = new ScrollView(this);
GridLayout container = new GridLayout(this);
scrollView.addView(container);
container.setColumnCount(2);
for (int i = 0; i < icon.length; i++) {
CheckBox button = new CheckBox(this);
button.setWidth(400);
button.setHeight(400);
button.setBackgroundResource(icon[i]);
container.addView(button);
}
setContentView(scrollView);
}
use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.
the class AnimatedVectorDrawableDupPerf method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ScrollView scrollView = new ScrollView(this);
GridLayout container = new GridLayout(this);
scrollView.addView(container);
container.setColumnCount(5);
Resources res = this.getResources();
container.setBackgroundColor(0xFF888888);
AnimatedVectorDrawable[] d = new AnimatedVectorDrawable[icon.length];
long time = android.os.SystemClock.elapsedRealtimeNanos();
for (int i = 0; i < icon.length; i++) {
d[i] = create(res, icon[i]);
}
time = android.os.SystemClock.elapsedRealtimeNanos() - time;
TextView t = new TextView(this);
DecimalFormat df = new DecimalFormat("#.##");
t.setText("avgL=" + df.format(time / (icon.length * 1000000.)) + " ms");
container.addView(t);
time = android.os.SystemClock.elapsedRealtimeNanos();
for (int i = 0; i < icon.length; i++) {
Button button = new Button(this);
button.setWidth(200);
button.setBackgroundResource(icon[i]);
container.addView(button);
}
setContentView(scrollView);
time = android.os.SystemClock.elapsedRealtimeNanos() - time;
t = new TextView(this);
t.setText("avgS=" + df.format(time / (icon.length * 1000000.)) + " ms");
container.addView(t);
}
use of android.widget.ScrollView in project android_frameworks_base by DirtyUnicorns.
the class ScaleDrawableTests method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ScrollView scrollView = new ScrollView(this);
GridLayout container = new GridLayout(this);
scrollView.addView(container);
container.setColumnCount(4);
container.setBackgroundColor(0xFF888888);
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
params.width = 300;
params.height = 200;
for (int i = 0; i < scaleTypes.length; i++) {
TextView t = new TextView(this);
t.setText(scaleTypes[i]);
container.addView(t);
ImageView.ScaleType scaleType = ImageView.ScaleType.values()[i];
ImageView png_view = new ImageView(this);
png_view.setLayoutParams(params);
png_view.setScaleType(scaleType);
png_view.setImageResource(icon);
container.addView(png_view);
ImageView view = new ImageView(this);
view.setLayoutParams(params);
view.setScaleType(scaleType);
view.setImageResource(vector_icon);
container.addView(view);
ImageView avd_view = new ImageView(this);
avd_view.setLayoutParams(params);
avd_view.setScaleType(scaleType);
avd_view.setImageResource(animated_vector_icon);
container.addView(avd_view);
}
setContentView(scrollView);
}
use of android.widget.ScrollView in project weex-example by KalicyZhou.
the class WXRenderStatement method createBody.
/**
* create RootView ,every weex Instance View has a rootView;
* @see com.taobao.weex.dom.WXDomStatement#createBody(JSONObject)
*/
void createBody(WXComponent component) {
long start = System.currentTimeMillis();
component.createView();
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.renderPerformanceLog("createView", (System.currentTimeMillis() - start));
}
start = System.currentTimeMillis();
component.applyLayoutAndEvent(component);
component.bindData(component);
if (WXEnvironment.isApkDebugable()) {
WXLogUtils.renderPerformanceLog("bind", (System.currentTimeMillis() - start));
}
if (component instanceof WXScroller) {
WXScroller scroller = (WXScroller) component;
if (scroller.getInnerView() instanceof ScrollView) {
mWXSDKInstance.setRootScrollView((ScrollView) scroller.getInnerView());
}
}
mWXSDKInstance.onRootCreated(component);
if (mWXSDKInstance.getRenderStrategy() != WXRenderStrategy.APPEND_ONCE) {
mWXSDKInstance.onCreateFinish();
}
}
use of android.widget.ScrollView in project react-native-navigation by wix.
the class CollapsingViewPagerScreen method setupCollapseDetection.
private void setupCollapseDetection(CollapsingContentView contentView) {
ScrollListener scrollListener = getScrollListener((CollapsingView) topBar);
contentView.setupCollapseDetection(scrollListener, new OnScrollViewAddedListener() {
@Override
public void onScrollViewAdded(ScrollView scrollView) {
((CollapsingTopBar) topBar).onScrollViewAdded(scrollView);
}
});
}
Aggregations