Skip to content

Commit

Permalink
visual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Mar 14, 2019
1 parent 554c74f commit 225ba10
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/co/tinode/tindroid/MessagesFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ private void updateFormValues() {
}

if (mTopic == null || !mTopic.isAttached()) {
// Default view when the topic is not available.
activity.findViewById(R.id.notReadable).setVisibility(View.VISIBLE);
activity.findViewById(R.id.notReadableNote).setVisibility(View.VISIBLE);
activity.findViewById(R.id.sendMessagePanel).setVisibility(View.GONE);
activity.findViewById(R.id.peersMessagingDisabled).setVisibility(View.GONE);
activity.findViewById(R.id.sendMessageDisabled).setVisibility(View.VISIBLE);
return;
}

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/co/tinode/tindroid/UiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -940,13 +940,14 @@ interface ContactsLoaderResultReceiver {
}

public static class EventListener extends Tinode.EventListener {
private AppCompatActivity mActivity;
private Activity mActivity;
private Boolean mConnected;

EventListener(AppCompatActivity owner, Boolean connected) {
EventListener(Activity owner, Boolean connected) {
super();
mActivity = owner;
mConnected = connected;
setConnectedStatus(mActivity, connected);
}

@Override
Expand Down
38 changes: 19 additions & 19 deletions app/src/main/res/layout/fragment_messages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@
android:background="@drawable/message_view_bkg"
tools:context=".MessagesFragment">

<androidx.cardview.widget.CardView
android:id="@+id/sendMessageFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
card_view:cardBackgroundColor="@android:color/background_light"
card_view:cardUseCompatPadding="true"
card_view:cardElevation="@dimen/cardview_elevation"
tools:layout="@layout/fragment_send_message">

<include layout="@layout/fragment_send_message" />
<include layout="@layout/fragment_messaging_disabled" />
<include layout="@layout/fragment_enable_peer" />

</androidx.cardview.widget.CardView>

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresher"
android:layout_width="match_parent"
Expand Down Expand Up @@ -60,4 +41,23 @@

</LinearLayout>

<androidx.cardview.widget.CardView
android:id="@+id/sendMessageFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="4dp"
card_view:cardBackgroundColor="@android:color/background_light"
card_view:cardUseCompatPadding="true"
card_view:cardElevation="@dimen/cardview_elevation"
tools:layout="@layout/fragment_send_message">

<include layout="@layout/fragment_send_message" />
<include layout="@layout/fragment_messaging_disabled" />
<include layout="@layout/fragment_enable_peer" />

</androidx.cardview.widget.CardView>

</RelativeLayout>

0 comments on commit 225ba10

Please sign in to comment.