android.text.method.ScrollingMovementMethod Java Examples

The following examples show how to use android.text.method.ScrollingMovementMethod. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: connectivity-samples   Author: android   File: MainActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  getSupportActionBar()
      .setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.actionBar));

  mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
  mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

  mPreviousStateView = (TextView) findViewById(R.id.previous_state);
  mCurrentStateView = (TextView) findViewById(R.id.current_state);

  mDebugLogView = (TextView) findViewById(R.id.debug_log);
  mDebugLogView.setVisibility(DEBUG ? View.VISIBLE : View.GONE);
  mDebugLogView.setMovementMethod(new ScrollingMovementMethod());

  mName = generateRandomName();

  ((TextView) findViewById(R.id.name)).setText(mName);
}
 
Example #2
Source Project: connectivity-samples   Author: android   File: MainActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  getSupportActionBar()
      .setBackgroundDrawable(ContextCompat.getDrawable(this, R.drawable.actionBar));

  mPreviousStateView = (TextView) findViewById(R.id.previous_state);
  mCurrentStateView = (TextView) findViewById(R.id.current_state);

  mDebugLogView = (TextView) findViewById(R.id.debug_log);
  mDebugLogView.setVisibility(DEBUG ? View.VISIBLE : View.GONE);
  mDebugLogView.setMovementMethod(new ScrollingMovementMethod());

  mName = generateRandomName();

  ((TextView) findViewById(R.id.name)).setText(mName);
}
 
Example #3
Source Project: grpc-nebula-java   Author: grpc-nebula   File: RouteGuideActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_routeguide);
  hostEdit = (EditText) findViewById(R.id.host_edit_text);
  portEdit = (EditText) findViewById(R.id.port_edit_text);
  startRouteGuideButton = (Button) findViewById(R.id.start_route_guide_button);
  exitRouteGuideButton = (Button) findViewById(R.id.exit_route_guide_button);
  getFeatureButton = (Button) findViewById(R.id.get_feature_button);
  listFeaturesButton = (Button) findViewById(R.id.list_features_button);
  recordRouteButton = (Button) findViewById(R.id.record_route_button);
  routeChatButton = (Button) findViewById(R.id.route_chat_button);
  resultText = (TextView) findViewById(R.id.result_text);
  resultText.setMovementMethod(new ScrollingMovementMethod());
  disableButtons();
}
 
Example #4
Source Project: yolov3-android-tflite   Author: wics1224   File: MainActivity.java    License: MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    textViewResult = findViewById(R.id.textViewResult);
    textViewResult.setMovementMethod(new ScrollingMovementMethod());

    btnDetectObject = findViewById(R.id.btnDetectObject);
    btnDetectObject.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent("android.intent.action.GET_CONTENT");
            intent.setType("image/*");
            startActivityForResult(intent,CHOOSE_PHOTO);//打开相册
        }
    });
    mContentView = (ImageView) findViewById(R.id.content);

    initTensorFlowAndLoadModel();

}
 
Example #5
Source Project: walt   Author: google   File: AccelerometerFragment.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    logger = SimpleLogger.getInstance(getContext());
    waltDevice = WaltDevice.getInstance(getContext());

    // Inflate the layout for this fragment
    final View view = inflater.inflate(R.layout.fragment_accelerometer, container, false);
    logTextView = (TextView) view.findViewById(R.id.txt_log);
    startButton = view.findViewById(R.id.button_start);
    latencyChart = (ScatterChart) view.findViewById(R.id.latency_chart);
    latencyChartLayout = view.findViewById(R.id.latency_chart_layout);
    logTextView.setMovementMethod(new ScrollingMovementMethod());
    view.findViewById(R.id.button_close_chart).setOnClickListener(this);
    sensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
    accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    if (accelerometer == null) {
        logger.log("ERROR! Accelerometer sensor not found");
    }
    return view;
}
 
