Java 类android.widget.ScrollView 实例源码

项目:Review-    文件:FavActivity.java   
public static void scrollToBottom(final ScrollView scroll, final View inner) {

        Handler mHandler = new Handler();

        mHandler.post(new Runnable() {
            public void run() {
                if (scroll == null || inner == null) {
                    return;
                }

                int offset = inner.getMeasuredHeight() - scroll.getHeight();
                if (offset < 0) {
                    offset = 0;
                }

                scroll.smoothScrollTo(0, offset);
            }
        });
    }
项目:aarLibrary    文件:XRefreshContentView.java   
public boolean canChildPullUp() {
    if (child instanceof AbsListView) {
        AbsListView absListView = (AbsListView) child;
        return canScrollVertically(child, 1)
                || absListView.getLastVisiblePosition() != mTotalItemCount - 1;
    } else if (child instanceof WebView) {
        WebView webview = (WebView) child;
        if (webview instanceof XWebView) {
            return !((XWebView) webview).isBottom();
        } else {
            float left = webview.getContentHeight() * webview.getScale();
            int right = webview.getHeight() + webview.getScrollY();
            return left != right;
        }
    } else if (child instanceof ScrollView) {
        ScrollView scrollView = (ScrollView) child;
        View childView = scrollView.getChildAt(0);
        if (childView != null) {
            return canScrollVertically(child, 1)
                    || scrollView.getScrollY() < childView.getHeight() - scrollView.getHeight();
        }
    } else {
        return canScrollVertically(child, 1);
    }
    return true;
}
项目:XPrivacy    文件:ActivityMain.java   
private void optionTutorial() {
    ((ScrollView) findViewById(R.id.svTutorialHeader)).setVisibility(View.VISIBLE);
    ((ScrollView) findViewById(R.id.svTutorialDetails)).setVisibility(View.VISIBLE);
    int userId = Util.getUserId(Process.myUid());
    PrivacyManager.setSetting(userId, PrivacyManager.cSettingTutorialMain, Boolean.FALSE.toString());

    Dialog dlgUsage = new Dialog(this);
    dlgUsage.requestWindowFeature(Window.FEATURE_LEFT_ICON);
    dlgUsage.setTitle(R.string.title_usage_header);
    dlgUsage.setContentView(R.layout.usage);
    dlgUsage.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));
    dlgUsage.setCancelable(true);
    dlgUsage.show();
}
项目:Hotspot-master-devp    文件:SubjectActivity.java   
@Override
public void getViews() {
    mInflater = LayoutInflater.from(context);
    mCustomWebView = (CustomWebView) findViewById(R.id.webview_custom);
    back = (ImageView) findViewById(R.id.back);
    toleft_iv_right = (ImageView) findViewById(R.id.toleft_iv_right);
    recommend_listview = (ListView) findViewById(R.id.recommend_listview);
    shareWeixinIV = (ImageView) findViewById(R.id.share_weixin);
    shareFriendsIV = (ImageView) findViewById(R.id.share_friends);
    shareQqIV = (ImageView) findViewById(R.id.share_qq);
    shareWeiboIV = (ImageView) findViewById(R.id.share_weibo);
    recommend_layout = (LinearLayout)findViewById(R.id.recommend_layout);
    share = (ImageView) findViewById(R.id.share);
    mProgressLayout = (ProgressBarView) findViewById(R.id.pbv_loading);
    allProgressLayuot = (ProgressBarView) findViewById(R.id.all_pbv_loading);
    share_layout = (LinearLayout)findViewById(R.id.share_layout);
    info = (ScrollView) findViewById(R.id.info);
}
项目:nowweather    文件:WeatherActivity.java   
private void initView() {
    weatherLayout = (ScrollView)findViewById(R.id.weather_layout);
    titleCity = (TextView)findViewById(R.id.title_city);
    titleUpdateTime = (TextView)findViewById(R.id.title_update_time);
    degreeText = (TextView)findViewById(R.id.degree_text);
    weatherInfoText = (TextView)findViewById(R.id.weather_info_text);
    forecastLayout = (LinearLayout)findViewById(R.id.forecast_layout);
    aqiText = (TextView)findViewById(R.id.aqi_text);
    pm25Text = (TextView)findViewById(R.id.pm25_text);
    comfortText = (TextView)findViewById(R.id.comfort_text);
    carWashText = (TextView)findViewById(R.id.car_wash_text);
    sportText = (TextView)findViewById(R.id.sport_text);
    bingPicImg = (ImageView)findViewById(R.id.bing_pic);
    swipeRefresh = (SwipeRefreshLayout)findViewById(R.id.swipe_refresh);
    drawerlayout = (DrawerLayout)findViewById(R.id.drawer_layout);
    navButton = (Button)findViewById(R.id.nav_button);
}
项目:CustomAndroidOneSheeld    文件:TwitterFragment.java   
@Override
public void onImageUploaded(final String tweet) {
    // TODO Auto-generated method stub
    uiHandler.removeCallbacksAndMessages(null);
    uiHandler.post(new Runnable() {

        @Override
        public void run() {
            if (canChangeUI()) {
                OneSheeldTextView tweetItem = (OneSheeldTextView) activity
                        .getLayoutInflater().inflate(
                                R.layout.tweet_item,
                                lastTweetTextContainer, false);
                tweetItem.setText(tweet);
                lastTweetTextContainer.addView(tweetItem);
                ((ScrollView) lastTweetTextContainer.getParent())
                        .invalidate();
            }
        }
    });
}
项目:qmui    文件:QDDialogFragment.java   
@Override
public View onBuildContent(QMUIDialog dialog, ScrollView parent) {
    LinearLayout layout = new LinearLayout(mContext);
    layout.setOrientation(LinearLayout.VERTICAL);
    layout.setLayoutParams(new ScrollView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    int padding = QMUIDisplayHelper.dp2px(mContext, 20);
    layout.setPadding(padding, padding, padding, padding);
    mEditText = new EditText(mContext);
    QMUIViewHelper.setBackgroundKeepingPadding(mEditText, QMUIResHelper.getAttrDrawable(mContext, R.attr.qmui_list_item_bg_with_border_bottom));
    mEditText.setHint("输入框");
    LinearLayout.LayoutParams editTextLP = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, QMUIDisplayHelper.dpToPx(50));
    editTextLP.bottomMargin = QMUIDisplayHelper.dp2px(getContext(), 15);
    mEditText.setLayoutParams(editTextLP);
    layout.addView(mEditText);
    TextView textView = new TextView(mContext);
    textView.setLineSpacing(QMUIDisplayHelper.dp2px(getContext(), 4), 1.0f);
    textView.setText("观察聚焦输入框后,键盘升起降下时 dialog 的高度自适应变化。\n\n" +
            "QMUI Android 的设计目的是用于辅助快速搭建一个具备基本设计还原效果的 Android 项目," +
            "同时利用自身提供的丰富控件及兼容处理,让开发者能专注于业务需求而无需耗费精力在基础代码的设计上。" +
            "不管是新项目的创建,或是已有项目的维护,均可使开发效率和项目质量得到大幅度提升。");
    textView.setTextColor(ContextCompat.getColor(getContext(), R.color.app_color_description));
    textView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    layout.addView(textView);
    return layout;
}
项目:myCoolWeather    文件:WeatherActivity.java   
private void initView() {
    weatherLayout = (ScrollView) findViewById(R.id.weather_layout);
    titileCity = (TextView) findViewById(R.id.title_city);
    titleUpdateTime = (TextView) findViewById(R.id.title_update_time);
    degressText = (TextView) findViewById(R.id.degress_text);
    weatherInfoText = (TextView) findViewById(R.id.weather_info_text);
    forecastLayout = (LinearLayout) findViewById(R.id.forecast_layout);
    aqiText = (TextView) findViewById(R.id.aqi_text);
    pm25Text = (TextView) findViewById(R.id.pm25_text);
    comfortText = (TextView) findViewById(R.id.comfort_text);
    carWashText = (TextView) findViewById(R.id.car_wash_text);
    sportText = (TextView) findViewById(R.id.sport_text);

    bingPicImg = (ImageView) findViewById(R.id.bing_pic_img);
    swipeRefresh = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh);

    swipeRefresh.setColorSchemeResources(R.color.colorPrimary);

    drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    navButton = (Button) findViewById(R.id.nav_button);
}
项目:CustomAndroidOneSheeld    文件:TwitterFragment.java   
@Override
public void onDirectMessageSent(final String userHandle,
                                final String msg) {
    // TODO Auto-generated method stub
    uiHandler.removeCallbacksAndMessages(null);
    uiHandler.post(new Runnable() {

        @Override
        public void run() {
            if (canChangeUI()) {
                OneSheeldTextView tweetItem = (OneSheeldTextView) activity
                        .getLayoutInflater().inflate(
                                R.layout.tweet_item,
                                lastTweetTextContainer, false);
                tweetItem.setText(activity.getString(R.string.twitter_to)+": " + userHandle + ", "+activity.getString(R.string.twitter_message)+": "
                        + msg);
                lastTweetTextContainer.addView(tweetItem);
                ((ScrollView) lastTweetTextContainer.getParent())
                        .invalidate();
            }
        }
    });
}
项目:android_ui    文件:ScrollableWrapper.java   
/**
 * Wraps the given <var>scrollableView</var> into scrollable wrapper implementation that best
 * suits to the type of the given view.
 *
 * @param scrollableView The scrollable view to be wrapped into scrollable wrapper.
 * @return New scrollable wrapper instance. See description of this class for supported wrappers.
 */
