예제 #1
0
 @Override
 public void requestChildFocus(View child, View focused) {
   if (focused != null && focused instanceof WebView) {
     return;
   }
   super.requestChildFocus(child, focused);
 }
예제 #2
0
 @Override
 public void requestChildFocus(View child, View focused) {
   /*
    * Normally a ScrollView will scroll the child into view.
    * Prevent this when a MessageWebView is first touched,
    * assuming it already is at least partially in view.
    *
    */
   if (mSkipWebViewScroll
       && focused instanceof MessageWebView
       && focused.getGlobalVisibleRect(new Rect())) {
     mSkipWebViewScroll = false;
     super.requestChildFocus(child, child);
     ViewParent parent = getParent();
     if (parent != null) {
       parent.requestChildFocus(this, focused);
     }
   } else {
     super.requestChildFocus(child, focused);
   }
 }
예제 #3
0
 // Initial prints
 private void initialPrint(boolean b) {
   Log.i(TAG, "BonitorActivity - printInitial()");
   String aux = "";
   if (b) {
     aux = getString(R.string.connecting);
   } else {
     aux = getString(R.string.connected);
   }
   TextView t = new TextView(getApplicationContext());
   t.setText(aux);
   t.setTextColor(Color.BLACK);
   linearLayout.addView(t, count);
   count++;
   scrollView.requestChildFocus(linearLayout, t);
 }
예제 #4
0
 // Print outputs
 private void printMonitor(String msg) {
   Log.i(TAG, "BonitorActivity - printMonitor()");
   if (!freeze) {
     Log.d(TAG, "output = " + msgTotal);
     TextView t = new TextView(getApplicationContext());
     t.setText(msg);
     t.setTextColor(Color.BLACK);
     if (topDown) {
       linearLayout.addView(t, 0);
     } else {
       linearLayout.addView(t, count);
     }
     count++;
     scrollView.requestChildFocus(linearLayout, t);
   }
   // Save in file
   try {
     logSave();
   } catch (IOException e) {
     Log.e(TAG, "Problem with file = " + e);
     e.printStackTrace();
   }
 }