Example #6
Source Project: walt   Author: google   File: TapLatencyFragment.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    shouldShowLatencyChart = getBooleanPreference(getContext(), R.string.preference_show_tap_histogram, true);
    if (getBooleanPreference(getContext(), R.string.preference_systrace, true)) {
        traceLogger = TraceLogger.getInstance();
    }
    waltDevice = WaltDevice.getInstance(getContext());
    logger = SimpleLogger.getInstance(getContext());
    // Inflate the layout for this fragment
    final View view = inflater.inflate(R.layout.fragment_tap_latency, container, false);
    restartButton = (ImageButton) view.findViewById(R.id.button_restart_tap);
    finishButton = (ImageButton) view.findViewById(R.id.button_finish_tap);
    tapCatcherView = (TextView) view.findViewById(R.id.tap_catcher);
    logTextView = (TextView) view.findViewById(R.id.txt_log_tap_latency);
    tapCountsView = (TextView) view.findViewById(R.id.txt_tap_counts);
    moveCountsView = (TextView) view.findViewById(R.id.txt_move_count);
    latencyChart = (HistogramChart) view.findViewById(R.id.latency_chart);
    logTextView.setMovementMethod(new ScrollingMovementMethod());
    finishButton.setEnabled(false);
    return view;
}
 
Example #7
Source Project: android-pdk   Author: pinterest   File: AnyPathActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_any_path);
    setTitle("Get Path..");

    pathText = (EditText) findViewById(R.id.path_edittext);
    fieldsText = (EditText) findViewById(R.id.fields_edittext);
    responseView = (TextView) findViewById(R.id.path_response_view);
    responseView.setMovementMethod(new ScrollingMovementMethod());
    getButton = (Button) findViewById(R.id.get_button);
    getButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onGet();
        }
    });

    spinner = (Spinner) findViewById(R.id.spinner);
    spinner.setOnItemSelectedListener(this);
    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
        R.array.paths_array, android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
}
 
Example #8
Source Project: android-MessagingService   Author: googlearchive   File: MessagingFragment.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_message_me, container, false);

    mSendSingleConversation = (Button) rootView.findViewById(R.id.send_1_conversation);
    mSendSingleConversation.setOnClickListener(this);

    mSendTwoConversations = (Button) rootView.findViewById(R.id.send_2_conversations);
    mSendTwoConversations.setOnClickListener(this);

    mSendConversationWithThreeMessages =
            (Button) rootView.findViewById(R.id.send_1_conversation_3_messages);
    mSendConversationWithThreeMessages.setOnClickListener(this);

    mDataPortView = (TextView) rootView.findViewById(R.id.data_port);
    mDataPortView.setMovementMethod(new ScrollingMovementMethod());

    mClearLogButton = (Button) rootView.findViewById(R.id.clear);
    mClearLogButton.setOnClickListener(this);

    setButtonsState(false);

    return rootView;
}
 
Example #9
Source Project: socialmediasignup   Author: ahmedadeltito   File: SocialMediaActivity.java    License: MIT License 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.social_media_content);

    socialMediaLoginButton = findViewById(R.id.social_media_content_log_in_btn);
    socialMediaLogoutButton = findViewById(R.id.social_media_content_log_out_btn);
    socialMediaContentTextView = findViewById(R.id.social_media_content_tv);
    socialMedialContentImageView = findViewById(R.id.social_media_content_iv);

    socialMediaContentTextView.setMovementMethod(new ScrollingMovementMethod());

    if (getIntent().getExtras() != null) {
        String socialMediaType = getIntent().getExtras().getString(SOCIAL_MEDIA_TYPE);
        updateSocialMediaState(socialMediaType);
        if (getSupportActionBar() != null) {
            getSupportActionBar().setTitle(socialMediaType);
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }
    }
}
 
Example #10
Source Project: Phantom   Author: ManbangGroup   File: ServiceFragment.java    License: Apache License 2.0 6 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.fragment_service, container, false);

    mETLog = (TextView) view.findViewById(R.id.tv_log);
    mETLog.setMovementMethod(ScrollingMovementMethod.getInstance());

    view.findViewById(R.id.btn_start_plugin_intent_service).setOnClickListener(this);
    view.findViewById(R.id.btn_start_plugin_service).setOnClickListener(this);
    view.findViewById(R.id.btn_stop_plugin_service).setOnClickListener(this);
    view.findViewById(R.id.btn_bind_plugin_service).setOnClickListener(this);
    view.findViewById(R.id.btn_unbind_plugin_service).setOnClickListener(this);
    return view;
}
 
Example #11
Source Project: grpc-java   Author: grpc   File: RouteGuideActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_routeguide);
  hostEdit = (EditText) findViewById(R.id.host_edit_text);
  portEdit = (EditText) findViewById(R.id.port_edit_text);
  startRouteGuideButton = (Button) findViewById(R.id.start_route_guide_button);
  exitRouteGuideButton = (Button) findViewById(R.id.exit_route_guide_button);
  getFeatureButton = (Button) findViewById(R.id.get_feature_button);
  listFeaturesButton = (Button) findViewById(R.id.list_features_button);
  recordRouteButton = (Button) findViewById(R.id.record_route_button);
  routeChatButton = (Button) findViewById(R.id.route_chat_button);
  resultText = (TextView) findViewById(R.id.result_text);
  resultText.setMovementMethod(new ScrollingMovementMethod());
  disableButtons();
}
 
