Skip to content

Commit

Permalink
Scroll view for toggle restrictions radio buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Sep 1, 2014
1 parent da9147c commit ba5595b
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 147 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ See for more information about XPrivacy 3 [this FAQ](https://github.com/M66B/XPr

**Next release**

* Showing message when expert mode enabled
* Scroll view for toggle restrictions radio buttons

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

**Version 3.1 STABLE**
Expand Down
287 changes: 141 additions & 146 deletions res/layout/sharelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,176 +9,171 @@
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".ActivityShare" >

<ScrollView
<!-- Header -->

<TextView
android:id="@+id/tvDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
android:autoLink="web"
android:ellipsize="start"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<Spinner
android:id="@+id/spRestriction"
android:layout_width="wrap_content"
android:layout_height="37dip"
android:visibility="gone" />

<CheckBox
android:id="@+id/cbClear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/menu_clear"
android:visibility="gone" />

<LinearLayout
<ScrollView
android:id="@+id/svToggle"
android:layout_width="match_parent"
android:layout_height="192dip"
android:orientation="vertical"
android:visibility="gone" >

<RadioGroup
android:id="@+id/rgToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<!-- Header -->

<TextView
android:id="@+id/tvDescription"
<RadioButton
android:id="@+id/rbClear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:ellipsize="start"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />

<Spinner
android:id="@+id/spRestriction"
android:layout_width="wrap_content"
android:layout_height="37dip"
android:visibility="gone" />

<CheckBox
android:id="@+id/cbClear"
android:text="@string/menu_clear"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbRestrict"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/menu_clear"
android:visibility="gone" />
android:text="@string/title_set_restrict"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioGroup
android:id="@+id/rgToggle"
<RadioButton
android:id="@+id/rbTemplateCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >

<RadioButton
android:id="@+id/rbClear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/menu_clear"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbRestrict"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_set_restrict"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbTemplateCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_template_category"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbTemplateFull"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_template_full"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbTemplateMergeSet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_template_merge"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbTemplateMergeReset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_template_merge_reset"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbEnableOndemand"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/color_dangerous"
android:text="@string/title_enable_ondemand"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbDisableOndemand"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/color_dangerous"
android:text="@string/title_disable_ondemand"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RadioGroup>

<Spinner
android:id="@+id/spTemplate"
android:layout_width="wrap_content"
android:text="@string/title_template_category"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbTemplateFull"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:visibility="gone" />
android:text="@string/title_template_full"
android:textAppearance="?android:attr/textAppearanceSmall" />

<!-- Footer -->
<RadioButton
android:id="@+id/rbTemplateMergeSet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_template_merge"
android:textAppearance="?android:attr/textAppearanceSmall" />

<View
<RadioButton
android:id="@+id/rbTemplateMergeReset"
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray" />
android:layout_height="wrap_content"
android:text="@string/title_template_merge_reset"
android:textAppearance="?android:attr/textAppearanceSmall" />

<LinearLayout
style="?android:attr/buttonBarButtonStyle"
<RadioButton
android:id="@+id/rbEnableOndemand"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<Button
android:id="@+id/btnCancel"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:text="@android:string/cancel" />

<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:background="@android:color/darker_gray" />

<Button
android:id="@+id/btnOk"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:enabled="false"
android:persistent="true"
android:text="@android:string/ok" />
</LinearLayout>

<!-- Progress -->

<RelativeLayout
android:background="?attr/color_dangerous"
android:text="@string/title_enable_ondemand"
android:textAppearance="?android:attr/textAppearanceSmall" />

<RadioButton
android:id="@+id/rbDisableOndemand"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<View
android:id="@+id/vShareProgressEmpty"
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"
android:paddingBottom="2dip" />

<View
android:id="@+id/vShareProgressFull"
android:layout_width="0dip"
android:layout_height="3dip"
android:background="?android:attr/colorActivatedHighlight" />
</RelativeLayout>
</LinearLayout>
android:layout_height="wrap_content"
android:background="?attr/color_dangerous"
android:text="@string/title_disable_ondemand"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RadioGroup>
</ScrollView>

<Spinner
android:id="@+id/spTemplate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:visibility="gone" />

<!-- Footer -->

<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray" />

<LinearLayout
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<Button
android:id="@+id/btnCancel"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:text="@android:string/cancel" />

<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:background="@android:color/darker_gray" />

<Button
android:id="@+id/btnOk"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:enabled="false"
android:persistent="true"
android:text="@android:string/ok" />
</LinearLayout>

<!-- Progress -->

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

<View
android:id="@+id/vShareProgressEmpty"
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"
android:paddingBottom="2dip" />

<View
android:id="@+id/vShareProgressFull"
android:layout_width="0dip"
android:layout_height="3dip"
android:background="?android:attr/colorActivatedHighlight" />
</RelativeLayout>

<!-- What it is all about -->

<ListView
Expand Down
4 changes: 3 additions & 1 deletion src/biz/bokhorst/xprivacy/ActivityShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TextView;
Expand Down Expand Up @@ -190,6 +191,7 @@ protected void onCreate(Bundle savedInstanceState) {

// Reference controls
final TextView tvDescription = (TextView) findViewById(R.id.tvDescription);
final ScrollView svToggle = (ScrollView) findViewById(R.id.svToggle);
final RadioGroup rgToggle = (RadioGroup) findViewById(R.id.rgToggle);
final Spinner spRestriction = (Spinner) findViewById(R.id.spRestriction);
RadioButton rbClear = (RadioButton) findViewById(R.id.rbClear);
Expand Down Expand Up @@ -292,7 +294,7 @@ protected void onCreate(Bundle savedInstanceState) {
} else if (action.equals(ACTION_TOGGLE)) {
tvDescription.setText(R.string.menu_toggle);
spRestriction.setVisibility(View.VISIBLE);
rgToggle.setVisibility(View.VISIBLE);
svToggle.setVisibility(View.VISIBLE);

// Listen for radio button
rgToggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {
Expand Down

0 comments on commit ba5595b

Please sign in to comment.