Example usage for android.view View FOCUS_DOWN

List of usage examples for android.view View FOCUS_DOWN

Introduction

In this page you can find the example usage for android.view View FOCUS_DOWN.

Prototype

int FOCUS_DOWN

To view the source code for android.view View FOCUS_DOWN.

Click Source Link

Document

Use with #focusSearch(int) .

Usage

From source file:Main.java

public static void scrollDown(final ScrollView view) {
    view.post(() -> view.fullScroll(View.FOCUS_DOWN));
}

From source file:Main.java

public static void scrollToBottom(final ScrollView scroll) {
    if (scroll != null) {
        scroll.post(new Runnable() {

            @Override/*ww  w.  ja  v  a  2s .  c  om*/
            public void run() {
                scroll.fullScroll(View.FOCUS_DOWN);
            }
        });
    }
}

From source file:com.idevity.card.read.ShowLog.java

/**
 * Method onCreateView./*from w w  w.  j a  v a2s. c  o m*/
 * 
 * @param inflater
 *            LayoutInflater
 * @param container
 *            ViewGroup
 * @param savedInstanceState
 *            Bundle
 * @return View
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    Globals g = Globals.getInstance();

    // get the log string buffer from the fragment activity intent

    String logStringBuffer = g.getLogData();

    // Create the view
    View log = inflater.inflate(R.layout.activity_show_log, container, false);

    // Get the text view associated with the log
    TextView fullLog = (TextView) log.findViewById(R.id.readerlog2);
    ScrollView scroll = (ScrollView) log.findViewById(R.id.scrollViewLog);

    fullLog.setText(logStringBuffer);
    scroll.fullScroll(View.FOCUS_DOWN);

    // return the view
    return log;
}

From source file:com.drisoftie.cwdroid.frag.FragBoard.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    swipeBoard = (SwipeRefreshLayout) inflater.inflate(R.layout.frag_board, container, false);
    webBoard = (WebView) swipeBoard.findViewById(R.id.web_board);
    webBoard.requestFocus(View.FOCUS_DOWN);

    webBoard.setWebViewClient(new WebViewClient() {
        @Override//  w  w  w .  jav  a 2  s.c om
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            getArguments().putString(FragBoard.class.getName(), url);
            return true;
        }
    });

    return webBoard;
}

From source file:it.rignanese.leo.slimfacebook.MessagesActivity.java

private void SetupMessagesWebView() {
    webViewMessages = (AdvancedWebView) findViewById(R.id.webViewMessages);
    webViewMessages.setListener(this, this);
    webViewMessages.addPermittedHostname("mbasic.facebook.com");

    WebSettings settings = webViewMessages.getSettings();
    webViewMessages.setDesktopMode(false);

    webViewMessages.requestFocus(View.FOCUS_DOWN);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);//remove the keyboard issue

    //set text zoom
    int zoom = Integer.parseInt(savedPreferences.getString("pref_textSize", "100"));
    settings.setTextZoom(zoom);/*from   w  ww.j ava2 s.  c om*/

    // Use WideViewport and Zoom out if there is no viewport defined
    settings.setUseWideViewPort(false);
    settings.setLoadWithOverviewMode(false);

    // better image sizing support
    settings.setSupportZoom(false);
    settings.setDisplayZoomControls(false);
    settings.setBuiltInZoomControls(false);

    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
        // Hide the zoom controls for HONEYCOMB+
        settings.setDisplayZoomControls(false);
    }
}

From source file:ch.jeda.platform.android.LogFragment.java

private void updateView() {
    this.textView.setText(this.log.toString());
    this.scrollView.fullScroll(View.FOCUS_DOWN);
}

From source file:am.project.x.business.others.printer.PrinterStateDialog.java

@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop,
        int oldRight, int oldBottom) {
    mVContent.fullScroll(View.FOCUS_DOWN);
}

From source file:org.h4des.alertrmobilemanager.MainActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    this.webView = (WebView) findViewById(R.id.webView);

    // clear cache
    this.webView.clearCache(true);

    // enable JavaScript
    this.webView.getSettings().setJavaScriptEnabled(true);

    this.webView.setWebChromeClient(new WebChromeClient());

    // create own WebViewClient
    this.webView.setWebViewClient(new WebViewClient() {

        // for debugging in the emulator only
        // install your own certificate on the android device via copying your cert.cer
        // on the sd card and add it in the security options
        //@Override
        //public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {            
        //    handler.proceed();
        //}/*from w  ww. j  ava  2 s .  co m*/

        // when using basic http authentication
        // enter your own credentials
        @Override
        public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host,
                String realm) {

            // get username and password from the settings
            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
            String username = preferences.getString("username", "None");
            String password = preferences.getString("password", "None");

            // use credentials from the settings
            handler.proceed(username, password);
        }
    });

    // get URL from the settings
    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
    String url = preferences.getString("url", "None");

    this.webView.loadUrl(url);

    // focus webView
    this.webView.requestFocus(View.FOCUS_DOWN);
}

From source file:org.mozilla.mozstumbler.client.subactivities.LogActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.scroll_to_start:
        this.mConsoleView.fullScroll(View.FOCUS_UP);
        return true;
    case R.id.scroll_to_end:
        this.mConsoleView.fullScroll(View.FOCUS_DOWN);
        return true;
    default:/*  w  ww.j  a  va 2  s  .  c o  m*/
        return super.onOptionsItemSelected(item);
    }
}

From source file:com.example.sample.provider.SampleProvider.java

@Override
public void onCreate(Bundle savedInstanceState) {

    sampleProviderObj = this;
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sampleprovider_layout);
    registerReceiver(mMessageReceiver, new IntentFilter("com.example.sample.provider.SampleProvider"));

    mLogTextView = (TextView) findViewById(R.id.txtLog);
    mTempValue = (TextView) findViewById(R.id.temperatureValue);
    mHumValue = (TextView) findViewById(R.id.humidityValue);

    sv_sclLog = (ScrollView) findViewById(R.id.sclLog);
    sv_sclLog.fullScroll(View.FOCUS_DOWN);
    findViewById(R.id.btnTemperatureUP).setOnClickListener(this);
    findViewById(R.id.btnTemperatureDown).setOnClickListener(this);
    findViewById(R.id.btnHumidityUP).setOnClickListener(this);
    findViewById(R.id.btnHumidityDown).setOnClickListener(this);
    findViewById(R.id.btnLogClear).setOnClickListener(this);

    isExecutePresence = false;//  ww  w .ja  v  a  2  s.co  m
    mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
            case 0:
                String[] tempHum = message.split(":");
                mTempValue.setText(tempHum[0]);
                mHumValue.setText(tempHum[1]);
            }
        }
    };
    setmHandler(mHandler);
}