Example #12
Source Project: letv   Author: JackChan1999   File: OAuth2Activity.java    License: Apache License 2.0 6 votes vote down vote up
private void initView() {
    this.m3thLogo = (ImageView) this.mRootView.findViewWithTag("umgr_oauth2_3th_logo");
    this.mCoolCloudLogo = (ImageView) this.mRootView.findViewWithTag("umgr_oauth2_coolcloud_logo");
    this.m3thName = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_3th_name");
    this.mRelation = (ImageView) this.mRootView.findViewWithTag("umgr_oauth2_relation");
    this.mAccountLogo = (ImageView) this.mRootView.findViewWithTag("umgr_oauth2_coolcloud_logo");
    this.mAccountTv = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_coolcloud_name");
    this.mUserLogo = (ImageView) this.mRootView.findViewWithTag("umgr_oauth2_user_logo");
    this.mUserAccount = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_user_account");
    this.mSwitchAccount = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_switch_account");
    this.mOAuth2 = (Button) this.mRootView.findViewWithTag("umgr_oauth2_submit");
    this.mOAuth2Scope = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_scope");
    this.mErrorPrompt = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_error_prompt");
    this.mOAuth2Prompt = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_prompt");
    this.mCoolCloudName = (TextView) this.mRootView.findViewWithTag("umgr_oauth2_coolcloud_name");
    this.mOAuth2Scope.setMovementMethod(ScrollingMovementMethod.getInstance());
}
 
Example #13
Source Project: karmadetector   Author: pmbento   File: MainActivity.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    textViewLog = (TextView) findViewById(R.id.textViewLog);
    wifiScannerIntent = new Intent(this, WifiScannerService.class);
    textViewLog.setMovementMethod(new ScrollingMovementMethod());
    sharedPreferences = getSharedPreferences("karmaDetectorPrefs", Context.MODE_PRIVATE);
    scanFrequencyText = (EditText) findViewById(R.id.scanFrequency);
    scanFrequencyText.addTextChangedListener(frequencyScanTextWatcher);
    autoStartSwitch = (Switch) findViewById(R.id.switchAutoStart);
    autoStartSwitch.setOnCheckedChangeListener(autoStartSwitchWatcher);
    loadPrefs();
    addToLog("App started.");
}
 
Example #14
Source Project: walt   Author: google   File: ScreenResponseFragment.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void run() {
    waltDevice.stopListener();
    waltDevice.clearTriggerHandler();

    // TODO: Add option to save this data into a separate file rather than the main log.
    logger.log(brightnessCurveData.toString());
    logger.log("=== End of screen brightness data ===");

    blackBox.setText(logger.getLogText());
    blackBox.setMovementMethod(new ScrollingMovementMethod());
    blackBox.setBackgroundColor(color_gray);
    isTestRunning = false;
    startButton.setEnabled(true);
    setFullScreen(false);
    drawBrightnessChart();
    LogUploader.uploadIfAutoEnabled(getContext());
}
 
Example #15
Source Project: LLApp   Author: Alex-Jerry   File: FloatView.java    License: Apache License 2.0 6 votes vote down vote up
/**
         * 设置值
         */
        @Override
        public void onBindViewHolder(final ViewHolder viewHolder, final int i) {
//            viewHolder.mImg.setImageResource(mDatas.get(i).pic);
//            Glide.with(getContext()).load(mDatas.get(i).pic).into(viewHolder.mImg);
            viewHolder.mImg.setImageResource(mDatas.get(i));
            viewHolder.mTxt.setText("艾弗森");
            viewHolder.mTxt.setMovementMethod(ScrollingMovementMethod.getInstance());
//            viewHolder.itemView.setOnClickListener(new OnClickListener() {
//                @Override
//                public void onClick(View view) {
//                    int position = viewHolder.getPosition();
//                    onItemClickListener.OnItemClick(view, position);
//                }
//            });
        }
 
