mirror of https://github.com/M66B/FairEmail.git
Added link sharing
This commit is contained in:
parent
4dcfdf0a9e
commit
f96db99a24
|
@ -4986,6 +4986,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_open_link, null);
|
||||
TextView tvTitle = dview.findViewById(R.id.tvTitle);
|
||||
ImageButton ibShare = dview.findViewById(R.id.ibShare);
|
||||
ImageButton ibCopy = dview.findViewById(R.id.ibCopy);
|
||||
final EditText etLink = dview.findViewById(R.id.etLink);
|
||||
TextView tvDifferent = dview.findViewById(R.id.tvDifferent);
|
||||
|
@ -4998,6 +4999,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
final TextView tvOwner = dview.findViewById(R.id.tvOwner);
|
||||
final Group grpOwner = dview.findViewById(R.id.grpOwner);
|
||||
|
||||
ibShare.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent send = new Intent();
|
||||
send.setAction(Intent.ACTION_SEND);
|
||||
send.putExtra(Intent.EXTRA_TEXT, uri.toString());
|
||||
send.setType("text/plain");
|
||||
startActivity(Intent.createChooser(send, title));
|
||||
}
|
||||
});
|
||||
|
||||
ibCopy.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
|
||||
</vector>
|
|
@ -20,16 +20,29 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:labelFor="@+id/etLink"
|
||||
android:text="Link title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibShare"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCaption" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibShare"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/title_share"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvTitle"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibCopy"
|
||||
app:srcCompat="@drawable/baseline_share_24" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibCopy"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
Loading…
Reference in New Issue