Java Code Examples for org.telegram.messenger.SharedConfig#smoothKeyboard()
The following examples show how to use
org.telegram.messenger.SharedConfig#smoothKeyboard() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DrawerLayoutContainer.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
@Override protected void onDraw(Canvas canvas) { if (Build.VERSION.SDK_INT >= 21 && lastInsets != null) { WindowInsets insets = (WindowInsets) lastInsets; if (!SharedConfig.smoothKeyboard) { int bottomInset = insets.getSystemWindowInsetBottom(); if (bottomInset > 0) { backgroundPaint.setColor(behindKeyboardColor); canvas.drawRect(0, getMeasuredHeight() - bottomInset, getMeasuredWidth(), getMeasuredHeight(), backgroundPaint); } } if (hasCutout) { backgroundPaint.setColor(0xff000000); int left = insets.getSystemWindowInsetLeft(); if (left != 0) { canvas.drawRect(0, 0, left, getMeasuredHeight(), backgroundPaint); } int right = insets.getSystemWindowInsetRight(); if (right != 0) { canvas.drawRect(right, 0, getMeasuredWidth(), getMeasuredHeight(), backgroundPaint); } } } }
Example 2
Source File: DrawerLayoutContainer.java From Telegram with GNU General Public License v2.0 | 6 votes |
@Override protected void onDraw(Canvas canvas) { if (Build.VERSION.SDK_INT >= 21 && lastInsets != null) { WindowInsets insets = (WindowInsets) lastInsets; if (!SharedConfig.smoothKeyboard) { int bottomInset = insets.getSystemWindowInsetBottom(); if (bottomInset > 0) { backgroundPaint.setColor(behindKeyboardColor); canvas.drawRect(0, getMeasuredHeight() - bottomInset, getMeasuredWidth(), getMeasuredHeight(), backgroundPaint); } } if (hasCutout) { backgroundPaint.setColor(0xff000000); int left = insets.getSystemWindowInsetLeft(); if (left != 0) { canvas.drawRect(0, 0, left, getMeasuredHeight(), backgroundPaint); } int right = insets.getSystemWindowInsetRight(); if (right != 0) { canvas.drawRect(right, 0, getMeasuredWidth(), getMeasuredHeight(), backgroundPaint); } } } }
Example 3
Source File: AdjustPanLayoutHelper.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
private void onUpdate() { if (!SharedConfig.smoothKeyboard) { return; } //prevMovement = Integer.MAX_VALUE; framesWithoutMovement = 0; wasMovement = false; parentView.invalidate(); }
Example 4
Source File: AdjustPanLayoutHelper.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public void update() { if (parentView.getVisibility() != View.VISIBLE || parentView.getParent() == null) { return; } if (!AndroidUtilities.usingHardwareInput && SharedConfig.smoothKeyboard) { parentView.getLocationInWindow(loc); if (loc[1] <= 0) { loc[1] -= parentView.getTranslationY(); if (Build.VERSION.SDK_INT < 21) { loc[1] -= AndroidUtilities.statusBarHeight; } } else { loc[1] = 0; } if (loc[1] != prevMovement) { if (!wasMovement) { onTransitionStart(); } wasMovement = true; onPanTranslationUpdate(-loc[1]); framesWithoutMovement = 0; prevMovement = loc[1]; } else { framesWithoutMovement++; } if (framesWithoutMovement < FRAMES_WITHOUT_MOVE_LIMIT) { parentView.invalidate(); } else if (wasMovement) { onTransitionEnd(); } } }
Example 5
Source File: AdjustPanLayoutHelper.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void onUpdate() { if (!SharedConfig.smoothKeyboard) { return; } //prevMovement = Integer.MAX_VALUE; framesWithoutMovement = 0; wasMovement = false; parentView.invalidate(); }
Example 6
Source File: AdjustPanLayoutHelper.java From Telegram with GNU General Public License v2.0 | 5 votes |
public void update() { if (parentView.getVisibility() != View.VISIBLE || parentView.getParent() == null) { return; } if (!AndroidUtilities.usingHardwareInput && SharedConfig.smoothKeyboard) { parentView.getLocationInWindow(loc); if (loc[1] <= 0) { loc[1] -= parentView.getTranslationY(); if (Build.VERSION.SDK_INT < 21) { loc[1] -= AndroidUtilities.statusBarHeight; } } else { loc[1] = 0; } if (loc[1] != prevMovement) { if (!wasMovement) { onTransitionStart(); } wasMovement = true; onPanTranslationUpdate(-loc[1]); framesWithoutMovement = 0; prevMovement = loc[1]; } else { framesWithoutMovement++; } if (framesWithoutMovement < FRAMES_WITHOUT_MOVE_LIMIT) { parentView.invalidate(); } else if (wasMovement) { onTransitionEnd(); } } }