Example usage for android.text.method ScrollingMovementMethod ScrollingMovementMethod

List of usage examples for android.text.method ScrollingMovementMethod ScrollingMovementMethod

Introduction

In this page you can find the example usage for android.text.method ScrollingMovementMethod ScrollingMovementMethod.

Prototype

ScrollingMovementMethod

Source Link

Usage

From source file:com.greatnowhere.radar.MainRadarActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (D)/*  ww w . ja v  a 2s  .  c  om*/
        Log.e(TAG, "+++ ON CREATE +++");

    // Set up the window layout
    setContentView(R.layout.main_radar_view);

    rootView = findViewById(R.id.mainViewLayout);

    eventBus = EventBus.getDefault();
    eventBus.register(this);

    uiModeManager = (UiModeManager) getApplicationContext().getSystemService(UI_MODE_SERVICE);

    Preferences.init(getApplicationContext());

    log = (TextView) findViewById(R.id.logScroll);
    log.setMovementMethod(new ScrollingMovementMethod());
    alert = (TextView) findViewById(R.id.radarState);
    alertCredibility = (TextView) findViewById(R.id.radarThreatCredibility);
    connState = (TextView) findViewById(R.id.connStatus);
    voltage = (TextView) findViewById(R.id.voltageText);
    btnReconnect = (Button) findViewById(R.id.btnReconnect);
    uiMode = (TextView) findViewById(R.id.mainViewTextuiMode);
    roadInfo = (TextView) findViewById(R.id.mainViewTextLocationInfo);
    location = (TextView) findViewById(R.id.mainViewLocation);
    speedLimit = (TextView) findViewById(R.id.mainViewTextSpeedLimit);
    activity = (TextView) findViewById(R.id.mainViewTextActivityMode);
    btnReconnect.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            attemptConnect();
        }
    });
    btnQuit = (Button) findViewById(R.id.btnQuit);
    btnQuit.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            finish();
        }
    });

    // If BT is not on, request that it be enabled.
    // setupChat() will then be called during onActivityResult
    if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
        showDialog("Bluetooth not available!", new Dialog.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                dialog.cancel();
                finish();
            }
        });
    } else {
        initialize();
        if (getIntent().getBooleanExtra(INTENT_BACKGROUND, false)) {
            goHome();
        }
    }
}

From source file:com.ksksue.app.ftdi_uart.MainActivity.java

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

    //initialize GoogleApiClient instance for location
    mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this).addApi(LocationServices.API).addApi(AppIndex.API).build();

    tvRead = (TextView) findViewById(R.id.tvRead);
    tvRead.setMovementMethod(new ScrollingMovementMethod());

    logRead = (TextView) findViewById(R.id.logRead);
    logRead.setMovementMethod(new ScrollingMovementMethod());

    etWrite = (EditText) findViewById(R.id.etWrite);

    btWrite = (Button) findViewById(R.id.btWrite);
    debuger = (Button) findViewById(R.id.debug);
    joinBtn = (Button) findViewById(R.id.joinBtn);

    List<String> list = new ArrayList<String>();
    list.add("Everyone");
    spinnerDataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);
    makeSpinner(spinnerDataAdapter);/*from  w  w w  . j  a va2s . c  om*/

    updateView(false);

    try {
        ftD2xx = D2xxManager.getInstance(this);
    } catch (D2xxManager.D2xxException ex) {
        Log.e(TAG, ex.toString());
    }

    IntentFilter filter = new IntentFilter();
    filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
    filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
    registerReceiver(mUsbReceiver, filter);

}

From source file:com.skalski.websocketsclient.ActivityMain.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Wrappers wrappers = new Wrappers();
    wrappers.add(onClickWrapperExit);//from w  w w.ja v a  2 s  .  c  om
    SuperActivityToast.onRestoreState(savedInstanceState, ActivityMain.this, wrappers);

    hostname = (EditText) findViewById(R.id.hostname);
    portNumber = (EditText) findViewById(R.id.port);
    timeout = (EditText) findViewById(R.id.timeout);

    cmdInput = (EditText) findViewById(R.id.cmdInput);
    cmdOutput = (TextView) findViewById(R.id.cmdOutput);
    connectButton = (CircularProgressButton) findViewById(R.id.btnConnect);

    cmdOutput.setMovementMethod(new ScrollingMovementMethod());
    connectButton.setIndeterminateProgressMode(true);

    /*
     * connectButton - onClickListener()
     */
    connectButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if (connectButton.getProgress() == 0) {
                connectButton.setProgress(50);

                if ((hostname.getText().toString().equals("")) || (portNumber.getText().toString().equals(""))
                        || (timeout.getText().toString().equals(""))) {

                    Log.e(TAG_LOG, "Invalid connection settings");
                    show_info(getResources().getString(R.string.info_msg_1), false);
                    connectButton.setProgress(-1);
                    return;
                }

                /* save last settings */
                ActivitySettings.pref_set_hostname(getBaseContext(), hostname.getText().toString());
                ActivitySettings.pref_set_port_number(getBaseContext(), portNumber.getText().toString());
                ActivitySettings.pref_set_timeout(getBaseContext(), timeout.getText().toString());

                /* connect */
                if (!wsConnect()) {
                    show_info(getResources().getString(R.string.info_msg_2), false);
                    connectButton.setProgress(-1);
                }

            } else if (connectButton.getProgress() == -1) {
                connectButton.setProgress(0);
            }
        }
    });

    /*
     * cmdInput - OnEditorActionListener()
     */
    cmdInput.setOnEditorActionListener(new EditText.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {

                /* send data to server */
                wsSend();
                return true;
            }
            return false;
        }
    });
}

From source file:com.adrguides.ReadGuideFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    v = inflater.inflate(R.layout.fragment_location, container, false);

    ImageSwitcher imageSwitcher = (ImageSwitcher) v.findViewById(R.id.switcherImageGuide);
    imageSwitcher.setInAnimation(AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_in));
    imageSwitcher.setOutAnimation(AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out));
    imageSwitcher.setFactory(new ViewSwitcher.ViewFactory() {
        @Override/*from  w  w  w . ja  va  2  s .  com*/
        public View makeView() {
            PhotoView iView = new PhotoView(getActivity());
            iView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            iView.setCropToPadding(false);
            iView.setLayoutParams(new ImageSwitcher.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT));
            iView.setBackgroundColor(0xFF000000);
            return iView;
        }
    });

    ((TextView) v.findViewById(R.id.textContent)).setMovementMethod(new ScrollingMovementMethod());

    return v;
}

From source file:org.kei.android.phone.netcap.OutputFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    Context context = owner.getApplicationContext();

    refreshBT = (Button) getView().findViewById(R.id.refreshBT);
    promiscuousCB = (CheckBox) getView().findViewById(R.id.promiscuousCB);
    devicesSp = (Spinner) getView().findViewById(R.id.devicesSp);
    showResult = (TextView) getView().findViewById(R.id.showResult);
    browseOutputCaptureTV = (TextView) getView().findViewById(R.id.browseOutputCaptureTV);
    browseOutputCaptureTV.setText(Tools.DEFAULT_DOWNLOAD.getAbsolutePath());
    browseOutputCaptureTV.setOnClickListener(this);
    captureBT = (ToggleButton) getView().findViewById(R.id.captureBT);
    captureBT.setOnClickListener(this);
    refreshBT.setOnClickListener(this);

    showResult.setMovementMethod(new ScrollingMovementMethod());

    buffer = new CircularFifoBuffer(20);
    // Create an ArrayAdapter using the string array and a default spinner
    // layout//from w  w w.j ava2  s.c  o  m
    adapter = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_item);
    // Specify the layout to use when the list of choices appears
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    devicesSp.setAdapter(adapter);
    onClick(refreshBT);
}

From source file:pl.poznan.put.cs.ify.app.market.MarketInfoDetailsFrag.java

private void initGui(View v, MarketInfo marketInfo) {
    TextView rate = (TextView) v.findViewById(R.id.tv_rate);
    TextView desc = (TextView) v.findViewById(R.id.tv_desc);
    TextView date = (TextView) v.findViewById(R.id.tv_date);
    TextView name = (TextView) v.findViewById(R.id.tv_name);
    ListView commentsList = (ListView) v.findViewById(R.id.lv_comments);
    TextView commentsLabel = (TextView) v.findViewById(R.id.tv_comments);
    View commentsSep = v.findViewById(R.id.comments_sep);

    if (marketInfo.getComments() == null || marketInfo.getComments().isEmpty()) {
        commentsList.setVisibility(View.GONE);
        commentsLabel.setVisibility(View.GONE);
        commentsSep.setVisibility(View.GONE);
    } else {/*from   w  w w  .ja v  a  2  s  .  c o m*/
        CommentsAdapter commentsAdapter = new CommentsAdapter(marketInfo.getComments(),
                (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE));
        commentsList.setAdapter(commentsAdapter);
    }

    try {
        rate.setText("Rate: " + rateFormat.format(marketInfo.getRate()));
    } catch (RuntimeException ex) {
        rate.setText("Not yet rated");
    }

    desc.setMovementMethod(new ScrollingMovementMethod());
    desc.setText(marketInfo.getDescription());
    date.setText(dateFormat.format(new Date(marketInfo.getTimestamp())));
    name.setText(marketInfo.getName());

    Button download = (Button) v.findViewById(R.id.btn_download);
    download.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            showLoadingButton();
            downloadJar(getMarketInfo());
        }
    });
}

From source file:yulei.android.client.AndroidMobilePushApp.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    numOfMissedMessages = getString(R.string.num_of_missed_messages);
    setContentView(R.layout.activity_main);
    tView = (TextView) findViewById(R.id.tViewId);
    tView.setMovementMethod(new ScrollingMovementMethod());
    startService(new Intent(this, MessageReceivingService.class));
    mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();

    Button bt1 = (Button) findViewById(R.id.button1);
    bt1.setOnClickListener(new OnClickListener() {

        @Override//from  ww  w.j a  va 2  s.co  m
        public void onClick(View v) {
            myClickHandler(v);
        }

    });

    // Create a heat map tile provider, passing it the latlngs of the police stations.
    mProvider = new HeatmapTileProvider.Builder().data(list).build();
    // Add a tile overlay to the map, using the heat map tile provider.
    mOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(mProvider));

}

From source file:com.microsoft.onedrive.apiexplorer.DeltaFragment.java

@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_json_view, container, false);
    ((TextView) view.findViewById(R.id.json)).setMovementMethod(new ScrollingMovementMethod());
    getActivity().setTitle(getString(R.string.delta_title, mItemName));

    refresh();/*from w  w w.j a  v  a2  s . c  o  m*/
    return view;
}

From source file:com.nxp.nfc_demo.fragments.SpeedTestFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.fragment_speedtest, container, false);
    rfButtonSpeedtest = (Button) layout.findViewById(R.id.startSpeedtest);
    rfButtonSpeedtest.setOnClickListener(this);
    rfReadOptions = (RadioGroup) layout.findViewById(R.id.radioReadOptions);
    rfMemOptions = (RadioGroup) layout.findViewById(R.id.radioMemoryOptions);
    rfMemOptions.setOnCheckedChangeListener(this);
    rfTextCallback = (TextView) layout.findViewById(R.id.rf_textCallback);
    rfDatarateCallback = (TextView) layout.findViewById(R.id.rf_datarateCallback);
    rfDatarateCallback.setMovementMethod(new ScrollingMovementMethod());
    rfEditCharMulti = (EditText) layout.findViewById(R.id.editCharMultipl);
    rfTextCharMulti = (TextView) layout.findViewById(R.id.textCharMultipl);
    rfEditCharMulti.setText("10");
    rfEditCharMulti.addTextChangedListener(charMultiListener);
    return layout;
}

From source file:com.example.nestedarchetypeactivityexample.InnerArchetypeViewerActivity.java

/**
  * Show info dialog./* ww  w.j  a  v  a 2s  .c  o  m*/
  *
  * @param content the content
  */
private void showInfoDialog(String content) {
    final Dialog dialog = new Dialog(this);
    dialog.setTitle("Json Adl Structure");
    dialog.setContentView(R.layout.custom_dialog);
    TextView dialogText = (TextView) dialog.findViewById(R.id.dialogText);
    dialogText.setMovementMethod(new ScrollingMovementMethod());
    dialogText.setText(content);

    Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);
    dialogButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            dialog.dismiss();

        }
    });

    dialog.show();
}