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));
}
}
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);
}
}
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;
}
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;
}
});
}
}
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;
}
Aggregations