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 File: MainActivity.java    From connectivity-samples with 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 #2
Source File: AnyPathActivity.java    From android-pdk with 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 #3
Source File: TapLatencyFragment.java    From walt with 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 #4
Source File: OAuth2Activity.java    From letv with 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 #5
Source File: RouteGuideActivity.java    From grpc-java with 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 #6
Source File: MessagingFragment.java    From android-MessagingService with 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 #7
Source File: ServiceFragment.java    From Phantom with 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 #8
Source File: MainActivity.java    From karmadetector with 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 #9
Source File: ScreenResponseFragment.java    From walt with 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 #10
Source File: FloatView.java    From LLApp with 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 #11
Source File: MainActivity.java    From settingscompat with 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 #12
Source File: AccelerometerFragment.java    From walt with 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 #13
Source File: SocialMediaActivity.java    From socialmediasignup with 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 #14
Source File: MainActivity.java    From yolov3-android-tflite with 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 #15
Source File: BidiInfoActivity.java    From Tehreer-Android with 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 #16
Source File: LocalPlayerActivity.java    From cast-videos-android with 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 #17
Source File: MainActivity.java    From connectivity-samples with 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 #18
Source File: RouteGuideActivity.java    From grpc-nebula-java with 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 #19
Source File: WebappUrlBar.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a WebappUrlBar.
 * @param context Context to grab resources from.
 */
public WebappUrlBar(Context context, AttributeSet attrSet) {
    super(context, attrSet);
    mIconResourceWidths = new SparseIntArray();

    mUrlBar = new TextView(context);
    mUrlBar.setSingleLine(true);
    mUrlBar.setGravity(Gravity.CENTER_VERTICAL);
    mUrlBar.setMovementMethod(ScrollingMovementMethod.getInstance());
    mUrlBar.setHorizontalFadingEdgeEnabled(true);
    mSeparator = new View(context);

    addView(mUrlBar,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER));
    addView(mSeparator,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, 1, Gravity.BOTTOM));

    // Set the colors.
    mSeparator.setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_separator));
    setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_bg));

    // Listen for changes in the URL bar's size.
    mUrlBar.addOnLayoutChangeListener(this);
}
 
Example #20
Source File: WebappUrlBar.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a WebappUrlBar.
 * @param context Context to grab resources from.
 */
public WebappUrlBar(Context context, AttributeSet attrSet) {
    super(context, attrSet);
    mIconResourceWidths = new SparseIntArray();

    mUrlBar = new TextView(context);
    mUrlBar.setSingleLine(true);
    mUrlBar.setGravity(Gravity.CENTER_VERTICAL);
    mUrlBar.setMovementMethod(ScrollingMovementMethod.getInstance());
    mUrlBar.setHorizontalFadingEdgeEnabled(true);
    mSeparator = new View(context);

    addView(mUrlBar,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER));
    addView(mSeparator,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, 1, Gravity.BOTTOM));

    // Set the colors.
    mSeparator.setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_separator));
    setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_bg));

    // Listen for changes in the URL bar's size.
    mUrlBar.addOnLayoutChangeListener(this);
}
 
Example #21
Source File: TrainingActivity.java    From Android-Face-Recognition-with-Deep-Learning-Test-Framework with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_training);
    progress = (TextView) findViewById(R.id.progressText);
    progress.setMovementMethod(new ScrollingMovementMethod());
}
 
Example #22
Source File: CreateFolderSample.java    From huaweicloud-sdk-java-obs with Apache License 2.0 5 votes vote down vote up
@Override
protected void onPostExecute(String result)
{
    TextView tv = (TextView)findViewById(R.id.tv);
    tv.setText(result);
    tv.setOnClickListener(null);
    tv.setMovementMethod(ScrollingMovementMethod.getInstance());
}
 
Example #23
Source File: MidiFragment.java    From walt with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    logger = SimpleLogger.getInstance(getContext());
    midiTest = new MidiTest(getActivity());
    midiTest.setTestStateListener(this);

    final View view = inflater.inflate(R.layout.fragment_midi, container, false);
    textView = (TextView) view.findViewById(R.id.txt_box_midi);
    startMidiInButton = view.findViewById(R.id.button_start_midi_in);
    startMidiOutButton = view.findViewById(R.id.button_start_midi_out);
    latencyChart = (HistogramChart) view.findViewById(R.id.latency_chart);
    textView.setMovementMethod(new ScrollingMovementMethod());
    return view;
}
 
Example #24
Source File: WebappUrlBar.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a WebappUrlBar.
 * @param context Context to grab resources from.
 */
public WebappUrlBar(Context context, AttributeSet attrSet) {
    super(context, attrSet);
    mIconResourceWidths = new SparseIntArray();

    mUrlBar = new TextView(context);
    mUrlBar.setSingleLine(true);
    mUrlBar.setGravity(Gravity.CENTER_VERTICAL);
    mUrlBar.setMovementMethod(ScrollingMovementMethod.getInstance());
    mUrlBar.setHorizontalFadingEdgeEnabled(true);
    mSeparator = new View(context);

    addView(mUrlBar,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER));
    addView(mSeparator,
            new FrameLayout.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, 1, Gravity.BOTTOM));

    // Set the colors.
    mSeparator.setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_separator));
    setBackgroundColor(ApiCompatibilityUtils.getColor(context.getResources(),
            R.color.webapp_url_bar_bg));

    // Listen for changes in the URL bar's size.
    mUrlBar.addOnLayoutChangeListener(this);
}
 
