Search in sources :

Example 56 with ImageView

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

the class PageIndicator method setIndex.

private void setIndex(int index) {
    final int N = getChildCount();
    for (int i = 0; i < N; i++) {
        ImageView v = (ImageView) getChildAt(i);
        // Clear out any animation positioning.
        v.setTranslationX(0);
        v.setImageResource(R.drawable.major_a_b);
        v.setAlpha(getAlpha(i == index));
    }
}
Also used : ImageView(android.widget.ImageView)

Example 57 with ImageView

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

the class ExpandableNotificationRow method setIconAnimationRunningForChild.

private void setIconAnimationRunningForChild(boolean running, View child) {
    if (child != null) {
        ImageView icon = (ImageView) child.findViewById(com.android.internal.R.id.icon);
        setIconRunning(icon, running);
        ImageView rightIcon = (ImageView) child.findViewById(com.android.internal.R.id.right_icon);
        setIconRunning(rightIcon, running);
    }
}
Also used : ImageView(android.widget.ImageView)

Example 58 with ImageView

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

the class SaveFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Context context = inflater.getContext();
    final View view = inflater.inflate(R.layout.fragment_save, container, false);
    final ImageView icon = (ImageView) view.findViewById(android.R.id.icon);
    icon.setImageDrawable(IconUtils.loadMimeIcon(context, getArguments().getString(EXTRA_MIME_TYPE)));
    mDisplayName = (EditText) view.findViewById(android.R.id.title);
    mDisplayName.addTextChangedListener(mDisplayNameWatcher);
    mDisplayName.setText(getArguments().getString(EXTRA_DISPLAY_NAME));
    mDisplayName.setOnKeyListener(new View.OnKeyListener() {

        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            // key.
            if (event.getAction() != KeyEvent.ACTION_DOWN) {
                return false;
            }
            // documents once the textView is empty, we are going to trap it here.
            if (keyCode == KeyEvent.KEYCODE_DEL && TextUtils.isEmpty(mDisplayName.getText())) {
                return true;
            }
            if (keyCode == KeyEvent.KEYCODE_ENTER && mSave.isEnabled()) {
                performSave();
                return true;
            }
            return false;
        }
    });
    mSave = (Button) view.findViewById(android.R.id.button1);
    mSave.setOnClickListener(mSaveListener);
    mSave.setEnabled(false);
    mProgress = (ProgressBar) view.findViewById(android.R.id.progress);
    return view;
}
Also used : Context(android.content.Context) KeyEvent(android.view.KeyEvent) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View)

Example 59 with ImageView

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

the class PrintActivity method bindUi.

