Commit 027e6594 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add 'Add new team' label to add server button and changed fallback placeholder...

Add 'Add new team' label to add server button and changed fallback placeholder icon to favicon asset size 512x512 which is usually the RocketChat default icon if not changed by the admin
parent 04d37254
......@@ -6,6 +6,8 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.widget.SlidingPaneLayout;
import android.view.LayoutInflater;
import android.view.View;
......@@ -88,7 +90,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
final SlidingPaneLayout subPane = (SlidingPaneLayout) findViewById(R.id.sub_sliding_pane);
if (subPane != null) {
Button addServerButton = subPane.findViewById(R.id.btn_add_server);
View addServerButton = subPane.findViewById(R.id.btn_add_server);
pane.setPanelSlideListener(new SlidingPaneLayout.SimplePanelSlideListener() {
@Override
public void onPanelClosed(View panel) {
......@@ -285,9 +287,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
serverRow.setOnClickListener(view -> changeServerIfNeeded(serverHostname));
Drawable placeholder = AvatarHelper.INSTANCE.getTextDrawable(serverHostname,this);
FrescoHelper.INSTANCE.loadImage(serverButton, serverLogoUrl, placeholder);
FrescoHelper.INSTANCE.loadImage(serverButton, serverLogoUrl, ContextCompat.getDrawable(this, R.mipmap.ic_launcher));
serverListContainer.addView(serverRow, serverCount - 1);
}
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sub_sliding_pane"
android:layout_width="280dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/sub_sliding_pane"
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:theme="@style/AppTheme.Dark">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:theme="@style/AppTheme.Dark">
android:background="?attr/colorPrimaryDark">
<android.support.v4.widget.NestedScrollView
<LinearLayout
android:id="@+id/server_list_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?attr/colorPrimaryDark">
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/server_list_bar"
<android.support.constraint.ConstraintLayout
android:id="@+id/btn_add_server"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_height="80dp">
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
<io.github.yusukeiwaki.android.widget.FontAwesomeButton
android:id="@+id/fa_add_server"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:id="@+id/btn_add_server"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="@dimen/margin_8"
android:text="@string/fa_plus" />
android:text="@string/fa_plus"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/add_new_team"
android:textColor="@android:color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/fa_add_server"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<FrameLayout
android:id="@+id/sidebar_fragment_container"
android:layout_width="280dp"
android:layout_height="match_parent" />
android:id="@+id/sidebar_fragment_container"
android:layout_width="280dp"
android:layout_height="match_parent" />
</android.support.v4.widget.SlidingPaneLayout>
\ No newline at end of file
......@@ -66,4 +66,5 @@
<string name="edit_message">Edit message</string>
<string name="message_options_no_message_info">Ooops. Something\'s up!</string>
<string name="message_options_no_permissions_info">You have no permissions</string>
<string name="add_new_team">ADD NEW TEAM</string>
</resources>
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