Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Fixed and improved batch operation layout
Browse files Browse the repository at this point in the history
Fixes #1539
  • Loading branch information
M66B committed Mar 13, 2014
1 parent 7cc2530 commit 58da9b0
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 59 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Changelog

* Fixed restrictions not always showing correct after on demand restricting ([issue](/../../issues/1549))
* Fixed invalid *restart required* when toggling restrictions of a category
* Fixed and improved batch operation layout ([issue](/../../issues/1539))
* Better matching of *sh* and *su* ([issue](/../../issues/1551))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
Expand Down
107 changes: 54 additions & 53 deletions res/layout/shareentry.xml
Original file line number Diff line number Diff line change
@@ -1,68 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<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="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:orientation="horizontal" >
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:orientation="vertical" >

<ImageView
android:id="@+id/imgIcon"
android:layout_width="?android:attr/listPreferredItemHeightSmall"
android:layout_height="?android:attr/listPreferredItemHeightSmall"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:contentDescription="@string/help_application" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<ImageView
android:id="@+id/imgInfo"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/imgIcon"
android:contentDescription="@string/help_application"
android:paddingLeft="6dip"
android:src="?attr/icon_info" />
<ImageView
android:id="@+id/imgIcon"
android:layout_width="?android:attr/listPreferredItemHeightSmall"
android:layout_height="?android:attr/listPreferredItemHeightSmall"
android:layout_gravity="center_vertical"
android:contentDescription="@string/help_application" />

<TextView
android:id="@+id/tvApp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/imgInfo"
android:paddingLeft="6dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textIsSelectable="false" />
<ImageView
android:id="@+id/imgInfo"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_gravity="center_vertical"
android:contentDescription="@string/help_application"
android:paddingLeft="6dip"
android:src="?attr/icon_info" />

<TextView
android:id="@+id/tvApp"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:paddingLeft="6dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textIsSelectable="false" />

<ImageView
android:id="@+id/imgResult"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="3dip"
android:contentDescription="@string/help_application"
android:visibility="invisible" />
<ImageView
android:id="@+id/imgResult"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_gravity="center_vertical"
android:layout_marginRight="3dip"
android:contentDescription="@string/help_application"
android:visibility="gone" />

<ProgressBar
android:id="@+id/pbRunning"
style="?android:attr/progressBarStyleInverse"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_gravity="center_vertical"
android:layout_marginRight="3dip"
android:visibility="gone" />
</LinearLayout>

<TextView
android:id="@+id/tvMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/imgResult"
android:ellipsize="end"
android:layout_gravity="right"
android:paddingRight="3dip"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textIsSelectable="false" />

<ProgressBar
android:id="@+id/pbRunning"
style="?android:attr/progressBarStyleInverse"
android:layout_width="32dip"
android:layout_height="32dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="3dip"
android:textIsSelectable="false"
android:visibility="gone" />

</RelativeLayout>
</LinearLayout>
18 changes: 12 additions & 6 deletions src/biz/bokhorst/xprivacy/ActivityShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import android.os.Environment;
import android.provider.ContactsContract;
import android.provider.Settings.Secure;
import android.text.TextUtils;
import android.util.Log;
import android.util.Patterns;
import android.util.SparseArray;
Expand Down Expand Up @@ -509,25 +510,30 @@ public void onClick(View view) {
holder.tvName.setText(xApp.appInfo.toString());

// Show app share state
holder.tvMessage.setText(xApp.message == null ? "" : xApp.message);
if (TextUtils.isEmpty(xApp.message))
holder.tvMessage.setVisibility(View.GONE);
else {
holder.tvMessage.setVisibility(View.VISIBLE);
holder.tvMessage.setText(xApp.message);
}
switch (xApp.state) {
case STATE_WAITING:
holder.imgResult.setVisibility(View.INVISIBLE);
holder.pbRunning.setVisibility(View.INVISIBLE);
holder.imgResult.setVisibility(View.GONE);
holder.pbRunning.setVisibility(View.GONE);
break;
case STATE_RUNNING:
holder.imgResult.setVisibility(View.INVISIBLE);
holder.imgResult.setVisibility(View.GONE);
holder.pbRunning.setVisibility(View.VISIBLE);
break;
case STATE_SUCCESS:
holder.imgResult.setBackgroundResource(R.drawable.btn_check_buttonless_on);
holder.imgResult.setVisibility(View.VISIBLE);
holder.pbRunning.setVisibility(View.INVISIBLE);
holder.pbRunning.setVisibility(View.GONE);
break;
case STATE_FAILURE:
holder.imgResult.setBackgroundResource(R.drawable.indicator_input_error);
holder.imgResult.setVisibility(View.VISIBLE);
holder.pbRunning.setVisibility(View.INVISIBLE);
holder.pbRunning.setVisibility(View.GONE);
break;
default:
Util.log(null, Log.ERROR, "Unknown state=" + xApp.state);
Expand Down

0 comments on commit 58da9b0

Please sign in to comment.