Skip to content

Commit 9ee3200

Browse files
committed
fix API33+ layouting on PM reply fragment
1 parent f01fb53 commit 9ee3200

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

Awful.apk/src/main/assets/changelog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ <h2>3.13.1</h2>
1212
<li>Now showing attachment file name if present. Hope you named that file well or remember what "1000016741.png" was</li>
1313
<li>Removed option to add attachments on edits, added option to remove attachments on edits. I think this balances it out.</li>
1414
<li>Fixed file permissions for adding attachments when posting new threads. Someone surely must be doing that, right?</li>
15+
<li>Fixed keyboard overlapping PM reply box on new Android versions. What do you mean "you read what you write before sending"?</li>
1516
</ul>
1617
</section>
1718
<section>

Awful.apk/src/main/java/com/ferg/awfulapp/MessageFragment.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
import android.os.Bundle;
1111
import android.os.Handler;
1212
import android.os.Messenger;
13+
14+
import androidx.core.graphics.Insets;
15+
import androidx.core.view.ViewCompat;
16+
import androidx.core.view.WindowInsetsCompat;
1317
import androidx.loader.app.LoaderManager;
1418
import androidx.loader.content.CursorLoader;
1519
import androidx.loader.content.Loader;
@@ -137,6 +141,25 @@ public View onCreateView(LayoutInflater aInflater, ViewGroup aContainer, Bundle
137141
}
138142

139143
getAwfulActivity().setPreferredFont(result);
144+
145+
ViewCompat.setOnApplyWindowInsetsListener(result.getRootView(), (view, insets) -> {
146+
Insets innerPadding = insets.getInsets(
147+
WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout()
148+
);
149+
150+
boolean imeVisible = insets.isVisible(WindowInsetsCompat.Type.ime());
151+
int imeHeight = insets.getInsets(WindowInsetsCompat.Type.ime()).bottom;
152+
153+
ViewCompat.setPaddingRelative(
154+
result.getRootView(),
155+
innerPadding.left,
156+
0,
157+
innerPadding.right,
158+
imeVisible ? imeHeight : innerPadding.bottom
159+
);
160+
return insets;
161+
});
162+
140163
return result;
141164
}
142165

Awful.apk/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@
521521
<string name="web_view_next_result_description">Next result</string>
522522
<string name="web_view_search_box_hint">Search in page</string>
523523
<string name="getting_forums">Getting forums</string>
524-
<string name="imgur_api_client_id">test</string>
525524
<string name="post_warning">The functionality to create threads is fresh and may contain bugs that could potentially lead to auto-bans.\n\nThere are no safety nets.\n\nBy accepting this you acknowledge that you are voluntarily taking this risk and only have yourself to blame if you get banned, either due to an app-malfunction or (more likely) your dog-shit posting.</string>
526525
<string name="terms_and_conditions">I accept the <a href="https://www.somethingawful.com/forum-rules/forum-rules/">terms and conditions of the forum rules</a></string>
527526

0 commit comments

Comments
 (0)