Commit 1483458f authored by Lucio Maciel's avatar Lucio Maciel Committed by GitHub

Merge branch 'develop' into userstatus-on-toolbar

parents 78b7b4e2 a906c68f
......@@ -85,6 +85,25 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
pane.openPane();
}
});
//ref: ActionBarDrawerToggle#setProgress
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
drawerArrowDrawable.setProgress(slideOffset);
}
@Override
public void onPanelOpened(View panel) {
drawerArrowDrawable.setVerticalMirror(true);
}
@Override
public void onPanelClosed(View panel) {
drawerArrowDrawable.setVerticalMirror(false);
closeUserActionContainer();
}
});
}
private boolean closeSidebarIfNeeded() {
......@@ -137,6 +156,14 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
.commit();
}
private void closeUserActionContainer() {
SidebarMainFragment sidebarFragment = (SidebarMainFragment) getSupportFragmentManager()
.findFragmentById(R.id.sidebar_fragment_container);
if (sidebarFragment != null) {
sidebarFragment.closeUserActionContainer();
}
}
@Override
protected void onRoomIdUpdated() {
super.onRoomIdUpdated();
......
......@@ -89,11 +89,11 @@ public class TwoStepAuthFragment extends AbstractServerConfigFragment
protected void onSetupView() {
waitingView = rootView.findViewById(R.id.waiting);
final TextView twoStepCodeTextView = (TextView) rootView.findViewById(R.id.two_step_code);
final TextView twoStepCodeTextView = rootView.findViewById(R.id.two_step_code);
twoStepCodeTextView.requestFocus();
submitButton = rootView.findViewById(R.id.btn_two_step_login);
submitButton.setOnClickListener(view -> {
presenter.onCode(twoStepCodeTextView.getText().toString());
});
submitButton.setOnClickListener(v -> presenter.onCode(twoStepCodeTextView.getText().toString()));
}
}
......@@ -166,12 +166,16 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
RxCompoundButton.checkedChanges(toggleUserAction)
.compose(bindToLifecycle())
.subscribe(
aBoolean -> rootView.findViewById(R.id.user_action_outer_container)
.setVisibility(aBoolean ? View.VISIBLE : View.GONE),
this::showUserActionContainer,
Logger::report
);
}
private void showUserActionContainer(boolean show) {
rootView.findViewById(R.id.user_action_outer_container)
.setVisibility(show ? View.VISIBLE : View.GONE);
}
@Override
public void showScreen() {
rootView.setVisibility(View.VISIBLE);
......@@ -256,7 +260,7 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
});
}
private void closeUserActionContainer() {
public void closeUserActionContainer() {
final CompoundButton toggleUserAction = rootView.findViewById(R.id.toggle_user_action);
if (toggleUserAction != null && toggleUserAction.isChecked()) {
toggleUserAction.setChecked(false);
......
......@@ -32,6 +32,7 @@ public class MessageListAdapter extends ExtModelListAdapter<Message, PairedMessa
public MessageListAdapter(Context context, String hostname) {
super(context);
this.hostname = hostname;
this.hasNext = true;
}
public void setAbsoluteUrl(AbsoluteUrl absoluteUrl) {
......
......@@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
android:theme="@style/AppTheme">
<include layout="@layout/list_item_message_newday" />
......@@ -63,6 +64,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:textColor="@color/color_timestamp"
tools:text="12:34" />
<View
......
......@@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/white"
android:theme="@style/AppTheme">
<include layout="@layout/list_item_message_newday" />
......@@ -50,6 +51,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:textColor="@color/color_timestamp"
tools:text="12:34" />
<View
......
......@@ -36,6 +36,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:textColor="@color/color_embed_hostname"
android:enabled="false" />
<TextView
......
......@@ -4,6 +4,9 @@
<color name="color_shadow">#FFE6E6E7</color>
<color name="color_icon_composer">#FFA8A8A8</color>
<color name="color_timestamp">#FFA8A8A8</color>
<color name="color_embed_hostname">@color/color_timestamp</color>
<!-- User status colors-->
<color name="color_user_status_online">#FF4CAF50</color> <!-- Green 500 -->
<color name="color_user_status_busy">#FFF44336</color> <!-- Red 500-->
......
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