List of usage examples for android.text.method ScrollingMovementMethod ScrollingMovementMethod
ScrollingMovementMethod
From source file:in.shubhamchaudhary.logmein.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); networkEngine = new NetworkEngine(); databaseEngine = new DatabaseEngine(this); outputTextView = (TextView) findViewById(R.id.outputTextView); outputTextView.setMovementMethod(new ScrollingMovementMethod()); String username = databaseEngine.getUsername(); if (username != null) { //if (username.length() != 0){ outputTextView.setText("Current user: " + username); } else {/*from ww w . j a v a 2 s . co m*/ username = "Welcome, Please enter username and password for the first time!"; outputTextView.setText(username); } button_save = (Button) findViewById(R.id.button_save); button_save.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { saveCredential(); } }); button_login = (Button) findViewById(R.id.button_login); button_login.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { login(); } }); button_logout = (Button) findViewById(R.id.button_logout); button_logout.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { logout(); } }); textbox_username = (EditText) findViewById(R.id.edit_username); textbox_password = (EditText) findViewById(R.id.edit_password); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit(); } }
From source file:info.schnatterer.logbackandroiddemo.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);//w ww .j a v a2s .c o m TextView textView = (TextView) findViewById(R.id.textView); textView.setMovementMethod(new ScrollingMovementMethod()); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new ReadLogOnClickListener(textView, this)); }
From source file:com.littlepancake.glpk.GlpkCodeFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.code_sample_layout, container, false); TextView tv = (TextView) v.findViewById(R.id.textViewCode); solveButton = (Button) v.findViewById(R.id.buttonSolve); solveButton.setOnClickListener(this); textViewSolution = (TextView) v.findViewById(R.id.textViewSolution); InputStream is;/*from w w w. j av a 2s . c o m*/ byte[] buffer = null; try { is = getActivity().getAssets().open("test.html"); int size = is.available(); buffer = new byte[size]; is.read(buffer); is.close(); } catch (IOException e) { tv.setMovementMethod(new ScrollingMovementMethod()); tv.setText(e.getMessage()); e.printStackTrace(); } if (buffer != null) { String str = new String(buffer); Spanned result = Html.fromHtml(str); tv.setMovementMethod(new ScrollingMovementMethod()); tv.setText(result); } return v; }
From source file:io.syng.fragment.ConsoleFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_console, container, false); mConsoleText = (TextView) view.findViewById(R.id.tv_console_log); mConsoleText.setText(SyngApplication.mConsoleLog); mConsoleText.setMovementMethod(new ScrollingMovementMethod()); ImageView background = (ImageView) view.findViewById(R.id.iv_background); Glide.with(this).load(R.drawable.console_bg).into(background); view.findViewById(R.id.fab_send).setOnClickListener(this); view.findViewById(R.id.fab_receive).setOnClickListener(this); return view;//from w ww . j a va2 s. c o m }
From source file:com.microsoft.aad.adal.example.userappwithbroker.ResultFragment.java
@Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.fragment_result, container, false); mTextView = (TextView) view.findViewById(R.id.txt_result); final Bundle bundle = getArguments(); final String accessToken = (String) bundle.get(ACCESS_TOKEN); final String idToken = (String) bundle.get(ID_TOKEN); final String displayable = (String) bundle.get(DISPLAYABLE); mTextView.setText(ACCESS_TOKEN + ": " + accessToken + '\n' + ID_TOKEN + ": " + idToken + '\n' + DISPLAYABLE + ": " + displayable); mTextView.setMovementMethod(new ScrollingMovementMethod()); return view;/*from w w w. j a v a2 s.c o m*/ }
From source file:com.example.ahmed.ui.Welcome.InfoActivity.java
protected void showLicenseInfo() { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle("License information"); TextView tv = new TextView(this); tv.setMovementMethod(new ScrollingMovementMethod()); tv.setText(Html.fromHtml(getString(R.string.isc_license))); tv.setPadding(16, 12, 16, 0);/* ww w. ja va2s . co m*/ alert.setView(tv); alert.setNegativeButton("Close", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); alert.show(); }
From source file:org.iotivity.base.examples.simpleserver.SimpleServer.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); registerReceiver(mMessageReceiver, new IntentFilter("org.iotivity.base.examples.simpleserver")); mEventsTextView = new TextView(this); mEventsTextView.setMovementMethod(new ScrollingMovementMethod()); LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout); layout.addView(mEventsTextView,/*from ww w . j a v a2 s . c o m*/ new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1f)); OcRepresentation rep = new OcRepresentation(); rep.setValueBool("test", false); boolean result = rep.getValueBool("test"); initOICStack(); }
From source file:com.cw.litenote.note.AudioUi_note.java
void init_audio_block() { mPager = (ViewPager) act.findViewById(R.id.tabs_pager); // audio block TextView tag = (TextView) act.findViewById(R.id.text_view_audio); tag.setTextColor(ColorSet.color_white); audio_title = (TextView) act.findViewById(R.id.pager_audio_title); // first setting audio_title.setTextColor(ColorSet.color_white); if (Util.isLandscapeOrientation(act)) { audio_title.setMovementMethod(new ScrollingMovementMethod()); audio_title.scrollTo(0, 0);/*from w w w .j a v a 2s . c om*/ } else { audio_title.setSingleLine(true); audio_title.setSelected(true); } audioBlock = (ViewGroup) act.findViewById(R.id.audioGroup); audioBlock.setBackgroundColor(ColorSet.color_black); mPager_audio_play_button = (ImageView) act.findViewById(R.id.pager_btn_audio_play); }
From source file:com.example.administrator.myapplication2._3_HB.fragments.ExampleFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout._3_fragment_main_dummy, container, false); mTextChat = (TextView) rootView.findViewById(R.id.text_chat); mTextChat.setMaxLines(1000);/*from w w w .j av a 2 s .c o m*/ mTextChat.setVerticalScrollBarEnabled(true); mTextChat.setMovementMethod(new ScrollingMovementMethod()); mEditChat = (EditText) rootView.findViewById(R.id.edit_chat); mEditChat.setOnEditorActionListener(mWriteListener); mBtnSend = (Button) rootView.findViewById(R.id.button_send); mBtnSend.setOnClickListener(this); handler = new MyHandler(); progressBar = (ProgressBar) rootView.findViewById(R.id.progressBar2); seekbar = (SeekBar) rootView.findViewById(R.id.seekBar); new Thread() { @Override public void run() { try { while (true) { sleep(1000); handler.sendMessage(new Message()); if (threadBool == false) { break; } } } catch (InterruptedException e) { e.printStackTrace(); } } }.start(); return rootView; }
From source file:com.lorenz.arthur.citybike.CopyrightActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_copyright); //set actionbar actionBar = getSupportActionBar();/* w ww .ja v a2 s .c o m*/ actionBar.setDefaultDisplayHomeAsUpEnabled(true); //set TextView TextView copyRight = (TextView) findViewById(R.id.textView2); copyRight.setText(COPYRIGHT); copyRight.setMovementMethod(new ScrollingMovementMethod()); }