Example usage for android.text.method ScrollingMovementMethod ScrollingMovementMethod

List of usage examples for android.text.method ScrollingMovementMethod ScrollingMovementMethod

Introduction

In this page you can find the example usage for android.text.method ScrollingMovementMethod ScrollingMovementMethod.

Prototype

ScrollingMovementMethod

Source Link

Usage

From source file:de.janrenz.app.mediathek.MediathekActivity.java

protected AlertDialog getInfoDialog() {
    TextView tv = new TextView(this);
    //tv.setBackgroundColor(getResources().getColor(R.color.abs__bright_foreground_holo_dark)); 
    tv.setPadding(15, 15, 15, 15);//  w w w .  j a v  a  2 s  .  c  o m
    tv.setMovementMethod(new ScrollingMovementMethod());
    tv.setScrollBarStyle(1);
    tv.setText(Html.fromHtml(getString(R.string.infotext)));
    AlertDialog.Builder builder = new AlertDialog.Builder(this);

    builder.setTitle("Mediathek 1").setView(tv).setInverseBackgroundForced(true)//needed for old android version
            .setCancelable(false)
            // OK button
            .setPositiveButton(this.getResources().getString(R.string.changelog_ok_button),
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    });
    // Show "More" button if we're only displaying a partial change log.
    builder.setNegativeButton(R.string.info_popup_changelog, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int id) {
            if (cl != null)
                cl.getFullLogDialog().show();
        }
    });

    return builder.create();
}

From source file:org.chromium.latency.walt.ScreenResponseFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    timesToBlink = getIntPreference(getContext(), R.string.preference_screen_blinks, 20);
    shouldShowLatencyChart = getBooleanPreference(getContext(), R.string.preference_show_blink_histogram, true);
    enableFullScreen = getBooleanPreference(getContext(), R.string.preference_screen_fullscreen, true);
    if (getBooleanPreference(getContext(), R.string.preference_systrace, true)) {
        traceLogger = TraceLogger.getInstance();
    }/*from  w ww .  j  a v a  2  s  .co  m*/
    waltDevice = WaltDevice.getInstance(getContext());
    logger = SimpleLogger.getInstance(getContext());

    // Inflate the layout for this fragment
    final View view = inflater.inflate(R.layout.fragment_screen_response, container, false);
    stopButton = view.findViewById(R.id.button_stop_screen_response);
    startButton = view.findViewById(R.id.button_start_screen_response);
    blackBox = (TextView) view.findViewById(R.id.txt_black_box_screen);
    fastSurfaceView = (FastPathSurfaceView) view.findViewById(R.id.fast_path_surface);
    spinner = (Spinner) view.findViewById(R.id.spinner_screen_response);
    buttonBarView = view.findViewById(R.id.button_bar);
    ArrayAdapter<CharSequence> modeAdapter = ArrayAdapter.createFromResource(getContext(),
            R.array.screen_response_mode_array, android.R.layout.simple_spinner_item);
    modeAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
    spinner.setAdapter(modeAdapter);
    stopButton.setEnabled(false);
    blackBox.setMovementMethod(new ScrollingMovementMethod());
    brightnessChartLayout = view.findViewById(R.id.brightness_chart_layout);
    view.findViewById(R.id.button_close_chart).setOnClickListener(this);
    brightnessChart = (LineChart) view.findViewById(R.id.chart);
    latencyChart = (HistogramChart) view.findViewById(R.id.latency_chart);

    if (getBooleanPreference(getContext(), R.string.preference_auto_increase_brightness, true)) {
        increaseScreenBrightness();
    }
    return view;
}

From source file:org.asnelt.derandom.MainActivity.java

