Commit d5c994f2 authored by Yusuke Iwaki's avatar Yusuke Iwaki

re-implement the room list in sidebar with Fragment.

parent cc2fe430
......@@ -8,6 +8,7 @@ import android.content.SharedPreferences;
*/
public class RocketChatCache {
public static final String KEY_SELECTED_SERVER_CONFIG_ID = "selectedServerConfigId";
public static final String KEY_SELECTED_ROOM_ID = "selectedRoomId";
/**
* get SharedPreference instance for RocketChat application cache.
......
package chat.rocket.android.activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import chat.rocket.android.LaunchUtil;
import chat.rocket.android.RocketChatCache;
import chat.rocket.android.model.ServerConfig;
......@@ -22,11 +20,14 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
});
protected String serverConfigId;
protected String roomId;
SharedPreferences.OnSharedPreferenceChangeListener preferenceChangeListener =
(sharedPreferences, key) -> {
if (RocketChatCache.KEY_SELECTED_SERVER_CONFIG_ID.equals(key)) {
updateServerConfigIdIfNeeded(sharedPreferences);
} else if (RocketChatCache.KEY_SELECTED_ROOM_ID.equals(key)) {
updateRoomIdIfNeeded(sharedPreferences);
}
};
......@@ -34,26 +35,46 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
String newServerConfigId = prefs.getString(RocketChatCache.KEY_SELECTED_SERVER_CONFIG_ID, null);
if (serverConfigId == null) {
if (newServerConfigId != null) {
serverConfigId = newServerConfigId;
onServerConfigIdUpdated();
updateServerConfigId(newServerConfigId);
}
} else {
if (!serverConfigId.equals(newServerConfigId)) {
serverConfigId = newServerConfigId;
onServerConfigIdUpdated();
updateServerConfigId(newServerConfigId);
}
}
}
protected void onServerConfigIdUpdated() {}
private void updateServerConfigId(String serverConfigId) {
this.serverConfigId = serverConfigId;
onServerConfigIdUpdated();
}
private void updateRoomIdIfNeeded(SharedPreferences prefs) {
String newRoomId = prefs.getString(RocketChatCache.KEY_SELECTED_ROOM_ID, null);
if (roomId == null) {
if (newRoomId != null) {
updateRoomId(newRoomId);
}
} else {
if (!roomId.equals(newRoomId)) {
updateRoomId(newRoomId);
}
}
}
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
private void updateRoomId(String roomId) {
this.roomId = roomId;
onRoomIdUpdated();
}
SharedPreferences prefs = RocketChatCache.get(this);
updateServerConfigIdIfNeeded(prefs);
protected void onServerConfigIdUpdated() {
RocketChatCache.get(this).edit()
.remove(RocketChatCache.KEY_SELECTED_ROOM_ID)
.apply();
}
protected void onRoomIdUpdated() {}
@Override protected void onResume() {
super.onResume();
RocketChatService.keepalive(this);
......@@ -61,6 +82,7 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
SharedPreferences prefs = RocketChatCache.get(this);
updateServerConfigIdIfNeeded(prefs);
updateRoomIdIfNeeded(prefs);
prefs.registerOnSharedPreferenceChangeListener(preferenceChangeListener);
}
......
......@@ -4,27 +4,21 @@ import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SlidingPaneLayout;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import chat.rocket.android.LaunchUtil;
import chat.rocket.android.R;
import chat.rocket.android.fragment.chatroom.HomeFragment;
import chat.rocket.android.fragment.chatroom.RoomFragment;
import chat.rocket.android.fragment.sidebar.SidebarMainFragment;
import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.layouthelper.chatroom.RoomListManager;
import chat.rocket.android.model.internal.Session;
import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.realm_helper.RealmStore;
import com.jakewharton.rxbinding.view.RxView;
import com.jakewharton.rxbinding.widget.RxCompoundButton;
import hugo.weaving.DebugLog;
/**
* Entry-point for Rocket.Chat.Android application.
*/
public class MainActivity extends AbstractAuthedActivity {
private RoomListManager roomListManager;
@Override protected int getLayoutContainerForFragment() {
return R.id.activity_main_container;
}
......@@ -34,24 +28,10 @@ public class MainActivity extends AbstractAuthedActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
showFragment(new HomeFragment());
}
setupSidebar();
}
private void setupSidebar() {
setupUserActionToggle();
roomListManager = new RoomListManager(
(LinearLayout) findViewById(R.id.channels_container),
(LinearLayout) findViewById(R.id.direct_messages_container));
roomListManager.setOnItemClickListener(view -> {
showRoomFragment(view.getRoomId());
closeSidebarIfNeeded();
});
SlidingPaneLayout pane = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
if (pane != null) {
final SlidingPaneLayout subPane = (SlidingPaneLayout) findViewById(R.id.sub_sliding_pane);
......@@ -74,26 +54,14 @@ public class MainActivity extends AbstractAuthedActivity {
}
}
private void setupUserActionToggle() {
final CompoundButton toggleUserAction =
((CompoundButton) findViewById(R.id.toggle_user_action));
toggleUserAction.setFocusableInTouchMode(false);
findViewById(R.id.user_info_container).setOnClickListener(view -> {
toggleUserAction.toggle();
});
RxCompoundButton.checkedChanges(toggleUserAction)
.compose(bindToLifecycle())
.subscribe(RxView.visibility(findViewById(R.id.user_action_outer_container)));
}
private void showRoomFragment(String roomId) {
showFragment(RoomFragment.create(serverConfigId, roomId));
}
@DebugLog
@Override protected void onServerConfigIdUpdated() {
super.onServerConfigIdUpdated();
getSupportFragmentManager().beginTransaction()
.replace(R.id.sidebar_fragment_container, SidebarMainFragment.create(serverConfigId))
.commit();
if (serverConfigId == null) {
return;
}
......@@ -115,4 +83,17 @@ public class MainActivity extends AbstractAuthedActivity {
LaunchUtil.showServerConfigActivity(this, serverConfigId);
}
}
@Override protected void onRoomIdUpdated() {
super.onRoomIdUpdated();
if (roomId != null) {
showFragment(RoomFragment.create(serverConfigId, roomId));
closeSidebarIfNeeded();
} else {
showFragment(new HomeFragment());
}
}
}
......@@ -181,6 +181,7 @@ public class MethodCallHelper {
}
return realmHelper.executeTransaction(realm -> {
realm.delete(RoomSubscription.class);
realm.createOrUpdateAllFromJson(
RoomSubscription.class, result);
return null;
......
......@@ -3,15 +3,15 @@ package chat.rocket.android.fragment;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.trello.rxlifecycle.components.support.RxFragment;
/**
* Fragment base class for this Application.
*/
public abstract class AbstractFragment extends Fragment {
public abstract class AbstractFragment extends RxFragment {
protected View rootView;
protected abstract @LayoutRes int getLayout();
......
......@@ -19,6 +19,7 @@ public class RoomFragment extends AbstractChatRoomFragment {
private RealmHelper realmHelper;
private String roomId;
private RealmObjectObserver<RoomSubscription> roomObserver;
/**
* create fragment with roomId.
......@@ -41,6 +42,9 @@ public class RoomFragment extends AbstractChatRoomFragment {
Bundle args = getArguments();
realmHelper = RealmStore.get(args.getString("serverConfigId"));
roomId = args.getString("roomId");
roomObserver = realmHelper
.createObjectObserver(realm -> realm.where(RoomSubscription.class).equalTo("rid", roomId))
.setOnUpdateListener(this::onRenderRoom);
}
@Override protected int getLayout() {
......@@ -60,11 +64,6 @@ public class RoomFragment extends AbstractChatRoomFragment {
}).continueWith(new LogcatIfError());
}
private RealmObjectObserver<RoomSubscription> roomObserver =
realmHelper
.createObjectObserver(realm -> realm.where(RoomSubscription.class).equalTo("rid", roomId))
.setOnUpdateListener(this::onRenderRoom);
private void onRenderRoom(RoomSubscription roomSubscription) {
activityToolbar.setTitle(roomSubscription.getName());
}
......
package chat.rocket.android.fragment.sidebar;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import chat.rocket.android.R;
import chat.rocket.android.RocketChatCache;
import chat.rocket.android.fragment.AbstractFragment;
import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.layouthelper.chatroom.RoomListManager;
import chat.rocket.android.model.ddp.RoomSubscription;
import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.realm_helper.RealmListObserver;
import chat.rocket.android.realm_helper.RealmStore;
import com.jakewharton.rxbinding.view.RxView;
import com.jakewharton.rxbinding.widget.RxCompoundButton;
public class SidebarMainFragment extends AbstractFragment {
private String serverConfigId;
private RoomListManager roomListManager;
private RealmListObserver<RoomSubscription> roomsObserver;
public SidebarMainFragment() {
}
public static SidebarMainFragment create(String serverConfigId) {
Bundle args = new Bundle();
args.putString("serverConfigId", serverConfigId);
SidebarMainFragment fragment = new SidebarMainFragment();
fragment.setArguments(args);
return fragment;
}
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle args = getArguments();
serverConfigId = args == null ? null : args.getString("serverConfigId");
if (!TextUtils.isEmpty(serverConfigId)) {
RealmHelper realmHelper = RealmStore.get(serverConfigId);
if (realmHelper != null) {
roomsObserver = realmHelper
.createListObserver(realm -> realm.where(RoomSubscription.class).findAll())
.setOnUpdateListener(list -> roomListManager.setRooms(list));
}
}
}
@Override protected int getLayout() {
if (serverConfigId == null) {
return R.layout.simple_screen;
} else {
return R.layout.fragment_sidebar_main;
}
}
@Override protected void onSetupView() {
if (serverConfigId == null) {
return;
}
setupUserActionToggle();
roomListManager = new RoomListManager(
(LinearLayout) rootView.findViewById(R.id.channels_container),
(LinearLayout) rootView.findViewById(R.id.direct_messages_container));
roomListManager.setOnItemClickListener(view -> {
RocketChatCache.get(view.getContext()).edit()
.putString(RocketChatCache.KEY_SELECTED_ROOM_ID, view.getRoomId())
.apply();
});
}
private void setupUserActionToggle() {
final CompoundButton toggleUserAction =
((CompoundButton) rootView.findViewById(R.id.toggle_user_action));
toggleUserAction.setFocusableInTouchMode(false);
rootView.findViewById(R.id.user_info_container).setOnClickListener(view -> {
toggleUserAction.toggle();
});
RxCompoundButton.checkedChanges(toggleUserAction)
.compose(bindToLifecycle())
.subscribe(RxView.visibility(rootView.findViewById(R.id.user_action_outer_container)));
}
@Override public void onResume() {
super.onResume();
if (roomsObserver != null) {
roomsObserver.sub();
}
}
@Override public void onPause() {
if (roomsObserver != null) {
roomsObserver.unsub();
}
super.onPause();
}
}
package chat.rocket.android.service.observer;
import android.content.Context;
import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.api.DDPClientWraper;
import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.model.ddp.RoomSubscription;
import chat.rocket.android.helper.LogcatIfError;
import chat.rocket.android.model.internal.Session;
import chat.rocket.android.realm_helper.RealmHelper;
import chat.rocket.android.api.DDPClientWraper;
import hugo.weaving.DebugLog;
import io.realm.Realm;
import io.realm.RealmResults;
......@@ -56,11 +55,7 @@ public class SessionObserver extends AbstractModelObserver<Session> {
}
@DebugLog private void onLogin() {
realmHelper.executeTransaction(realm -> {
realm.delete(RoomSubscription.class);
return null;
}).onSuccessTask(_task -> methodCall.getRooms())
.continueWith(new LogcatIfError());
methodCall.getRooms().continueWith(new LogcatIfError());
}
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:theme="@style/AppTheme.Dark"
>
<LinearLayout
android:id="@+id/user_info_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"
android:foreground="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="@dimen/margin_16"
android:layout_alignParentTop="true"
android:elevation="2dp"
>
<ImageView
android:id="@+id/img_userstatus"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@drawable/userstatus_online"
/>
<Space
android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/img_my_avatar"
android:layout_width="48dp"
android:layout_height="48dp"
/>
<FrameLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_8"
android:layout_marginRight="@dimen/margin_8"
android:layout_weight="1"
>
<TextView
android:id="@+id/txt_account_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="John Doe"
android:textSize="14sp"
/>
</FrameLayout>
<chat.rocket.android.widget.DownUpToggleView
android:id="@+id/toggle_user_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/user_info_container"
android:background="?attr/colorPrimary"
android:layout_alignParentBottom="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:orientation="vertical"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CHANNELS"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textStyle="bold"
android:alpha="0.62"
android:layout_gravity="start|center_vertical"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_plus"
android:textSize="12dp"
android:layout_gravity="end|center_vertical"
style="@style/Widget.AppCompat.Button.Borderless"
/>
</FrameLayout>
<LinearLayout
android:id="@+id/channels_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DIRECT MESSAGES"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textStyle="bold"
android:alpha="0.62"
android:layout_gravity="start|center_vertical"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_plus"
android:textSize="12dp"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_gravity="end|center_vertical"
/>
</FrameLayout>
<LinearLayout
android:id="@+id/direct_messages_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.v4.widget.NestedScrollView
android:id="@+id/user_action_outer_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/user_info_container"
android:layout_alignParentBottom="true"
android:background="?attr/colorPrimaryDark"
android:elevation="2dp"
android:visibility="gone"
tools:visibility="visible"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:id="@+id/btn_status_online"
android:orientation="horizontal"
style="@style/sidebar_list_item"
>
<FrameLayout
android:layout_width="48dp"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/userstatus_online"
android:layout_gravity="center"
/>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Online"
android:textAppearance="?attr/textAppearanceListItemSmall"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/btn_status_away"
android:orientation="horizontal"
style="@style/sidebar_list_item"
>
<FrameLayout
android:layout_width="48dp"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/userstatus_away"
android:layout_gravity="center"
/>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Away"
android:textAppearance="?attr/textAppearanceListItemSmall"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/btn_status_busy"
android:orientation="horizontal"
style="@style/sidebar_list_item"
>
<FrameLayout
android:layout_width="48dp"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/userstatus_busy"
android:layout_gravity="center"
/>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Busy"
android:textAppearance="?attr/textAppearanceListItemSmall"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/btn_status_invisible"
android:orientation="horizontal"
style="@style/sidebar_list_item"
>
<FrameLayout
android:layout_width="48dp"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/userstatus_offline"
android:layout_gravity="center"
/>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Invisible"
android:textAppearance="?attr/textAppearanceListItemSmall"
/>
</LinearLayout>
<chat.rocket.android.widget.DividerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/btn_logout"
android:orientation="horizontal"
style="@style/sidebar_list_item"
>
<FrameLayout
android:layout_width="48dp"
android:layout_height="match_parent"
>
<chat.rocket.android.widget.FontAwesomeTextView
android:layout_width="16dp"
android:layout_height="16dp"
android:textSize="14dp"
android:text="@string/fa_sign_out"
android:layout_gravity="center"
android:gravity="center"
/>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Logout"
android:textAppearance="?attr/textAppearanceListItemSmall"
/>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
\ No newline at end of file
......@@ -2,8 +2,6 @@
<android.support.v4.widget.SlidingPaneLayout
android:id="@+id/sub_sliding_pane"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_gravity="start"
android:layout_width="280dp"
android:layout_height="match_parent"
......@@ -38,211 +36,10 @@
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<RelativeLayout
android:layout_width="288dp"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/user_info_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"
android:foreground="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="@dimen/margin_16"
android:layout_alignParentTop="true"
android:elevation="2dp"
>
<ImageView
android:id="@+id/img_userstatus"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@drawable/userstatus_online"
/>
<Space
android:layout_width="@dimen/margin_8"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/img_my_avatar"
android:layout_width="48dp"
android:layout_height="48dp"
/>
<FrameLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_8"
android:layout_marginRight="@dimen/margin_8"
android:layout_weight="1"
>
<TextView
android:id="@+id/txt_account_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="John Doe"
android:textSize="14sp"
/>
</FrameLayout>
<chat.rocket.android.widget.DownUpToggleView
android:id="@+id/toggle_user_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/user_info_container"
android:background="?attr/colorPrimary"
android:layout_alignParentBottom="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:orientation="vertical"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CHANNELS"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textStyle="bold"
android:alpha="0.62"
android:layout_gravity="start|center_vertical"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_plus"
android:textSize="12dp"
android:layout_gravity="end|center_vertical"
style="@style/Widget.AppCompat.Button.Borderless"
/>
</FrameLayout>
<LinearLayout
android:id="@+id/channels_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DIRECT MESSAGES"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textStyle="bold"
android:alpha="0.62"
android:layout_gravity="start|center_vertical"
/>
<chat.rocket.android.widget.FontAwesomeButton
android:layout_width="48dp"
android:layout_height="48dp"
android:text="@string/fa_plus"
android:textSize="12dp"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_gravity="end|center_vertical"
/>
</FrameLayout>
<LinearLayout
android:id="@+id/direct_messages_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginEnd="?attr/listPreferredItemPaddingRight"
android:id="@+id/sidebar_fragment_container"
android:layout_width="280dp"
android:layout_height="match_parent"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.v4.widget.NestedScrollView
android:id="@+id/user_action_outer_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/user_info_container"
android:layout_alignParentBottom="true"
android:background="?attr/colorPrimaryDark"
android:elevation="2dp"
android:visibility="gone"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:paddingEnd="?attr/listPreferredItemPaddingRight"
android:gravity="center_vertical"
android:text="Online"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:paddingEnd="?attr/listPreferredItemPaddingRight"
android:gravity="center_vertical"
android:text="Away"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:paddingEnd="?attr/listPreferredItemPaddingRight"
android:gravity="center_vertical"
android:text="Busy"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:paddingEnd="?attr/listPreferredItemPaddingRight"
android:gravity="center_vertical"
android:text="Invisible"
/>
<chat.rocket.android.widget.DividerView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/listPreferredItemHeightSmall"
android:paddingStart="?attr/listPreferredItemPaddingLeft"
android:paddingEnd="?attr/listPreferredItemPaddingRight"
android:gravity="center_vertical"
android:text="Logout"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
</android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
......@@ -4,4 +4,5 @@
<string name="fa_twitter" translatable="false">&#xf099;</string>
<string name="fa_github" translatable="false">&#xf09b;</string>
<string name="fa_plus" translatable="false">&#xf067;</string>
<string name="fa_sign_out" translatable="false">&#xf08b;</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="sidebar_list_item">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">?attr/listPreferredItemHeight</item>
<item name="android:paddingStart">?attr/listPreferredItemPaddingLeft</item>
<item name="android:paddingEnd">?attr/listPreferredItemPaddingRight</item>
<item name="android:gravity">center_vertical</item>
<item name="android:background">?attr/selectableItemBackground</item>
</style>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment