org.telegram.messenger.AndroidUtilities源码实例Demo

android.widget.Magnifier#org.telegram.messenger.AndroidUtilities源码实例Demo

下面列出了android.widget.Magnifier#org.telegram.messenger.AndroidUtilities 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: TelePlus-Android   文件: FeaturedSettings.java
private TabSettings()
{
    super(TabSettings.class.getName());
    tabsToBottom = getBool(TabsToBottom, false);
    hideTabs = getBool(HideTabs, false);
    hideALl = getBool(HideAll, false);
    hideUsers = getBool(HideUsers, false);
    hideGroups = getBool(HideGroups, false);
    hideSuperGroups = getBool(HideSuperGroups, false);
    hideChannels = getBool(HideChannels, false);
    hideBots = getBool(HideBots, false);
    hideFavorites = getBool(HideFavorites, false);
    hideAdmins = getBool(HideAdmins, true);
    hideUnreads = getBool(HideUnreads, true);
    hideTabsCounters = getBool(HideTabsCounters, false);
    tabsCountersCountNotMuted = getBool(TabsCountersCountNotMuted, true);
    tabsCountersCountChats = getBool(TabsCountersCountChats, false);
    limitTabsCounters = getBool(LimitTabsCounters, false);
    tabsShouldExpand = getBool(TabsShouldExpand, true);
    chatsTabCounterSize = getInt(ChatsTabCounterSize, AndroidUtilities.isTablet() ? 13 : 11);
    tabsTextSize = getInt(TabsTextSize, 14);
    tabsHeight = getInt(TabsHeight, 40);
    disableTabsScrolling = getBool(DisableTabsScrolling, false);
    actionBarCastShadows = storage.getBoolean(ActionBarCastShadowsKey, true);
    currentTab = getInt(CurrentTab, 0);
}
 
private void fixLayoutInternal()
{
    if (getParentActivity() == null)
    {
        return;
    }

    WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE);
    int rotation = manager.getDefaultDisplay().getRotation();
    columnsCount = 2;
    if (!AndroidUtilities.isTablet() && (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90))
    {
        columnsCount = 4;
    }
    listAdapter.notifyDataSetChanged();
}
 
源代码3 项目: Telegram   文件: ChatEditActivity.java
@Override
public void didUploadPhoto(final TLRPC.InputFile file, final TLRPC.PhotoSize bigSize, final TLRPC.PhotoSize smallSize) {
    AndroidUtilities.runOnUIThread(() -> {
        if (file != null) {
            uploadedAvatar = file;
            if (createAfterUpload) {
                try {
                    if (progressDialog != null && progressDialog.isShowing()) {
                        progressDialog.dismiss();
                        progressDialog = null;
                    }
                } catch (Exception e) {
                    FileLog.e(e);
                }
                donePressed = false;
                doneButton.performClick();
            }
            showAvatarProgress(false, true);
        } else {
            avatar = smallSize.location;
            avatarBig = bigSize.location;
            avatarImage.setImage(ImageLocation.getForLocal(avatar), "50_50", avatarDrawable, currentChat);
            showAvatarProgress(true, false);
        }
    });
}
 
源代码4 项目: Telegram   文件: StickersSearchAdapter.java
public void search(String text) {
    if (reqId != 0) {
        ConnectionsManager.getInstance(currentAccount).cancelRequest(reqId, true);
        reqId = 0;
    }
    if (reqId2 != 0) {
        ConnectionsManager.getInstance(currentAccount).cancelRequest(reqId2, true);
        reqId2 = 0;
    }
    if (TextUtils.isEmpty(text)) {
        searchQuery = null;
        localPacks.clear();
        emojiStickers.clear();
        serverPacks.clear();
        delegate.setAdapterVisible(false);
        notifyDataSetChanged();
    } else {
        searchQuery = text.toLowerCase();
    }
    AndroidUtilities.cancelRunOnUIThread(searchRunnable);
    AndroidUtilities.runOnUIThread(searchRunnable, 300);
}
 
源代码5 项目: Telegram-FOSS   文件: LocationActivity.java
private void openShareLiveLocation() {
    if (delegate == null || getParentActivity() == null || myLocation == null) {
        return;
    }
    TLRPC.User user = null;
    if ((int) dialogId > 0) {
        user = getMessagesController().getUser((int) dialogId);
    }
    showDialog(AlertsCreator.createLocationUpdateDialog(getParentActivity(), user, param -> {
        TLRPC.TL_messageMediaGeoLive location = new TLRPC.TL_messageMediaGeoLive();
        location.geo = new TLRPC.TL_geoPoint();
        location.geo.lat = AndroidUtilities.fixLocationCoord(myLocation.getLatitude());
        location.geo._long = AndroidUtilities.fixLocationCoord(myLocation.getLongitude());
        location.period = param;
        delegate.didSelectLocation(location, locationType, true, 0);
        finishFragment();
    }));
}
 
源代码6 项目: Telegram-FOSS   文件: ContextProgressView.java
public ContextProgressView(Context context, int colorType) {
    super(context);
    innerPaint.setStyle(Paint.Style.STROKE);
    innerPaint.setStrokeWidth(AndroidUtilities.dp(2));
    outerPaint.setStyle(Paint.Style.STROKE);
    outerPaint.setStrokeWidth(AndroidUtilities.dp(2));
    outerPaint.setStrokeCap(Paint.Cap.ROUND);
    if (colorType == 0) {
        innerKey = Theme.key_contextProgressInner1;
        outerKey = Theme.key_contextProgressOuter1;
    } else if (colorType == 1) {
        innerKey = Theme.key_contextProgressInner2;
        outerKey = Theme.key_contextProgressOuter2;
    } else if (colorType == 2) {
        innerKey = Theme.key_contextProgressInner3;
        outerKey = Theme.key_contextProgressOuter3;
    } else if (colorType == 3) {
        innerKey = Theme.key_contextProgressInner4;
        outerKey = Theme.key_contextProgressOuter4;
    }
    updateColors();
}
 
源代码7 项目: Telegram   文件: ProgressButton.java
public ProgressButton(Context context) {
    super(context);
    setAllCaps(false);
    setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
    setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        setOutlineProvider(null);
    }

    ViewHelper.setPadding(this, 8, 0, 8, 0);
    final int minWidth = AndroidUtilities.dp(60);
    setMinWidth(minWidth);
    setMinimumWidth(minWidth);

    progressRect = new RectF();
    progressPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    progressPaint.setStrokeCap(Paint.Cap.ROUND);
    progressPaint.setStyle(Paint.Style.STROKE);
    progressPaint.setStrokeWidth(AndroidUtilities.dp(2));
}
 
源代码8 项目: Telegram-FOSS   文件: ReorderingHintDrawable.java
private void drawStage2(Canvas canvas, float progress) {
    final Rect bounds = getBounds();

    progress = interpolator.getInterpolation(progress);

    tempRect.left = (int) (AndroidUtilities.dp(2) * scaleX);
    tempRect.bottom = bounds.bottom - ((int) (AndroidUtilities.dp(6) * scaleY));
    tempRect.right = bounds.right - tempRect.left;
    tempRect.top = tempRect.bottom - ((int) (AndroidUtilities.dp(4) * scaleY));
    tempRect.offset(0, AndroidUtilities.dp(AndroidUtilities.lerp(0, -8, progress)));
    secondaryRectDrawable.setBounds(tempRect);
    secondaryRectDrawable.draw(canvas);

    tempRect.left = (int) (AndroidUtilities.dpf2(AndroidUtilities.lerp(1, 2, progress)) * scaleX);
    tempRect.top = (int) (AndroidUtilities.dpf2(AndroidUtilities.lerp(5, 6, progress)) * scaleY);
    tempRect.right = bounds.right - tempRect.left;
    tempRect.bottom = tempRect.top + (int) (AndroidUtilities.dpf2(AndroidUtilities.lerp(6, 4, progress)) * scaleY);
    tempRect.offset(0, AndroidUtilities.dp(AndroidUtilities.lerp(0, 8, progress)));
    primaryRectDrawable.setBounds(tempRect);
    primaryRectDrawable.setAlpha(255);
    primaryRectDrawable.draw(canvas);
}
 
源代码9 项目: TelePlus-Android   文件: ShareDialogCell.java
public ShareDialogCell(Context context) {
    super(context);

    imageView = new BackupImageView(context);
    imageView.setRoundRadius(AndroidUtilities.dp(27));
    addView(imageView, LayoutHelper.createFrame(54, 54, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 7, 0, 0));

    nameTextView = new TextView(context);
    nameTextView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
    nameTextView.setMaxLines(2);
    nameTextView.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
    nameTextView.setLines(2);
    nameTextView.setEllipsize(TextUtils.TruncateAt.END);
    addView(nameTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 6, 64, 6, 0));

    checkBox = new CheckBox(context, R.drawable.round_check2);
    checkBox.setSize(24);
    checkBox.setCheckOffset(AndroidUtilities.dp(1));
    checkBox.setVisibility(VISIBLE);
    checkBox.setColor(Theme.getColor(Theme.key_dialogRoundCheckBox), Theme.getColor(Theme.key_dialogRoundCheckBoxCheck));
    addView(checkBox, LayoutHelper.createFrame(24, 24, Gravity.CENTER_HORIZONTAL | Gravity.TOP, 17, 39, 0, 0));
}
 
