This repository has been archived by the owner on Mar 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show all Panic Responder apps so the user can enable/disable them
This shows all apps that will responder to the panic trigger, and provides a switch each app so the user can enable/disable which apps should receive the trigger.
- Loading branch information
Showing
8 changed files
with
299 additions
and
25 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
36 changes: 36 additions & 0 deletions
36
app/src/main/java/org/iilab/pb/fragment/SimpleDividerItemDecoration.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,36 @@ | ||
package org.iilab.pb.fragment; | ||
|
||
import android.content.Context; | ||
import android.graphics.Canvas; | ||
import android.graphics.drawable.Drawable; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.View; | ||
|
||
import org.iilab.pb.R; | ||
|
||
public class SimpleDividerItemDecoration extends RecyclerView.ItemDecoration { | ||
private final Drawable mDivider; | ||
|
||
public SimpleDividerItemDecoration(Context context) { | ||
mDivider = context.getResources().getDrawable(R.drawable.responder_line_divider); | ||
} | ||
|
||
@Override | ||
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { | ||
int left = parent.getPaddingLeft(); | ||
int right = parent.getWidth() - parent.getPaddingRight(); | ||
|
||
int childCount = parent.getChildCount(); | ||
for (int i = 0; i < childCount; i++) { | ||
View child = parent.getChildAt(i); | ||
|
||
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams(); | ||
|
||
int top = child.getBottom() + params.bottomMargin; | ||
int bottom = top + mDivider.getIntrinsicHeight(); | ||
|
||
mDivider.setBounds(left, top, right, bottom); | ||
mDivider.draw(c); | ||
} | ||
} | ||
} |
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,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
|
||
<size | ||
android:width="1dp" | ||
android:height="1dp" /> | ||
|
||
<solid android:color="@color/gray" /> | ||
|
||
</shape> |
49 changes: 24 additions & 25 deletions
49
app/src/main/res/layout/fragment_type_interactive_panic_responders.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 |
---|---|---|
@@ -1,36 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:orientation="vertical" | ||
android:descendantFocusability="beforeDescendants" | ||
android:focusableInTouchMode="true"> | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<ScrollView | ||
android:id="@+id/wizard_start_root" | ||
<LinearLayout | ||
style="@style/wizard_static_panel" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_width="fill_parent"> | ||
android:orientation="vertical"> | ||
|
||
<RelativeLayout | ||
android:layout_width="fill_parent" | ||
<TextView | ||
android:id="@+id/fragment_title" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
style="@style/wizard_static_panel"> | ||
android:gravity="center_horizontal" | ||
android:paddingBottom="5dp" | ||
android:text="@string/page_title_text" | ||
android:textSize="32sp" /> | ||
|
||
<TextView | ||
android:id="@+id/fragment_title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/page_title_text" | ||
android:textSize="32sp" | ||
android:paddingBottom="5dp" | ||
android:layout_centerHorizontal="true" /> | ||
<TextView | ||
android:id="@+id/fragment_intro" | ||
style="@style/wizard_intro_style" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" /> | ||
|
||
<TextView | ||
android:id="@+id/fragment_intro" | ||
style="@style/wizard_intro_style" | ||
android:layout_below="@+id/fragment_title" /> | ||
</LinearLayout> | ||
|
||
</RelativeLayout> | ||
</ScrollView> | ||
<android.support.v7.widget.RecyclerView | ||
android:id="@+id/recycler_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"/> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?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="wrap_content"> | ||
|
||
<ImageView | ||
android:id="@+id/iconView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:layout_alignParentLeft="true" | ||
android:layout_alignParentStart="true" | ||
android:gravity="center" | ||
android:padding="20dp" | ||
android:src="@android:drawable/ic_dialog_alert"/> | ||
|
||
<LinearLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:layout_centerVertical="true" | ||
android:layout_toEndOf="@+id/iconView" | ||
android:layout_toLeftOf="@+id/on_switch" | ||
android:layout_toRightOf="@+id/iconView" | ||
android:layout_toStartOf="@+id/on_switch" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/appLabel" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingBottom="5dp" | ||
android:textAppearance="?android:attr/textAppearanceLarge" /> | ||
|
||
<TextView | ||
android:id="@+id/editableLabel" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/app_hides" | ||
android:textAppearance="?android:attr/textAppearanceMedium" | ||
android:textColor="@android:color/darker_gray" /> | ||
</LinearLayout> | ||
|
||
<Switch | ||
android:id="@+id/on_switch" | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:layout_alignParentEnd="true" | ||
android:layout_alignParentRight="true" | ||
android:layout_centerVertical="true" | ||
android:padding="20dp" /> | ||
|
||
</RelativeLayout> |
Oops, something went wrong.