Search in sources :

Example 76 with ScrollView

use of android.widget.ScrollView in project platform_frameworks_base by android.

the class MicroAlertController method setupContent.

@Override
protected void setupContent(ViewGroup contentPanel) {
    // Special case for small screen - the scroll view is higher in hierarchy
    mScrollView = (ScrollView) mWindow.findViewById(R.id.scrollView);
    // Special case for users that only want to display a String
    mMessageView = (TextView) contentPanel.findViewById(R.id.message);
    if (mMessageView == null) {
        return;
    }
    if (mMessage != null) {
        mMessageView.setText(mMessage);
    } else {
        // no message, remove associated views
        mMessageView.setVisibility(View.GONE);
        contentPanel.removeView(mMessageView);
        if (mListView != null) {
            // has ListView, swap scrollView with ListView
            // move topPanel into top of scrollParent
            View topPanel = mScrollView.findViewById(R.id.topPanel);
            ((ViewGroup) topPanel.getParent()).removeView(topPanel);
            FrameLayout.LayoutParams topParams = new FrameLayout.LayoutParams(topPanel.getLayoutParams());
            topParams.gravity = Gravity.TOP;
            topPanel.setLayoutParams(topParams);
            // move buttonPanel into bottom of scrollParent
            View buttonPanel = mScrollView.findViewById(R.id.buttonPanel);
            ((ViewGroup) buttonPanel.getParent()).removeView(buttonPanel);
            FrameLayout.LayoutParams buttonParams = new FrameLayout.LayoutParams(buttonPanel.getLayoutParams());
            buttonParams.gravity = Gravity.BOTTOM;
            buttonPanel.setLayoutParams(buttonParams);
            // remove scrollview
            final ViewGroup scrollParent = (ViewGroup) mScrollView.getParent();
            final int childIndex = scrollParent.indexOfChild(mScrollView);
            scrollParent.removeViewAt(childIndex);
            // add list view
            scrollParent.addView(mListView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
            // add top and button panel
            scrollParent.addView(topPanel);
            scrollParent.addView(buttonPanel);
        } else {
            // no content, just hide everything
            contentPanel.setVisibility(View.GONE);
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View)

Example 77 with ScrollView

use of android.widget.ScrollView in project JamsMusicPlayer by psaravan.

the class EqualizerActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    //Context.
    mContext = getApplicationContext();
    mApp = (Common) mContext.getApplicationContext();
    mFragment = this;
    setTheme();
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_equalizer);
    //Equalizer container elements.
    mScrollView = (ScrollView) findViewById(R.id.equalizerScrollView);
    mScrollView.setBackgroundColor(UIElementsHelper.getBackgroundColor(mContext));
    //50Hz equalizer controls.
    equalizer50HzSeekBar = (VerticalSeekBar) findViewById(R.id.equalizer50Hz);
    text50HzGainTextView = (TextView) findViewById(R.id.text50HzGain);
    text50Hz = (TextView) findViewById(R.id.text50Hz);
    //130Hz equalizer controls.
    equalizer130HzSeekBar = (VerticalSeekBar) findViewById(R.id.equalizer130Hz);
    text130HzGainTextView = (TextView) findViewById(R.id.text130HzGain);
    text130Hz = (TextView) findViewById(R.id.text130Hz);
    //320Hz equalizer controls.
    equalizer320HzSeekBar = (VerticalSeekBar) findViewById(R.id.equalizer320Hz);
    text320HzGainTextView = (TextView) findViewById(R.id.text320HzGain);
    text320Hz = (TextView) findViewById(R.id.text320Hz);
    //800Hz equalizer controls.
    equalizer800HzSeekBar = (VerticalSeekBar) findViewById(R.id.equalizer800Hz);
    text800HzGainTextView = (TextView) findViewById(R.id.text800HzGain);
    text800Hz = (TextView) findViewById(R.id.text800Hz);
    //2kHz equalizer controls.
    equalizer2kHzSeekBar = (VerticalSeekBar) findViewById(R.id.equalizer2kHz);
    text2kHzGainTextView = (TextView) findViewById(R.id.text2kHzGain);
    text2kHz = (TextView) findViewById(R.id.text2kHz);
    //5kHz equalizer controls.
    equalizer5kHzSeekBar = (VerticalSeekBar) findViewById(R.id.equalizer5kHz);
    text5kHzGainTextView = (TextView) findViewById(R.id.text5kHzGain);
    text5kHz = (TextView) findViewById(R.id.text5kHz);
    //12.5kHz equalizer controls.
    equalizer12_5kHzSeekBar = (VerticalSeekBar) findViewById(R.id.equalizer12_5kHz);
    text12_5kHzGainTextView = (TextView) findViewById(R.id.text12_5kHzGain);
    text12_5kHz = (TextView) findViewById(R.id.text12_5kHz);
    //Equalizer preset controls.
    loadPresetButton = (RelativeLayout) findViewById(R.id.loadPresetButton);
    saveAsPresetButton = (RelativeLayout) findViewById(R.id.saveAsPresetButton);
    resetAllButton = (RelativeLayout) findViewById(R.id.resetAllButton);
    loadPresetText = (TextView) findViewById(R.id.load_preset_text);
    savePresetText = (TextView) findViewById(R.id.save_as_preset_text);
    resetAllText = (TextView) findViewById(R.id.reset_all_text);
    //Audio FX elements.
    virtualizerSeekBar = (SeekBar) findViewById(R.id.virtualizer_seekbar);
    bassBoostSeekBar = (SeekBar) findViewById(R.id.bass_boost_seekbar);
    reverbSpinner = (Spinner) findViewById(R.id.reverb_spinner);
    virtualizerTitle = (TextView) findViewById(R.id.virtualizer_title_text);
    bassBoostTitle = (TextView) findViewById(R.id.bass_boost_title_text);
    reverbTitle = (TextView) findViewById(R.id.reverb_title_text);
    text50HzGainTextView.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text130HzGainTextView.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text320HzGainTextView.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text800HzGainTextView.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text2kHzGainTextView.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text5kHzGainTextView.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text12_5kHzGainTextView.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text50Hz.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text130Hz.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text320Hz.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text800Hz.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text2kHz.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text5kHz.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    text12_5kHz.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    loadPresetText.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Bold"));
    savePresetText.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Bold"));
    resetAllText.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Bold"));
    text50HzGainTextView.setPaintFlags(text50HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text130HzGainTextView.setPaintFlags(text130HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text320HzGainTextView.setPaintFlags(text320HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text800HzGainTextView.setPaintFlags(text130HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text2kHzGainTextView.setPaintFlags(text320HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text5kHzGainTextView.setPaintFlags(text130HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text12_5kHzGainTextView.setPaintFlags(text320HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text50Hz.setPaintFlags(text50Hz.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text130Hz.setPaintFlags(text130Hz.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text320Hz.setPaintFlags(text320Hz.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text800Hz.setPaintFlags(text800Hz.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text2kHz.setPaintFlags(text2kHz.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text5kHz.setPaintFlags(text5kHz.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text12_5kHz.setPaintFlags(text12_5kHz.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    loadPresetText.setPaintFlags(text50HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    savePresetText.setPaintFlags(text50HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    resetAllText.setPaintFlags(text50HzGainTextView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
    text50HzGainTextView.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text130HzGainTextView.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text320HzGainTextView.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text800HzGainTextView.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text2kHzGainTextView.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text5kHzGainTextView.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text12_5kHzGainTextView.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text50Hz.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text130Hz.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text320Hz.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text800Hz.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text2kHz.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text5kHz.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    text12_5kHz.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    //Init reverb presets.
    ArrayList<String> reverbPresets = new ArrayList<String>();
    reverbPresets.add("None");
    reverbPresets.add("Large Hall");
    reverbPresets.add("Large Room");
    reverbPresets.add("Medium Hall");
    reverbPresets.add("Medium Room");
    reverbPresets.add("Small Room");
    reverbPresets.add("Plate");
    ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reverbPresets);
    dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    reverbSpinner.setAdapter(dataAdapter);
    //Set the max values for the seekbars.
    virtualizerSeekBar.setMax(1000);
    bassBoostSeekBar.setMax(1000);
    virtualizerTitle.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    virtualizerTitle.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    virtualizerTitle.setPaintFlags(virtualizerTitle.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG);
    bassBoostTitle.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    bassBoostTitle.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    bassBoostTitle.setPaintFlags(bassBoostTitle.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG);
    reverbTitle.setTypeface(TypefaceHelper.getTypeface(mContext, "RobotoCondensed-Regular"));
    reverbTitle.setTextColor(UIElementsHelper.getSmallTextColor(mContext));
    reverbTitle.setPaintFlags(reverbTitle.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG);
    resetAllButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            //Reset all sliders to 0.
            equalizer50HzSeekBar.setProgressAndThumb(16);
            equalizer130HzSeekBar.setProgressAndThumb(16);
            equalizer320HzSeekBar.setProgressAndThumb(16);
            equalizer800HzSeekBar.setProgressAndThumb(16);
            equalizer2kHzSeekBar.setProgressAndThumb(16);
            equalizer5kHzSeekBar.setProgressAndThumb(16);
            equalizer12_5kHzSeekBar.setProgressAndThumb(16);
            virtualizerSeekBar.setProgress(0);
            bassBoostSeekBar.setProgress(0);
            reverbSpinner.setSelection(0, false);
            //Apply the new setings to the service.
            applyCurrentEQSettings();
            //Show a confirmation toast.
            Toast.makeText(mContext, R.string.eq_reset, Toast.LENGTH_SHORT).show();
        }
    });
    loadPresetButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            buildLoadPresetDialog().show();
        }
    });
    saveAsPresetButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            buildSavePresetDialog().show();
        }
    });
    equalizer50HzSeekBar.setOnSeekBarChangeListener(equalizer50HzListener);
    equalizer130HzSeekBar.setOnSeekBarChangeListener(equalizer130HzListener);
    equalizer320HzSeekBar.setOnSeekBarChangeListener(equalizer320HzListener);
    equalizer800HzSeekBar.setOnSeekBarChangeListener(equalizer800HzListener);
    equalizer2kHzSeekBar.setOnSeekBarChangeListener(equalizer2kHzListener);
    equalizer5kHzSeekBar.setOnSeekBarChangeListener(equalizer5kHzListener);
    equalizer12_5kHzSeekBar.setOnSeekBarChangeListener(equalizer12_5kHzListener);
    virtualizerSeekBar.setOnSeekBarChangeListener(virtualizerListener);
    bassBoostSeekBar.setOnSeekBarChangeListener(bassBoostListener);
    reverbSpinner.setOnItemSelectedListener(reverbListener);
    //Get the saved equalizer settings and apply them to the UI elements.
    new AsyncInitSlidersTask().execute();
}
Also used : ArrayList(java.util.ArrayList) OnClickListener(android.view.View.OnClickListener) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) ArrayAdapter(android.widget.ArrayAdapter)

Example 78 with ScrollView

use of android.widget.ScrollView in project frostwire by frostwire.

the class BuyActivity method scrollToSelectedCard.

private void scrollToSelectedCard() {
    ScrollView scrollView = findView(R.id.activity_buy_scrollview);
    LinearLayout linearLayout = (LinearLayout) scrollView.getChildAt(0);
    int index = linearLayout.indexOfChild(selectedProductCard);
    int cardHeight = selectedProductCard.getHeight() + selectedProductCard.getPaddingTop();
    scrollView.scrollTo(0, index * cardHeight);
}
Also used : ScrollView(android.widget.ScrollView) LinearLayout(android.widget.LinearLayout)

Example 79 with ScrollView

use of android.widget.ScrollView in project AndroidUtilLib by SiberiaDante.

the class SDBottomItemDialog method builder.

public SDBottomItemDialog builder() {
    View view = LayoutInflater.from(context).inflate(R.layout.dialog_bottom_item_layout, null);
    view.setMinimumWidth(display.getWidth());
    sLayout_content = (ScrollView) view.findViewById(R.id.bottom_item_dialog_scroll_view);
    lLayout_content = (LinearLayout) view.findViewById(R.id.bottom_item_dialog_content_ll);
    txt_title = (TextView) view.findViewById(R.id.tv_bottom_item_dialog_title);
    view_line = view.findViewById(R.id.bottom_item_dialog_view_line);
    txt_cancel = (TextView) view.findViewById(R.id.tv_bottom_item_dialog_cancel);
    txt_cancel.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            dialog.dismiss();
        }
    });
    dialog = new Dialog(context, R.style.ActionGeneralDialog);
    dialog.setContentView(view);
    Window dialogWindow = dialog.getWindow();
    dialogWindow.setGravity(Gravity.START | Gravity.BOTTOM);
    WindowManager.LayoutParams lp = dialogWindow.getAttributes();
    lp.x = 0;
    lp.y = 0;
    dialogWindow.setAttributes(lp);
    return this;
}
Also used : Window(android.view.Window) Dialog(android.app.Dialog) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) WindowManager(android.view.WindowManager)

Example 80 with ScrollView

use of android.widget.ScrollView in project collect by opendatakit.

the class ColorPickerDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    OnColorChangedListener l = new OnColorChangedListener() {

        public void colorChanged(String key, int color) {
            listener.colorChanged(ColorPickerDialog.this.key, color);
            dismiss();
        }
    };
    /*BIDIRECTIONAL SCROLLVIEW*/
    ScrollView sv = new ScrollView(this.getContext());
    WScrollView hsv = new WScrollView(this.getContext());
    hsv.sv = sv;
    /*END OF BIDIRECTIONAL SCROLLVIEW*/
    sv.addView(new ColorPickerView(getContext(), l, initialColor, defaultColor), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    hsv.addView(sv, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
    setContentView(hsv, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    setCanceledOnTouchOutside(true);
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) HorizontalScrollView(android.widget.HorizontalScrollView) ScrollView(android.widget.ScrollView)

Aggregations

ScrollView (android.widget.ScrollView)363 View (android.view.View)173 TextView (android.widget.TextView)149 LinearLayout (android.widget.LinearLayout)93 ImageView (android.widget.ImageView)65 ViewGroup (android.view.ViewGroup)53 Button (android.widget.Button)36 EditText (android.widget.EditText)36 ListView (android.widget.ListView)29 RecyclerView (android.support.v7.widget.RecyclerView)25 Intent (android.content.Intent)24 AbsListView (android.widget.AbsListView)24 AdapterView (android.widget.AdapterView)24 GridLayout (android.widget.GridLayout)24 ArrayList (java.util.ArrayList)21 SuppressLint (android.annotation.SuppressLint)20 WebView (android.webkit.WebView)19 FrameLayout (android.widget.FrameLayout)19 Dialog (android.app.Dialog)17 DialogInterface (android.content.DialogInterface)16