源代码10 项目: Telegram-FOSS   文件: TextPriceCell.java
public TextPriceCell(Context context) {
    super(context);

    setWillNotDraw(false);

    textView = new TextView(context);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    textView.setLines(1);
    textView.setMaxLines(1);
    textView.setSingleLine(true);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
    addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, 21, 0, 21, 0));

    valueTextView = new TextView(context);
    valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    valueTextView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    valueTextView.setLines(1);
    valueTextView.setMaxLines(1);
    valueTextView.setSingleLine(true);
    valueTextView.setEllipsize(TextUtils.TruncateAt.END);
    valueTextView.setGravity((LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL);
    addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.TOP, 21, 0, 21, 0));
}
 
源代码11 项目: TelePlus-Android   文件: StickerCell.java
public void setSticker(TLRPC.Document document, int side) {
    if (document != null && document.thumb != null) {
        imageView.setImage(document.thumb.location, null, "webp", null);
    }
    sticker = document;
    if (side == -1) {
        setBackgroundResource(R.drawable.stickers_back_left);
        setPadding(AndroidUtilities.dp(7), 0, 0, 0);
    } else if (side == 0) {
        setBackgroundResource(R.drawable.stickers_back_center);
        setPadding(0, 0, 0, 0);
    } else if (side == 1) {
        setBackgroundResource(R.drawable.stickers_back_right);
        setPadding(0, 0, AndroidUtilities.dp(7), 0);
    } else if (side == 2) {
        setBackgroundResource(R.drawable.stickers_back_all);
        setPadding(AndroidUtilities.dp(3), 0, AndroidUtilities.dp(3), 0);
    }
    Drawable background = getBackground();
    if (background != null) {
        background.setAlpha(230);
        background.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_stickersHintPanel), PorterDuff.Mode.MULTIPLY));
    }
}
 
源代码12 项目: Telegram   文件: StickerMasksAlert.java
public void search(String text) {
    if (reqId2 != 0) {
        ConnectionsManager.getInstance(currentAccount).cancelRequest(reqId2, true);
        reqId2 = 0;
    }
    if (TextUtils.isEmpty(text)) {
        searchQuery = null;
        localPacks.clear();
        emojiStickers.clear();
        if (gridView.getAdapter() != stickersGridAdapter) {
            gridView.setAdapter(stickersGridAdapter);
        }
        notifyDataSetChanged();
    } else {
        searchQuery = text.toLowerCase();
    }
    AndroidUtilities.cancelRunOnUIThread(searchRunnable);
    AndroidUtilities.runOnUIThread(searchRunnable, 300);
}
 
源代码13 项目: TelePlus-Android   文件: EmbedBottomSheet.java
@JavascriptInterface
public void postEvent(final String eventName, final String eventData) {
    AndroidUtilities.runOnUIThread(new Runnable() {
        @Override
        public void run() {
            switch (eventName) {
                case "loaded":
                    progressBar.setVisibility(View.INVISIBLE);
                    progressBarBlackBackground.setVisibility(View.INVISIBLE);
                    pipButton.setEnabled(true);
                    pipButton.setAlpha(1.0f);
                    showOrHideYoutubeLogo(false);
                    break;
            }
        }
    });
}
 
源代码14 项目: TelePlus-Android   文件: ActionBarLayout.java
public void removeFragmentFromStack(BaseFragment fragment)
{
    if (useAlphaAnimations && fragmentsStack.size() == 1 && AndroidUtilities.isTablet())
    {
        closeLastFragment(true);
    }
    else
    {
        removeFragmentFromStackInternal(fragment);
    }
}
 
源代码15 项目: TelePlus-Android   文件: ConnectionsManager.java
public static void onLogout(final int currentAccount)
{
    AndroidUtilities.runOnUIThread(() ->
    {
        if (UserConfig.getInstance(currentAccount).getClientUserId() != 0)
        {
            UserConfig.getInstance(currentAccount).clearConfig();
            MessagesController.getInstance(currentAccount).performLogout(0);
        }
    });
}
 