private void bindUi() {
    // Summary
    mSummaryContainer = findViewById(R.id.summary_content);
    mSummaryCopies = (TextView) findViewById(R.id.copies_count_summary);
    mSummaryPaperSize = (TextView) findViewById(R.id.paper_size_summary);
    // Options container
    mOptionsContent = (PrintContentView) findViewById(R.id.options_content);
    mOptionsContent.setOptionsStateChangeListener(this);
    mOptionsContent.setOpenOptionsController(this);
    OnItemSelectedListener itemSelectedListener = new MyOnItemSelectedListener();
    OnClickListener clickListener = new MyClickListener();
    // Copies
    mCopiesEditText = (EditText) findViewById(R.id.copies_edittext);
    mCopiesEditText.setOnFocusChangeListener(mSelectAllOnFocusListener);
    mCopiesEditText.setText(MIN_COPIES_STRING);
    mCopiesEditText.setSelection(mCopiesEditText.getText().length());
    mCopiesEditText.addTextChangedListener(new EditTextWatcher());
    // Destination.
    mPrintersObserver = new PrintersObserver();
    mDestinationSpinnerAdapter.registerDataSetObserver(mPrintersObserver);
    mDestinationSpinner = (Spinner) findViewById(R.id.destination_spinner);
    mDestinationSpinner.setAdapter(mDestinationSpinnerAdapter);
    mDestinationSpinner.setOnItemSelectedListener(itemSelectedListener);
    // Media size.
    mMediaSizeSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
    mMediaSizeSpinner = (Spinner) findViewById(R.id.paper_size_spinner);
    mMediaSizeSpinner.setAdapter(mMediaSizeSpinnerAdapter);
    mMediaSizeSpinner.setOnItemSelectedListener(itemSelectedListener);
    // Color mode.
    mColorModeSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
    mColorModeSpinner = (Spinner) findViewById(R.id.color_spinner);
    mColorModeSpinner.setAdapter(mColorModeSpinnerAdapter);
    mColorModeSpinner.setOnItemSelectedListener(itemSelectedListener);
    // Duplex mode.
    mDuplexModeSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
    mDuplexModeSpinner = (Spinner) findViewById(R.id.duplex_spinner);
    mDuplexModeSpinner.setAdapter(mDuplexModeSpinnerAdapter);
    mDuplexModeSpinner.setOnItemSelectedListener(itemSelectedListener);
    // Orientation
    mOrientationSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
    String[] orientationLabels = getResources().getStringArray(R.array.orientation_labels);
    mOrientationSpinnerAdapter.add(new SpinnerItem<>(ORIENTATION_PORTRAIT, orientationLabels[0]));
    mOrientationSpinnerAdapter.add(new SpinnerItem<>(ORIENTATION_LANDSCAPE, orientationLabels[1]));
    mOrientationSpinner = (Spinner) findViewById(R.id.orientation_spinner);
    mOrientationSpinner.setAdapter(mOrientationSpinnerAdapter);
    mOrientationSpinner.setOnItemSelectedListener(itemSelectedListener);
    // Range options
    ArrayAdapter<SpinnerItem<Integer>> rangeOptionsSpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1);
    mRangeOptionsSpinner = (Spinner) findViewById(R.id.range_options_spinner);
    mRangeOptionsSpinner.setAdapter(rangeOptionsSpinnerAdapter);
    mRangeOptionsSpinner.setOnItemSelectedListener(itemSelectedListener);
    updatePageRangeOptions(PrintDocumentInfo.PAGE_COUNT_UNKNOWN);
    // Page range
    mPageRangeTitle = (TextView) findViewById(R.id.page_range_title);
    mPageRangeEditText = (EditText) findViewById(R.id.page_range_edittext);
    mPageRangeEditText.setVisibility(View.INVISIBLE);
    mPageRangeTitle.setVisibility(View.INVISIBLE);
    mPageRangeEditText.setOnFocusChangeListener(mSelectAllOnFocusListener);
    mPageRangeEditText.addTextChangedListener(new RangeTextWatcher());
    // Advanced options button.
    mMoreOptionsButton = (Button) findViewById(R.id.more_options_button);
    mMoreOptionsButton.setOnClickListener(clickListener);
    // Print button
    mPrintButton = (ImageView) findViewById(R.id.print_button);
    mPrintButton.setOnClickListener(clickListener);
    // The UI is now initialized
    mIsOptionsUiBound = true;
    // Special prompt instead of destination spinner for the first time the user printed
    if (!hasUserEverPrinted()) {
        mShowDestinationPrompt = true;
        mSummaryCopies.setEnabled(false);
        mSummaryPaperSize.setEnabled(false);
        mDestinationSpinner.setOnTouchListener(new View.OnTouchListener() {

            @Override
            public boolean onTouch(View v, MotionEvent event) {
                mShowDestinationPrompt = false;
                mSummaryCopies.setEnabled(true);
                mSummaryPaperSize.setEnabled(true);
                updateOptionsUi();
                mDestinationSpinner.setOnTouchListener(null);
                mDestinationSpinnerAdapter.notifyDataSetChanged();
                return false;
            }
        });
    }
}
Also used : ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) PrintContentView(com.android.printspooler.widget.PrintContentView) MotionEvent(android.view.MotionEvent) OnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener) OnClickListener(android.view.View.OnClickListener) ArrayAdapter(android.widget.ArrayAdapter)

Example 60 with ImageView

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

the class SignalTileView method createIcon.

@Override
protected View createIcon() {
    mIconFrame = new FrameLayout(mContext);
    mSignal = new ImageView(mContext);
    mIconFrame.addView(mSignal);
    mOverlay = new ImageView(mContext);
    mIconFrame.addView(mOverlay, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
    return mIconFrame;
}
Also used : FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView)

Aggregations

ImageView (android.widget.ImageView)2257 View (android.view.View)1144 TextView (android.widget.TextView)1005 Intent (android.content.Intent)200 Drawable (android.graphics.drawable.Drawable)197 LinearLayout (android.widget.LinearLayout)192 Bitmap (android.graphics.Bitmap)178 ViewGroup (android.view.ViewGroup)163 LayoutInflater (android.view.LayoutInflater)159 OnClickListener (android.view.View.OnClickListener)145 AdapterView (android.widget.AdapterView)111 ListView (android.widget.ListView)103 RecyclerView (android.support.v7.widget.RecyclerView)102 FrameLayout (android.widget.FrameLayout)97 Button (android.widget.Button)83 Bundle (android.os.Bundle)81 BitmapDrawable (android.graphics.drawable.BitmapDrawable)80 RelativeLayout (android.widget.RelativeLayout)72 Test (org.junit.Test)70 Context (android.content.Context)69