/**
 * Initializes this activity and eventually recovers its state.
 * @param savedInstanceState Bundle with saved state
 *///from   w w w .  j a va2 s .  c  o m
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

    textHistoryInput = (HistoryView) findViewById(R.id.text_history_input);
    textHistoryInput.setHistoryViewListener(this);
    textHistoryPrediction = (HistoryView) findViewById(R.id.text_history_prediction);
    textHistoryPrediction.setHistoryViewListener(this);
    textPrediction = (TextView) findViewById(R.id.text_prediction);
    textInput = (EditText) findViewById(R.id.text_input);
    spinnerInput = (Spinner) findViewById(R.id.spinner_input);
    spinnerGenerator = (Spinner) findViewById(R.id.spinner_generator);
    progressBar = (ProgressBar) findViewById(R.id.progress_bar);

    textInput.setRawInputType(InputType.TYPE_CLASS_NUMBER);
    textHistoryInput.setHorizontallyScrolling(true);
    textHistoryPrediction.setHorizontallyScrolling(true);
    textPrediction.setHorizontallyScrolling(true);
    textHistoryInput.setMovementMethod(new ScrollingMovementMethod());
    textHistoryPrediction.setMovementMethod(new ScrollingMovementMethod());
    textPrediction.setMovementMethod(new ScrollingMovementMethod());

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setIcon(R.drawable.ic_launcher);
    }

    FragmentManager fragmentManager = getSupportFragmentManager();
    processingFragment = (ProcessingFragment) fragmentManager.findFragmentByTag(TAG_PROCESSING_FRAGMENT);
    // Generate new fragment if there is no retained fragment
    if (processingFragment == null) {
        processingFragment = new ProcessingFragment();
        fragmentManager.beginTransaction().add(processingFragment, TAG_PROCESSING_FRAGMENT).commit();
    }
    // Apply predictions length preference
    int predictionLength = getNumberPreference(SettingsActivity.KEY_PREF_PREDICTION_LENGTH);
    processingFragment.setPredictionLength(predictionLength);
    // Apply server port preference
    int serverPort = getNumberPreference(SettingsActivity.KEY_PREF_SOCKET_PORT);
    processingFragment.setServerPort(serverPort);
    // Apply history length preference
    int historyLength = getNumberPreference(SettingsActivity.KEY_PREF_HISTORY_LENGTH);
    textHistoryInput.setCapacity(historyLength);
    textHistoryPrediction.setCapacity(historyLength);
    processingFragment.setCapacity(historyLength);
    // Apply color preference
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    if (sharedPreferences.getBoolean(SettingsActivity.KEY_PREF_COLORED_PAST, true)) {
        textHistoryPrediction.enableColor(null);
    }
    // Apply auto-detect preference
    boolean autoDetect = sharedPreferences.getBoolean(SettingsActivity.KEY_PREF_AUTO_DETECT, true);
    processingFragment.setAutoDetect(autoDetect);

    // Eventually recover state
    if (savedInstanceState != null) {
        Layout layout = textHistoryInput.getLayout();
        if (layout != null) {
            textHistoryInput.scrollTo(0, layout.getHeight());
        }
        layout = textHistoryPrediction.getLayout();
        if (layout != null) {
            textHistoryPrediction.scrollTo(0, layout.getHeight());
        }
        textPrediction.scrollTo(0, 0);
        Uri inputUri = processingFragment.getInputUri();
        if (inputUri != null) {
            disableDirectInput(inputUri);
        }
        if (processingFragment.getInputSelection() == INDEX_SOCKET_INPUT) {
            disableDirectInput(null);
        }
    }

    // Create an ArrayAdapter using the string array and a default spinner layout
    String[] inputNames = new String[3];
    inputNames[INDEX_DIRECT_INPUT] = getResources().getString(R.string.input_direct_name);
    inputNames[INDEX_FILE_INPUT] = getResources().getString(R.string.input_file_name);
    inputNames[INDEX_SOCKET_INPUT] = getResources().getString(R.string.input_socket_name);
    ArrayAdapter<String> spinnerInputAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item,
            inputNames);
    // Specify the layout to use when the list of choices appears
    spinnerInputAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    spinnerInput.setAdapter(spinnerInputAdapter);
    spinnerInput.setOnItemSelectedListener(this);
    if (spinnerInput.getSelectedItemPosition() != processingFragment.getInputSelection()) {
        spinnerInput.setSelection(processingFragment.getInputSelection());
    }

    // Create an ArrayAdapter using the string array and a default spinner layout
    String[] generatorNames = processingFragment.getGeneratorNames();
    ArrayAdapter<String> spinnerGeneratorAdapter = new ArrayAdapter<>(this,
            android.R.layout.simple_spinner_item, generatorNames);
    // Specify the layout to use when the list of choices appears
    spinnerGeneratorAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner
    spinnerGenerator.setAdapter(spinnerGeneratorAdapter);
    spinnerGenerator.setOnItemSelectedListener(this);

    if (processingFragment.isMissingUpdate()) {
        // The activity missed an update while it was reconstructed
        processingFragment.updateAll();
    }
    onProgressUpdate();
}