源代码16 项目: Telegram   文件: PullForegroundDrawable.java
public PullForegroundDrawable(String pullText, String releaseText) {
    tooltipTextPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    tooltipTextPaint.setTextAlign(Paint.Align.CENTER);
    tooltipTextPaint.setTextSize(AndroidUtilities.dp(16));

    final ViewConfiguration vc = ViewConfiguration.get(ApplicationLoader.applicationContext);
    touchSlop = vc.getScaledTouchSlop();

    pullTooltip = pullText;
    releaseTooltip = releaseText;
}
 
源代码17 项目: Telegram   文件: FloatingToolbar.java
private ImageButton createOverflowButton() {
    final ImageButton overflowButton = new ImageButton(mContext);
    overflowButton.setLayoutParams(new ViewGroup.LayoutParams(AndroidUtilities.dp(56), AndroidUtilities.dp(48)));
    overflowButton.setPaddingRelative(AndroidUtilities.dp(16), AndroidUtilities.dp(12), AndroidUtilities.dp(16), AndroidUtilities.dp(12));
    overflowButton.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    overflowButton.setImageDrawable(mOverflow);
    int color;
    if (currentStyle == STYLE_DIALOG) {
        color = Theme.getColor(Theme.key_dialogTextBlack);
        overflowButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_listSelector), 1));
    } else if (currentStyle == STYLE_BLACK) {
        color = 0xfffafafa;
        overflowButton.setBackgroundDrawable(Theme.createSelectorDrawable(0x40ffffff, 1));
    } else {
        color = Theme.getColor(Theme.key_windowBackgroundWhiteBlackText);
        overflowButton.setBackgroundDrawable(Theme.createSelectorDrawable(Theme.getColor(Theme.key_listSelector), 1));
    }
    mOverflow.setTint(color);
    mArrow.setTint(color);
    mToArrow.setTint(color);
    mToOverflow.setTint(color);
    overflowButton.setOnClickListener(v -> {
        if (mIsOverflowOpen) {
            overflowButton.setImageDrawable(mToOverflow);
            mToOverflow.start();
            closeOverflow();
        } else {
            overflowButton.setImageDrawable(mToArrow);
            mToArrow.start();
            openOverflow();
        }
    });
    return overflowButton;
}
 
源代码18 项目: TelePlus-Android   文件: EmojiView.java
public int getTabForPosition(int position) {
    if (position == 0) {
        position = 1;
    }
    if (stickersPerRow == 0) {
        int width = getMeasuredWidth();
        if (width == 0) {
            width = AndroidUtilities.displaySize.x;
        }
        stickersPerRow = width / AndroidUtilities.dp(72);
    }
    int row = positionToRow.get(position, Integer.MIN_VALUE);
    if (row == Integer.MIN_VALUE) {
        return stickerSets.size() - 1 + stickersTabOffset;
    }
    Object pack = rowStartPack.get(row);
    if (pack instanceof String) {
        if ("recent".equals(pack)) {
            return recentTabBum;
        } else {
            return favTabBum;
        }
    } else {
        TLRPC.TL_messages_stickerSet set = (TLRPC.TL_messages_stickerSet) pack;
        int idx = stickerSets.indexOf(set);
        return idx + stickersTabOffset;
    }
}
 
源代码19 项目: TelePlus-Android   文件: VoIPService.java
public void onUIForegroundStateChanged(boolean isForeground) {
	if (currentState == STATE_WAITING_INCOMING) {
		if (isForeground) {
			stopForeground(true);
		} else {
			if (!((KeyguardManager) getSystemService(KEYGUARD_SERVICE)).inKeyguardRestrictedInputMode()) {
				if(NotificationManagerCompat.from(this).areNotificationsEnabled())
					showIncomingNotification(ContactsController.formatName(user.first_name, user.last_name), null, user, null, 0, VoIPActivity.class);
				else
					declineIncomingCall(DISCARD_REASON_LINE_BUSY, null);
			} else {
				AndroidUtilities.runOnUIThread(new Runnable() {
					@Override
					public void run() {
						Intent intent = new Intent(VoIPService.this, VoIPActivity.class);
						intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
						try {
							PendingIntent.getActivity(VoIPService.this, 0, intent, 0).send();
						} catch (PendingIntent.CanceledException e) {
                               if (BuildVars.LOGS_ENABLED) {
                                   FileLog.e("error restarting activity", e);
                               }
							declineIncomingCall(DISCARD_REASON_LINE_BUSY, null);
						}
						if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){
							showNotification();
						}
					}
				}, 500);
			}
		}
	}
}
 
