Search in sources :

Example 61 with ImageView

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

the class SignalTileView method addTrafficView.

private ImageView addTrafficView(int icon) {
    final ImageView traffic = new ImageView(mContext);
    traffic.setImageResource(icon);
    traffic.setAlpha(0f);
    addView(traffic);
    return traffic;
}
Also used : ImageView(android.widget.ImageView)

Example 62 with ImageView

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

the class QSIconView method createIcon.

protected View createIcon() {
    final ImageView icon = new ImageView(mContext);
    icon.setId(android.R.id.icon);
    icon.setScaleType(ScaleType.FIT_CENTER);
    return icon;
}
Also used : ImageView(android.widget.ImageView)

Example 63 with ImageView

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

the class QSTileView method createLabel.

protected void createLabel() {
    View view = LayoutInflater.from(mContext).inflate(R.layout.qs_tile_label, null);
    mLabel = (TextView) view.findViewById(R.id.tile_label);
    mPadLock = (ImageView) view.findViewById(R.id.restricted_padlock);
    addView(view);
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 64 with ImageView

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

the class NotificationHeaderViewWrapper method updateCropToPaddingForImageViews.

/**
     * Since we are deactivating the clipping when transforming the ImageViews don't get clipped
     * anymore during these transitions. We can avoid that by using
     * {@link ImageView#setCropToPadding(boolean)} on all ImageViews.
     */
private void updateCropToPaddingForImageViews() {
    Stack<View> stack = new Stack<>();
    stack.push(mView);
    while (!stack.isEmpty()) {
        View child = stack.pop();
        if (child instanceof ImageView) {
            ((ImageView) child).setCropToPadding(true);
        } else if (child instanceof ViewGroup) {
            ViewGroup group = (ViewGroup) child;
            for (int i = 0; i < group.getChildCount(); i++) {
                stack.push(group.getChildAt(i));
            }
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TransformableView(com.android.systemui.statusbar.TransformableView) NotificationPanelView(com.android.systemui.statusbar.phone.NotificationPanelView) View(android.view.View) NotificationHeaderView(android.view.NotificationHeaderView) Stack(java.util.Stack)

Example 65 with ImageView

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

the class ZenModePanel method bind.

private void bind(final Condition condition, final View row, final int rowId) {
    if (condition == null)
        throw new IllegalArgumentException("condition must not be null");
    final boolean enabled = condition.state == Condition.STATE_TRUE;
    final ConditionTag tag = row.getTag() != null ? (ConditionTag) row.getTag() : new ConditionTag();
    row.setTag(tag);
    final boolean first = tag.rb == null;
    if (tag.rb == null) {
        tag.rb = (RadioButton) mZenRadioGroup.getChildAt(rowId);
    }
    tag.condition = condition;
    final Uri conditionId = getConditionId(tag.condition);
    if (DEBUG)
        Log.d(mTag, "bind i=" + mZenRadioGroupContent.indexOfChild(row) + " first=" + first + " condition=" + conditionId);
    tag.rb.setEnabled(enabled);
    tag.rb.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (mExpanded && isChecked) {
                tag.rb.setChecked(true);
                if (DEBUG)
                    Log.d(mTag, "onCheckedChanged " + conditionId);
                MetricsLogger.action(mContext, MetricsEvent.QS_DND_CONDITION_SELECT);
                select(tag.condition);
                announceConditionSelection(tag);
            }
        }
    });
    if (tag.lines == null) {
        tag.lines = row.findViewById(android.R.id.content);
    }
    if (tag.line1 == null) {
        tag.line1 = (TextView) row.findViewById(android.R.id.text1);
        mSpTexts.add(tag.line1);
    }
    if (tag.line2 == null) {
        tag.line2 = (TextView) row.findViewById(android.R.id.text2);
        mSpTexts.add(tag.line2);
    }
    final String line1 = !TextUtils.isEmpty(condition.line1) ? condition.line1 : condition.summary;
    final String line2 = condition.line2;
    tag.line1.setText(line1);
    if (TextUtils.isEmpty(line2)) {
        tag.line2.setVisibility(GONE);
    } else {
        tag.line2.setVisibility(VISIBLE);
        tag.line2.setText(line2);
    }
    tag.lines.setEnabled(enabled);
    tag.lines.setAlpha(enabled ? 1 : .4f);
    final ImageView button1 = (ImageView) row.findViewById(android.R.id.button1);
    button1.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            onClickTimeButton(row, tag, false, /*down*/
            rowId);
        }
    });
    final ImageView button2 = (ImageView) row.findViewById(android.R.id.button2);
    button2.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            onClickTimeButton(row, tag, true, /*up*/
            rowId);
        }
    });
    tag.lines.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            tag.rb.setChecked(true);
        }
    });
    final long time = ZenModeConfig.tryParseCountdownConditionId(conditionId);
    if (rowId != COUNTDOWN_ALARM_CONDITION_INDEX && time > 0) {
        button1.setVisibility(VISIBLE);
        button2.setVisibility(VISIBLE);
        if (mBucketIndex > -1) {
            button1.setEnabled(mBucketIndex > 0);
            button2.setEnabled(mBucketIndex < MINUTE_BUCKETS.length - 1);
        } else {
            final long span = time - System.currentTimeMillis();
            button1.setEnabled(span > MIN_BUCKET_MINUTES * MINUTES_MS);
            final Condition maxCondition = ZenModeConfig.toTimeCondition(mContext, MAX_BUCKET_MINUTES, ActivityManager.getCurrentUser());
            button2.setEnabled(!Objects.equals(condition.summary, maxCondition.summary));
        }
        button1.setAlpha(button1.isEnabled() ? 1f : .5f);
        button2.setAlpha(button2.isEnabled() ? 1f : .5f);
    } else {
        button1.setVisibility(GONE);
        button2.setVisibility(GONE);
    }
    // wire up interaction callbacks for newly-added condition rows
    if (first) {
        Interaction.register(tag.rb, mInteractionCallback);
        Interaction.register(tag.lines, mInteractionCallback);
        Interaction.register(button1, mInteractionCallback);
        Interaction.register(button2, mInteractionCallback);
    }
    row.setVisibility(VISIBLE);
}
Also used : Condition(android.service.notification.Condition) OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) Uri(android.net.Uri) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) ImageView(android.widget.ImageView) CompoundButton(android.widget.CompoundButton)

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