From source file:pl.poznan.put.cs.ify.app.ui.InitializedRecipeDialog.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.initialized_recipe_dialog, container);
    mInfo = getArguments().getParcelable(YAbstractRecipeService.INFO);
    TextView name = (TextView) v.findViewById(R.id.name);
    name.setText(mInfo.getName());/* w  w w.j  a va  2 s.  co m*/

    TextView feats = (TextView) v.findViewById(R.id.feats);
    String featList = YFeatureList.maskToString(mInfo.getParams().getFeatures());
    feats.setText("Used features: " + featList);

    initParams(v, mInfo.getParams(), inflater);
    mLogs = (TextView) v.findViewById(R.id.logs);

    if ((mInfo.getParams().getFeatures() & Y.Text) == 0) {
        v.findViewById(R.id.send_layout).setVisibility(View.GONE);
    } else {
        send_button = (Button) v.findViewById(R.id.send_button);
        send_edittext = (EditText) v.findViewById(R.id.send_edittext);
        send_button.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View arg0) {
                if (send_edittext != null && send_edittext.getText() != null)
                    sendTextToRecipe(send_edittext.getText().toString());
                else
                    requestLogs();
            }
        });
    }

    mLogs.setMovementMethod(new ScrollingMovementMethod());
    Button disable = (Button) v.findViewById(R.id.disable_button);
    disable.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mCallback != null) {
                Bundle args = getArguments();
                ActiveRecipeInfo info = args.getParcelable(YAbstractRecipeService.INFO);
                int id = info.getId();
                mCallback.onDisableRecipe(id);
            }
            getDialog().cancel();
        }
    });
    requestLogs();
    getDialog().setTitle("Active recipe");
    return v;
}

From source file:ca.ualberta.cmput301w14t08.geochan.fragments.EditFragment.java

/**
 * Overriden method from Fragment. Determines the Comment being edited based on the id
 * contained in fragment arguments as well as the ThreadComment containing said Comment.
 * After the Comment is found the appropriate UI elements and state variables are set.
 *///w  w w.  java2 s .  c o  m
@Override
public void onStart() {
    super.onStart();
    Bundle bundle = getArguments();
    String commentId = bundle.getString("commentId");
    int threadIndex = bundle.getInt("threadIndex");
    boolean fromFavs = bundle.getBoolean("fromFavs");
    if (fromFavs == true) {
        FavouritesLog log = FavouritesLog.getInstance(getActivity());
        thread = log.getThreads().get(threadIndex);
    } else {
        thread = ThreadList.getThreads().get(threadIndex);
    }
    if (thread.getBodyComment().getId().equals(commentId)) {
        editComment = thread.getBodyComment();
        isThread = true;
    } else {
        getCommentFromId(commentId, thread.getBodyComment().getChildren());
        isThread = false;
    }
    if (EditFragment.oldText == null) {
        EditFragment.oldText = editComment.getTextPost();
        TextView oldTextView = (TextView) getActivity().findViewById(R.id.old_comment_text);
        oldTextView.setText(EditFragment.oldText);
    }
    if (EditFragment.oldThumbnail == null && editComment.getImageThumb() != null) {
        EditFragment.oldThumbnail = editComment.getImageThumb();
    }
    newTextPost = (EditText) getActivity().findViewById(R.id.editBody);
    newTextPost.setText(editComment.getTextPost());
    newTextPost.setMovementMethod(new ScrollingMovementMethod());
}

