From ae5de1f46b6c971b19abb3bd650ef1143baa17cd Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sat, 4 Mar 2023 01:23:50 -0500 Subject: Fix edit text hidden under keyboard in ViewPrivateMessagesActivity. --- .../activities/ViewPrivateMessagesActivity.java | 50 +--------------------- 1 file changed, 1 insertion(+), 49 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java index 12f2d4a7..77df7de1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPrivateMessagesActivity.java @@ -7,8 +7,6 @@ import android.os.Bundle; import android.os.Handler; import android.view.MenuItem; import android.view.View; -import android.view.Window; -import android.view.WindowManager; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; @@ -16,10 +14,6 @@ import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; -import androidx.core.graphics.Insets; -import androidx.core.view.ViewCompat; -import androidx.core.view.WindowInsetsAnimationCompat; -import androidx.core.view.WindowInsetsCompat; import androidx.recyclerview.widget.RecyclerView; import androidx.transition.AutoTransition; import androidx.transition.TransitionManager; @@ -33,7 +27,6 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import java.util.ArrayList; -import java.util.List; import java.util.concurrent.Executor; import javax.inject.Inject; @@ -116,7 +109,7 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit protected void onCreate(Bundle savedInstanceState) { ((Infinity) getApplication()).getAppComponent().inject(this); - //setImmersiveModeNotApplicable(); + setImmersiveModeNotApplicable(); super.onCreate(savedInstanceState); @@ -134,30 +127,6 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit addOnOffsetChangedListener(mAppBarLayout); } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - Window window = getWindow(); - - if (isChangeStatusBarIconColor()) { - addOnOffsetChangedListener(mAppBarLayout); - } - - if (isImmersiveInterface()) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - window.setDecorFitsSystemWindows(false); - } else { - window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); - } - adjustToolbar(mToolbar); - - int navBarHeight = getNavBarHeight(); - if (navBarHeight > 0) { - LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mEditTextLinearLayout.getLayoutParams(); - params.bottomMargin += navBarHeight; - mEditTextLinearLayout.setLayoutParams(params); - } - } - } - setSupportActionBar(mToolbar); setToolbarGoToTop(mToolbar); @@ -176,23 +145,6 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit } else { EventBus.getDefault().post(new PassPrivateMessageIndexEvent(getIntent().getIntExtra(EXTRA_PRIVATE_MESSAGE_INDEX, -1))); } - - ViewCompat.setWindowInsetsAnimationCallback( - mCoordinatorLayout, - new WindowInsetsAnimationCompat.Callback( - WindowInsetsAnimationCompat.Callback.DISPATCH_MODE_CONTINUE_ON_SUBTREE - ) { - @NonNull - @Override - public WindowInsetsCompat onProgress(@NonNull WindowInsetsCompat insets, @NonNull List runningAnimations) { - Insets typesInset = insets.getInsets(WindowInsetsCompat.Type.ime()); - Insets otherInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()); - Insets diff = Insets.max(Insets.NONE, Insets.subtract(typesInset, otherInset)); - - mCoordinatorLayout.setPadding(0, 0, 0, diff.bottom); - return insets; - } - }); } private void bindView() { -- cgit v1.2.3