Example #25
Source File: DeviceServicesActivity.java    From EFRConnect-android with Apache License 2.0 5 votes vote down vote up
@Override
public void handleMessage(Message msg) {
    //Log.i("handler","receiving message");
    String sentString = msg.getData().getString("whatisconnected");
    try {
        tv = findViewById(R.id.log_view);
        tv.setMovementMethod(new ScrollingMovementMethod());
        tv.append(sentString);
        tv.scrollTo(0, tv.getScrollY());
    } catch (Exception e) {
        Log.e("mHandle", "error: " + e);
    }

}
 
Example #26
Source File: RunCommandDialog.java    From rpicheck with MIT License 5 votes vote down vote up
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final AlertDialog.Builder builder = new AlertDialog.Builder(
            getActivity());
    this.device = (RaspberryDeviceBean) this.getArguments()
            .getSerializable("pi");
    this.command = (CommandBean) this.getArguments().getSerializable("cmd");
    if (this.getArguments().getString("passphrase") != null) {
        this.passphrase = this.getArguments().getString("passphrase");
    }

    builder.setTitle(getString(R.string.run_cmd_dialog_title,
            this.command.getName()));

    // fetching the theme-dependent icon
    TypedValue icon = new TypedValue();
    if (getActivity().getTheme().resolveAttribute(R.attr.ic_dialog_run,
            icon, true)) {
        builder.setIcon(icon.resourceId);
    }

    builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            // just closing the dialog
        }
    });
    final LayoutInflater inflater = getActivity().getLayoutInflater();
    final View view = inflater.inflate(R.layout.dialog_command_run, null);
    builder.setView(view);
    consoleOutput = (TextView) view.findViewById(R.id.runCommandOutput);
    consoleOutput.setMovementMethod(new ScrollingMovementMethod());
    if (savedInstanceState != null) {
        this.didRun = savedInstanceState.getBoolean("didRun", false);
    }
    return builder.create();
}
 
Example #27
Source File: PatchHisDialog.java    From DanDanPlayForAndroid with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.dialog_patch_his);
    ButterKnife.bind(this);

    StringBuilder his = new StringBuilder();
    if (eventList != null && eventList.size() > 0) {
        for (int i = eventList.size() - 1; i >= 0; i--) {
            PatchFixEvent event = eventList.get(i);
            his.append(event.getTime());
            if (event.getCode() > 0)
                his.append("    c:").append(event.getCode());
            his.append("    v:").append(event.getVersion());
            if (event.getCode() == -2)
                his.append("    ").append("Newest").append("\n\n");
            else
                his.append("\n").append(event.getMsg()).append("\n\n");
        }
    }

    if (AppConfig.getInstance().isAutoQueryPatch()) {
        fixModeTv.setText("自动");
        fixModeTv.setTextColor(CommonUtils.getResColor(R.color.immutable_text_theme));
    } else {
        fixModeTv.setText("手动");
        fixModeTv.setTextColor(CommonUtils.getResColor(R.color.immutable_text_pink));
    }

    hisTv.setText(his.toString());
    hisTv.setMovementMethod(ScrollingMovementMethod.getInstance());
}
 
Example #28
Source File: BroadcastFragment.java    From Phantom with Apache License 2.0 5 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_broadcast, container, false);

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

    view.findViewById(R.id.btn_send_broadcast).setOnClickListener(this);
    return view;
}
 
Example #29
Source File: PostObjectSample.java    From huaweicloud-sdk-java-obs with Apache License 2.0 5 votes vote down vote up
@Override
protected void onPostExecute(String result)
{
    TextView tv = (TextView)findViewById(R.id.tv);
    tv.setText(result);
    tv.setOnClickListener(null);
    tv.setMovementMethod(ScrollingMovementMethod.getInstance());
}
 
Example #30
Source File: BookDetailActivity.java    From MyBookshelf with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void bindView() {
    ButterKnife.bind(this);
    //弹窗
    moDialogHUD = new MoDialogHUD(this);
    tvIntro.setMovementMethod(ScrollingMovementMethod.getInstance());
    if (mPresenter.getOpenFrom() == FROM_BOOKSHELF) {
        updateView();
    } else {
        if (mPresenter.getSearchBook() == null) return;
        SearchBookBean searchBookBean = mPresenter.getSearchBook();
        upImageView(searchBookBean.getCoverUrl(), searchBookBean.getName(), searchBookBean.getAuthor());
        tvName.setText(searchBookBean.getName());
        author = searchBookBean.getAuthor();
        tvAuthor.setText(TextUtils.isEmpty(author) ? "未知" : author);
        String origin = TextUtils.isEmpty(searchBookBean.getOrigin()) ? "未知" : searchBookBean.getOrigin();
        tvOrigin.setText(origin);
        tvChapter.setText(searchBookBean.getLastChapter());  // newest
        tvIntro.setText(StringUtils.formatHtml(searchBookBean.getIntroduce()));
        tvShelf.setText(R.string.add_to_shelf);
        tvRead.setText(R.string.start_read);
        tvRead.setOnClickListener(v -> {
            //放入书架
        });
        tvIntro.setVisibility(View.INVISIBLE);
        tvLoading.setVisibility(View.VISIBLE);
        tvLoading.setText(R.string.loading);
        tvLoading.setOnClickListener(null);
    }
}