From source file:com.dodo.wbbshoutbox.codebot.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    context = getApplicationContext();/*  ww w. ja va 2s.c o  m*/

    checkUpdate();

    Request.client.setUserAgent("Dodo Shoutboxapp");

    myCookieStore = new PersistentCookieStore(this);
    Request.client.setCookieStore(myCookieStore);

    Usernamefield = (TextView) findViewById(R.id.txtUsername);
    Sendbutton = (Button) findViewById(R.id.cmdSend);
    Refreshbutton = (Button) findViewById(R.id.cmdRefresh);
    pbReadChat = (ProgressBar) findViewById(R.id.pbReadChat);
    lblVerlauf = (TextView) findViewById(R.id.lblVerlauf);
    lblAutoRefresh = (TextView) findViewById(R.id.lblAutorefresh);

    if (UserData.readPref("textsize", this).equals("")) {
        UserData.writePref("textsize", "10", this);
    }
    if (UserData.readPref("refreshcircle", this).equals("")) {
        UserData.writePref("refreshcircle", "1", this);
        refreshanimation = 1;
    } else if (UserData.readPref("refreshcircle", this).equals("1")) {
        refreshanimation = 1;
    }
    /*
     * if(UserData.readPref("changechatdirection", this).equals("")) {
     * UserData.writePref("changechatdirection", "0", this); } else
     * if(UserData.readPref("changechatdirection", this).equals("1")) {
     * changechatdirection = 1; }
     */
    if (UserData.readPref("showtime", this).equals("")) {
        UserData.writePref("showtime", "1", this);
    } else {
        showTime = Integer.valueOf(UserData.readPref("showtime", this));
    }

    if (!UserData.readPref("username", this).equals("")) {
        Usernamefield.setText(UserData.readPref("username", this));
    }

    if (!UserData.readPref("autorefresh", this).equals("")) {
        Button cmdRefresh = (Button) findViewById(R.id.cmdRefresh);
        TextView lblARefresh = (TextView) findViewById(R.id.lblAutorefresh);

        cmdRefresh.setVisibility(Button.INVISIBLE);
        lblARefresh.setVisibility(TextView.VISIBLE);
        Toast.makeText(this, "Automatisches Laden aktiviert!", Toast.LENGTH_SHORT).show();
        autorefresh = 1;
    }

    if (UserData.readPref("ar_intervall", this).equals("")) {
        UserData.writePref("ar_intervall", "30000", this);
    }

    setTextSize();
    setCookies();

    final Button cmdSend = (Button) findViewById(R.id.cmdSend);
    if (requireLogin == 1 && loggedIn == 0) {
        cmdSend.setEnabled(false);
        cmdSend.setText("Zuerst einloggen!");
    }
    cmdSend.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            InputMethodManager inputManager = (InputMethodManager) getSystemService(
                    Context.INPUT_METHOD_SERVICE);
            inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                    InputMethodManager.HIDE_NOT_ALWAYS);

            send();
        }
    });

    final Button cmdRefresh = (Button) findViewById(R.id.cmdRefresh);
    cmdRefresh.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            getRequest(baseUrl + "index.php?page=ShoutboxEntryXMLList");
        }
    });

    final Button cmdMenu = (Button) findViewById(R.id.cmdMenu);
    cmdMenu.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            InputMethodManager inputManager = (InputMethodManager) getSystemService(
                    Context.INPUT_METHOD_SERVICE);
            inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),
                    InputMethodManager.HIDE_NOT_ALWAYS);

            // openOptionsMenu();
            Intent myIntent2 = new Intent(getApplicationContext(), Settings2.class);
            startActivityForResult(myIntent2, 0);
        }
    });

    TextView lblVerlauf = (TextView) findViewById(R.id.lblVerlauf);
    lblVerlauf.setMovementMethod(LinkMovementMethod.getInstance());
    lblVerlauf.setMovementMethod(new ScrollingMovementMethod());

}

