Simplification

This commit is contained in:
M66B 2022-07-17 07:47:58 +02:00
parent 51f067d651
commit a23829807c
2 changed files with 2 additions and 46 deletions

View File

@ -915,28 +915,6 @@ public class FragmentSetup extends FragmentBase {
boolean setup_welcome = prefs.getBoolean("setup_welcome", true);
ibWelcome.setImageLevel(setup_welcome ? 0 /* less */ : 1 /* more */);
grpWelcome.setVisibility(setup_welcome ? View.VISIBLE : View.GONE);
ViewGroup vwWelcome = (ViewGroup) ibWelcome.getParent();
if (vwWelcome == null)
return;
vwWelcome.post(new Runnable() {
@Override
public void run() {
try {
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
return;
Rect rect = new Rect(
vwWelcome.getLeft(),
ibWelcome.getTop(),
vwWelcome.getRight(),
ibWelcome.getBottom());
vwWelcome.setTouchDelegate(new TouchDelegate(rect, ibWelcome));
} catch (Throwable ex) {
Log.e(ex);
}
}
});
}
private void updateManual() {
@ -964,28 +942,6 @@ public class FragmentSetup extends FragmentBase {
? View.VISIBLE : View.GONE);
grpExtra.setVisibility(setup_extra ? View.VISIBLE : View.GONE);
ViewGroup vwExtra = (ViewGroup) ibExtra.getParent();
if (vwExtra == null)
return;
vwExtra.post(new Runnable() {
@Override
public void run() {
try {
if (!getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
return;
Rect rect = new Rect(
vwExtra.getLeft(),
ibExtra.getTop(),
vwExtra.getRight(),
ibExtra.getBottom());
vwExtra.setTouchDelegate(new TouchDelegate(rect, ibExtra));
} catch (Throwable ex) {
Log.e(ex);
}
}
});
}
private void ensureVisible(View child) {

View File

@ -127,7 +127,7 @@
<ImageButton
android:id="@+id/ibWelcome"
android:layout_width="36dp"
android:layout_width="84dp"
android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:padding="6dp"
@ -1075,7 +1075,7 @@
<ImageButton
android:id="@+id/ibExtra"
android:layout_width="36dp"
android:layout_width="84dp"
android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:padding="6dp"