Add + button besides TokenAutoComplete, Issue #925
Signed-off-by: Durgesh <007durgesh219@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import android.os.Bundle;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.ViewAnimator;
|
import android.widget.ViewAnimator;
|
||||||
|
|
||||||
import com.tokenautocomplete.TokenCompleteTextView;
|
import com.tokenautocomplete.TokenCompleteTextView;
|
||||||
@@ -109,6 +110,14 @@ public class EncryptModeAsymmetricFragment extends EncryptModeFragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ImageView addRecipientImgView = (ImageView) view.findViewById(R.id.add_recipient);
|
||||||
|
addRecipientImgView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mEncryptKeyView.showAllKeys();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,4 +171,22 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView<KeyItem>
|
|||||||
mLoaderManager.restartLoader(0, args, this);
|
mLoaderManager.restartLoader(0, args, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean enoughToFilter() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showAllKeys(){
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putString(ARG_QUERY, "");
|
||||||
|
mLoaderManager.restartLoader(0, args, this);
|
||||||
|
super.showDropDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
this.setDropDownWidth(this.getLeft()+this.getRight());
|
||||||
|
this.setDropDownHorizontalOffset(-this.getLeft());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,13 +39,21 @@
|
|||||||
|
|
||||||
<org.sufficientlysecure.keychain.ui.widget.EncryptKeyCompletionView
|
<org.sufficientlysecure.keychain.ui.widget.EncryptKeyCompletionView
|
||||||
android:id="@+id/recipient_list"
|
android:id="@+id/recipient_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:hint="@string/label_to"
|
android:hint="@string/label_to"
|
||||||
android:minHeight="56dip"
|
android:minHeight="56dip"
|
||||||
android:paddingLeft="8dp"
|
android:paddingLeft="8dp"
|
||||||
android:paddingRight="8dp"
|
android:paddingRight="8dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical" />
|
android:layout_gravity="center_vertical" />
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/add_recipient"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:clickable="true"
|
||||||
|
android:src="@drawable/ic_person_add_grey_24dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user