Skip to content

Commit

Permalink
cosmetic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Apr 7, 2019
1 parent 31fbfef commit 59bd875
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
8 changes: 8 additions & 0 deletions app/src/main/java/co/tinode/tindroid/ChatsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,13 @@ public void onLogin(int code, String txt) {
super.onLogin(code, txt);
UiUtils.attachMeTopic(ChatsActivity.this, mMeTopicListener);
}

@Override
public void onDisconnect(boolean byServer, int code, String reason) {
super.onDisconnect(byServer, code, reason);

// Update online status of contacts.
datasetChanged();
}
}
}
4 changes: 0 additions & 4 deletions app/src/main/java/co/tinode/tindroid/MessageActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ public boolean onOptionsItemSelected(MenuItem item) {

// Try to send all pending messages.
public void syncAllMessages(final boolean runLoader) {
Log.i(TAG, "syncAllMessages runLoader="+runLoader);
syncMessages(-1, runLoader);
}

Expand All @@ -338,19 +337,16 @@ public void syncMessages(final long msgId, final boolean runLoader) {
mMessageSender.submit(new Runnable() {
@Override
public void run() {
Log.i(TAG, "Sync started");
PromisedReply<ServerMessage> promise;
if (msgId >= 0) {
promise = mTopic.syncOne(msgId);
} else {
Log.i(TAG, "Calling mTopic.syncAll()");
promise = mTopic.syncAll();
}
if (runLoader) {
promise.thenApply(new PromisedReply.SuccessListener<ServerMessage>() {
@Override
public PromisedReply<ServerMessage> onSuccess(ServerMessage result) {
Log.i(TAG, "Sync succeeded");
runMessagesLoader();
return null;
}
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/co/tinode/tindroid/MessagesAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
import co.tinode.tindroid.widgets.RoundImageDrawable;
import co.tinode.tinodesdk.ComTopic;
import co.tinode.tinodesdk.LargeFileHelper;
import co.tinode.tinodesdk.NotConnectedException;
import co.tinode.tinodesdk.PromisedReply;
import co.tinode.tinodesdk.Storage;
import co.tinode.tinodesdk.Topic;
Expand All @@ -80,7 +79,7 @@
* Handle display of a conversation
*/
public class MessagesAdapter extends RecyclerView.Adapter<MessagesAdapter.ViewHolder> {
private static final String TAG = "MessagesListAdapter";
private static final String TAG = "MessagesAdapter";

private static final int MESSAGES_TO_LOAD = 20;

Expand Down Expand Up @@ -652,7 +651,6 @@ private void runLoader(final boolean hard) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Log.i(TAG, "runMessageLoader hard=" + hard);
final LoaderManager lm = LoaderManager.getInstance(mActivity);
final Loader<Cursor> loader = lm.getLoader(MESSAGES_QUERY_ID);
Bundle args = new Bundle();
Expand Down Expand Up @@ -809,7 +807,6 @@ public Loader<Cursor> onCreateLoader(int id, Bundle args) {
if (args != null) {
mHardReset = args.getBoolean(HARD_RESET, false);
}
Log.i(TAG, "MessageLoaderCallbacks.onCreateLoader, topicName=" + mTopicName + ", hard=" + mHardReset);
return new MessageDb.Loader(mActivity, mTopicName, mPagesToLoad, MESSAGES_TO_LOAD);
}

Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_add.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_add_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
app:elevation="@dimen/fab_elevation"
app:layout_anchor="@id/content"
app:layout_anchorGravity="bottom|end"
app:srcCompat="@drawable/ic_check"/>
app:srcCompat="@drawable/ic_add"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 comments on commit 59bd875

Please sign in to comment.