-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*There's no reason to show a permissions dialogue below Android M. This library is now compatible down to API 15 because why not. *Created nonblurred background fallback for v21 and below due to lack of rounded corners. Renderscript is supported down to v17 but no rounded corners looks terrible.
- Loading branch information
1 parent
82fb6e7
commit f781f9a
Showing
7 changed files
with
256 additions
and
48 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
128 changes: 128 additions & 0 deletions
128
custompermissionsdialogue/src/main/res/layout-v21/alert_permissions.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,128 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<stream.custompermissionsdialogue.ui.CustomBlurDialogue | ||
android:id="@+id/blurview" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/alert_dialogue_margin_side" | ||
android:layout_marginRight="@dimen/alert_dialogue_margin_side" | ||
android:layout_marginTop="@dimen/alert_dialogue_margin_top" | ||
android:layout_gravity="center_horizontal" | ||
app:blurOverlayColor="@color/colorOverlay"> | ||
|
||
<LinearLayout | ||
android:id="@+id/permissions_required" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingTop="12dp" | ||
android:paddingLeft="12dp" | ||
android:paddingRight="12dp" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/title" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/alert_text_margin_border" | ||
android:layout_marginRight="@dimen/alert_text_margin_border" | ||
android:gravity="center" | ||
android:text="Permissions Manager" | ||
android:textSize="@dimen/alert_text_title_size" | ||
android:textColor="@color/alert_text_default" | ||
android:textStyle="bold"/> | ||
|
||
<ImageView | ||
android:id="@+id/icon" | ||
android:layout_width="60dp" | ||
android:layout_height="60dp" | ||
android:layout_margin="18dp" | ||
android:layout_gravity="center_horizontal" | ||
android:src="@drawable/icon_blank" | ||
android:scaleType="fitXY" | ||
android:elevation="2dp"/> | ||
|
||
<TextView | ||
android:id="@+id/message" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="@dimen/alert_text_message_margin_bottom" | ||
android:layout_marginLeft="@dimen/alert_text_margin_border" | ||
android:layout_marginRight="@dimen/alert_text_margin_border" | ||
android:gravity="center" | ||
android:text="Custom Intro is a Custom app and requires the following permissions: " | ||
android:textSize="@dimen/alert_text_message_size" | ||
android:textColor="@color/alert_text_default"/> | ||
|
||
<android.support.v7.widget.RecyclerView | ||
android:id="@+id/permissions_list" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="@dimen/alert_text_message_margin_bottom" | ||
android:layout_gravity="center_horizontal" | ||
android:scrollbars="none" | ||
android:overScrollMode="never"/> | ||
|
||
<Button | ||
android:id="@+id/permissions_btn" | ||
android:layout_width="wrap_content" | ||
android:layout_height="35dp" | ||
android:paddingLeft="10dp" | ||
android:paddingRight="10dp" | ||
android:layout_marginTop="18dp" | ||
android:layout_marginBottom="18dp" | ||
android:layout_marginLeft="12dp" | ||
android:layout_marginRight="12dp" | ||
android:layout_gravity="center_horizontal" | ||
android:text="Grant Permissions" | ||
android:textSize="16sp" | ||
android:textColor="@color/white" | ||
android:fontFamily="sans-serif-medium" | ||
android:background="@drawable/icon_add_selector" | ||
android:elevation="2dp"/> | ||
</LinearLayout> | ||
</stream.custompermissionsdialogue.ui.CustomBlurDialogue> | ||
|
||
<stream.custompermissionsdialogue.ui.CustomBlurDialogue | ||
android:id="@+id/blurview_optional" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/alert_dialogue_margin_side" | ||
android:layout_marginRight="@dimen/alert_dialogue_margin_side" | ||
android:layout_marginTop="@dimen/alert_dialogue_margin_top" | ||
android:layout_gravity="center_horizontal" | ||
app:blurOverlayColor="@color/colorOverlay"> | ||
|
||
<LinearLayout | ||
android:id="@+id/permissions_optional" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:padding="12dp" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/permissions_optional_text" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginLeft="@dimen/alert_text_margin_border" | ||
android:layout_marginRight="@dimen/alert_text_margin_border" | ||
android:gravity="center" | ||
android:text="Optional Permissions (enable for full app functionality): " | ||
android:textSize="@dimen/alert_text_message_size" | ||
android:textColor="@color/alert_text_default"/> | ||
|
||
<android.support.v7.widget.RecyclerView | ||
android:id="@+id/permissions_list_optional" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="@dimen/alert_text_message_margin_bottom" | ||
android:layout_gravity="center_horizontal" | ||
android:scrollbars="vertical" | ||
android:overScrollMode="never"/> | ||
</LinearLayout> | ||
</stream.custompermissionsdialogue.ui.CustomBlurDialogue> | ||
</LinearLayout> |
66 changes: 66 additions & 0 deletions
66
custompermissionsdialogue/src/main/res/layout-v21/item_permission.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,66 @@ | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginLeft="12dp" | ||
android:layout_marginRight="12dp" | ||
android:layout_gravity="center_horizontal" | ||
android:background="@null" | ||
android:orientation="vertical"> | ||
|
||
<ImageView | ||
android:id="@+id/permission_icon" | ||
android:layout_width="35dp" | ||
android:layout_height="35dp" | ||
android:layout_gravity="center_horizontal" | ||
android:scaleType="fitCenter" | ||
app:srcCompat="@drawable/ic_phone"/> | ||
|
||
<TextView | ||
android:id="@+id/permission_name" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="4dp" | ||
android:layout_gravity="center_horizontal" | ||
android:text="Permission" | ||
android:textSize="14sp" | ||
android:textColor="@color/textPrimary" | ||
android:maxLines="1" | ||
android:singleLine="true" | ||
android:ellipsize="end"/> | ||
|
||
<TextView | ||
android:id="@+id/permission_detail" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="2dp" | ||
android:layout_gravity="center_horizontal" | ||
android:text="Permission is required to send app." | ||
android:textSize="12sp" | ||
android:textColor="@color/textSecondary"/> | ||
|
||
<stream.custombutton.CustomButton | ||
android:id="@+id/permission_btn" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="6dp" | ||
android:paddingTop="6dp" | ||
android:paddingBottom="6dp" | ||
android:paddingLeft="8dp" | ||
android:paddingRight="8dp" | ||
android:layout_gravity="center_horizontal" | ||
android:text="Enable" | ||
android:textSize="12sp" | ||
android:fontFamily="sans-serif-medium" | ||
android:maxLines="1" | ||
android:singleLine="true" | ||
android:ellipsize="none" | ||
app:btn_cornerRadius="20dp" | ||
app:btn_strokeWidth="1dp" | ||
app:btn_strokeColor="@color/button_pressed" | ||
app:btn_buttonColor="@color/transparent" | ||
app:btn_buttonSelectColor="@color/button_pressed" | ||
app:btn_textColor="@color/button_pressed" | ||
app:btn_textSelectColor="@color/white"/> | ||
</LinearLayout> |
Oops, something went wrong.