Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 3b3ce36

Browse files
committed
Implement Floating ActionButton
1 parent 845f442 commit 3b3ce36

File tree

7 files changed

+22
-3
lines changed

7 files changed

+22
-3
lines changed

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import android.os.Build;
3030
import android.os.Bundle;
3131
import android.os.Handler;
32+
import android.support.design.widget.FloatingActionButton;
3233
import android.support.v4.app.ActionBarDrawerToggle;
3334
import android.support.v4.app.FragmentManager;
3435
import android.support.v4.app.FragmentTransaction;
@@ -61,11 +62,8 @@
6162
import com.j256.ormlite.android.AndroidDatabaseResults;
6263
import com.zulip.android.BuildConfig;
6364
import com.zulip.android.database.DatabaseHelper;
64-
<<<<<<< 570cc3a5e10b8fa1d614fb8f139261a05897c3a7
6565
import com.zulip.android.models.Emoji;
66-
=======
6766
import com.zulip.android.filters.NarrowFilterToday;
68-
>>>>>>> Filter by today's messages
6967
import com.zulip.android.models.Message;
7068
import com.zulip.android.models.MessageType;
7169
import com.zulip.android.filters.NarrowFilter;
@@ -112,6 +110,8 @@ public class ZulipActivity extends AppCompatActivity implements
112110
private DrawerLayout drawerLayout;
113111
private ActionBarDrawerToggle drawerToggle;
114112
ExpandableListView streamsDrawer;
113+
private LinearLayout chatBox;
114+
private FloatingActionButton fab;
115115

116116
private HashMap<String, Bitmap> gravatars = new HashMap<>();
117117

@@ -390,6 +390,7 @@ public void onClick(View v) {
390390
streamActv.setAdapter(streamActvAdapter);
391391
topicActv.setAdapter(subjectActvAdapter);
392392
checkAndSetupStreamsDrawer();
393+
<<<<<<< a44f4687bd03950b07becf52be5222d106af8588
393394
SimpleCursorAdapter combinedAdapter = new SimpleCursorAdapter(
394395
that, R.layout.emoji_tile, null,
395396
new String[]{Emoji.NAME_FIELD, Emoji.NAME_FIELD},
@@ -487,8 +488,15 @@ private Cursor makePeopleNameCursor(CharSequence name) throws SQLException {
487488
+ Person.NAME_FIELD + " COLLATE NOCASE",
488489
DatabaseHelper.likeEscape(name.toString()) + "%")
489490
.closeableIterator().getRawResults()).getRawCursor();
491+
=======
492+
setupFab();
493+
>>>>>>> Implement Floating ActionButton
490494
}
491495

496+
private void setupFab() {
497+
fab = (FloatingActionButton) findViewById(R.id.fab);
498+
chatBox = (LinearLayout) findViewById(R.id.messageBoxContainer);
499+
}
492500
public void setupListViewAdapter() {
493501
ExpandableStreamDrawerAdapter streamsDrawerAdapter = null;
494502
Callable<Cursor> streamsGenerator = new Callable<Cursor>() {
202 Bytes
Loading
160 Bytes
Loading
222 Bytes
Loading
269 Bytes
Loading
319 Bytes
Loading

app/src/main/res/layout/main.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@
3939

4040
<include layout="@layout/chatbox" />
4141
</LinearLayout>
42+
43+
<android.support.design.widget.FloatingActionButton
44+
android:id="@+id/fab"
45+
android:layout_width="wrap_content"
46+
android:layout_height="wrap_content"
47+
android:layout_gravity="end|bottom"
48+
android:layout_margin="16dp"
49+
app:backgroundTint="@color/colorPrimary"
50+
android:src="@drawable/ic_mode_edit_black_24dp"
51+
app:borderWidth="0dp"
52+
app:layout_behavior="com.zulip.android.util.RemoveViewsOnScroll" />
4253
</android.support.design.widget.CoordinatorLayout>
4354

4455
<ExpandableListView

0 commit comments

Comments
 (0)