Search in sources :

Example 36 with ScrollView

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);
}
Also used : GridLayout(android.widget.GridLayout) ScrollView(android.widget.ScrollView) CheckBox(android.widget.CheckBox)

Example 37 with 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);
}
Also used : GridLayout(android.widget.GridLayout) ScrollView(android.widget.ScrollView) Button(android.widget.Button) DecimalFormat(java.text.DecimalFormat) TextView(android.widget.TextView) Resources(android.content.res.Resources) AnimatedVectorDrawable(android.graphics.drawable.AnimatedVectorDrawable)

Example 38 with ScrollView

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);
}
Also used : GridLayout(android.widget.GridLayout) LayoutParams(android.view.ViewGroup.LayoutParams) ScrollView(android.widget.ScrollView) TextView(android.widget.TextView) ImageView(android.widget.ImageView)

Example 39 with 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();
    }
}
Also used : ScrollView(android.widget.ScrollView) WXScroller(com.taobao.weex.ui.component.WXScroller)

Example 40 with ScrollView

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);
        }
    });
}
Also used : ScrollView(android.widget.ScrollView) OnScrollListener(com.reactnativenavigation.views.collapsingToolbar.OnScrollListener) ScrollListener(com.reactnativenavigation.views.collapsingToolbar.ScrollListener) OnScrollViewAddedListener(com.reactnativenavigation.views.collapsingToolbar.OnScrollViewAddedListener)

Aggregations

ScrollView (android.widget.ScrollView)366 View (android.view.View)173 TextView (android.widget.TextView)148 LinearLayout (android.widget.LinearLayout)93 ImageView (android.widget.ImageView)65 ViewGroup (android.view.ViewGroup)53 Button (android.widget.Button)36 EditText (android.widget.EditText)36 ListView (android.widget.ListView)29 AbsListView (android.widget.AbsListView)27 RecyclerView (android.support.v7.widget.RecyclerView)25 Intent (android.content.Intent)24 AdapterView (android.widget.AdapterView)24 GridLayout (android.widget.GridLayout)24 WebView (android.webkit.WebView)22 SuppressLint (android.annotation.SuppressLint)21 ArrayList (java.util.ArrayList)21 FrameLayout (android.widget.FrameLayout)19 Dialog (android.app.Dialog)16 DialogInterface (android.content.DialogInterface)16