bring scan button to StartConversationActivity

This commit is contained in:
Daniel Gultsch 2018-02-26 21:18:36 +01:00
parent 3bd42230f2
commit 12031515d1
3 changed files with 1076 additions and 1059 deletions

View File

@ -1746,8 +1746,16 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
private boolean scrolledToBottom() {
final ListView l = this.binding.messagesView;
return l.getLastVisiblePosition() == l.getAdapter().getCount() -1 && l.getChildAt(l.getChildCount() - 1).getBottom() <= l.getHeight();
if (this.binding == null) {
return false;
}
final ListView listView = this.binding.messagesView;
if (listView.getLastVisiblePosition() == listView.getAdapter().getCount() -1) {
final View lastChild = listView.getChildAt(listView.getChildCount() -1);
return lastChild != null && lastChild.getBottom() <= listView.getHeight();
} else {
return false;
}
}
private void processExtras(Bundle extras) {

View File

@ -15,7 +15,8 @@
<item
android:id="@+id/action_scan_qr_code"
android:title="@string/scan_qr_code"
app:showAsAction="never"/>
android:icon="?attr/icon_scan_qr_code"
app:showAsAction="always"/>
<item
android:id="@+id/action_hide_offline"