mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-08 11:34:07 +08:00
confict
This commit is contained in:
@@ -893,9 +893,7 @@ public final class TerminalView extends View {
|
|||||||
android.R.attr.textSelectHandleWindowStyle);
|
android.R.attr.textSelectHandleWindowStyle);
|
||||||
mContainer.setSplitTouchEnabled(true);
|
mContainer.setSplitTouchEnabled(true);
|
||||||
mContainer.setClippingEnabled(false);
|
mContainer.setClippingEnabled(false);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
mContainer.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
|
mContainer.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
|
||||||
}
|
|
||||||
mContainer.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
|
mContainer.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
mContainer.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
|
mContainer.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
|
||||||
@@ -910,14 +908,8 @@ public final class TerminalView extends View {
|
|||||||
case LEFT: {
|
case LEFT: {
|
||||||
if (mSelectHandleLeft == null) {
|
if (mSelectHandleLeft == null) {
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
mSelectHandleLeft = getContext().getDrawable(
|
mSelectHandleLeft = getContext().getDrawable(
|
||||||
R.drawable.text_select_handle_left_material);
|
R.drawable.text_select_handle_left_material);
|
||||||
} else {
|
|
||||||
mSelectHandleLeft = getContext().getResources().getDrawable(
|
|
||||||
R.drawable.text_select_handle_left_material);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
mDrawable = mSelectHandleLeft;
|
mDrawable = mSelectHandleLeft;
|
||||||
@@ -928,13 +920,8 @@ public final class TerminalView extends View {
|
|||||||
|
|
||||||
case RIGHT: {
|
case RIGHT: {
|
||||||
if (mSelectHandleRight == null) {
|
if (mSelectHandleRight == null) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
mSelectHandleRight = getContext().getDrawable(
|
mSelectHandleRight = getContext().getDrawable(
|
||||||
R.drawable.text_select_handle_right_material);
|
R.drawable.text_select_handle_right_material);
|
||||||
} else {
|
|
||||||
mSelectHandleRight = getContext().getResources().getDrawable(
|
|
||||||
R.drawable.text_select_handle_right_material);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mDrawable = mSelectHandleRight;
|
mDrawable = mSelectHandleRight;
|
||||||
handleWidth = mDrawable.getIntrinsicWidth();
|
handleWidth = mDrawable.getIntrinsicWidth();
|
||||||
@@ -1228,7 +1215,6 @@ public final class TerminalView extends View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
mActionMode = startActionMode(new ActionMode.Callback2() {
|
mActionMode = startActionMode(new ActionMode.Callback2() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
||||||
@@ -1267,9 +1253,7 @@ public final class TerminalView extends View {
|
|||||||
outRect.set(x1, y1 + mHandleHeight, x2, y2 + mHandleHeight);
|
outRect.set(x1, y1 + mHandleHeight, x2, y2 + mHandleHeight);
|
||||||
}
|
}
|
||||||
}, ActionMode.TYPE_FLOATING);
|
}, ActionMode.TYPE_FLOATING);
|
||||||
} else {
|
|
||||||
mActionMode = startActionMode(callback);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hide() {
|
public void hide() {
|
||||||
@@ -1500,21 +1484,17 @@ public final class TerminalView extends View {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (mActionMode != null) {
|
if (mActionMode != null) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
mActionMode.hide(0); // hide off.
|
mActionMode.hide(0); // hide off.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void hideFloatingToolbar(int duration) {
|
void hideFloatingToolbar(int duration) {
|
||||||
if (mActionMode != null) {
|
if (mActionMode != null) {
|
||||||
removeCallbacks(mShowFloatingToolbar);
|
removeCallbacks(mShowFloatingToolbar);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
|
||||||
mActionMode.hide(duration);
|
mActionMode.hide(duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void showFloatingToolbar() {
|
private void showFloatingToolbar() {
|
||||||
if (mActionMode != null) {
|
if (mActionMode != null) {
|
||||||
|
Reference in New Issue
Block a user