Commit b968f97a authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #339 from filipedelimabrito/develop

Add waiting view to hostname screen/layout
parents 625dbcaf 14133a9a
...@@ -21,9 +21,9 @@ import chat.rocket.android.service.ConnectivityManager; ...@@ -21,9 +21,9 @@ import chat.rocket.android.service.ConnectivityManager;
public class InputHostnameFragment extends AbstractFragment implements InputHostnameContract.View { public class InputHostnameFragment extends AbstractFragment implements InputHostnameContract.View {
private InputHostnameContract.Presenter presenter; private InputHostnameContract.Presenter presenter;
private View waitingView;
public InputHostnameFragment() { public InputHostnameFragment() {}
}
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
...@@ -45,6 +45,7 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost ...@@ -45,6 +45,7 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
protected void onSetupView() { protected void onSetupView() {
setupVersionInfo(); setupVersionInfo();
waitingView = rootView.findViewById(R.id.waiting);
rootView.findViewById(R.id.btn_connect).setOnClickListener(view -> handleConnect()); rootView.findViewById(R.id.btn_connect).setOnClickListener(view -> handleConnect());
} }
...@@ -82,11 +83,13 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost ...@@ -82,11 +83,13 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
@Override @Override
public void showLoader() { public void showLoader() {
rootView.findViewById(R.id.btn_connect).setEnabled(false); rootView.findViewById(R.id.btn_connect).setEnabled(false);
waitingView.setVisibility(View.VISIBLE);
} }
@Override @Override
public void hideLoader() { public void hideLoader() {
rootView.findViewById(R.id.btn_connect).setEnabled(true); rootView.findViewById(R.id.btn_connect).setEnabled(true);
waitingView.setVisibility(View.GONE);
} }
@Override @Override
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent" android:layout_width="match_parent"
android:orientation="horizontal"> android:layout_height="match_parent"
android:orientation="horizontal"
tools:context="chat.rocket.android.fragment.chatroom.RoomFragment">
<include layout="@layout/fragment_room_main" /> <include layout="@layout/fragment_room_main" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimaryDark"> android:background="?attr/colorPrimaryDark"
tools:context="chat.rocket.android.fragment.add_server.InputHostnameFragment">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@color/white" android:minWidth="288dp"
android:minWidth="288dp" android:padding="@dimen/margin_24"
android:orientation="horizontal" android:background="@color/white"
android:padding="@dimen/margin_24"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0px" android:layout_width="0px"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:text="@string/fragment_input_hostname_hostname" android:text="@string/fragment_input_hostname_hostname"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" /> android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<EditText <EditText
android:id="@+id/editor_hostname" android:id="@+id/editor_hostname"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -35,13 +43,13 @@ ...@@ -35,13 +43,13 @@
android:imeOptions="actionGo" android:imeOptions="actionGo"
android:inputType="textWebEditText" android:inputType="textWebEditText"
android:singleLine="true" /> android:singleLine="true" />
</LinearLayout> </LinearLayout>
<Space <Space
android:layout_width="@dimen/margin_8" android:layout_width="@dimen/margin_16"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btn_connect" android:id="@+id/btn_connect"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -49,15 +57,23 @@ ...@@ -49,15 +57,23 @@
app:elevation="2dp" app:elevation="2dp"
app:fabSize="mini" app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" /> app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
</LinearLayout> </LinearLayout>
<TextView <chat.rocket.android.widget.WaitingView
android:id="@+id/version_info" android:id="@+id/waiting"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom" android:layout_marginTop="@dimen/margin_16"
android:layout_margin="@dimen/margin_8" android:layout_gravity="center"
android:textColor="@android:color/white" android:visibility="gone"/>
android:textAppearance="@style/TextAppearance.AppCompat.Caption" </LinearLayout>
tools:text="Version: 1.0" />
<TextView
android:id="@+id/version_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_margin="@dimen/margin_8"
android:textColor="@android:color/white"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
</FrameLayout> </FrameLayout>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:id="@+id/drawer_layout"
android:layout_height="match_parent"> android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="chat.rocket.android.fragment.chatroom.RoomFragment">
<include layout="@layout/fragment_room_main" /> <include layout="@layout/fragment_room_main" />
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="end" android:layout_gravity="end"
android:clickable="true" android:clickable="true"
android:theme="@style/AppTheme.Dark"> android:theme="@style/AppTheme.Dark">
<include layout="@layout/room_side_menu" /> <include layout="@layout/room_side_menu" />
</FrameLayout> </FrameLayout>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/messageListRelativeLayout" android:id="@+id/messageListRelativeLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
tools:context="chat.rocket.android.fragment.chatroom.RoomFragment">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/messageRecyclerView" android:id="@+id/messageRecyclerView"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/room_side_menu" android:id="@+id/room_side_menu"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="end" android:layout_gravity="end"
android:orientation="vertical"> android:orientation="vertical">
<io.github.yusukeiwaki.android.widget.FontAwesomeButton <io.github.yusukeiwaki.android.widget.FontAwesomeButton
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:enabled="false" android:enabled="false"
android:text="@string/fa_search" android:text="@string/fa_search"
android:textSize="24dp" /> android:textSize="24dp" />
<io.github.yusukeiwaki.android.widget.FontAwesomeButton <io.github.yusukeiwaki.android.widget.FontAwesomeButton
android:id="@+id/btn_users" android:id="@+id/btn_users"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:text="@string/fa_users" android:text="@string/fa_users"
android:textSize="24dp" /> android:textSize="24dp" />
<io.github.yusukeiwaki.android.widget.FontAwesomeButton <io.github.yusukeiwaki.android.widget.FontAwesomeButton
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:enabled="false" android:enabled="false"
android:text="@string/fa_at" android:text="@string/fa_at"
android:textSize="24dp" /> android:textSize="24dp" />
</LinearLayout> </LinearLayout>
\ 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