List of usage examples for android.text.method ScrollingMovementMethod ScrollingMovementMethod
ScrollingMovementMethod
From source file:MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); editTextTweet = (EditText) findViewById(R.id.editTextTweet); editTextTweet.addTextChangedListener(new MyTextWatcher()); textViewCountChars = (TextView) findViewById(R.id.textViewCountChars); editTextUsername = (EditText) findViewById(R.id.editTextUsername); textViewTimeline = (TextView) findViewById(R.id.textViewTimeline); textViewTimeline.setMovementMethod(new ScrollingMovementMethod()); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.setOAuthConsumerKey("TYPE YOUR OWN VALUE HERE").setOAuthConsumerSecret("TYPE YOUR OWN VALUE HERE") .setOAuthAccessToken("TYPE YOUR OWN VALUE HERE") .setOAuthAccessTokenSecret("TYPE YOUR OWN VALUE HERE"); TwitterFactory factory = new TwitterFactory(builder.build()); twitter = factory.getInstance();/*w w w.j a va 2s. c om*/ }
From source file:com.adnanbal.fxdedektifi.forex.presentation.view.fragment.TermsAndConditionsFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_terms_and_conditions, container, false); TextView documentView = v.findViewById(R.id.termsDoc); documentView.setMovementMethod(new ScrollingMovementMethod()); return v;/*from ww w. ja v a2 s .c o m*/ }
From source file:com.darizotas.metadatastrip.AboutDialogFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //Set title for this dialog getDialog().setTitle(getResources().getString(R.string.app_name) + " v1.0"); //Set the licenses View v = inflater.inflate(R.layout.fragment_about_dialog, container, false); TextView tv = (TextView) v.findViewById(R.id.textAbout); //http://stackoverflow.com/questions/1748977/making-textview-scrollable-in-android tv.setMovementMethod(new ScrollingMovementMethod()); tv.setText(getLicense(License.LIC_METADATASTRIP) + "\n\n*** Third party license agreements ***\n\n" + getLicense(License.LIC_METADATAEXTRACTOR) + "\n\n*** ***\n\n" + getLicense(License.LIC_HOPSTARTER)); return v;//from www. ja v a 2s . co m }
From source file:tk.jordynsmediagroup.nightmode.activity.AboutActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); try {/* ww w . jav a 2 s .c o m*/ // Set the context of the textview to the app VerionName TextView version = (TextView) findViewById(R.id.nameView); String app_ver = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName; version.setText(getString(R.string.app_name) + " Version" + " " + app_ver); } catch (PackageManager.NameNotFoundException e) { // This should never happen Log.e("NightMode/AboutActivity", e.getMessage()); finish(); } TextView licenseDetails = (TextView) findViewById(R.id.licenceText); licenseDetails.setText(Html.fromHtml(getString(R.string.licence_info))); // Make the license scrollable licenseDetails.setMovementMethod(new ScrollingMovementMethod()); }
From source file:com.intervigil.micdroid.StartupDialogFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle icicle) { View view = inflater.inflate(R.layout.startup_dialog_fragment, container); AppCompatTextView textView = (AppCompatTextView) view.findViewById(R.id.startup_dialog_text); textView.setMovementMethod(new ScrollingMovementMethod()); mDismissBtn = (AppCompatButton) view.findViewById(R.id.startup_dialog_accept_btn); mDismissBtn.setOnClickListener(mBtnListener); return view;// w ww .j a v a 2 s.com }
From source file:DetailActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); detector = new GestureDetector(this, new GalleryGestureDetector()); listener = new View.OnTouchListener() { @Override//from w w w . j a v a2 s . co m public boolean onTouch(View v, MotionEvent event) { return detector.onTouchEvent(event); } }; ImageIndex = 0; detailImage = (ImageView) findViewById(R.id.detail_image); detailImage.setOnTouchListener(listener); TextView detailName = (TextView) findViewById(R.id.detail_name); TextView detailDistance = (TextView) findViewById(R.id.detail_distance); TextView detailText = (TextView) findViewById(R.id.detail_text); detailText.setMovementMethod(new ScrollingMovementMethod()); ImageView detailWebLink = (ImageView) findViewById(R.id.detail_web_link); int i = MainActivity.currentItem; Random n = new Random(); int m = n.nextInt((600 - 20) + 1) + 20; setTitle(getString(R.string.app_name) + " - " + MainData.nameArray[i]); detailImage.setImageResource(MainData.detailImageArray[i]); detailName.setText(MainData.nameArray[i]); detailDistance.setText(String.valueOf(m) + " miles"); detailText.setText(MainData.detailTextArray[i]); detailWebLink.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_BROWSABLE); intent.setData(Uri.parse(MainData.detailWebLink[MainActivity.currentItem])); startActivity(intent); } }); }
From source file:com.irccloud.android.fragment.TextListFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Context ctx = getActivity();// w w w. j a va 2s. c o m if (ctx == null) return null; LayoutInflater inflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(R.layout.dialog_textlist, null); textView = v.findViewById(R.id.textView); textView.setHorizontallyScrolling(true); textView.setMovementMethod(new ScrollingMovementMethod()); if (savedInstanceState != null && savedInstanceState.containsKey("text")) { text = savedInstanceState.getString("text"); } if (text != null) { setText(text); } Dialog d = new AlertDialog.Builder(ctx).setView(v).setTitle(title) .setNegativeButton("Close", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }).create(); return d; }
From source file:com.seven.designbox.designpatterns.patterns.compound.mvvm.view.PlayerDetailFragment.java
@Nullable @Override/* ww w .j ava 2s . c o m*/ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { mViewDataBinding = DataBindingUtil.inflate(inflater, R.layout.player_details_mvvm, container, false); mViewDataBinding.tvLyrics.setMovementMethod(new ScrollingMovementMethod()); return mViewDataBinding.getRoot(); }
From source file:org.chromium.latency.walt.LogFragment.java
@Override public void onResume() { super.onResume(); textView = (TextView) activity.findViewById(R.id.txt_log); textView.setMovementMethod(new ScrollingMovementMethod()); textView.setText(logger.getLogText()); logger.registerReceiver(logReceiver); }
From source file:com.hardcopy.btchat.fragments.ExampleFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main_dummy, container, false); mTextChat = (TextView) rootView.findViewById(R.id.text_chat); mTextChat.setMaxLines(1000);//from ww w. j av a2 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); return rootView; }