源代码20 项目: TelePlus-Android   文件: SnowflakesEffect.java
public void draw(Canvas canvas) {
    switch (type) {
        case 0: {
            particlePaint.setAlpha((int) (255 * alpha));
            canvas.drawPoint(x, y, particlePaint);
            break;
        }
        case 1:
        default: {
            particleThinPaint.setAlpha((int) (255 * alpha));

            float angle = (float) -Math.PI / 2;

            float px = AndroidUtilities.dpf2(2.0f) * 2 * scale;
            float px1 = -AndroidUtilities.dpf2(0.57f) * 2 * scale;
            float py1 = AndroidUtilities.dpf2(1.55f) * 2 * scale;
            for (int a = 0; a < 6; a++) {
                float x1 = (float) Math.cos(angle) * px;
                float y1 = (float) Math.sin(angle) * px;
                float cx = x1 * 0.66f;
                float cy = y1 * 0.66f;
                canvas.drawLine(x, y, x + x1, y + y1, particleThinPaint);

                float angle2 = (float) (angle - Math.PI / 2);
                x1 = (float) (Math.cos(angle2) * px1 - Math.sin(angle2) * py1);
                y1 = (float) (Math.sin(angle2) * px1 + Math.cos(angle2) * py1);
                canvas.drawLine(x + cx, y + cy, x + x1, y + y1, particleThinPaint);

                x1 = (float) (-Math.cos(angle2) * px1 - Math.sin(angle2) * py1);
                y1 = (float) (-Math.sin(angle2) * px1 + Math.cos(angle2) * py1);
                canvas.drawLine(x + cx, y + cy, x + x1, y + y1, particleThinPaint);

                angle += angleDiff;
            }
            break;
        }
    }

}
 
源代码21 项目: TelePlus-Android   文件: ShareAlert.java
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
{
    View view = new ShareDialogCell(context);
    view.setLayoutParams(new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, AndroidUtilities.dp(100)));
    return new RecyclerListView.Holder(view);
}
 
源代码22 项目: Telegram-FOSS   文件: TextCheckCell.java
private void setAnimationProgress(float value) {
    animationProgress = value;
    float rad = Math.max(lastTouchX, getMeasuredWidth() - lastTouchX) + AndroidUtilities.dp(40);
    float cx = lastTouchX;
    int cy = getMeasuredHeight() / 2;
    float animatedRad = rad * animationProgress;
    checkBox.setOverrideColorProgress(cx, cy, animatedRad);
}
 
源代码23 项目: Telegram   文件: MediaActivity.java
private boolean onItemLongClick(MessageObject item, View view, int a) {
    if (actionBar.isActionModeShowed() || getParentActivity() == null) {
        return false;
    }
    AndroidUtilities.hideKeyboard(getParentActivity().getCurrentFocus());
    selectedFiles[item.getDialogId() == dialog_id ? 0 : 1].put(item.getId(), item);
    if (!item.canDeleteMessage(false, null)) {
        cantDeleteMessagesCount++;
    }
    actionBar.createActionMode().getItem(delete).setVisibility(cantDeleteMessagesCount == 0 ? View.VISIBLE : View.GONE);
    if (gotoItem != null) {
        gotoItem.setVisibility(View.VISIBLE);
    }
    selectedMessagesCountTextView.setNumber(1, false);
    AnimatorSet animatorSet = new AnimatorSet();
    ArrayList<Animator> animators = new ArrayList<>();
    for (int i = 0; i < actionModeViews.size(); i++) {
        View view2 = actionModeViews.get(i);
        AndroidUtilities.clearDrawableAnimation(view2);
        animators.add(ObjectAnimator.ofFloat(view2, View.SCALE_Y, 0.1f, 1.0f));
    }
    animatorSet.playTogether(animators);
    animatorSet.setDuration(250);
    animatorSet.start();
    scrolling = false;
    if (view instanceof SharedDocumentCell) {
        ((SharedDocumentCell) view).setChecked(true, true);
    } else if (view instanceof SharedPhotoVideoCell) {
        ((SharedPhotoVideoCell) view).setChecked(a, true, true);
    } else if (view instanceof SharedLinkCell) {
        ((SharedLinkCell) view).setChecked(true, true);
    } else if (view instanceof SharedAudioCell) {
        ((SharedAudioCell) view).setChecked(true, true);
    }
    if (!actionBar.isActionModeShowed()) {
        actionBar.showActionMode(null, actionModeBackground, null, null, null, 0);
        resetScroll();
    }
    return true;
}
 
