Skip to content

Commit

Permalink
Merge pull request #11 from TemMax/master
Browse files Browse the repository at this point in the history
round card in room list !
  • Loading branch information
00xkhaled authored Mar 3, 2021
2 parents 8bc72cb + ff31e90 commit efc8d27
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Outline;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
Expand Down Expand Up @@ -87,6 +89,19 @@ public int getSpanSize(int position){
return 12;
}
});
list.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
outline.setRoundRect(
0,
0,
view.getWidth(),
view.getHeight() + V.dp(36),
V.dp(36)
);
}
});
list.setClipToOutline(true);
list.setLayoutManager(lm);
list.setPadding(0, V.dp(16), 0, V.dp(16));
list.setClipToPadding(false);
Expand Down
10 changes: 10 additions & 0 deletions Houseclub/src/main/res/drawable/gray_rounded_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/buttonGrayPressed">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/buttonGray" />
<corners android:radius="50dp" />
</shape>
</item>
</ripple>
132 changes: 73 additions & 59 deletions Houseclub/src/main/res/layout/in_channel.xml
Original file line number Diff line number Diff line change
@@ -1,63 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<me.grishka.appkit.views.UsableRecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<include layout="@layout/appkit_empty"
android:id="@+id/empty"/>
</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom"
android:padding="8dp">

<Button
android:id="@+id/leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Widget.Button.Grey"
android:text="@string/leave_room"/>

<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>

<Button
android:id="@+id/raise"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
style="@style/Widget.Button.Grey"
android:text=""/>
<ImageButton
android:id="@+id/mute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
android:src="@drawable/ic_mic_off"
style="@style/Widget.Button.Grey"/>

</LinearLayout>
</LinearLayout>
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<me.grishka.appkit.views.UsableRecyclerView
android:id="@+id/list"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<include
android:id="@+id/empty"
layout="@layout/appkit_empty" />
</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="horizontal"
android:padding="8dp">

<Button
android:id="@+id/leave"
style="@style/Widget.Button.Grey"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:includeFontPadding="false"
android:paddingStart="18dp"
android:paddingEnd="18dp"
android:text="@string/leave_room"
android:textColor="@color/red"
android:textSize="16sp" />

<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />

<Button
android:id="@+id/raise"
style="@style/Widget.Button.Grey"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginEnd="12dp"
android:includeFontPadding="false"
android:minWidth="0dp"
android:text=""
android:textSize="16sp" />

<ImageButton
android:id="@+id/mute"
style="@style/Widget.Button.Grey"
android:layout_width="42dp"
android:layout_height="42dp"
android:includeFontPadding="false"
android:minWidth="0dp"
android:src="@drawable/ic_mic_off"
android:textSize="16sp" />

</LinearLayout>
</LinearLayout>

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
2 changes: 1 addition & 1 deletion Houseclub/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<string name="waitlist_text">You\'re waiting for someone to invite you to Clubhouse. Your account is currently inactive.</string>
<string name="log_out">Log out</string>
<string name="ongoing_call">Ongoing call</string>
<string name="leave_room">Leave room</string>
<string name="leave_room">Leave room</string>
<string name="join_this_room">Join this room?</string>
<string name="join">Join</string>
<string name="cancel">Cancel</string>
Expand Down
5 changes: 5 additions & 0 deletions Houseclub/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<style name="Widget.Button.Grey" parent="android:Widget.Material.Button">
<item name="android:textColor">#DC4855</item>
<item name="android:colorAccent">#E3E0D9</item>
<item name="android:background">@drawable/gray_rounded_background</item>
<item name="android:stateListAnimator">@null</item>
<item name="android:textAllCaps">false</item>
<item name="android:background">@drawable/button_grey_background</item>
Expand All @@ -43,8 +44,12 @@
<item name="android:colorAccent">@color/blue</item>
</style>

<color name="white">#FFF</color>
<color name="lightBeige">#F1EEE4</color>
<color name="blue">#5b75a6</color>
<color name="navBar">#000</color>
<color name="grey">#E3E0D9</color>
<color name="buttonGray">#f2f2f2</color>
<color name="buttonGrayPressed">#C8C8C8</color>
<color name="red">#ea5858</color>
</resources>

0 comments on commit efc8d27

Please sign in to comment.