List of usage examples for android.text.method ScrollingMovementMethod ScrollingMovementMethod
ScrollingMovementMethod
From source file:com.hectorosorio.hosocast.mediaplayer.LocalPlayerActivity.java
private void loadViews() { mVideoView = (VideoView) findViewById(R.id.videoView1); mTitleView = (TextView) findViewById(R.id.textView1); mDescriptionView = (TextView) findViewById(R.id.textView2); mDescriptionView.setMovementMethod(new ScrollingMovementMethod()); mAuthorView = (TextView) findViewById(R.id.textView3); mStartText = (TextView) findViewById(R.id.startText); mEndText = (TextView) findViewById(R.id.endText); mSeekbar = (SeekBar) findViewById(R.id.seekBar1); // mVolBar = (SeekBar) findViewById(R.id.seekBar2); mPlayPause = (ImageView) findViewById(R.id.imageView2); mLoading = (ProgressBar) findViewById(R.id.progressBar1); // mVolumeMute = (ImageView) findViewById(R.id.imageView2); mControllers = findViewById(R.id.controllers); mContainer = findViewById(R.id.container); mCoverArt = (ImageView) findViewById(R.id.coverArtView); //ViewCompat.setTransitionName(mCoverArt, getString(R.string.transition_image)); mPlayCircle = (ImageButton) findViewById(R.id.play_circle); mPlayCircle.setOnClickListener(new View.OnClickListener() { @Override/*from ww w. j ava2 s. co m*/ public void onClick(View v) { togglePlayback(); } }); }
From source file:com.repkap11.repcast.activities.LocalPlayerActivity.java
private void loadViews() { mVideoView = (VideoView) findViewById(R.id.videoView1); mTitleView = (TextView) findViewById(R.id.textView1); mDescriptionView = (TextView) findViewById(R.id.textView2); mDescriptionView.setMovementMethod(new ScrollingMovementMethod()); mAuthorView = (TextView) findViewById(R.id.textView3); mStartText = (TextView) findViewById(R.id.startText); mEndText = (TextView) findViewById(R.id.endText); mSeekbar = (SeekBar) findViewById(R.id.seekBar1); // mVolBar = (SeekBar) findViewById(R.id.seekBar2); mPlayPause = (ImageView) findViewById(R.id.imageView2); mLoading = (ProgressBar) findViewById(R.id.progressBar1); // mVolumeMute = (ImageView) findViewById(R.id.imageView2); mControllers = findViewById(R.id.controllers); mContainer = findViewById(R.id.container); mCoverArt = (ImageView) findViewById(R.id.coverArtView); ViewCompat.setTransitionName(mCoverArt, getString(R.string.transition_image)); mPlayCircle = (ImageButton) findViewById(R.id.play_circle); mPlayCircle.setOnClickListener(new OnClickListener() { @Override// w w w. j ava 2 s.co m public void onClick(View v) { togglePlayback(); } }); }
From source file:com.sdspikes.fireworks.FireworksActivity.java
private void displayInitialState() { switchToScreen(R.id.screen_game);/*from w w w . jav a2s .co m*/ GameState.HandNode currentNode = mTurnData.state.hands.get(mMyId); FragmentManager fm = getFragmentManager(); fragments = new HashMap<>(); if (fm.findFragmentById(R.id.my_hand) == null) { if (currentNode != null) { addHandFragment(fm, currentNode, mMyId, mIdToName.get(mMyId), R.id.my_hand); } else { Log.d(TAG, mMyId); } } if (fm.findFragmentById(R.id.other_hands) == null) { while (true) { String currentId = currentNode.nextPlayerId; if (currentId.equals(mMyId)) { break; } currentNode = mTurnData.state.hands.get(currentId); addHandFragment(fm, currentNode, currentId, mIdToName.get(currentId), R.id.other_hands); } } LinearLayout played = (LinearLayout) findViewById(R.id.played_pile); played.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { LinearLayout played = (LinearLayout) findViewById(R.id.played_pile); mDiscardWidthR2 = played.getMeasuredWidth(); if (mDiscardWidthR2 != 0) { int usableWidth = mDiscardWidthR2 - findViewById(R.id.played_label).getMeasuredWidth(); mDiscardWidthR1 = mDiscardWidthR2 - findViewById(R.id.discarded_label).getMeasuredWidth(); for (int i = 1; i < played.getChildCount(); i++) { ViewGroup.LayoutParams params = played.getChildAt(i).getLayoutParams(); params.width = usableWidth / 5; played.getChildAt(i).setLayoutParams(params); } played.getViewTreeObserver().removeOnGlobalLayoutListener(this); LinearLayout chooseAttribute = (LinearLayout) findViewById(R.id.chooseAttribute); for (int i = 1; i <= 5; i++) { chooseAttribute.addView(makeAttributeTextView(i, null)); } for (GameState.CardColor color : GameState.CardColor.values()) { chooseAttribute.addView(makeAttributeTextView(-1, color)); } // In case all the data is ready already and was just waiting on this. updateDisplay(); } } }); createInitialLog(); ((TextView) findViewById(R.id.log)).setMovementMethod(new ScrollingMovementMethod()); }
From source file:com.updetector.MainActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /**//from www . j av a2 s . co m * Set the views */ // Set the main layout setContentView(R.layout.activity_main); // get a handle to the console textview consoleTextView = (TextView) findViewById(R.id.console_text_id); consoleTextView.setMovementMethod(new ScrollingMovementMethod()); //setup monitoring fields environTextView = (TextView) findViewById(R.id.environment); environTextView.setText(ENVIRONMENT_PREFIX + CommonUtils.eventCodeToString(lastEnvironment)); stateTextView = (TextView) findViewById(R.id.state); //stateTextView.setText(STATE_PREFIX+"unknown"); googleStateTextView = (TextView) findViewById(R.id.google_state); googleStateTextView.setText(GOOGLE_MOBILITY_STATE_PREFIX + "unknown"); //indicatorTextView=(TextView) findViewById(R.id.indicator); //indicatorTextView.setText(INDICATOR_PREFIX); // set up the map view setupMapIfNeeded(); //set up the location client setupLocationClientIfNeeded(); /** * set up color coded map */ if (parkingBlocks == null) { parkingBlocks = ParkingBlocks.GetParkingBlocks(); showAvailabilityMap(); } mTextToSpeech = new TextToSpeech(this, this); mCalendar = Calendar.getInstance(); /* * Initialize managers */ // Instantiate an adapter to store update data from the log /* mStatusAdapter = new ArrayAdapter<Spanned>( this, R.layout.item_layout, R.id.log_text );*/ // Set the broadcast receiver intent filer mBroadcastManager = LocalBroadcastManager.getInstance(this); // Create a new Intent filter for the broadcast receiver mBroadcastFilter = new IntentFilter(Constants.ACTION_REFRESH_STATUS_LIST); mBroadcastFilter.addCategory(Constants.CATEGORY_LOCATION_SERVICES); mBroadcastFilter.addAction(Constants.BLUETOOTH_CONNECTION_UPDATE); mBroadcastFilter.addAction(Constants.GOOGLE_ACTIVITY_RECOGNITION_UPDATE); mBroadcastManager.registerReceiver(mBroadcastReceiver, mBroadcastFilter); // Get the instance of the customized notification manager mDetectionNotificationManager = DetectionNotificationManager.getInstance(this); //Get the FusionManager object mFusionManager = new FusionManager(this); // Get the ClassificationManager object mClassificationManager = ClassificationManager.getInstance(this); //TODO train classifiers if necessary if (Constants.IS_TRAINING_MODE) { int[] classifiersToBeTrained = { Constants.ACCEL_MOTION_STATE }; for (int classifier : classifiersToBeTrained) { mClassificationManager.mClassfiers.get(classifier).train(); } } //get the sensor service mSensorManager = (SensorManager) this.getSystemService(SENSOR_SERVICE); //get the accelerometer sensor mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mSensorManager.registerListener(mSensorEventListener, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL); mAudioRecordManager = AudioRecordManager.getInstance(); // Get the WakeLockManager object mWakeLockManager = WakeLockManager.getInstance(this); mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); // Get the LogManager object mLogManager = LogManager.getInstance(this); mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); mXPSHandler = new XPS(this); mXPSHandler.setRegistrationUser(new WPSAuthentication("dbmc", "uic")); //mXPSHandler.setTiling("", 0, 0, null); /** * Initialize IODetector */ cellTowerChart = new CellTowerChart((TelephonyManager) getSystemService(TELEPHONY_SERVICE), this); magnetChart = new MagnetChart(mSensorManager, this); lightChart = new LightChart(mSensorManager, this); //new AggregatedIODetector().execute("");//Check the detection for the first time //This timer handle starts the aggregated calculation for the detection //Interval 1 seconds. Timer uiTimer = new Timer(); mIODectorHandler = new Handler(); /*uiTimer.scheduleAtFixedRate(new TimerTask() { private int walked = 0; @Override public void run() { mIODectorHandler.post(new Runnable() { @Override public void run() { if(phoneNotStill){//Check if the user is walking walked++; } else{ walked = 0; } if(aggregationFinish && walked > 3){//Check if the user has walked for at least 3 second, and the previous calculation has been finish aggregationFinish = false; walked = 0; new AggregatedIODetector().execute(""); } } }); } }, 0, 1000);*/ /** * Initialize fields other than managers */ lastAccReading = new double[3]; /** * Startup routines */ // catch the force close error Thread.setDefaultUncaughtExceptionHandler(new UnCaughtException(MainActivity.this)); /** * Start Google Activity Recognition */ mGoogleActivityDetectionRequester = new GoogleActivityRecognitionClientRequester(this); mGoogleActivityDetectionRemover = new GoogleActivityRecognitionClientRemover(this); startGoogleActivityRecognitionUpdates(null); checkGPSEnabled(); //test record sample //mAudioRecordManager.recordAudioSample("/sdcard/audio.wav"); //Test extract features from audio files //String features=AudioFeatureExtraction.extractFeatures(this, "/sdcard/bus6.wav"); //mClassificationManager.mClassfiers.get(Constants.SENSOR_MICROPHONE).classify(features); }
From source file:com.concentricsky.android.khanacademy.app.VideoDetailActivity.java
private void populateHeader() { View headerView = findViewById(R.id.video_header); Log.d(LOG_TAG, "populateHeader: header is " + (headerView == null ? "null" : "not null")); if (video != null && headerView != null) { ((TextView) headerView.findViewById(R.id.video_title)).setText(video.getTitle()); String desc = video.getDescription(); TextView descView = (TextView) headerView.findViewById(R.id.video_description); if (desc != null && desc.length() > 0) { descView.setText(desc);/*w w w . j a va2 s .c om*/ descView.setVisibility(View.VISIBLE); descView.setMovementMethod(new ScrollingMovementMethod()); } else { descView.setVisibility(View.GONE); } } }
From source file:cm.aptoide.pt.MainActivity.java
private void refreshAvailableList(boolean setAdapter) { if (depth.equals(ListDepth.STORES)) { availableView.findViewById(R.id.add_store_layout).setVisibility(View.VISIBLE); registerForContextMenu(availableListView); availableListView.setLongClickable(true); banner.setVisibility(View.GONE); } else {//from w ww . ja v a2 s.c o m unregisterForContextMenu(availableListView); availableView.findViewById(R.id.add_store_layout).setVisibility(View.GONE); if (ApplicationAptoide.MULTIPLESTORES && !joinStores_boolean) { banner.setVisibility(View.VISIBLE); RelativeLayout background_layout = (RelativeLayout) banner .findViewById(R.id.banner_background_layout); setBackgroundLayoutStoreTheme(db.getStoreTheme(store_id), background_layout); bannerStoreName.setText(db.getStoreName(store_id)); String avatarURL = db.getStoreAvatar(store_id); cm.aptoide.com.nostra13.universalimageloader.core.ImageLoader.getInstance().displayImage(avatarURL, bannerStoreAvatar); bannerStoreDescription.setText(db.getStoreDescription(store_id)); bannerStoreDescription.setMovementMethod(new ScrollingMovementMethod()); } } availableView.findViewById(R.id.refresh_view_layout).setVisibility(View.GONE); refreshClick = true; availableAdapter.changeCursor(null); pb.setVisibility(View.VISIBLE); pb.setText(R.string.please_wait); if (setAdapter) { availableListView.setAdapter(availableAdapter); } availableLoader.forceLoad(); }