Example #16
Source Project: settingscompat   Author: czy1121   File: MainActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    vFloat = new FloatView(this);
    vResult = (TextView) findViewById(R.id.result);

    findViewById(R.id.result).setOnClickListener(this);
    findViewById(R.id.check).setOnClickListener(this);
    findViewById(R.id.manage).setOnClickListener(this);
    findViewById(R.id.toggle).setOnClickListener(this);
    findViewById(R.id.detail).setOnClickListener(this);

    TextView tv = (TextView) findViewById(R.id.info);
    tv.setMovementMethod(ScrollingMovementMethod.getInstance());

    tv.setText(readString("/system/build.prop"));
    if (SettingsCompat.canDrawOverlays(this)) {
        vFloat.attach();
    } else {
        vFloat.detach();
    }
}
 
Example #17
Source Project: Tehreer-Android   Author: Tehreer   File: BidiInfoActivity.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_bidi_info);

    Intent intent = getIntent();
    mBidiText = String.valueOf(intent.getCharSequenceExtra(BIDI_TEXT));
    mDensity = getResources().getDisplayMetrics().scaledDensity;

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }

    SpannableStringBuilder builder = new SpannableStringBuilder();
    writeBidiText(builder);

    TextView bidiTextView = findViewById(R.id.text_view_bidi);
    bidiTextView.setMovementMethod(ScrollingMovementMethod.getInstance());
    bidiTextView.setText(builder);
}
 
Example #18
Source Project: cast-videos-android   Author: googlecodelabs   File: LocalPlayerActivity.java    License: Apache License 2.0 6 votes vote down vote up
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);
    mStartText.setText(Utils.formatMillis(0));
    mEndText = (TextView) findViewById(R.id.endText);
    mSeekbar = (SeekBar) findViewById(R.id.seekBar1);
    mPlayPause = (ImageView) findViewById(R.id.imageView2);
    mLoading = (ProgressBar) findViewById(R.id.progressBar1);
    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
        public void onClick(View v) {
            togglePlayback();
        }
    });
}
 
Example #19
Source Project: grpc-nebula-java   Author: grpc-nebula   File: HelloworldActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_helloworld);
  sendButton = (Button) findViewById(R.id.send_button);
  hostEdit = (EditText) findViewById(R.id.host_edit_text);
  portEdit = (EditText) findViewById(R.id.port_edit_text);
  messageEdit = (EditText) findViewById(R.id.message_edit_text);
  resultText = (TextView) findViewById(R.id.grpc_response_text);
  resultText.setMovementMethod(new ScrollingMovementMethod());
}
 
Example #20
Source Project: grpc-nebula-java   Author: grpc-nebula   File: ClientCacheExampleActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_clientcacheexample);
  sendButton = (Button) findViewById(R.id.send_button);
  hostEdit = (EditText) findViewById(R.id.host_edit_text);
  portEdit = (EditText) findViewById(R.id.port_edit_text);
  messageEdit = (EditText) findViewById(R.id.message_edit_text);
  getCheckBox = (CheckBox) findViewById(R.id.get_checkbox);
  noCacheCheckBox = (CheckBox) findViewById(R.id.no_cache_checkbox);
  onlyIfCachedCheckBox = (CheckBox) findViewById(R.id.only_if_cached_checkbox);
  resultText = (TextView) findViewById(R.id.grpc_response_text);
  resultText.setMovementMethod(new ScrollingMovementMethod());
  cache = SafeMethodCachingInterceptor.newLruCache(CACHE_SIZE_IN_BYTES);
}
 
Example #21
Source Project: SimpleBluetoothLeTerminal   Author: kai-morich   File: TerminalFragment.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_terminal, container, false);
    receiveText = view.findViewById(R.id.receive_text);                          // TextView performance decreases with number of spans
    receiveText.setTextColor(getResources().getColor(R.color.colorRecieveText)); // set as default color to reduce number of spans
    receiveText.setMovementMethod(ScrollingMovementMethod.getInstance());
    TextView sendText = view.findViewById(R.id.send_text);
    View sendBtn = view.findViewById(R.id.send_btn);
    sendBtn.setOnClickListener(v -> send(sendText.getText().toString()));
    return view;
}
 
Example #22
Source Project: audio-analyzer-for-android   Author: bewantbe   File: InfoRecActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_info_rec);
	// Show the Up button in the action bar.
	setupActionBar();

	analyzerUtil = new AnalyzerUtil(this);
	testResultSt = null;

	final TextView tv = (TextView) findViewById(R.id.info_rec_tv);
	tv.setMovementMethod(new ScrollingMovementMethod());
}
 
