forked from grishka/Houseclub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature-ui-improvements' of github.com:dievskiy/Houseclub
- Loading branch information
Showing
12 changed files
with
262 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Houseclub/src/main/java/me/grishka/houseclub/utils/AndroidUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package me.grishka.houseclub.utils; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.content.res.Resources; | ||
import android.graphics.Rect; | ||
import android.util.DisplayMetrics; | ||
|
||
public class AndroidUtils { | ||
|
||
public static boolean hasNavigationBar(Activity activity) { | ||
Rect rectangle = new Rect(); | ||
DisplayMetrics displayMetrics = new DisplayMetrics(); | ||
activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(rectangle); | ||
activity.getWindowManager().getDefaultDisplay().getRealMetrics(displayMetrics); | ||
return displayMetrics.heightPixels != (rectangle.top + rectangle.height()); | ||
} | ||
|
||
public static int getNavigationBarSize(Context context){ | ||
Resources resources = context.getResources(); | ||
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); | ||
if (resourceId > 0) { | ||
return resources.getDimensionPixelSize(resourceId); | ||
} | ||
return 0; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
Houseclub/src/main/res/drawable/background_channel_item.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<transition xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<ripple android:color="?android:attr/colorControlHighlight"> | ||
<item> | ||
<shape android:id="@android:id/mask"> | ||
<solid android:color="#fff" /> | ||
|
||
<padding | ||
android:bottom="0dp" | ||
android:left="8dp" | ||
android:right="8dp" | ||
android:top="0dp" /> | ||
<corners | ||
android:radius="25dp" /> | ||
</shape> | ||
</item> | ||
</ripple> | ||
</item> | ||
<item> | ||
<shape android:id="@android:id/mask"> | ||
<solid android:color="#aaa" /> | ||
<padding | ||
android:bottom="0dp" | ||
android:left="8dp" | ||
android:right="8dp" | ||
android:top="0dp" /> | ||
<corners android:radius="25dp" /> | ||
</shape> | ||
</item> | ||
|
||
</transition> |
32 changes: 32 additions & 0 deletions
32
Houseclub/src/main/res/drawable/button_blue_background.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<transition xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<ripple android:color="?android:attr/colorControlHighlight"> | ||
<item> | ||
<shape android:id="@android:id/mask"> | ||
<solid android:color="@color/blue" /> | ||
|
||
<padding | ||
android:bottom="0dp" | ||
android:left="8dp" | ||
android:right="8dp" | ||
android:top="0dp" /> | ||
<corners | ||
android:radius="28dp" /> | ||
</shape> | ||
</item> | ||
</ripple> | ||
</item> | ||
<item> | ||
<shape android:id="@android:id/mask"> | ||
<solid android:color="#494E57" /> | ||
<padding | ||
android:bottom="0dp" | ||
android:left="8dp" | ||
android:right="8dp" | ||
android:top="0dp" /> | ||
<corners android:radius="28dp" /> | ||
</shape> | ||
</item> | ||
|
||
</transition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<gradient | ||
android:startColor="#10000000" | ||
android:endColor="@android:color/transparent" | ||
android:angle="90" /> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="bottom" | ||
android:orientation="vertical" | ||
android:visibility="invisible" | ||
tools:visibility="visible"> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="3dp" | ||
android:background="@drawable/shadow" /> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/return_container" | ||
android:layout_gravity="bottom" | ||
android:background="#fff" | ||
android:clickable="true" | ||
android:focusable="true" | ||
android:foreground="?android:attr/selectableItemBackground" | ||
android:orientation="vertical" | ||
android:paddingTop="10dp" | ||
android:paddingBottom="10dp"> | ||
|
||
<TextView | ||
android:id="@+id/return_title" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="50dp" | ||
android:layout_marginEnd="50dp" | ||
android:ellipsize="end" | ||
android:gravity="center" | ||
android:maxLines="1" | ||
android:text="Return to channel" | ||
android:textColor="@color/text_gray" /> | ||
|
||
</LinearLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.