Skip to content

Commit

Permalink
Add rooms page
Browse files Browse the repository at this point in the history
  • Loading branch information
zetbaitsu committed Apr 11, 2016
1 parent 248dc8a commit e5893e5
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

<activity android:name="id.sis.chat.ui.MainActivity"/>
<activity android:name="id.sis.chat.ui.InputNameActivity"/>
<activity android:name="id.sis.chat.ui.RoomsActivity"/>
</application>

</manifest>
32 changes: 32 additions & 0 deletions app/src/main/java/id/sis/chat/ui/RoomsActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package id.sis.chat.ui;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;

import butterknife.Bind;
import id.zelory.benih.ui.BenihActivity;
import id.zelory.benih.ui.view.BenihRecyclerView;
import id.zelory.sischat.R;

/**
* Created on : April 11, 2016
* Author : zetbaitsu
* Name : Zetra
* Email : [email protected]
* GitHub : https://github.com/zetbaitsu
* LinkedIn : https://id.linkedin.com/in/zetbaitsu
*/
public class RoomsActivity extends BenihActivity {
@Bind(R.id.recycler_view) BenihRecyclerView recyclerView;
@Bind(R.id.button_add_room) FloatingActionButton addRoom;

@Override
protected int getResourceLayout() {
return R.layout.activity_rooms;
}

@Override
protected void onViewReady(Bundle savedInstanceState) {

}
}
2 changes: 1 addition & 1 deletion app/src/main/java/id/sis/chat/ui/SplashActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected void onViewReady(Bundle savedInstanceState) {
try {
String name = LocalDataManager.getInstance().getSavedName();
Timber.d("Name: " + name);
new Handler().postDelayed(() -> startActivity(new Intent(this, MainActivity.class)), 1800);
new Handler().postDelayed(() -> startActivity(new Intent(this, RoomsActivity.class)), 1800);
} catch (RuntimeException e) {
e.printStackTrace();
new Handler().postDelayed(() -> startActivity(new Intent(this, InputNameActivity.class)), 1800);
Expand Down
67 changes: 67 additions & 0 deletions app/src/main/res/layout/activity_rooms.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?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"
android:orientation="vertical">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="SIS Chat"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="#FFF"/>

<ImageView
android:id="@+id/search"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_toLeftOf="@+id/settings"
android:layout_toStartOf="@+id/settings"
android:padding="8dp"
android:src="@drawable/places_ic_search"
android:tint="#FFF"/>

<ImageView
android:id="@+id/settings"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:padding="8dp"
android:src="@drawable/common_full_open_on_phone"
android:tint="#FFF"/>

</RelativeLayout>

</android.support.v7.widget.Toolbar>

<id.zelory.benih.ui.view.BenihRecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar"/>

<android.support.design.widget.FloatingActionButton
android:id="@+id/button_add_room"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_margin="16dp"
android:src="@drawable/places_ic_clear"
android:tint="#FFF"/>

</RelativeLayout>

0 comments on commit e5893e5

Please sign in to comment.