@SuppressWarnings("unchecked")
public static <V extends View> ScrollableWrapper<V> wrapScrollableView(@NonNull V scrollableView) {
    if (scrollableView instanceof AbsListView) {
        return new AbsListViewWrapper((AbsListView) scrollableView);
    } else if (scrollableView instanceof RecyclerView) {
        return new RecyclerViewWrapper((RecyclerView) scrollableView);
    } else if (scrollableView instanceof ScrollView) {
        return new ScrollViewWrapper((ScrollView) scrollableView);
    } else if (scrollableView instanceof HorizontalScrollView) {
        return new HorizontalScrollViewWrapper((HorizontalScrollView) scrollableView);
    } else if (scrollableView instanceof ViewPager) {
        return new ViewPagerWrapper((ViewPager) scrollableView);
    } else if (scrollableView instanceof WebView) {
        return new WebViewWrapper((WebView) scrollableView);
    }
    return new ViewWrapper(scrollableView);
}
项目:RabbitCloud    文件:PtrDefaultHandler2.java   
public static boolean canChildScrollDown(View view) {
    if (android.os.Build.VERSION.SDK_INT < 14) {
        if (view instanceof AbsListView) {
            final AbsListView absListView = (AbsListView) view;
            return absListView.getChildCount() > 0
                    && (absListView.getLastVisiblePosition() < absListView.getChildCount() - 1
                    || absListView.getChildAt(absListView.getChildCount() - 1).getBottom() > absListView.getPaddingBottom());
        } else if (view instanceof ScrollView) {
            ScrollView scrollView = (ScrollView) view;
            if (scrollView.getChildCount() == 0) {
                return false;
            } else {
                return scrollView.getScrollY() < scrollView.getChildAt(0).getHeight() - scrollView.getHeight();
            }
        } else {
            return false;
        }
    } else {
        return view.canScrollVertically(1);
    }
}
项目:RNLearn_Project1    文件:ReactScrollViewTestCase.java   
public void testScrollEvents() {
  ScrollView scrollView = getViewAtPath(0);

  dragUp();

  waitForBridgeAndUIIdle();
  mScrollListenerModule.waitForScrollIdle();
  waitForBridgeAndUIIdle();

  ArrayList<Double> yOffsets = mScrollListenerModule.getYOffsets();
  assertFalse("Expected to receive at least one scroll event", yOffsets.isEmpty());
  assertTrue("Expected offset to be greater than 0", yOffsets.get(yOffsets.size() - 1) > 0);
  assertTrue(
      "Expected no item click event fired",
      mScrollListenerModule.getItemsPressed().isEmpty());
  assertEquals(
      "Expected last offset to be offset of scroll view",
      PixelUtil.toDIPFromPixel(scrollView.getScrollY()),
      yOffsets.get(yOffsets.size() - 1).doubleValue(),
      1e-5);
  assertTrue("Begin and End Drag should be called", mScrollListenerModule.dragEventsMatch());
}
项目:arch-users-forum    文件:ViewTopicActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.view_topic_activity);
    Intent intent = getIntent();
    String forum_link = intent.getStringExtra("link_to_get");
    cr= new CrawlerRunnable();
    cr.initiate_url(forum_link);
    cr.start();
    t = (TextView)findViewById(R.id.text_view2);
    t.setOnClickListener(listener);
    t.setVisibility(View.INVISIBLE);
    sv = (ScrollView)findViewById(R.id.scroll_view3);
    ll = (LinearLayout)findViewById(R.id.linear_layout3);
    try {
        handler.removeCallbacks(time_task);
        handler.postDelayed(time_task, 1000);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目:boohee_v5.6    文件:BitmapUtil.java   
public static Bitmap getBitmapByView(ScrollView scrollView) {
    int h = 0;
    for (int i = 0; i < scrollView.getChildCount(); i++) {
        h += scrollView.getChildAt(i).getHeight();
    }
    Bitmap bitmap = Bitmap.createBitmap(scrollView.getWidth(), h, Config.ARGB_8888);
    scrollView.draw(new Canvas(bitmap));
    return bitmap;
}
项目:weex-3d-map    文件:ScreenShot.java   
public static View findFirstScrollerByRootView(View  rootView){

        View firstScrollView = null;

        if(null != rootView){
            allViews = ViewUtil.getAllChildViews(rootView);
            for (View view:allViews
                 ) {
                if(view instanceof ScrollView){
                    firstScrollView = view;
                    break;
                }
            }
        }
        return firstScrollView;
    }
项目:EasyUpdateApplication    文件:ms_AlertDialog.java   
private void initAlertDialog(Context context)
{
    layout = LayoutInflater.from(context).inflate(R.layout.ms_dialog, null);

    custom_view = (ViewGroup)layout.findViewById(R.id.id_custom_view);

    title = (TextView)layout.findViewById(R.id.id_title);
    content = (TextView)layout.findViewById(R.id.id_content_text);
    button_bar = (LinearLayout)layout.findViewById(R.id.bar_button);
    positive = (Button)layout.findViewById(R.id.button_positive);
    negative = (Button)layout.findViewById(R.id.button_negative);
    scroll = (ScrollView)layout.findViewById(R.id.id_scroll);
    list = (ListView)layout.findViewById(R.id.id_list);
    recycler = (RecyclerView)layout.findViewById(R.id.id_recycler);

    builder = new AlertDialog.Builder(context)
        .setView(layout);

    dialog = builder.create();
    dialog.show();
}
项目:CustomAndroidOneSheeld    文件:TwitterFragment.java   
@Override
public void onRecieveTweet(final String tweet) {
    // TODO Auto-generated method stub
    if (canChangeUI()) {
        uiHandler.removeCallbacksAndMessages(null);
        uiHandler.post(new Runnable() {

            @Override
            public void run() {
                OneSheeldTextView tweetItem = (OneSheeldTextView) activity
                        .getLayoutInflater().inflate(
                                R.layout.tweet_item,
                                lastTweetTextContainer, false);
                tweetItem.setText(tweet);
                lastTweetTextContainer.addView(tweetItem);
                ((ScrollView) lastTweetTextContainer.getParent())
                        .invalidate();
            }
        });
    }
}
项目:weex-3d-map    文件:WXRenderStatement.java   
/**
 * 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(mGodComponent, -1);
  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.setRootView(mGodComponent.getRealView());
  if (mWXSDKInstance.getRenderStrategy() != WXRenderStrategy.APPEND_ONCE) {
    mWXSDKInstance.onViewCreated(mGodComponent);
  }
}
项目:letv    文件:LeBoxMainActivity.java   
public void onRefresh(PullToRefreshBase<ScrollView> pullToRefreshBase) {
    LeboxConnectManager.getInstance().setConnectProgressReciver(new ConnectProgressReciver() {
        public void notifyProgress(int p) {
            switch (p) {
                case 27:
                    LeBoxMainActivity.this.mPullToRefreshScrollView.getLoadingLayoutProxy().setLastUpdatedLabel("");
                    LeBoxMainActivity.this.mPullToRefreshScrollView.onRefreshComplete();
                    LeBoxMainActivity.this.initData(false);
                    return;
                default:
                    if (10 <= p && p < 27) {
                        String text = Util.getConnectProcessPrompt(p);
                        if (!TextUtils.isEmpty(text)) {
                            LeBoxMainActivity.this.mPullToRefreshScrollView.getLoadingLayoutProxy().setLastUpdatedLabel(text);
                            return;
                        }
                        return;
                    }
                    return;
            }
        }
    });
    LeboxConnectManager.getInstance().startConnect();
}
项目:Huochexing12306    文件:PullToRefreshView.java   
/**
 * init AdapterView like ListView,GridView and so on;or init ScrollView
 * 
 * @description hylin 2012-7-30下午8:48:12
 */
private void initContentAdapterView() {
    int count = getChildCount();
    if (count < 3) {
        throw new IllegalArgumentException(
                "this layout must contain 3 child views,and AdapterView or ScrollView must in the second position!");
    }
    View view = null;
    for (int i = 0; i < count - 1; ++i) {
        view = getChildAt(i);
        if (view instanceof AdapterView<?>) {
            mAdapterView = (AdapterView<?>) view;
        }
        if (view instanceof ScrollView) {
            // finish later
            mScrollView = (ScrollView) view;
        }
    }
    if (mAdapterView == null && mScrollView == null) {
        throw new IllegalArgumentException(
                "must contain a AdapterView or ScrollView in this layout!");
    }
}
项目:HtmlNative    文件:SourceHtmlActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String source = getIntent().getStringExtra(INTENT_SOURCE_CODE);

    TextView sourceCodeTxt = new TextView(this);
    sourceCodeTxt.setBackgroundColor(Color.parseColor("#363636"));
    sourceCodeTxt.setTextColor(Color.WHITE);
    if (source != null) {
        sourceCodeTxt.setText(source);
    }

    ScrollView scrollView = new ScrollView(this);
    scrollView.addView(sourceCodeTxt, new FrameLayout.LayoutParams(FrameLayout.LayoutParams
            .MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    setContentView(scrollView);
}
项目:mybotproject-Android    文件:MainActivity.java   
/**
     * Adds a message dialog view to the UI.
     *
     * @param message ConversationMessage containing a message and the sender.
     */
    private void addMessageFromUser(ConversationMessage message) {
        View messageView;
        LinearLayout messageContainer = (LinearLayout) findViewById(R.id.message_container);

        if (message.getUser().equals(USER_WATSON)) {
            messageView = this.getLayoutInflater().inflate(R.layout.watson_text, messageContainer, false);
            TextView watsonMessageText = (TextView) messageView.findViewById(R.id.watsonTextView);
            watsonMessageText.setText(message.getMessageText());
            if (message.getMessageText() != null)
                Log.i("User will see this", message.getMessageText());
//            if (message.getMessageText().contains("violations")) {
//                Log.i("Inside VIOlations","Vioation indisa");
//                messageView = this.getLayoutInflater().inflate(R.layout.watson_text, messageContainer, false);
////                TextView watsonMessageText = (TextView)messageView.findViewById(R.id.watsonTextView);
//                watsonMessageText.setText("you have fines");
//            }
        } else {
            messageView = this.getLayoutInflater().inflate(R.layout.user_text, messageContainer, false);
            TextView userMessageText = (TextView) messageView.findViewById(R.id.userTextView);
            userMessageText.setText(message.getMessageText());
        }

        messageContainer.addView(messageView);

        // Scroll to the bottom of the view so the user sees the update.
        final ScrollView scrollView = (ScrollView) findViewById(R.id.message_scrollview);
        scrollView.post(new Runnable() {
            @Override
            public void run() {
                scrollView.fullScroll(View.FOCUS_DOWN);
            }
        });
    }
项目:AgentWebX5    文件:ScrollingUtil.java   
public static void scrollAViewBy(View view, int height) {
    if (view instanceof RecyclerView) ((RecyclerView) view).scrollBy(0, height);
    else if (view instanceof ScrollView) ((ScrollView) view).smoothScrollBy(0, height);
    else if (view instanceof AbsListView) ((AbsListView) view).smoothScrollBy(height, 0);
    else {
        try {
            Method method = view.getClass().getDeclaredMethod("smoothScrollBy", Integer.class, Integer.class);
            method.invoke(view, 0, height);
        } catch (Exception e) {
            view.scrollBy(0, height);
        }
    }
}
项目:AgentWebX5    文件:ScrollingUtil.java   
public static void scrollToBottom(final ScrollView scrollView) {
    if (scrollView != null) {
        scrollView.post(new Runnable() {
            @Override
            public void run() {
                scrollView.fullScroll(ScrollView.FOCUS_DOWN);
            }
        });
    }
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:ConsoleView.java   
private void init() {
    inflate(getContext(), R.layout.console_view, this);
    mTextView = (TextView) findViewById(R.id.content);
    mTextView.setMovementMethod(new ScrollingMovementMethod());
    mContentContainer = (ScrollView) findViewById(R.id.content_container);
    initEditText();
    initSubmitButton();
}
项目:aos-Video    文件:TVCardView.java   
@Override
public void restoreFocus(ScrollView sv) {
    if (lastFocused == -1 && findViewById(R.id.imageView) != null&&slaveView!=null)
        findViewById(R.id.imageView).requestFocus();
    else {
        if (others.size() > lastFocused) {
            if (others.get(lastFocused) instanceof FocusableTVCardView)
                ((FocusableTVCardView) others.get(lastFocused)).restoreFocus((ScrollView) findViewById(R.id.contentScrollView));
            else if(slaveView!=null)
                others.get(lastFocused).requestFocus();
        }
    }

}
项目:GitHub    文件:DemoMainActivity.java   
@Override
public void initView() {//必须调用
    exitAnim = R.anim.bottom_push_out;

    rlDemoMainTopbar = findViewById(R.id.rlDemoMainTopbar);

    ivDemoMainHead = findViewById(R.id.ivDemoMainHead, this);
    tvDemoMainHeadName = findViewById(R.id.tvDemoMainHeadName, this);

    svDemoMain = (ScrollView) findViewById(R.id.svDemoMain);
}
项目:GitHub    文件:DemoMainActivity.java   
@Override
public void initView() {//必须调用
    exitAnim = R.anim.bottom_push_out;

    rlDemoMainTopbar = findViewById(R.id.rlDemoMainTopbar);

    ivDemoMainHead = findViewById(R.id.ivDemoMainHead, this);
    tvDemoMainHeadName = findViewById(R.id.tvDemoMainHeadName, this);

    svDemoMain = (ScrollView) findViewById(R.id.svDemoMain);
}
项目:PullToLoad    文件:PullToRefreshLayout.java   
boolean canScrollUp() {
    int size = mInAreaViewGroups.size();
    for (int i = 0; i < size; i++) {
        ViewGroup viewGroup = mInAreaViewGroups.get(i);
        if (viewGroup != null && viewGroup.isEnabled() && viewGroup.getVisibility() != GONE) {
            if (viewGroup instanceof RecyclerView
                    || viewGroup instanceof AbsListView
                    || viewGroup instanceof ScrollView)
                return ViewCompat.canScrollVertically(viewGroup, -1);
        }
    }
    return mRootView == null || ViewCompat.canScrollVertically(mRootView, -1);
}
项目:SmartRefreshLayout    文件:RefreshContentWrapper.java   
protected boolean isScrollableView(View view) {
    return view instanceof AbsListView
            || view instanceof ScrollView
            || view instanceof ScrollingView
            || view instanceof NestedScrollingChild
            || view instanceof NestedScrollingParent
            || view instanceof WebView
            || view instanceof ViewPager;
}
项目:boohee_v5.6    文件:SummaryActivity$$ViewInjector.java   
public void inject(Finder finder, T target, Object source) {
    target.sv_main = (ScrollView) finder.castView((View) finder.findRequiredView(source, R.id
            .sv_main, "field 'sv_main'"), R.id.sv_main, "field 'sv_main'");
    target.ll_card_breakfast = (LinearLayout) finder.castView((View) finder.findRequiredView
            (source, R.id.ll_card_breakfast, "field 'll_card_breakfast'"), R.id
            .ll_card_breakfast, "field 'll_card_breakfast'");
    target.ll_card_snacks_breakfast = (LinearLayout) finder.castView((View) finder
            .findRequiredView(source, R.id.ll_card_snacks_breakfast, "field " +
                    "'ll_card_snacks_breakfast'"), R.id.ll_card_snacks_breakfast, "field " +
            "'ll_card_snacks_breakfast'");
    target.ll_card_lunch = (LinearLayout) finder.castView((View) finder.findRequiredView
            (source, R.id.ll_card_lunch, "field 'll_card_lunch'"), R.id.ll_card_lunch, "field" +
            " 'll_card_lunch'");
    target.ll_card_snacks_lunch = (LinearLayout) finder.castView((View) finder
            .findRequiredView(source, R.id.ll_card_snacks_lunch, "field " +
                    "'ll_card_snacks_lunch'"), R.id.ll_card_snacks_lunch, "field " +
            "'ll_card_snacks_lunch'");
    target.ll_card_dinner = (LinearLayout) finder.castView((View) finder.findRequiredView
            (source, R.id.ll_card_dinner, "field 'll_card_dinner'"), R.id.ll_card_dinner,
            "field 'll_card_dinner'");
    target.ll_card_snacks_dinner = (LinearLayout) finder.castView((View) finder
            .findRequiredView(source, R.id.ll_card_snacks_dinner, "field " +
                    "'ll_card_snacks_dinner'"), R.id.ll_card_snacks_dinner, "field " +
            "'ll_card_snacks_dinner'");
    target.ll_card_sport = (LinearLayout) finder.castView((View) finder.findRequiredView
            (source, R.id.ll_card_sport, "field 'll_card_sport'"), R.id.ll_card_sport, "field" +
            " 'll_card_sport'");
    target.tv_diet_calory = (TextView) finder.castView((View) finder.findRequiredView(source,
            R.id.tv_diet_calory, "field 'tv_diet_calory'"), R.id.tv_diet_calory, "field " +
            "'tv_diet_calory'");
    target.tv_sport_calory = (TextView) finder.castView((View) finder.findRequiredView
            (source, R.id.tv_sport_calory, "field 'tv_sport_calory'"), R.id.tv_sport_calory,
            "field 'tv_sport_calory'");
    target.tv_date = (TextView) finder.castView((View) finder.findRequiredView(source, R.id
            .tv_date, "field 'tv_date'"), R.id.tv_date, "field 'tv_date'");
}
项目:FingerprintIdentify    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mTvTips = (TextView) findViewById(R.id.mTvTips);
    mScrollView = (ScrollView) findViewById(R.id.mScrollView);

    long time = System.currentTimeMillis();
    append("new FingerprintIdentify() ");
    mFingerprintIdentify = new FingerprintIdentify(getApplicationContext(), new BaseFingerprint.FingerprintIdentifyExceptionListener() {
        @Override
        public void onCatchException(Throwable exception) {
            append("\nException:" + exception.getLocalizedMessage());
        }
    });

    append("\n" + getString(R.string.time) + (System.currentTimeMillis() - time) + "ms");
    append("\nisHardwareEnable() " + mFingerprintIdentify.isHardwareEnable());
    append("\nisRegisteredFingerprint() " + mFingerprintIdentify.isRegisteredFingerprint());
    append("\nisFingerprintEnable() " + mFingerprintIdentify.isFingerprintEnable());

    if (!mFingerprintIdentify.isFingerprintEnable()) {
        append("\n" + getString(R.string.not_support));
        return;
    }

    append("\n" + getString(R.string.click_to_start));
}
项目:RNLearn_Project1    文件:JSResponderTestCase.java   
public void testResponderLocksScrollView() {
  ScrollView scrollView = getViewByTestId("scroll_view");
  assertNotNull(scrollView);
  assertEquals(0, scrollView.getScrollY());

  float inpx40dp = PixelUtil.toPixelFromDIP(40f);
  float inpx100dp = PixelUtil.toPixelFromDIP(100f);

  SingleTouchGestureGenerator gestureGenerator = createGestureGenerator();

  gestureGenerator
      .startGesture(30, 30 + inpx100dp)
      .dragTo(30 + inpx40dp, 30, 10, 1200)
      .endGesture(180, 100);

  waitForBridgeAndUIIdle();

  assertTrue("Expected to scroll by at least 80 dp", scrollView.getScrollY() >= inpx100dp * .8f);

  int previousScroll = scrollView.getScrollY();

  gestureGenerator
      .startGesture(30, 30 + inpx100dp)
      .dragTo(30 + inpx40dp, 30 + inpx100dp, 10, 1200);

  waitForBridgeAndUIIdle();

  gestureGenerator
      .dragTo(30 + inpx40dp, 30, 10, 1200)
      .endGesture();

  waitForBridgeAndUIIdle();
  assertEquals("Expected not to scroll", scrollView.getScrollY(), previousScroll);

}
项目:GitHub    文件:BGARefreshScrollingUtil.java   
public static void scrollToBottom(final ScrollView scrollView) {
    if (scrollView != null) {
        scrollView.post(new Runnable() {
            @Override
            public void run() {
                scrollView.fullScroll(ScrollView.FOCUS_DOWN);
            }
        });
    }
}
项目:letv    文件:LetvVipActivity.java   
private void initUI() {
    setRedPacketFrom(new RedPacketFrom(0));
    this.mRootView.loading(true);
    this.mHead = getLayoutInflater().inflate(R.layout.letv_vip_activity_header, null);
    this.mRootView.addView(this.mHead, new LayoutParams(-1, -2));
    this.mIsSeniorVip = getIntent().getBooleanExtra("isSeniorVip", false);
    this.mProductImageView = (ImageView) findViewById(R.id.sproduct_pic);
    this.mScrollView = (ScrollView) findViewById(R.id.letv_vip_activity_layout);
    this.mBackIv = (ImageView) this.mHead.findViewById(R.id.vip_back_btn);
    this.mBackIv.setOnClickListener(this);
    this.mMobileDevicesVipButton = (Button) findViewById(R.id.mobile_devices_vip_btn);
    this.mMobileDevicesVipButton.setText(TipUtils.getTipMessage("90067", 2131101101));
    this.mSuperVipButton = (Button) findViewById(R.id.super_vip_btn);
    this.mSuperVipButton.setText(TipUtils.getTipMessage("90068", 2131101134));
    this.mLetvLoginTextView = (TextView) findViewById(R.id.letv_vip_login_tv);
    this.mLetvLoginTextView.setOnClickListener(this);
    this.mMobileDevicesVipButton.setOnClickListener(this);
    this.mSuperVipButton.setOnClickListener(this);
    this.mVipImageView = (ImageView) findViewById(R.id.vip_imageview);
    this.mSuperVipTipTv = (TextView) findViewById(R.id.super_vip_tip_tv);
    this.mMemberShipServiceAgreement = (TextView) findViewById(R.id.membershipa_service_agreement);
    this.mMemberShipServiceAgreement.setOnClickListener(this);
    this.mExchangeBtn = (Button) findViewById(R.id.exchange_btn);
    this.mExchangeBtn.setOnClickListener(this);
    this.mVipNameTv = (TextView) findViewById(R.id.vip_name_tv);
    UIs.zoomView(320, 98, this.mProductImageView);
    requestAutoPaySignStatusTask("1");
    StatisticsUtils.staticticsInfoPost(this, "19", "b3", null, -1, null, PageIdConstant.vipPage, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE);
}
项目:xmrwallet    文件:GenerateReviewFragment.java   
void showAdvancedInfo() {
    llAdvancedInfo.setVisibility(View.VISIBLE);
    bAdvancedInfo.setVisibility(View.GONE);
    scrollview.post(new Runnable() {
        @Override
        public void run() {
            scrollview.fullScroll(ScrollView.FOCUS_DOWN);
        }
    });
}
项目:diary    文件:Diary.java   
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    // Get preferences
    getPreferences();

    if (darkTheme)
        setTheme(R.style.AppDarkTheme);

    setContentView(R.layout.main);

    textView = (EditText) findViewById(R.id.text);
    scrollView = (ScrollView) findViewById(R.id.scroll);
    markdownView = (MarkdownView) findViewById(R.id.markdown);

    accept = findViewById(R.id.accept);
    edit = findViewById(R.id.edit);

    WebSettings settings = markdownView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setBuiltInZoomControls(true);
    settings.setDisplayZoomControls(false);

    setListeners();

    gestureDetector =
        new GestureDetector(this, new GestureListener());

    if (savedInstanceState == null)
    {
        // Set the date
        today();

        // Check for sent media
        mediaCheck(getIntent());
    }
}
项目:BlackList    文件:SMSSendFragment.java   
private void moveScroll() {
    View view = getView();
    if (view != null) {
        final ScrollView scroll = (ScrollView) view.findViewById(R.id.scroll);
        scroll.post(new Runnable() {
            @Override
            public void run() {
                scroll.fullScroll(ScrollView.FOCUS_DOWN);
            }
        });
    }
}
项目:Idea-ChainSelector    文件:ChainSelectorView.java   
private void compileScroll() {
    postDelayed(new Runnable() {
        @Override
        public void run() {
            scrollView.fullScroll(ScrollView.FOCUS_RIGHT);
        }
    }, 100);
}
项目:Tribe    文件:InterceptLayout.java   
public boolean svPullUpIntercept(View child) {
    boolean intercept = false;
    ScrollView scrollView = (ScrollView) child;
    View scrollChild = scrollView.getChildAt(0);

    if (scrollView.getScrollY() >= (scrollChild.getHeight() - scrollView.getHeight())) {
        intercept = true;
    }
    return intercept;
}