源代码24 项目: TelePlus-Android   文件: SizeNotifierFrameLayout.java
public void notifyHeightChanged() {
    if (delegate != null) {
        keyboardHeight = getKeyboardHeight();
        final boolean isWidthGreater = AndroidUtilities.displaySize.x > AndroidUtilities.displaySize.y;
        post(new Runnable() {
            @Override
            public void run() {
                if (delegate != null) {
                    delegate.onSizeChanged(keyboardHeight, isWidthGreater);
                }
            }
        });
    }
}
 
源代码25 项目: Telegram-FOSS   文件: CheckBoxBase.java
public void setDrawBackgroundAsArc(int type) {
    drawBackgroundAsArc = type;
    if (type == 4 || type == 5) {
        backgroundPaint.setStrokeWidth(AndroidUtilities.dp(1.9f));
        if (type == 5) {
            checkPaint.setStrokeWidth(AndroidUtilities.dp(1.5f));
        }
    } else if (type == 3) {
        backgroundPaint.setStrokeWidth(AndroidUtilities.dp(1.2f));
    } else if (type != 0) {
        backgroundPaint.setStrokeWidth(AndroidUtilities.dp(1.5f));
    }
}
 
源代码26 项目: Telegram-FOSS   文件: ThemeActivity.java
@Override
protected void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
    if (isOpen) {
        AndroidUtilities.requestAdjustResize(getParentActivity(), classGuid);
        AndroidUtilities.setAdjustResizeToNothing(getParentActivity(), classGuid);
    }
}
 
源代码27 项目: TelePlus-Android   文件: CropRotationWheel.java
@Override
public boolean onTouchEvent(MotionEvent ev) {
    int action = ev.getActionMasked();
    float x = ev.getX();

    if (action == MotionEvent.ACTION_DOWN) {
        prevX = x;

        if (rotationListener != null)
            rotationListener.onStart();
    } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
        if (rotationListener != null)
            rotationListener.onEnd(this.rotation);
    } else if (action == MotionEvent.ACTION_MOVE) {
        float delta = prevX - x;

        float newAngle = this.rotation + (float)(delta / AndroidUtilities.density / Math.PI / 1.65f);
        newAngle = Math.max(-MAX_ANGLE, Math.min(MAX_ANGLE, newAngle));

        if (Math.abs(newAngle - this.rotation) > 0.001) {
            if (Math.abs(newAngle) < 0.05)
                newAngle = 0;

            setRotation(newAngle, false);

            if (rotationListener != null)
                rotationListener.onChange(this.rotation);

            prevX = x;
        }
    }

    return true;
}
 
源代码28 项目: Telegram-FOSS   文件: ProxySettingsActivity.java
@Override
protected void onTransitionAnimationEnd(boolean isOpen, boolean backward) {
    if (isOpen && !backward && addingNewProxy) {
        inputFields[FIELD_IP].requestFocus();
        AndroidUtilities.showKeyboard(inputFields[FIELD_IP]);
    }
}
 
源代码29 项目: TelePlus-Android   文件: ChatActionCell.java
public ChatActionCell(Context context)
{
    super(context);
    imageReceiver = new ImageReceiver(this);
    imageReceiver.setRoundRadius(AndroidUtilities.dp(32));
    avatarDrawable = new AvatarDrawable();
}
 
源代码30 项目: TelePlus-Android   文件: WebPlayerView.java
private void updatePlayButton() {
    controlsView.checkNeedHide();
    AndroidUtilities.cancelRunOnUIThread(progressRunnable);
    if (!videoPlayer.isPlaying()) {
        if (isCompleted) {
            playButton.setImageResource(isInline ? R.drawable.ic_againinline : R.drawable.ic_again);
        } else {
            playButton.setImageResource(isInline ? R.drawable.ic_playinline : R.drawable.ic_play);
        }
    } else {
        playButton.setImageResource(isInline ? R.drawable.ic_pauseinline : R.drawable.ic_pause);
        AndroidUtilities.runOnUIThread(progressRunnable, 500);
        checkAudioFocus();
    }
}
 
源代码评论
动弹
沙发等你来抢
 方法所在类