From source file:org.chromium.latency.walt.TapLatencyFragment.java

@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();
    }//from ww  w .  j ava2 s.  c  o  m
    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;
}

From source file:com.mk4droid.IMC_Activities.Fragment_Issue_Details.java

/**
 *    OnCreateView/*ww  w. j ava2 s .  co  m*/
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    isVisible = true;

    vfrag_issue_details = inflater.inflate(R.layout.fragment_issue_details, container, false);
    ctx = vfrag_issue_details.getContext();
    resources = setResources();
    mfrag_issue_details = this;

    //========= Image =================
    dbHandler = new DatabaseHandler(ctx);
    imvFull = (ImageView) vfrag_issue_details.findViewById(R.id.imvIssue_Full);

    IssuePic issuepic = dbHandler.getIssuePic(mIssue._id);

    if (issuepic._IssuePicData != null) {
        bmI = My_System_Utils.LowMemBitmapDecoder(issuepic._IssuePicData);
    } else {
        //------- Try to download from internet --------------  
        if (InternetConnCheck.getInstance(ctx).isOnline(ctx) && !mIssue._urlphoto.equals("null")
                && !mIssue._urlphoto.equals("") && mIssue._urlphoto.length() > 0) {

            mIssue._urlphoto = mIssue._urlphoto.replaceFirst("/thumbs", "");
            new ThumbnailTask_IssDetails(mIssue._urlphoto, mIssue._id).execute();
        }
    }

    dbHandler.db.close();

    imvFull.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            dialogZoomIm = null;

            if (FActivity_TabHost.IndexGroup == 0)
                dialogZoomIm = new Dialog(ctx, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
            else if (FActivity_TabHost.IndexGroup == 1)
                dialogZoomIm = new Dialog(FActivity_TabHost.ctx,
                        android.R.style.Theme_Black_NoTitleBar_Fullscreen);

            dialogZoomIm.requestWindowFeature(Window.FEATURE_NO_TITLE);
            dialogZoomIm.setContentView(R.layout.custom_dialog);
            dialogZoomIm.show();
        }
    });

    // ============ Title and id =========
    tv_id = (TextView) vfrag_issue_details.findViewById(R.id.tv_issuenumber);
    TextView tvTitB = (TextView) vfrag_issue_details.findViewById(R.id.tvTitleIssDetB);

    tv_id.setText(Html.fromHtml("<b><big>#</big></b> " + issueId));
    tv_id.setMovementMethod(new ScrollingMovementMethod());

    tvTitB.setText(mIssue._title);

    //=============== Description ======================
    tvDescription = (TextView) vfrag_issue_details.findViewById(R.id.textViewDescription);
    if (!mIssue._description.equals(""))
        tvDescription.setText(mIssue._description);
    else {
        tvDescription.setVisibility(View.GONE);
    }

    // ============== CATEGORY ===============================
    TextView tvCateg = (TextView) vfrag_issue_details.findViewById(R.id.textViewCategContent);

    int iCateg = 0;
    for (int i = 0; i < Service_Data.mCategL.size(); i++)
        if (Service_Data.mCategL.get(i)._id == mIssue._catid) {
            iCateg = i;
            break;
        }

    tvCateg.setText(Service_Data.mCategL.get(iCateg)._name);

    try {
        bmCateg = My_System_Utils.LowMemBitmapDecoder(Service_Data.mCategL.get(iCateg)._icon);
        BitmapDrawable drCateg = new BitmapDrawable(bmCateg);

        tvCateg.setCompoundDrawablesWithIntrinsicBounds(drCateg, null, null, null);
        tvCateg.setCompoundDrawablePadding(10);
        tvCateg.postInvalidate();
    } catch (Exception e) {

    }

    markerOptions = new MarkerOptions().position(new LatLng(mIssue._latitude, mIssue._longitude))
            .title(mIssue._title).icon(BitmapDescriptorFactory.fromBitmap(bmCateg));

    //================  STATUS ================      
    tvStatus_ack = (TextView) vfrag_issue_details.findViewById(R.id.tv_Status_issuedetails_ack);
    tvStatus_cl = (TextView) vfrag_issue_details.findViewById(R.id.tv_Status_issuedetails_cl);

    vStatus_ack = vfrag_issue_details.findViewById(R.id.v_Status_issuedetails_acknow);
    vStatus_cl = vfrag_issue_details.findViewById(R.id.v_Status_issuedetails_cl);

    int CurrStat = mIssue._currentstatus;

    Colora(CurrStat);

    // ============== Time and Author ================
    TextView tvSubmitted = (TextView) vfrag_issue_details.findViewById(R.id.tvSubmitted);

    String TimeStampRep = mIssue._reported.replace("-", "/");

    tvSubmitted.setText(resources.getString(R.string.Submitted) + " "
            + My_Date_Utils.SubtractDate(TimeStampRep, LangSTR) + " " + resources.getString(R.string.ago) + " "
            + resources.getString(R.string.by) + " " + mIssue._username);

    //============== Votes========================
    TextView tvVotes = (TextView) vfrag_issue_details.findViewById(R.id.textViewVotes);
    tvVotes.setText(Integer.toString(mIssue._votes) + " " + resources.getString(R.string.peoplevoted));

    Button btVote = (Button) vfrag_issue_details.findViewById(R.id.buttonVote);
    //-------- Check if state is Ack or Closed then can not vote ----
    if (CurrStat == 2 || CurrStat == 3)
        btVote.setEnabled(false);

    //-------- Check if Has Voted ----------
    DatabaseHandler dbHandler = new DatabaseHandler(ctx);
    HasVotedSW = dbHandler.CheckIfHasVoted(issueId);

    OwnIssue = false;
    if (UserID_STR.length() > 0)
        OwnIssue = dbHandler.checkIfOwnIssue(Integer.toString(issueId), UserID_STR);

    dbHandler.db.close();

    // if has not voted, it is not his issue, and authenticated then able to vote 
    if (!OwnIssue && !HasVotedSW && AuthFlag) {
        btVote.setEnabled(true);
    }

    if (OwnIssue || HasVotedSW) {
        btVote.setEnabled(false);
        btVote.setText(resources.getString(R.string.AlreadyVoted));
    }

    if (!AuthFlag) {
        btVote.setText(resources.getString(R.string.Vote));
    }

    btVote.setOnClickListener(new View.OnClickListener() {
        public void onClick(View arg0) {
            if (InternetConnCheck.getInstance(ctx).isOnline(ctx) && AuthFlag) {
                new AsynchTaskVote().execute();
            } else if (!InternetConnCheck.getInstance(ctx).isOnline(ctx)) {
                Toast.makeText(ctx, resources.getString(R.string.NoInternet), Toast.LENGTH_SHORT).show();
            } else if (!AuthFlag) {
                Toast.makeText(ctx, resources.getString(R.string.OnlyRegistered), Toast.LENGTH_SHORT).show();
            }
        }
    });

    //============ Address - MapStatic - Button Map dynamic ========================
    TextView tvAddr = (TextView) vfrag_issue_details.findViewById(R.id.textViewAddressContent);
    tvAddr.setText(mIssue._address);

    fmap_issdet = SupportMapFragment.newInstance();

    FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
    fragmentTransaction.add(R.id.lliss_det_map, fmap_issdet);
    fragmentTransaction.commit();

    // ============ COMMENTS ===========================
    Button btCommentsSW = (Button) vfrag_issue_details.findViewById(R.id.btCommentsSW);

    btCommentsSW.setText(resources.getString(R.string.ViewComments));

    btCommentsSW.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            if (InternetConnCheck.getInstance(ctx).isOnline(ctx)) {
                FragmentTransaction ft2 = getFragmentManager().beginTransaction();

                Fragment_Comments newfrag_comments = new Fragment_Comments(); // Instantiate a new fragment.
                Bundle args = new Bundle();
                args.putInt("issueId", issueId);
                args.putString("issueTitle", mIssue._title);
                newfrag_comments.setArguments(args); // Add the fragment to the activity, pushing this transaction on to the back stack.

                if (FActivity_TabHost.IndexGroup == 0)
                    ft2.add(R.id.flmain, newfrag_comments, "FTAG_COMMENTS");
                else if (FActivity_TabHost.IndexGroup == 1) {
                    ft2.add(R.id.fl_IssuesList_container, newfrag_comments, "FTAG_COMMENTS");
                }

                ft2.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
                ft2.addToBackStack(null);
                ft2.commit();
            } else {
                Toast.makeText(ctx, resources.getString(R.string.NoInternet), Toast.LENGTH_SHORT).show();
            }
        }
    });

    return vfrag_issue_details;
}