Example #23
Source Project: ANetty   Author: jenly1314   File: MainActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    etHost = findViewById(R.id.etHost);
    etPort = findViewById(R.id.etPort);
    etContent = findViewById(R.id.etContent);
    tvContent = findViewById(R.id.tvContent);
    tvContent.setMovementMethod(ScrollingMovementMethod.getInstance());
    etHost.setText(mHost);
    etPort.setText(String.valueOf(mPort));
    initNetty();
}
 
Example #24
Source Project: SimpleBluetoothTerminal   Author: kai-morich   File: TerminalFragment.java    License: MIT License 5 votes vote down vote up
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_terminal, container, false);
    receiveText = view.findViewById(R.id.receive_text);                          // TextView performance decreases with number of spans
    receiveText.setTextColor(getResources().getColor(R.color.colorRecieveText)); // set as default color to reduce number of spans
    receiveText.setMovementMethod(ScrollingMovementMethod.getInstance());
    TextView sendText = view.findViewById(R.id.send_text);
    View sendBtn = view.findViewById(R.id.send_btn);
    sendBtn.setOnClickListener(v -> send(sendText.getText().toString()));
    return view;
}
 
Example #25
Source Project: libcurldroid   Author: aloha-app   File: MainActivity.java    License: Artistic License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    textView = (TextView) findViewById(R.id.text_view);
    textView.setMovementMethod(new ScrollingMovementMethod());
}
 
Example #26
Source Project: audio-analyzer-for-android   Author: bewantbe   File: AnalyzerViews.java    License: Apache License 2.0 5 votes vote down vote up
void showPermissionExplanation(int resId) {
    TextView tv = new TextView(activity);
    tv.setMovementMethod(new ScrollingMovementMethod());
    tv.setText(fromHtml(activity.getString(resId)));
    new AlertDialog.Builder(activity)
            .setTitle(R.string.permission_explanation_title)
            .setView(tv)
            .setNegativeButton(R.string.dismiss, null)
            .create().show();
}
 
Example #27
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detection_test);
    progress = (TextView) findViewById(R.id.progressText);
    progress.setMovementMethod(new ScrollingMovementMethod());
}
 
Example #28
Source Project: FirefoxReality   Author: MozillaReality   File: TextPromptWidget.java    License: Mozilla Public License 2.0 5 votes vote down vote up
protected void initialize(Context aContext) {
    inflate(aContext, R.layout.prompt_text, this);

    mAudio = AudioEngine.fromContext(aContext);

    mLayout = findViewById(R.id.layout);

    mTitle = findViewById(R.id.textTitle);
    mMessage = findViewById(R.id.textMessage);
    mMessage.setMovementMethod(new ScrollingMovementMethod());
    mPromptText = findViewById(R.id.promptText);

    mOkButton = findViewById(R.id.positiveButton);
    mOkButton.setOnClickListener(view -> {
        if (mAudio != null) {
            mAudio.playSound(AudioEngine.Sound.CLICK);
        }

        if (mPromptDelegate != null && mPromptDelegate instanceof TextPromptDelegate) {
            ((TextPromptDelegate)mPromptDelegate).confirm(mPromptText.getText().toString());
        }

        hide(REMOVE_WIDGET);
    });

    mCancelButton = findViewById(R.id.negativeButton);
    mCancelButton.setOnClickListener(view -> {
        if (mAudio != null) {
            mAudio.playSound(AudioEngine.Sound.CLICK);
        }

        onDismiss();
    });
}
 
Example #29
Source Project: walt   Author: google   File: LogFragment.java    License: Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #30
Source Project: LyricHere   Author: markzhai   File: LyricView.java    License: Apache License 2.0 5 votes vote down vote up
public LyricView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    setFocusable(true);

    int backgroundColor = Color.BLACK;
    int highlightColor = Color.RED;
    int normalColor = Color.WHITE;

    setBackgroundColor(backgroundColor);

    // Non-highlight part
    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setTextSize(36);
    mPaint.setColor(normalColor);
    mPaint.setTypeface(Typeface.SERIF);

    // highlight part, current lyric
    mCurrentPaint = new Paint();
    mCurrentPaint.setAntiAlias(true);
    mCurrentPaint.setColor(highlightColor);
    mCurrentPaint.setTextSize(36);
    mCurrentPaint.setTypeface(Typeface.SANS_SERIF);

    mPaint.setTextAlign(Paint.Align.CENTER);
    mCurrentPaint.setTextAlign(Paint.Align.CENTER);
    setHorizontallyScrolling(true);
    setMovementMethod(new ScrollingMovementMethod());
}