From source file:org.chromium.latency.walt.AutoRunFragment.java

@Override
public void onResume() {
    super.onResume();
    txtLogAutoRun = (TextView) getActivity().findViewById(R.id.txt_log_auto_run);
    txtLogAutoRun.setMovementMethod(new ScrollingMovementMethod());
    txtLogAutoRun.setText(logger.getLogText());
    logger.registerReceiver(logReceiver);
}

From source file:com.google.android.car.kitchensink.radio.RadioTestFragment.java

@Nullable
@Override//from   w ww.  ja  va  2  s. c  o m
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    if (DBG) {
        Log.i(TAG, "onCreateView");
    }

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

    mOpenRadio = (Button) view.findViewById(R.id.button_open_radio);
    mCloseRadio = (Button) view.findViewById(R.id.button_close_radio);
    mGetRadioFocus = (Button) view.findViewById(R.id.button_get_radio_focus);
    mReleaseRadioFocus = (Button) view.findViewById(R.id.button_release_radio_focus);
    mGetFocus = (Button) view.findViewById(R.id.button_get_focus_in_radio);
    mReleaseFocus = (Button) view.findViewById(R.id.button_release_focus_in_radio);
    mRadioNext = (Button) view.findViewById(R.id.button_radio_next);
    mRadioPrev = (Button) view.findViewById(R.id.button_radio_prev);
    mRadioScanCancel = (Button) view.findViewById(R.id.button_radio_scan_cancel);
    mRadioGetProgramInfo = (Button) view.findViewById(R.id.button_radio_get_program_info);
    mRadioTuneToStation = (Button) view.findViewById(R.id.button_radio_tune_to_station);
    mRadioStepUp = (Button) view.findViewById(R.id.button_radio_step_up);
    mRadioStepDown = (Button) view.findViewById(R.id.button_radio_step_down);

    mStationFrequency = (EditText) view.findViewById(R.id.edittext_station_frequency);

    mToggleMuteRadio = (ToggleButton) view.findViewById(R.id.togglebutton_mute_radio);
    mToggleMuteRadio.setChecked(true);
    mRadioBand = (ToggleButton) view.findViewById(R.id.button_band_selection);

    mStationInfo = (TextView) view.findViewById(R.id.radio_station_info);
    mChannelInfo = (TextView) view.findViewById(R.id.radio_channel_info);
    mSongInfo = (TextView) view.findViewById(R.id.radio_song_info);
    mArtistInfo = (TextView) view.findViewById(R.id.radio_artist_info);

    mLog = (TextView) view.findViewById(R.id.radio_log);
    mLog.setMovementMethod(new ScrollingMovementMethod());

    mNaString = getContext().getString(R.string.radio_na);

    addHandlers();
    updateStates();

    return view;
}